22301008 | b2ef519 | 2025-06-19 22:00:37 +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: white; |
| 105 | } |
| 106 | |
| 107 | /* 主要内容区 */ |
| 108 | .post-content { |
| 109 | flex: 1; |
| 110 | padding: 20px; |
| 111 | } |
| 112 | |
| 113 | .post-title { |
| 114 | font-size: 24px; |
| 115 | font-weight: 700; |
| 116 | line-height: 1.4; |
| 117 | margin-bottom: 20px; |
| 118 | color: #333; |
| 119 | } |
| 120 | |
| 121 | /* 帖子元信息 */ |
| 122 | .post-meta { |
| 123 | display: flex; |
| 124 | justify-content: space-between; |
| 125 | align-items: center; |
| 126 | margin-bottom: 20px; |
| 127 | padding-bottom: 16px; |
| 128 | border-bottom: 1px solid #f0f0f0; |
| 129 | } |
| 130 | |
| 131 | .author-info { |
| 132 | display: flex; |
| 133 | align-items: center; |
| 134 | gap: 12px; |
| 135 | } |
| 136 | |
| 137 | .avatar { |
| 138 | width: 40px; |
| 139 | height: 40px; |
| 140 | border-radius: 50%; |
| 141 | background: #ff4757; |
| 142 | color: white; |
| 143 | display: flex; |
| 144 | align-items: center; |
| 145 | justify-content: center; |
| 146 | font-weight: 600; |
| 147 | font-size: 16px; |
| 148 | } |
| 149 | |
| 150 | .author-details { |
| 151 | display: flex; |
| 152 | flex-direction: column; |
| 153 | gap: 2px; |
| 154 | } |
| 155 | |
| 156 | .author-name { |
| 157 | font-weight: 600; |
| 158 | color: #333; |
| 159 | font-size: 14px; |
| 160 | } |
| 161 | |
| 162 | .post-date { |
| 163 | font-size: 12px; |
| 164 | color: #666; |
| 165 | } |
| 166 | |
| 167 | .post-stats { |
| 168 | display: flex; |
| 169 | gap: 16px; |
| 170 | } |
| 171 | |
| 172 | .stat-item { |
| 173 | display: flex; |
| 174 | align-items: center; |
| 175 | gap: 4px; |
| 176 | font-size: 14px; |
| 177 | color: #666; |
| 178 | } |
| 179 | |
| 180 | /* 标签 */ |
| 181 | .post-tags { |
| 182 | display: flex; |
| 183 | flex-wrap: wrap; |
| 184 | gap: 8px; |
| 185 | margin-bottom: 20px; |
| 186 | } |
| 187 | |
| 188 | .tag { |
| 189 | padding: 4px 12px; |
| 190 | background: #f8f9fa; |
| 191 | border-radius: 16px; |
| 192 | font-size: 12px; |
| 193 | color: #666; |
| 194 | border: 1px solid #e9ecef; |
| 195 | } |
| 196 | |
| 197 | /* 帖子正文 */ |
| 198 | .post-body { |
| 199 | margin-bottom: 24px; |
| 200 | line-height: 1.6; |
| 201 | color: #333; |
| 202 | font-size: 16px; |
| 203 | } |
| 204 | |
| 205 | .post-body p { |
| 206 | margin-bottom: 16px; |
| 207 | } |
| 208 | |
| 209 | /* 类别信息 */ |
| 210 | .post-category { |
| 211 | margin-bottom: 20px; |
| 212 | padding: 12px; |
| 213 | background: #f8f9fa; |
| 214 | border-radius: 8px; |
| 215 | font-size: 14px; |
| 216 | } |
| 217 | |
| 218 | .category-label { |
| 219 | color: #666; |
| 220 | font-weight: 500; |
| 221 | } |
| 222 | |
| 223 | .category-name { |
| 224 | color: #333; |
| 225 | font-weight: 600; |
| 226 | } |
| 227 | |
| 228 | /* 评论区 */ |
| 229 | .comments-section { |
| 230 | margin-top: 32px; |
| 231 | padding-top: 24px; |
| 232 | border-top: 1px solid #eee; |
| 233 | } |
| 234 | |
| 235 | .comments-header { |
| 236 | margin-bottom: 20px; |
| 237 | } |
| 238 | |
| 239 | .comments-toggle { |
| 240 | display: flex; |
| 241 | align-items: center; |
| 242 | gap: 8px; |
| 243 | padding: 10px 16px; |
| 244 | border: 1px solid #e9ecef; |
| 245 | background: #f8f9fa; |
| 246 | border-radius: 8px; |
| 247 | cursor: pointer; |
| 248 | transition: background-color 0.2s; |
| 249 | font-size: 14px; |
| 250 | color: #333; |
| 251 | } |
| 252 | |
| 253 | .comments-toggle:hover { |
| 254 | background: #e9ecef; |
| 255 | } |
| 256 | |
| 257 | .comments-content { |
| 258 | margin-top: 16px; |
| 259 | } |
| 260 | |
| 261 | /* 评论表单 */ |
| 262 | .comment-form { |
| 263 | margin-bottom: 24px; |
| 264 | padding: 16px; |
| 265 | background: #f8f9fa; |
| 266 | border-radius: 8px; |
| 267 | } |
| 268 | |
| 269 | .comment-input { |
| 270 | width: 100%; |
| 271 | padding: 12px; |
| 272 | border: 1px solid #dee2e6; |
| 273 | border-radius: 6px; |
| 274 | resize: vertical; |
| 275 | font-family: inherit; |
| 276 | font-size: 14px; |
| 277 | margin-bottom: 12px; |
| 278 | outline: none; |
| 279 | transition: border-color 0.2s; |
| 280 | } |
| 281 | |
| 282 | .comment-input:focus { |
| 283 | border-color: #ff4757; |
| 284 | } |
| 285 | |
| 286 | .comment-submit { |
| 287 | padding: 8px 16px; |
| 288 | background: #ff4757; |
| 289 | color: white; |
| 290 | border: none; |
| 291 | border-radius: 6px; |
| 292 | cursor: pointer; |
| 293 | font-size: 14px; |
| 294 | transition: background-color 0.2s; |
| 295 | } |
| 296 | |
| 297 | .comment-submit:hover { |
| 298 | background: #e84c4a; |
| 299 | } |
| 300 | |
| 301 | /* 评论列表 */ |
| 302 | .comments-list { |
| 303 | display: flex; |
| 304 | flex-direction: column; |
| 305 | gap: 16px; |
| 306 | } |
| 307 | |
| 308 | .no-comments { |
| 309 | text-align: center; |
| 310 | color: #666; |
| 311 | font-style: italic; |
| 312 | padding: 32px 0; |
| 313 | } |
| 314 | |
| 315 | .comment-item { |
| 316 | padding: 16px; |
| 317 | background: #fff; |
| 318 | border: 1px solid #e9ecef; |
| 319 | border-radius: 8px; |
| 320 | } |
| 321 | |
| 322 | .comment-author { |
| 323 | display: flex; |
| 324 | align-items: center; |
| 325 | gap: 8px; |
| 326 | margin-bottom: 8px; |
| 327 | } |
| 328 | |
| 329 | .comment-avatar { |
| 330 | width: 32px; |
| 331 | height: 32px; |
| 332 | border-radius: 50%; |
| 333 | background: #6c757d; |
| 334 | color: white; |
| 335 | display: flex; |
| 336 | align-items: center; |
| 337 | justify-content: center; |
| 338 | font-weight: 600; |
| 339 | font-size: 14px; |
| 340 | } |
| 341 | |
| 342 | .comment-name { |
| 343 | font-weight: 600; |
| 344 | color: #333; |
| 345 | font-size: 14px; |
| 346 | } |
| 347 | |
| 348 | .comment-time { |
| 349 | font-size: 12px; |
| 350 | color: #666; |
| 351 | margin-left: auto; |
| 352 | } |
| 353 | |
| 354 | .comment-content { |
| 355 | font-size: 14px; |
| 356 | line-height: 1.5; |
| 357 | color: #333; |
| 358 | margin-left: 40px; |
| 359 | } |
| 360 | |
| 361 | /* 底部操作栏 */ |
| 362 | .post-footer { |
| 363 | padding: 16px 20px; |
| 364 | border-top: 1px solid #eee; |
| 365 | background: #fff; |
| 366 | position: sticky; |
| 367 | bottom: 0; |
| 368 | } |
| 369 | |
| 370 | .action-bar { |
| 371 | display: flex; |
| 372 | justify-content: space-around; |
| 373 | align-items: center; |
| 374 | max-width: 400px; |
| 375 | margin: 0 auto; |
| 376 | } |
| 377 | |
| 378 | .action-button { |
| 379 | display: flex; |
| 380 | flex-direction: column; |
| 381 | align-items: center; |
| 382 | gap: 4px; |
| 383 | padding: 8px 12px; |
| 384 | border: none; |
| 385 | background: transparent; |
| 386 | cursor: pointer; |
| 387 | transition: color 0.2s; |
| 388 | color: #666; |
| 389 | font-size: 12px; |
| 390 | } |
| 391 | |
| 392 | .action-button:hover { |
| 393 | color: #333; |
| 394 | } |
| 395 | |
| 396 | .action-button.liked { |
| 397 | color: #ff4757; |
| 398 | } |
| 399 | |
| 400 | .action-button.bookmarked { |
| 401 | color: #ffa502; |
| 402 | } |
| 403 | |
| 404 | /* 响应式设计 */ |
| 405 | @media (max-width: 768px) { |
| 406 | .post-detail { |
| 407 | margin: 0; |
| 408 | } |
| 409 | |
| 410 | .post-content { |
| 411 | padding: 16px; |
| 412 | } |
| 413 | |
| 414 | .post-title { |
| 415 | font-size: 20px; |
| 416 | } |
| 417 | |
| 418 | .post-meta { |
| 419 | flex-direction: column; |
| 420 | align-items: flex-start; |
| 421 | gap: 12px; |
| 422 | } |
| 423 | |
| 424 | .post-stats { |
| 425 | align-self: flex-end; |
| 426 | } |
| 427 | |
| 428 | .action-bar { |
| 429 | max-width: none; |
| 430 | } |
| 431 | |
| 432 | .comment-content { |
| 433 | margin-left: 0; |
| 434 | margin-top: 8px; |
| 435 | } |
| 436 | } |