/**
 * 知识付费博客模板 - 文章详情样式
 * 包含文章头部、正文、作者卡片、相关文章等组件
 */

/* ========== 文章头部 ========== */
.article-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #4c6ca8 100%);
    padding: 60px 0 40px;
    margin-bottom: 30px;
}

.article-header-content {
    text-align: center;
}

.article-main-title {
    color: var(--text-white);
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.4;
}

.article-main-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
}

.article-main-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

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

.article-main-meta .meta-item a {
    color: rgba(255, 255, 255, 0.9);
}

.article-main-meta .meta-item a:hover {
    color: var(--text-white);
}

/* ========== 文章详情 ========== */
.article-content-section {
    flex: 1;
    min-width: 0;
}

.article-detail {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: var(--box-shadow);
}

.article-cover {
    margin-bottom: 25px;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.article-cover img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
}

.article-tags .tag-item {
    padding: 5px 12px;
    background: var(--bg-secondary);
    color: var(--primary-color);
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
}

.article-tags .tag-item:hover {
    background: var(--primary-color);
    color: var(--text-white);
}

/* 文章正文 */
.article-body {
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 30px;
}

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6 {
    margin: 30px 0 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.article-body h1 {
    font-size: 2rem;
}

.article-body h2 {
    font-size: 1.6rem;
}

.article-body h3 {
    font-size: 1.3rem;
}

.article-body p {
    margin-bottom: 15px;
}

.article-body img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
    border-radius: var(--border-radius);
}

.article-body a {
    color: var(--primary-color);
    text-decoration: underline;
}

.article-body a:hover {
    color: var(--secondary-color);
}

.article-body ul,
.article-body ol {
    margin: 15px 0;
    padding-left: 30px;
}

.article-body ul {
    list-style: disc;
}

.article-body ol {
    list-style: decimal;
}

.article-body li {
    margin: 8px 0;
}

.article-body blockquote {
    margin: 20px 0;
    padding: 15px 20px;
    background: var(--bg-secondary);
    border-left: 4px solid var(--primary-color);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.article-body code {
    padding: 2px 6px;
    background: var(--bg-secondary);
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.article-body pre {
    margin: 20px 0;
    padding: 15px;
    background: #2d2d2d;
    border-radius: var(--border-radius);
    overflow-x: auto;
}

.article-body pre code {
    color: #f8f8f2;
    background: transparent;
    padding: 0;
}

.article-body table {
    width: 100%;
    margin: 20px 0;
    border-collapse: collapse;
}

.article-body table th,
.article-body table td {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
}

.article-body table th {
    background: var(--bg-secondary);
    font-weight: 600;
}

/* 文章操作 */
.article-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.article-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: var(--primary-color);
    color: var(--text-white);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.action-btn i {
    font-size: 1.1rem;
}

/* 作者卡片 */
.author-card {
    display: flex;
    gap: 20px;
    padding: 25px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    margin-top: 25px;
}

.author-avatar {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-info {
    flex: 1;
}

.author-info h5 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.author-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* 相关文章 */
.related-articles {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--box-shadow);
}

.section-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--bg-secondary);
    color: var(--text-primary);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.related-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all 0.3s ease;
}

.related-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--box-shadow);
}

.related-image {
    width: 100%;
    height: 140px;
    overflow: hidden;
}

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

.related-card:hover .related-image img {
    transform: scale(1.05);
}

.related-content {
    padding: 15px;
}

.related-content h5 {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-meta {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.related-meta i {
    margin-right: 3px;
}

/* 评论区 */
.comments-section {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--box-shadow);
}

.empty-comments {
    text-align: center;
    padding: 60px 20px;
}

.empty-comments i {
    font-size: 3.5rem;
    color: var(--text-tertiary);
    margin-bottom: 15px;
}

.empty-comments p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .article-header {
        padding: 40px 0 30px;
    }

    .article-main-title {
        font-size: 1.6rem;
    }

    .article-main-meta {
        font-size: 0.85rem;
        gap: 12px;
    }

    .article-detail {
        padding: 20px;
    }

    .article-body {
        font-size: 0.95rem;
    }

    .article-actions {
        flex-wrap: wrap;
    }

    .action-btn {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }

    .author-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }

    .related-articles,
    .comments-section {
        padding: 20px;
    }
}

@media (max-width: 576px) {
    .article-header {
        padding: 30px 0 25px;
    }

    .article-main-title {
        font-size: 1.4rem;
    }

    .article-detail {
        padding: 15px;
    }

    .article-body h1 {
        font-size: 1.6rem;
    }

    .article-body h2 {
        font-size: 1.3rem;
    }

    .article-body h3 {
        font-size: 1.1rem;
    }

    .action-btn {
        padding: 8px 15px;
        font-size: 0.85rem;
    }
}
