/* ============================================
   新闻文章详情页样式 - 专业简洁风格
   ============================================ */

/* 分类导航（顶部） */
.news-category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.category-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    color: #4b5563;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.category-link:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.category-link.active {
    background: #2563eb;
    color: #fff;
}

/* 文章头部区域 */
.article-hero {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.article-category-tag {
    margin-bottom: 1rem;
}

.article-category-tag a {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    background: #eff6ff;
    color: #2563eb;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.article-category-tag a:hover {
    background: #dbeafe;
}

.article-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.4;
    margin: 0 0 1.25rem 0;
    text-align: center;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.meta-item i {
    color: #9ca3af;
}

.article-actions {
    display: flex;
    gap: 0.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e5e7eb;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #4b5563;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-action:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #1f2937;
}

/* 文章目录侧边栏 */
.toc-sidebar {
    position: sticky;
    top: 100px;
}

.toc-header {
    padding: 0.875rem 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
}

.toc-header h5 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
}

.toc-nav {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 0.75rem 0;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-item {
    border-bottom: 1px solid #f3f4f6;
}

.toc-item:last-child {
    border-bottom: none;
}

.toc-link {
    display: block;
    padding: 0.625rem 1rem;
    color: #4b5563;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.toc-link:hover {
    background: #f9fafb;
    color: #2563eb;
    border-left-color: #2563eb;
}

.toc-item.h2 .toc-link {
    padding-left: 1rem;
}

.toc-item.h3 .toc-link {
    padding-left: 1.75rem;
    font-size: 0.8rem;
}

/* 文章内容 */
.article-content {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 2rem;
}

.article-body {
    font-size: 1rem;
    line-height: 1.8;
    color: #374151;
}

.article-body h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.article-body h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin: 1.75rem 0 0.875rem;
}

.article-body h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin: 1.5rem 0 0.75rem;
}

.article-body p {
    margin-bottom: 1rem;
}

.article-body ul,
.article-body ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.article-body li {
    margin-bottom: 0.5rem;
}

.article-body code {
    background: #f3f4f6;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.9em;
    color: #ef4444;
}

.article-body pre {
    background: #1f2937;
    color: #f9fafb;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

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

.article-body blockquote {
    border-left: 4px solid #2563eb;
    padding-left: 1rem;
    margin: 1rem 0;
    color: #6b7280;
    font-style: italic;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

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

.article-body th,
.article-body td {
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    text-align: left;
}

.article-body th {
    background: #f9fafb;
    font-weight: 600;
}

/* 文章标签 */
.article-tags {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.tags-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-right: 0.5rem;
}

.tag-item {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #f3f4f6;
    color: #4b5563;
    font-size: 0.8rem;
    border-radius: 4px;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

/* 文章导航 */
.article-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.nav-card {
    padding: 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-card:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
}

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

.nav-card.empty {
    background: #f9fafb;
    border-style: dashed;
    cursor: default;
}

.nav-card.empty:hover {
    background: #f9fafb;
    border-color: #e5e7eb;
}

.nav-label {
    font-size: 0.8rem;
    color: #9ca3af;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-card.next .nav-label {
    justify-content: flex-end;
}

.nav-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.375rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.nav-card:hover .nav-title {
    color: #2563eb;
}

.nav-summary {
    font-size: 0.8rem;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 侧边栏 */
.sidebar-block {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.sidebar-header {
    padding: 0.875rem 1rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    border-radius: 8px 8px 0 0;
}

.sidebar-header h5 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
}

.sidebar-content {
    padding: 0.75rem 0;
}

/* 相关文章 */
.related-item {
    display: block;
    padding: 0.75rem 1rem;
    text-decoration: none;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s ease;
}

.related-item:last-child {
    border-bottom: none;
}

.related-item:hover {
    background: #f9fafb;
}

.related-title {
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.5;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.related-item:hover .related-title {
    color: #2563eb;
}

.related-meta {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* 移动端目录 */
.toc-nav-mobile {
    padding: 0.75rem 0;
    max-height: 300px;
    overflow-y: auto;
}

/* 响应式 */
@media (max-width: 991px) {
    .article-hero {
        padding: 1.5rem;
    }

    .article-title {
        font-size: 1.5rem;
    }

    .article-meta {
        gap: 0.875rem;
    }

    .meta-item {
        font-size: 0.8rem;
    }

    .article-content {
        padding: 1.5rem;
    }

    .article-nav {
        grid-template-columns: 1fr;
    }

    .nav-card.next {
        text-align: left;
    }

    .nav-card.next .nav-label {
        justify-content: flex-start;
    }
}

@media (max-width: 576px) {
    .article-hero {
        padding: 1rem;
    }

    .article-title {
        font-size: 1.25rem;
    }

    .article-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

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

    .btn-action {
        flex: 1;
        justify-content: center;
    }

    .article-content {
        padding: 1rem;
    }

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

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

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

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