navigation.css 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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: center;
  19. align-items: center;
  20. gap: 16px;
  21. padding: 24px 20px;
  22. background: #ffffff;
  23. /* 非常明显的底部边框 - 加粗加深 */
  24. border-bottom: 4px solid #8b5cf6;
  25. /* 增强的阴影效果 - 多层阴影营造更强的分隔感 */
  26. box-shadow: 0 6px 20px rgba(139, 92, 246, 0.25),
  27. 0 3px 10px rgba(0, 0, 0, 0.12),
  28. 0 1px 3px rgba(0, 0, 0, 0.08);
  29. /* 添加上边框增强边界感 */
  30. border-top: 1px solid rgba(229, 231, 235, 0.8);
  31. /* 禁用文字选中 */
  32. user-select: none;
  33. -webkit-user-select: none;
  34. -moz-user-select: none;
  35. -ms-user-select: none;
  36. /* 固定定位,确保边框始终可见 */
  37. position: relative;
  38. z-index: 100;
  39. }
  40. /* 导航按钮 */
  41. .nav-btn {
  42. padding: 12px 32px;
  43. font-size: 15px;
  44. font-weight: 600;
  45. color: #6b7280;
  46. background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
  47. border: 2px solid #e5e7eb;
  48. border-radius: 12px;
  49. cursor: pointer;
  50. transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  51. outline: none;
  52. user-select: none;
  53. -webkit-user-select: none;
  54. -moz-user-select: none;
  55. -ms-user-select: none;
  56. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  57. letter-spacing: 0.3px;
  58. }
  59. .nav-btn:hover {
  60. color: #8b5cf6;
  61. border-color: #8b5cf6;
  62. background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
  63. transform: translateY(-2px);
  64. box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
  65. }
  66. .nav-btn.active {
  67. color: #ffffff;
  68. background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
  69. border-color: transparent;
  70. box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4), 0 2px 8px rgba(0, 0, 0, 0.1);
  71. transform: translateY(-2px);
  72. }
  73. .nav-btn.active:hover {
  74. background: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%);
  75. box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5), 0 3px 10px rgba(0, 0, 0, 0.15);
  76. }
  77. /* 响应式设计 */
  78. @media (max-width: 768px) {
  79. .top-navigation {
  80. padding: 16px 12px;
  81. gap: 12px;
  82. }
  83. .nav-btn {
  84. padding: 10px 24px;
  85. font-size: 14px;
  86. }
  87. }
  88. @media (max-width: 480px) {
  89. .top-navigation {
  90. padding: 12px 8px;
  91. gap: 8px;
  92. }
  93. .nav-btn {
  94. padding: 8px 16px;
  95. font-size: 13px;
  96. }
  97. }