header.css 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  1. /*前台通用头部*/
  2. /* 头部 */
  3. .fly-header{
  4. position: fixed;
  5. left: 0;
  6. top: 0;
  7. z-index: 10000;
  8. width: 100%;
  9. border-bottom: 1px solid #404553;
  10. border-right: 1px solid #404553;
  11. border-radius: 0;
  12. background-color:#2f363c;
  13. height: 60px;
  14. transition: height 0.3s ease;
  15. }
  16. .fly-header .layui-container {
  17. position: relative;
  18. height: 60px;
  19. }
  20. .fly-header .fly-head {
  21. display: flex;
  22. align-items: center;
  23. justify-content: space-between;
  24. height: 60px;
  25. width: 100%;
  26. }
  27. .fly-header .navbar-toggle {
  28. position: relative;
  29. padding: 18px 12px;
  30. cursor: pointer;
  31. background: transparent;
  32. border: none;
  33. outline: none;
  34. flex-shrink: 0;
  35. z-index: 1001;
  36. }
  37. .fly-header .navbar-toggle .icon-bar {
  38. display: block;
  39. height: 2px;
  40. border-radius: 1px;
  41. width: 20px;
  42. background-color: #888;
  43. transition: all 0.3s ease;
  44. }
  45. .fly-header .navbar-toggle .icon-bar + .icon-bar {
  46. margin-top: 4px;
  47. }
  48. .fly-header .navbar-toggle:hover .icon-bar {
  49. background-color: #fff;
  50. }
  51. .fly-header .fly-logo {
  52. float: left;
  53. flex-shrink: 0;
  54. }
  55. .fly-header .fly-logo h2 {
  56. font-size: 21px;
  57. line-height: 60px;
  58. color: #fff;
  59. font-weight: normal;
  60. margin: 0;
  61. white-space: nowrap;
  62. }
  63. /* 桌面端导航 */
  64. .fly-nav-desktop {
  65. display: block;
  66. }
  67. .fly-header .fly-nav-user .iconfont {
  68. position: relative;
  69. }
  70. .fly-header .fly-nav-avatar img {
  71. width: 36px;
  72. height: 36px;
  73. margin-right: 10px;
  74. border-radius: 100%;
  75. }
  76. .fly-header .fly-nav-user .layui-nav-child a i {
  77. position: relative;
  78. top: 1px;
  79. margin-right: 10px;
  80. }
  81. .fly-header .layui-nav {
  82. padding: 0;
  83. background: transparent;
  84. }
  85. .fly-header .fly-nav-user li a {
  86. padding: 0 10px;
  87. }
  88. .fly-header .fly-nav-user li .fly-nav-avatar {
  89. padding-right: 25px;
  90. }
  91. .fly-header .layui-nav .layui-this:after,
  92. .fly-header .layui-nav .layui-nav-bar {
  93. display: none !important;
  94. }
  95. .fly-header .layui-nav-right {
  96. float: right !important;
  97. }
  98. .fly-header .layui-nav .fly-nav-user {
  99. margin-left: 30px;
  100. }
  101. .fly-header .layui-nav .fly-nav-user .layui-btn-register,
  102. .fly-header .layui-nav .fly-nav-user .layui-btn-login {
  103. display: inline-block;
  104. color: #fff !important;
  105. }
  106. /* 导航图标样式 */
  107. .fly-header .layui-nav-item a i {
  108. margin-right: 5px;
  109. font-size: 16px;
  110. }
  111. .fly-header .layui-nav-item a .iconfont {
  112. vertical-align: middle;
  113. }
  114. /* 移动端导航图标 */
  115. @media screen and (max-width: 768px) {
  116. .fly-header .fly-nav-mobile .layui-nav-item a i {
  117. font-size: 18px;
  118. width: 24px;
  119. text-align: center;
  120. display: inline-block;
  121. }
  122. }
  123. /* 图标字体占位(如果 iconfont 未加载) */
  124. .icon-search:before { content: "🔍"; }
  125. .icon-language:before { content: "🌐"; }
  126. .icon-shop:before { content: "🛒"; }
  127. /*白色主题*/
  128. .light-theme .fly-header {
  129. border-color: #fff;
  130. box-shadow: 0 1px 8px rgb(0 0 0 / 8%);
  131. background: #fff;
  132. }
  133. .light-theme .fly-header .layui-nav .layui-nav-item a {
  134. color: #555;
  135. }
  136. .light-theme .fly-header .layui-nav {
  137. background-color: #fff;
  138. color: #555;
  139. }
  140. .light-theme .fly-header .navbar-toggle {
  141. color: #000;
  142. }
  143. .light-theme .fly-header .navbar-toggle .icon-bar {
  144. background-color: #333;
  145. }
  146. .light-theme .fly-header .fly-logo h2 {
  147. color: #333;
  148. }
  149. .light-theme .fly-header .layui-nav .layui-this>a {
  150. color: #1e9fff;
  151. }
  152. /* 移动端白色主题适配 */
  153. @media screen and (max-width: 768px) {
  154. .light-theme .fly-header .navbar-toggle .icon-bar {
  155. background-color: #333;
  156. }
  157. }
  158. /* 底部 */
  159. .fly-footer {margin: 50px 0 0;}
  160. .fly-footer .copyright{background: #393939;line-height: 50px;text-align: center; color: #aaa;}
  161. .fly-footer .copyright a{padding:0 6px; font-weight: 300; color: #aaa;}
  162. .fly-footer .copyright a:hover{color: #fff;}
  163. @media screen and (min-width: 768px) {
  164. .fly-header .fly-head {
  165. float: left;
  166. }
  167. .fly-header .navbar-toggle {
  168. display: none;
  169. }
  170. .fly-header .navbar-collapse.layui-hide {
  171. display: block !important;
  172. }
  173. .fly-nav-mobile {
  174. display: none !important;
  175. }
  176. }
  177. @media screen and (max-width: 768px) {
  178. /* 隐藏桌面端导航 */
  179. .fly-nav-desktop {
  180. display: none !important;
  181. }
  182. /* 头部固定高度,防止拉长 */
  183. .fly-header {
  184. height: 56px;
  185. }
  186. .fly-header .layui-container {
  187. height: 56px;
  188. }
  189. .fly-header .fly-logo h2 {
  190. font-size: 17px;
  191. line-height: 56px;
  192. }
  193. /* 移动端菜单容器 - 绝对定位,不影响头部高度 */
  194. .fly-header .navbar-collapse {
  195. position: absolute;
  196. top: 56px;
  197. left: 0;
  198. right: 0;
  199. background: #fff;
  200. box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  201. max-height: 0;
  202. overflow: hidden;
  203. transition: max-height 0.3s ease-out;
  204. z-index: 999;
  205. margin: 0;
  206. padding: 0;
  207. }
  208. .fly-header .navbar-collapse.layui-hide {
  209. max-height: 0;
  210. }
  211. .fly-header .navbar-collapse:not(.layui-hide) {
  212. max-height: 500px;
  213. overflow-y: auto;
  214. -webkit-overflow-scrolling: touch;
  215. }
  216. /* 移动端导航样式 */
  217. .fly-header .fly-nav-mobile {
  218. width: 100%;
  219. background: #fff !important;
  220. }
  221. .fly-header .fly-nav-mobile .layui-nav-item {
  222. display: block;
  223. border-bottom: 1px solid #f0f0f0;
  224. }
  225. .fly-header .fly-nav-mobile .layui-nav-item a {
  226. padding: 14px 20px;
  227. height: auto;
  228. line-height: 1.4;
  229. color: #333;
  230. display: flex;
  231. align-items: center;
  232. }
  233. .fly-header .fly-nav-mobile .layui-nav-item a i {
  234. width: 24px;
  235. font-size: 18px;
  236. margin-right: 10px;
  237. text-align: center;
  238. }
  239. .fly-header .fly-nav-mobile .layui-nav-item.layui-this a {
  240. background-color: #f5f5f5;
  241. color: #1e9fff;
  242. }
  243. .fly-header .fly-nav-mobile .layui-nav-child {
  244. position: static;
  245. width: 100%;
  246. background: #fafafa;
  247. border-top: 1px solid #f0f0f0;
  248. border-radius: 0;
  249. box-shadow: none;
  250. }
  251. .fly-header .fly-nav-mobile .layui-nav-child dd a {
  252. padding-left: 54px;
  253. font-size: 14px;
  254. }
  255. /* 用户头像区域 */
  256. .fly-header .fly-nav-mobile .fly-nav-avatar {
  257. display: flex;
  258. align-items: center;
  259. padding: 14px 20px !important;
  260. }
  261. .fly-header .fly-nav-mobile .fly-nav-avatar img {
  262. width: 32px;
  263. height: 32px;
  264. margin-right: 10px;
  265. }
  266. .fly-header .fly-nav-mobile .fly-nav-avatar cite {
  267. font-style: normal;
  268. font-size: 14px;
  269. }
  270. .fly-header .fly-nav-mobile .fly-nav-user .layui-nav-child {
  271. background: #fafafa;
  272. }
  273. .fly-header .fly-nav-mobile .fly-nav-user .layui-nav-child dd a {
  274. padding-left: 54px;
  275. }
  276. /* 汉堡菜单按钮 */
  277. .fly-header .navbar-toggle {
  278. padding: 16px 10px;
  279. margin: 0;
  280. background: transparent;
  281. }
  282. .fly-header .navbar-toggle .icon-bar {
  283. width: 20px;
  284. height: 2px;
  285. background-color: #666;
  286. }
  287. .light-theme .fly-header .navbar-toggle .icon-bar {
  288. background-color: #333;
  289. }
  290. /* 页脚 */
  291. .fly-footer {
  292. margin-top: 25px;
  293. border-top: none;
  294. }
  295. }