/* 文章详情页样式表 */ .article-detail-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; } .article-detail { background-color: #fff; border-radius: 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); padding: 40px; margin-bottom: 40px; } /* 文章头部 */ .article-header { margin-bottom: 30px; text-align: center; } .article-title { font-size: 32px; font-weight: bold; color: #333; line-height: 1.4; margin-bottom: 20px; } .article-meta { display: flex; justify-content: center; flex-wrap: wrap; gap: 15px; color: #999; font-size: 14px; } .article-meta i { margin-right: 5px; color: #bbb; } .article-like { margin: 20px 0; text-align: center; } .link { margin: 4px; } /* 文章封面图 */ .article-cover { margin: 30px 0; border-radius: 6px; overflow: hidden; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); } .article-cover img { width: 100%; height: auto; display: block; } /* 文章内容 */ .article-content { font-size: 16px; line-height: 1.8; color: #444; margin-bottom: 40px; } .article-content p { margin-bottom: 20px; } .article-content h2, .article-content h3, .article-content h4 { margin: 30px 0 20px; font-weight: bold; color: #333; } .article-content h2 { font-size: 24px; padding-bottom: 10px; border-bottom: 1px solid #eee; } .article-content h3 { font-size: 20px; } .article-content h4 { font-size: 18px; } .article-content img { max-width: 100%; height: auto; margin: 20px 0; border-radius: 6px; } .article-content pre { background-color: #f8f9fa; padding: 15px; border-radius: 6px; overflow-x: auto; margin: 20px 0; } .article-content code { font-family: 'Courier New', monospace; background-color: #f8f9fa; padding: 2px 5px; border-radius: 3px; } .article-content blockquote { border-left: 4px solid #3498db; padding-left: 20px; margin: 20px 0; color: #666; font-style: italic; } /* 文章标签 */ .article-tags { margin: 30px 0; padding: 15px 0; border-top: 1px solid #eee; border-bottom: 1px solid #eee; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; } .article-tags i { color: #999; } .tag { display: inline-block; background-color: #f0f7ff; color: #3498db; padding: 4px 12px; border-radius: 20px; font-size: 14px; transition: all 0.3s; } .tag:hover { background-color: #3498db; color: #fff; } /* 文章导航 */ .article-nav { display: flex; justify-content: space-between; margin: 40px 0; padding: 20px 0; border-top: 1px solid #eee; border-bottom: 1px solid #eee; } .article-nav a { max-width: 48%; color: #666; font-size: 15px; transition: all 0.3s; } .article-nav a:hover { color: #3498db; } .article-nav i { margin: 0 5px; } .prev { text-align: left; } .next { text-align: right; } /* 相关文章 */ .related-articles { margin: 40px 0; } .section-title { font-size: 22px; color: #333; margin-bottom: 25px; padding-bottom: 10px; border-bottom: 1px solid #eee; } .related-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; } .related-card { background-color: #f9f9f9; border-radius: 6px; overflow: hidden; transition: all 0.3s; } .related-card:hover { transform: translateY(-5px); box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); } .related-image { height: 180px; overflow: hidden; } .related-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; } .related-card:hover .related-image img { transform: scale(1.05); } .related-info { padding: 20px; } .related-info h4 { font-size: 18px; margin-bottom: 10px; color: #333; } .related-info p { font-size: 14px; color: #777; line-height: 1.6; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } .related-date { font-size: 13px; color: #999; } /* 评论区域 */ .comment-section { margin-top: 50px; } .comment-form { margin-bottom: 40px; } .form-group { margin-bottom: 20px; } .form-group { display: flex; justify-content: space-between; flex-wrap: wrap; } .comment-form textarea { width: 100%; padding: 15px; border: 1px solid #eee; border-radius: 6px; resize: vertical; min-height: 120px; font-size: 15px; transition: border 0.3s; } .comment-form textarea:focus { border-color: #3498db; outline: none; } .form-group > .comment-input { width: 49.5%; height: 30px; border: 1px solid #eee; border-radius: 6px; margin-bottom: 10px; padding: 15px; } .submit-btn { background-color: #3498db; color: #fff; border: none; padding: 12px 25px; border-radius: 6px; font-size: 15px; cursor: pointer; transition: all 0.3s; } .submit-btn:hover { background-color: #2980b9; } /* 评论列表 */ .comment-list { margin-top: 30px; } .comment-item { display: flex; padding: 20px 0; border-bottom: 1px solid #f0f0f0; } .comment-avatar { width: 50px; height: 50px; margin-right: 15px; flex-shrink: 0; } .comment-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; } .comment-content { flex-grow: 1; } .comment-header { margin-bottom: 8px; display: flex; align-items: center; } .comment-user { font-weight: bold; color: #333; margin-right: 15px; } .comment-time { font-size: 13px; color: #999; } .comment-content p { color: #444; line-height: 1.7; margin-bottom: 10px; } /* 回复区域 */ .comment-replies { margin-left: 50px; margin-top: 15px; padding-left: 15px; border-left: 2px solid #eee; } .reply-item { display: flex; padding: 15px 0; border-bottom: 1px dashed #f0f0f0; } .reply-avatar { width: 40px; height: 40px; margin-right: 12px; flex-shrink: 0; } .reply-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; } .reply-content { flex-grow: 1; } .reply-header { margin-bottom: 5px; display: flex; align-items: center; } .reply-user { font-weight: bold; color: #333; margin-right: 10px; font-size: 14px; } .reply-time { font-size: 12px; color: #999; } .reply-content p { color: #555; line-height: 1.6; font-size: 14px; } .no-comments { text-align: center; padding: 30px 0; color: #999; font-size: 15px; } /* 响应式设计 */ @media (max-width: 768px) { .article-detail { padding: 20px; } .article-title { font-size: 26px; } .article-nav { flex-direction: column; gap: 15px; } .article-nav a { max-width: 100%; } .related-list { grid-template-columns: 1fr; } .comment-item { flex-direction: column; } .comment-avatar { margin-right: 0; margin-bottom: 10px; } .comment-replies { margin-left: 20px; } }