navigation.css 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. /* 导航栏样式 */
  2. * {
  3. margin: 0;
  4. padding: 0;
  5. box-sizing: border-box;
  6. }
  7. body {
  8. margin: 0;
  9. padding: 0;
  10. overflow: hidden;
  11. font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
  12. "Noto Sans", sans-serif;
  13. background: linear-gradient(135deg, #fdfcfb 0%, #f7f7f8 50%, #fdfcfb 100%);
  14. }
  15. /* 顶部导航栏容器 */
  16. .top-navigation {
  17. display: flex;
  18. justify-content: space-between;
  19. align-items: center;
  20. padding: 24px 20px;
  21. background: #ffffff;
  22. /* 非常明显的底部边框 - 加粗加深 */
  23. border-bottom: 4px solid #8b5cf6;
  24. /* 增强的阴影效果 - 多层阴影营造更强的分隔感 */
  25. box-shadow: 0 6px 20px rgba(139, 92, 246, 0.25),
  26. 0 3px 10px rgba(0, 0, 0, 0.12),
  27. 0 1px 3px rgba(0, 0, 0, 0.08);
  28. /* 添加上边框增强边界感 */
  29. border-top: 1px solid rgba(229, 231, 235, 0.8);
  30. /* 禁用文字选中 */
  31. user-select: none;
  32. -webkit-user-select: none;
  33. -moz-user-select: none;
  34. -ms-user-select: none;
  35. /* 固定定位,确保边框始终可见 */
  36. position: relative;
  37. z-index: 100;
  38. }
  39. /* 导航栏左侧区域(Logo) */
  40. .nav-left {
  41. display: flex;
  42. align-items: center;
  43. gap: 12px;
  44. flex: 0 0 auto;
  45. }
  46. /* Logo样式 */
  47. .nav-logo {
  48. height: 40px;
  49. width: auto;
  50. object-fit: contain;
  51. }
  52. /* 标题样式 */
  53. .nav-title {
  54. font-size: 18px;
  55. font-weight: 600;
  56. color: #1f2937;
  57. letter-spacing: 0.5px;
  58. }
  59. /* 导航栏中间区域(导航按钮) */
  60. .nav-center {
  61. display: flex;
  62. justify-content: center;
  63. align-items: center;
  64. gap: 16px;
  65. flex: 1;
  66. position: absolute;
  67. left: 50%;
  68. transform: translateX(-50%);
  69. }
  70. /* 导航栏右侧区域(登录注册按钮) */
  71. .nav-right {
  72. display: flex;
  73. align-items: center;
  74. gap: 12px;
  75. flex: 0 0 auto;
  76. }
  77. /* 导航按钮 */
  78. .nav-btn {
  79. padding: 12px 32px;
  80. font-size: 15px;
  81. font-weight: 600;
  82. color: #6b7280;
  83. background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
  84. border: 2px solid #e5e7eb;
  85. border-radius: 12px;
  86. cursor: pointer;
  87. transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  88. outline: none;
  89. user-select: none;
  90. -webkit-user-select: none;
  91. -moz-user-select: none;
  92. -ms-user-select: none;
  93. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  94. letter-spacing: 0.3px;
  95. }
  96. .nav-btn:hover {
  97. color: #8b5cf6;
  98. border-color: #8b5cf6;
  99. background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
  100. transform: translateY(-2px);
  101. box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
  102. }
  103. .nav-btn.active {
  104. color: #ffffff;
  105. background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
  106. border-color: transparent;
  107. box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4), 0 2px 8px rgba(0, 0, 0, 0.1);
  108. transform: translateY(-2px);
  109. }
  110. .nav-btn.active:hover {
  111. background: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%);
  112. box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5), 0 3px 10px rgba(0, 0, 0, 0.15);
  113. }
  114. /* 登录注册按钮 */
  115. .auth-btn {
  116. padding: 10px 24px;
  117. font-size: 14px;
  118. font-weight: 600;
  119. border-radius: 8px;
  120. cursor: pointer;
  121. transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  122. outline: none;
  123. user-select: none;
  124. -webkit-user-select: none;
  125. -moz-user-select: none;
  126. -ms-user-select: none;
  127. border: 2px solid transparent;
  128. letter-spacing: 0.3px;
  129. }
  130. .login-btn {
  131. color: #6b7280;
  132. background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
  133. border-color: #e5e7eb;
  134. }
  135. .login-btn:hover {
  136. color: #8b5cf6;
  137. border-color: #8b5cf6;
  138. background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
  139. transform: translateY(-2px);
  140. box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
  141. }
  142. .register-btn {
  143. color: #ffffff;
  144. background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
  145. border-color: transparent;
  146. box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
  147. }
  148. .register-btn:hover {
  149. background: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%);
  150. transform: translateY(-2px);
  151. box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4), 0 2px 8px rgba(0, 0, 0, 0.1);
  152. }
  153. /* 用户头像容器 */
  154. .user-avatar-container {
  155. display: flex;
  156. align-items: center;
  157. justify-content: center;
  158. cursor: pointer;
  159. transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  160. }
  161. .user-avatar {
  162. width: 40px;
  163. height: 40px;
  164. border-radius: 50%;
  165. object-fit: cover;
  166. border: 2px solid #8b5cf6;
  167. box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
  168. transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  169. }
  170. .user-avatar:hover {
  171. transform: scale(1.1);
  172. box-shadow: 0 4px 12px rgba(139, 92, 246, 0.5);
  173. border-color: #7c3aed;
  174. }
  175. /* 响应式设计 */
  176. @media (max-width: 768px) {
  177. .top-navigation {
  178. padding: 16px 12px;
  179. }
  180. .nav-center {
  181. gap: 12px;
  182. }
  183. .nav-btn {
  184. padding: 10px 24px;
  185. font-size: 14px;
  186. }
  187. .nav-right {
  188. gap: 8px;
  189. }
  190. .auth-btn {
  191. padding: 8px 16px;
  192. font-size: 13px;
  193. }
  194. }
  195. @media (max-width: 480px) {
  196. .top-navigation {
  197. padding: 12px 8px;
  198. }
  199. .nav-center {
  200. gap: 8px;
  201. }
  202. .nav-btn {
  203. padding: 8px 16px;
  204. font-size: 13px;
  205. }
  206. .nav-right {
  207. gap: 6px;
  208. }
  209. .auth-btn {
  210. padding: 6px 12px;
  211. font-size: 12px;
  212. }
  213. }