22301009 | 53d46ca | 2025-04-15 21:25:18 +0800 | [diff] [blame] | 1 | /* Header 样式 */ |
22301009 | 5b28c67 | 2025-04-10 20:12:45 +0800 | [diff] [blame] | 2 | .header { |
22301009 | 53d46ca | 2025-04-15 21:25:18 +0800 | [diff] [blame] | 3 | display: flex; |
| 4 | justify-content: space-between; |
| 5 | align-items: center; |
| 6 | padding: 10px 20px; /* 增加左右间距,避免元素靠得太近 */ |
| 7 | background-color: #5F4437; /* 深棕色背景 */ |
| 8 | box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* 增加阴影效果 */ |
| 9 | } |
| 10 | |
| 11 | /* Logo 和网站名称 */ |
| 12 | .logo-and-name { |
| 13 | display: flex; |
| 14 | align-items: center; |
| 15 | } |
| 16 | |
| 17 | .logo { |
| 18 | height: 40px; |
| 19 | margin-right: 10px; |
| 20 | } |
| 21 | |
| 22 | .site-name { |
| 23 | font-size:32px; |
| 24 | font-weight: bold; |
| 25 | color: #FBF2E3; /* 更加柔和的字体颜色 */ |
| 26 | } |
| 27 | |
| 28 | /* 用户头像和消息中心 */ |
| 29 | .user-and-message { |
| 30 | display: flex; |
| 31 | align-items: center; |
| 32 | } |
| 33 | |
| 34 | .user-avatar { |
| 35 | height: 50px; |
| 36 | width: 50px; /* 确保头像是圆形 */ |
| 37 | border-radius: 50%; /* 圆形 */ |
| 38 | margin-right: 10px; |
| 39 | } |
| 40 | |
| 41 | .message-center { |
| 42 | font-size: 24px; |
| 43 | color: #FBF2E3; /* 统一字体颜色 */ |
| 44 | cursor: pointer; |
| 45 | transition: color 0.3s ease; /* 平滑过渡 */ |
| 46 | } |
| 47 | |
| 48 | .message-center:hover { |
| 49 | color: #D8C0A1; /* 当鼠标悬停时字体颜色变亮 */ |
| 50 | } |
| 51 | |
| 52 | /* 导航栏样式 */ |
| 53 | .nav { |
| 54 | display: flex; |
| 55 | justify-content: center; |
| 56 | background-color: #dab8c2; |
| 57 | box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* 增加阴影 */ |
| 58 | transition: background 0.3s ease; |
| 59 | } |
| 60 | |
| 61 | /* 每个导航项 */ |
| 62 | .nav-item { |
| 63 | padding: 14px 12px; |
| 64 | text-decoration: none; |
| 65 | color: #FBF2E3; |
| 66 | font-size: 18px; |
| 67 | font-weight: 500; |
| 68 | text-align: center; |
| 69 | border-radius: 8px; /* 圆角效果 */ |
| 70 | transition: background-color 0.3s, color 0.3s, transform 0.3s ease; /* 平滑过渡 */ |
| 71 | position: relative; /* 为阴影和动画提供定位 */ |
| 72 | } |
| 73 | |
| 74 | /* 鼠标悬停时 */ |
| 75 | .nav-item:hover { |
| 76 | background-color: #5c270c; /* 背景色变深 */ |
| 77 | color: #FBF2E3; /* 字体颜色与背景形成对比 */ |
| 78 | transform: scale(1.05); /* 微微放大,增加互动感 */ |
| 79 | } |
| 80 | |
| 81 | /* 选中状态 */ |
| 82 | .nav-item.active { |
| 83 | background-color: #5c270c; /* 活动状态时的背景色 */ |
| 84 | color: #FBF2E3; /* 活动状态时的字体颜色 */ |
| 85 | font-weight: bold; |
| 86 | border-radius: 16px; /* 更圆的圆角效果 */ |
| 87 | padding: 4px 12px; /* 减小上下和左右的padding,框变小 */ |
| 88 | box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15); /* 增加阴影,带来浮动感 */ |
| 89 | transition: background-color 0.3s, box-shadow 0.3s, transform 0.3s ease; /* 平滑过渡 */ |
| 90 | transform: scale(1.1); /* 选中项微微放大 */ |
| 91 | line-height: 40px; /* 调整line-height,使文字更居中 */ |
| 92 | } |
| 93 | |
| 94 | |