22301008 | d5fbb78 | 2025-06-18 16:28:43 +0800 | [diff] [blame] | 1 | /* 帖子详情页面容器 */ |
| 2 | .post-detail { |
| 3 | max-width: 800px; |
| 4 | margin: 0 auto; |
| 5 | background: #fff; |
| 6 | min-height: 100vh; |
| 7 | display: flex; |
| 8 | flex-direction: column; |
| 9 | } |
| 10 | |
| 11 | /* 加载状态 */ |
| 12 | .loading-container { |
| 13 | display: flex; |
| 14 | flex-direction: column; |
| 15 | align-items: center; |
| 16 | justify-content: center; |
| 17 | padding: 60px 20px; |
| 18 | color: #666; |
| 19 | } |
| 20 | |
| 21 | .loading-spinner { |
| 22 | width: 40px; |
| 23 | height: 40px; |
| 24 | border: 3px solid #f3f3f3; |
| 25 | border-top: 3px solid #ff4757; |
| 26 | border-radius: 50%; |
| 27 | animation: spin 1s linear infinite; |
| 28 | margin-bottom: 20px; |
| 29 | } |
| 30 | |
| 31 | @keyframes spin { |
| 32 | 0% { transform: rotate(0deg); } |
| 33 | 100% { transform: rotate(360deg); } |
| 34 | } |
| 35 | |
| 36 | /* 错误状态 */ |
| 37 | .error-container { |
| 38 | text-align: center; |
| 39 | padding: 60px 20px; |
| 40 | color: #666; |
| 41 | } |
| 42 | |
| 43 | .error-container h2 { |
| 44 | margin-bottom: 16px; |
| 45 | color: #333; |
| 46 | } |
| 47 | |
| 48 | /* 顶部导航栏 */ |
| 49 | .post-header { |
| 50 | display: flex; |
| 51 | justify-content: space-between; |
| 52 | align-items: center; |
| 53 | padding: 16px 20px; |
| 54 | border-bottom: 1px solid #eee; |
| 55 | background: #fff; |
| 56 | position: sticky; |
| 57 | top: 0; |
| 58 | z-index: 100; |
| 59 | } |
| 60 | |
| 61 | .back-btn { |
| 62 | display: flex; |
| 63 | align-items: center; |
| 64 | gap: 8px; |
| 65 | padding: 8px 16px; |
| 66 | border: none; |
| 67 | background: #f8f9fa; |
| 68 | border-radius: 20px; |
| 69 | cursor: pointer; |
| 70 | transition: background-color 0.2s; |
| 71 | font-size: 14px; |
| 72 | color: #333; |
| 73 | } |
| 74 | |
| 75 | .back-btn:hover { |
| 76 | background: #e9ecef; |
| 77 | } |
| 78 | |
| 79 | .header-actions { |
| 80 | display: flex; |
| 81 | gap: 8px; |
| 82 | } |
| 83 | |
| 84 | .action-btn { |
| 85 | display: flex; |
| 86 | align-items: center; |
| 87 | justify-content: center; |
| 88 | width: 40px; |
| 89 | height: 40px; |
| 90 | border: none; |
| 91 | background: #f8f9fa; |
| 92 | border-radius: 50%; |
| 93 | cursor: pointer; |
| 94 | transition: background-color 0.2s; |
| 95 | color: #666; |
| 96 | } |
| 97 | |
| 98 | .action-btn:hover { |
| 99 | background: #e9ecef; |
| 100 | } |
| 101 | |
| 102 | .action-btn.active { |
| 103 | background: #ff4757; |
| 104 | color: #fff; |
| 105 | } |
| 106 | |
| 107 | /* 主要内容区 */ |
| 108 | .post-content { |
| 109 | flex: 1; |
| 110 | padding: 20px; |
| 111 | } |
| 112 | |
| 113 | /* 帖子标题 */ |
| 114 | .post-title { |
| 115 | font-size: 28px; |
| 116 | font-weight: 700; |
| 117 | line-height: 1.3; |
| 118 | margin-bottom: 20px; |
| 119 | color: #2c3e50; |
| 120 | } |
| 121 | |
| 122 | /* 作者信息和元数据 */ |
| 123 | .post-meta { |
| 124 | display: flex; |
| 125 | justify-content: space-between; |
| 126 | align-items: center; |
| 127 | margin-bottom: 20px; |
| 128 | padding-bottom: 16px; |
| 129 | border-bottom: 1px solid #eee; |
| 130 | } |
| 131 | |
| 132 | .author-info { |
| 133 | display: flex; |
| 134 | align-items: center; |
| 135 | gap: 12px; |
| 136 | } |
| 137 | |
| 138 | .avatar { |
| 139 | width: 48px; |
| 140 | height: 48px; |
| 141 | border-radius: 50%; |
| 142 | background: linear-gradient(135deg, #ff4757, #ff6b7a); |
| 143 | display: flex; |
| 144 | align-items: center; |
| 145 | justify-content: center; |
| 146 | color: #fff; |
| 147 | font-size: 18px; |
| 148 | font-weight: 600; |
| 149 | } |
| 150 | |
| 151 | .author-details { |
| 152 | display: flex; |
| 153 | flex-direction: column; |
| 154 | gap: 4px; |
| 155 | } |
| 156 | |
| 157 | .author-name { |
| 158 | font-size: 16px; |
| 159 | font-weight: 600; |
| 160 | color: #2c3e50; |
| 161 | } |
| 162 | |
| 163 | .post-date { |
| 164 | font-size: 14px; |
| 165 | color: #7f8c8d; |
| 166 | } |
| 167 | |
| 168 | .post-stats { |
| 169 | display: flex; |
| 170 | gap: 16px; |
| 171 | } |
| 172 | |
| 173 | .stat-item { |
| 174 | display: flex; |
| 175 | align-items: center; |
| 176 | gap: 4px; |
| 177 | color: #7f8c8d; |
| 178 | font-size: 14px; |
| 179 | } |
| 180 | |
| 181 | /* 标签 */ |
| 182 | .post-tags { |
| 183 | display: flex; |
| 184 | flex-wrap: wrap; |
| 185 | gap: 8px; |
| 186 | margin-bottom: 24px; |
| 187 | } |
| 188 | |
| 189 | .tag { |
| 190 | padding: 4px 12px; |
| 191 | background: #f8f9fa; |
| 192 | border-radius: 12px; |
| 193 | font-size: 12px; |
| 194 | color: #666; |
| 195 | border: 1px solid #dee2e6; |
| 196 | } |
| 197 | |
| 198 | /* 帖子正文 */ |
| 199 | .post-body { |
| 200 | line-height: 1.8; |
| 201 | font-size: 16px; |
| 202 | color: #2c3e50; |
| 203 | margin-bottom: 24px; |
| 204 | } |
| 205 | |
| 206 | .post-body p { |
| 207 | margin-bottom: 16px; |
| 208 | } |
| 209 | |
| 210 | /* 类别信息 */ |
| 211 | .post-category { |
| 212 | display: flex; |
| 213 | align-items: center; |
| 214 | gap: 8px; |
| 215 | padding: 12px 16px; |
| 216 | background: #f8f9fa; |
| 217 | border-radius: 8px; |
| 218 | margin-bottom: 20px; |
| 219 | } |
| 220 | |
| 221 | .category-label { |
| 222 | font-size: 14px; |
| 223 | color: #7f8c8d; |
| 224 | } |
| 225 | |
| 226 | .category-name { |
| 227 | font-size: 14px; |
| 228 | font-weight: 600; |
| 229 | color: #ff4757; |
| 230 | } |
| 231 | |
| 232 | /* 底部操作栏 */ |
| 233 | .post-footer { |
| 234 | border-top: 1px solid #eee; |
| 235 | background: #fff; |
| 236 | position: sticky; |
| 237 | bottom: 0; |
| 238 | } |
| 239 | |
| 240 | .action-bar { |
| 241 | display: flex; |
| 242 | justify-content: space-around; |
| 243 | padding: 12px 20px; |
| 244 | } |
| 245 | |
| 246 | .action-button { |
| 247 | display: flex; |
| 248 | flex-direction: column; |
| 249 | align-items: center; |
| 250 | gap: 4px; |
| 251 | padding: 8px 12px; |
| 252 | border: none; |
| 253 | background: transparent; |
| 254 | cursor: pointer; |
| 255 | transition: all 0.2s; |
| 256 | color: #7f8c8d; |
| 257 | font-size: 12px; |
| 258 | border-radius: 8px; |
| 259 | min-width: 60px; |
| 260 | } |
| 261 | |
| 262 | .action-button:hover { |
| 263 | background: #f8f9fa; |
| 264 | color: #2c3e50; |
| 265 | } |
| 266 | |
| 267 | .action-button.liked { |
| 268 | color: #ff4757; |
| 269 | } |
| 270 | |
| 271 | .action-button.bookmarked { |
| 272 | color: #ffa726; |
| 273 | } |
| 274 | |
| 275 | /* 响应式设计 */ |
| 276 | @media (max-width: 768px) { |
| 277 | .post-detail { |
| 278 | margin: 0; |
| 279 | } |
| 280 | |
| 281 | .post-title { |
| 282 | font-size: 24px; |
| 283 | } |
| 284 | |
| 285 | .post-content { |
| 286 | padding: 16px; |
| 287 | } |
| 288 | |
| 289 | .post-header { |
| 290 | padding: 12px 16px; |
| 291 | } |
| 292 | |
| 293 | .post-meta { |
| 294 | flex-direction: column; |
| 295 | align-items: flex-start; |
| 296 | gap: 12px; |
| 297 | } |
| 298 | |
| 299 | .post-stats { |
| 300 | align-self: flex-end; |
| 301 | } |
| 302 | |
| 303 | .action-bar { |
| 304 | padding: 8px 16px; |
| 305 | } |
| 306 | |
| 307 | .action-button { |
| 308 | font-size: 11px; |
| 309 | min-width: 50px; |
| 310 | } |
| 311 | } |
| 312 | |
| 313 | /* 平滑滚动 */ |
| 314 | html { |
| 315 | scroll-behavior: smooth; |
| 316 | } |
| 317 | |
| 318 | /* 选中文本样式 */ |
| 319 | ::selection { |
| 320 | background: rgba(255, 71, 87, 0.2); |
| 321 | color: #2c3e50; |
| 322 | } |