/* ===== 新闻详情页样式 ===== */

/* 文章头部 */
.article-header {
    margin-bottom: 30px;
}

.article-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 20px;
    line-height: 1.3;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.article-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}

.author-title {
    font-size: 0.8rem;
    color: var(--text-lighter);
}

.article-meta-info {
    display: flex;
    gap: 20px;
    color: var(--text-light);
    font-size: 0.9rem;
}

.article-meta-info i {
    color: var(--primary);
    margin-right: 5px;
}

/* 特色图片 */
.article-featured-image {
    margin-bottom: 30px;
}

.article-featured-image img {
    width: 100%;
    height: auto;
    border-radius: 16px;
}

.image-caption {
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-lighter);
    text-align: center;
    font-style: italic;
}

/* 文章内容 */
.article-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text);
    max-width: 100%;
    overflow-x: auto;          /* 防止长代码块/表格溢出，加滚动条 */
    word-wrap: break-word;     /* 长单词换行 */
    overflow-wrap: break-word;
    word-break: break-word;    /* 长链接/URL 强制换行 */
}

.article-intro {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 12px;
    border-left: 4px solid var(--primary);
}

.article-content h2 {
    font-size: 1.8rem;
    margin: 40px 0 20px;
    color: var(--text);
}

.article-content h3 {
    font-size: 1.4rem;
    margin: 30px 0 15px;
    color: var(--text);
}

.article-content p {
    margin-bottom: 20px;
}

.article-content ul, .article-content ol {
    margin: 20px 0 20px 30px;
}

.article-content li {
    margin-bottom: 8px;
}

/* 内容中的图片自适应 */
.article-content img {
    max-width: 100%;
    height: auto;
    display: block;            /* 去除图片下方多余空白 */
    margin: 0 auto;            /* 居中显示（可选） */
}

.article-image-full {
    margin: 30px 0;
}

.article-image-full img {
    width: 100%;
    height: auto;
    border-radius: 12px;
}

/* 文章标签 */
.article-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 40px 0 30px;
    padding: 20px 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}

.tags-label {
    font-weight: 600;
    color: var(--text);
    margin-right: 10px;
}

/* 文章分享 */
.article-share {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 40px;
}

.share-label {
    font-weight: 600;
    color: var(--text);
}

.share-buttons {
    display: flex;
    gap: 10px;
}

.share-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s;
}

.share-btn.facebook {
    background: #3b5998;
}

.share-btn.twitter {
    background: #1da1f2;
}

.share-btn.linkedin {
    background: #0077b5;
}

.share-btn.email {
    background: #666;
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* 上一篇/下一篇导航 */
.article-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 40px 0;
}

.nav-prev, .nav-next {
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
}

.nav-prev {
    align-items: flex-start;
}

.nav-next {
    align-items: flex-end;
}

.nav-prev:hover, .nav-next:hover {
    background: var(--primary-light);
}

.nav-prev i, .nav-next i {
    color: var(--primary);
    font-size: 0.9rem;
}

.nav-prev span:first-of-type, .nav-next span:first-of-type {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

.nav-title {
    font-weight: 600;
    color: var(--text);
    font-size: 1rem;
}

/* 相关文章 */
.related-articles-section {
    margin: 50px 0 30px;
}

.related-title {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--text);
    position: relative;
    padding-bottom: 10px;
}

.related-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--primary);
}

.related-mini-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.related-mini-item {
    display: flex;
    gap: 15px;
    text-decoration: none;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 12px;
    transition: all 0.3s;
}

.related-mini-item:hover {
    background: var(--primary-light);
}

.related-mini-image {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
}

.related-mini-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-mini-info {
    flex: 1;
}

.related-mini-info h4 {
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 4px;
    line-height: 1.4;
}

.related-mini-date {
    font-size: 0.8rem;
    color: var(--text-lighter);
}

/* 热点文章中的当前文章高亮 */
.hot-article-item.active {
    background: var(--primary-light);
}

.hot-article-item.active .hot-article-number {
    background: var(--primary);
    color: white;
}

.hot-article-item.active .hot-article-info h4 {
    color: var(--primary);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .article-title {
        font-size: 1.8rem;
    }

    .article-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .article-meta-info {
        flex-wrap: wrap;
        gap: 10px;
    }

    .article-content {
        font-size: 1rem;
    }

    .article-content h2 {
        font-size: 1.5rem;
    }

    .article-navigation {
        grid-template-columns: 1fr;
    }

    .nav-prev, .nav-next {
        align-items: center;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .article-tags {
        flex-direction: column;
        align-items: flex-start;
    }

    .share-buttons {
        flex-wrap: wrap;
    }
}

.news-detail-main {
    padding-top: 40px;  /* 添加上间距 */
    padding-bottom: 60px;
}

/* 面包屑 */
.breadcrumb-wrapper {
    background: #f8f9fa;
    padding: 12px 0;
    margin-bottom: 20px;
}
.breadcrumb {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
}
.breadcrumb li:not(:last-child):after {
    content: "›";
    margin: 0 8px;
    color: #999;
}
.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

/* 主题链接和标签 */
.article-topic-link, .article-tags {
    margin-bottom: 15px;
}
.label {
    font-weight: 600;
    color: var(--text);
    margin-right: 8px;
}
.topic-link {
    color: var(--primary);
    text-decoration: none;
}
.tag-link {
    display: inline-block;
    background: #f0f0f0;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-right: 8px;
    margin-bottom: 8px;
    color: #555;
    text-decoration: none;
}
.tag-link:hover {
    background: var(--primary);
    color: white;
}

/* 目录 */
.table-of-contents {
    background: #f9f9f9;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
}
.table-of-contents h4 {
    margin-top: 0;
    margin-bottom: 10px;
}
.table-of-contents ul {
    list-style: none;
    padding-left: 20px;
}
.table-of-contents li {
    margin: 5px 0;
}
.table-of-contents a {
    text-decoration: none;
    color: #333;
}
.table-of-contents a:hover {
    color: var(--primary);
}

/* 相关文章 */
.related-articles {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}
.related-articles ul {
    list-style: none;
    padding-left: 0;
}
.related-articles li {
    margin-bottom: 10px;
}
.related-articles a {
    color: var(--text);
    text-decoration: none;
}
.related-articles a:hover {
    color: var(--primary);
}

/* 上一篇/下一篇导航 */
.article-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}
.nav-prev, .nav-next {
    max-width: 45%;
}
.nav-prev span, .nav-next span {
    font-size: 0.8rem;
    color: #999;
}
.nav-prev a, .nav-next a {
    color: var(--text);
    text-decoration: none;
}
.nav-prev a:hover, .nav-next a:hover {
    color: var(--primary);
}