/**
 * 页面样式文件 - 文章详情页、分类页、标签页
 * 
 * @author: 商家助手开发团队
 * @version: 1.0.0
 */

/* ==========================================================================
   文章详情页样式
   ========================================================================== */

.post-detail {
    background: #fff;
    margin-bottom: 2rem;
}

/* 文章头部 */
.post-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0 3rem;
    position: relative;
}

.post-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: white;
    clip-path: polygon(0 100%, 100% 0, 100% 100%);
}

.post-title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 1rem 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin: 1.5rem 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.meta-item i {
    font-size: 1rem;
}

.post-tags {
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tags-label {
    font-weight: 600;
    margin-right: 0.5rem;
}

.tag-link {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.3);
}

.tag-link:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

/* 特色图片 */
.post-featured-image {
    margin: 2rem 0;
}

.featured-img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* 文章内容 */
.post-content {
    padding: 2rem 0;
}

.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
    max-width: 800px;
    margin: 0 auto;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    margin: 2rem 0 1rem;
    color: #2c3e50;
    font-weight: 600;
}

.article-content h2 {
    font-size: 1.8rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.article-content h3 {
    font-size: 1.5rem;
    color: #e74c3c;
}

.article-content p {
    margin: 1.5rem 0;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.article-content blockquote {
    border-left: 4px solid #3498db;
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    border-radius: 0 8px 8px 0;
}

.article-content code {
    background: #f1f2f6;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #e74c3c;
}

.article-content pre {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2rem 0;
}

.article-content pre code {
    background: none;
    color: inherit;
    padding: 0;
}

/* 分享按钮 */
.post-share {
    margin: 3rem 0;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 12px;
    text-align: center;
}

.post-share h4 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.share-btn.weibo {
    background: #e6162d;
    color: white;
}

.share-btn.wechat {
    background: #1aad19;
    color: white;
}

.share-btn.qq {
    background: #12b7f5;
    color: white;
}

.share-btn.copy {
    background: #6c757d;
    color: white;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* 文章导航 */
.post-navigation {
    background: #f8f9fa;
    padding: 2rem 0;
    margin: 2rem 0;
}

.nav-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.nav-previous,
.nav-next {
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.nav-previous:hover,
.nav-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.nav-previous a,
.nav-next a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.nav-next {
    text-align: right;
}

.nav-subtitle {
    font-size: 0.9rem;
    color: #6c757d;
    display: block;
    margin-bottom: 0.5rem;
}

.nav-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    display: block;
}

/* 相关文章 */
.related-posts {
    padding: 3rem 0;
    background: #f8f9fa;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #2c3e50;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.post-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.post-thumbnail {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card:hover .post-thumbnail img {
    transform: scale(1.05);
}

.post-info {
    padding: 1.5rem;
}

.post-info .post-title {
    font-size: 1.2rem;
    margin: 0 0 1rem;
    line-height: 1.4;
}

.post-info .post-title a {
    color: #2c3e50;
    text-decoration: none;
}

.post-info .post-title a:hover {
    color: #3498db;
}

.post-info .post-meta {
    font-size: 0.85rem;
    color: #6c757d;
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
}

/* 阅读进度条 */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(0,0,0,0.1);
    z-index: 1000;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #e74c3c);
    width: 0%;
    transition: width 0.1s ease;
}

/* ==========================================================================
   分类页和标签页样式
   ========================================================================== */

.category-page,
.tag-page {
    padding: 2rem 0;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    color: white;
    border-radius: 12px;
}

.category-header,
.tag-header {
    max-width: 600px;
    margin: 0 auto;
}

.category-title,
.tag-title {
    font-size: 2.5rem;
    margin: 1rem 0;
    font-weight: 700;
}

.category-description,
.tag-description {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 1rem 0;
}

.category-stats,
.tag-stats {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
    font-size: 0.9rem;
}

.tag-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    text-align: left;
}

.tag-icon {
    font-size: 3rem;
    opacity: 0.8;
}

/* 文章列表 */
.posts-section {
    margin: 3rem 0;
}

.posts-grid .post-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.posts-grid .post-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-excerpt {
    color: #6c757d;
    line-height: 1.6;
    margin: 1rem 0;
    flex: 1;
}

.post-category {
    margin-bottom: 0.5rem;
}

.category-link {
    background: #3498db;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
}

.post-tags {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.post-tags .tag {
    background: #ecf0f1;
    color: #2c3e50;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
}

/* 分页导航 */
.pagination {
    margin: 3rem 0;
    text-align: center;
}

.pagination-info {
    margin-bottom: 1.5rem;
    color: #6c757d;
    font-size: 0.9rem;
}

.pagination-list {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    padding: 0.8rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    text-decoration: none;
    color: #495057;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 44px;
    justify-content: center;
}

.pagination-link:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
    transform: translateY(-1px);
}

.pagination-link.current {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.pagination-link.prev,
.pagination-link.next {
    padding: 0.8rem 1.5rem;
}

.pagination-ellipsis {
    padding: 0.8rem 0.5rem;
    color: #6c757d;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin: 1rem 0;
    color: #495057;
}

.empty-state p {
    font-size: 1rem;
    margin: 1rem 0 2rem;
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

/* 相关标签 */
.related-tags {
    margin: 3rem 0;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 12px;
}

.related-tags h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
}

.tags-cloud .tag-link {
    background: white;
    color: #495057;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    text-decoration: none;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.tags-cloud .tag-link:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
    transform: translateY(-1px);
}

.current-tag {
    background: #e74c3c !important;
    color: white !important;
    border-color: #e74c3c !important;
}

/* ==========================================================================
   响应式设计
   ========================================================================== */

@media (max-width: 768px) {
    .post-title {
        font-size: 2rem;
    }
    
    .post-meta {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .nav-links {
        grid-template-columns: 1fr;
    }
    
    .nav-next {
        text-align: left;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .category-title,
    .tag-title {
        font-size: 2rem;
    }
    
    .tag-header {
        flex-direction: column;
        text-align: center;
    }
    
    .category-stats,
    .tag-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .pagination-list {
        flex-wrap: wrap;
    }
    
    .share-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .share-btn {
        width: 200px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .post-header {
        padding: 1.5rem 0 2rem;
    }
    
    .post-title {
        font-size: 1.5rem;
    }
    
    .article-content {
        font-size: 1rem;
    }
    
    .post-card {
        margin: 0 -1rem;
        border-radius: 0;
    }
    
    .pagination-link {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }
}

/* ==========================================================================
   性能优化
   ========================================================================== */

/* 图片懒加载效果 */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* 预加载关键资源 */
.post-card:hover .post-thumbnail::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(52, 152, 219, 0.1);
    pointer-events: none;
}

/* 减少重绘和回流 */
.post-card,
.pagination-link,
.share-btn,
.btn {
    will-change: transform;
}

/* 优化字体渲染 */
.post-title,
.category-title,
.tag-title {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
} 