/* ===================================
   新闻列表页 & 文章详情页 样式
   =================================== */

/* ---------- 页面标题横幅 ---------- */
.page-banner {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    padding: 120px 0 60px;
    text-align: center;
    color: #fff;
}
.page-banner h1 {
    font-size: 2.6rem;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}
.page-banner p {
    font-size: 1.05rem;
    opacity: .8;
}

/* ===================================
   新闻列表页
   =================================== */
.news-list-section {
    padding: 60px 0 80px;
    background: var(--bg-light);
    min-height: 60vh;
}
.news-list-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
}

/* ---------- 左侧边栏 ---------- */
.news-sidebar {
    position: sticky;
    top: 88px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}
.sidebar-block {
    background: var(--bg-white);
    border-radius: var(--r-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}
.sidebar-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
}
.sidebar-cats a {
    display: block;
    padding: 9px 12px;
    border-radius: var(--r-sm);
    font-size: .9rem;
    color: var(--text-mid);
    transition: var(--tr);
}
.sidebar-cats a:hover {
    background: rgba(37,99,235,.08);
    color: var(--primary);
}
.sidebar-cats a.active {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}
.sidebar-hot li {
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
    font-size: .88rem;
}
.sidebar-hot li:last-child { border-bottom: none; }
.sidebar-hot a {
    color: var(--text-mid);
    transition: color .2s;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-hot a:hover { color: var(--primary); }

/* ---------- 右侧文章列表 ---------- */
.news-list-main {
    min-width: 0;
}
.news-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.news-list-heading {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
}
.news-sort span {
    font-size: .85rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px 10px;
    border-radius: var(--r-sm);
    transition: var(--tr);
}
.news-sort span:hover { color: var(--primary); }
.news-sort .sort-active {
    color: var(--primary);
    font-weight: 600;
    background: rgba(37,99,235,.08);
}

/* ---------- 文章卡片 ---------- */
.news-articles {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.news-article-card {
    background: var(--bg-white);
    border-radius: var(--r-lg);
    padding: 24px 28px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .25s, transform .25s;
    border-left: 3px solid transparent;
}
.news-article-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
    border-left-color: var(--primary);
}
.nac-badge {
    display: inline-block;
    font-size: .72rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 20px;
    margin-bottom: 8px;
}
.badge-build    { background: #dbeafe; color: #1d4ed8; }
.badge-software { background: #dcfce7; color: #15803d; }
.badge-geo     { background: #ede9fe; color: #6d28d9; }

.nac-title {
    font-size: 1.08rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.5;
}
.nac-title a { color: var(--text-dark); }
.nac-title a:hover { color: var(--primary); }

.nac-summary {
    font-size: .88rem;
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.nac-meta {
    display: flex;
    gap: 16px;
    font-size: .78rem;
    color: var(--text-light);
}

/* ---------- 分页 ---------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 36px;
    flex-wrap: wrap;
}
.page-num,
.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: var(--r-md);
    font-size: .88rem;
    color: var(--text-mid);
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    transition: var(--tr);
    cursor: pointer;
}
.page-num:hover,
.page-btn:hover {
    background: rgba(37,99,235,.08);
    color: var(--primary);
}
.page-num.active {
    background: var(--primary);
    color: #fff;
    font-weight: 700;
}
.page-ellipsis {
    color: var(--text-light);
    font-size: .88rem;
    padding: 0 4px;
}
.page-prev, .page-next {
    font-weight: 500;
}

/* ===================================
   文章详情页
   =================================== */
.article-section {
    padding: 60px 0 80px;
    background: var(--bg-light);
    min-height: 60vh;
}
.article-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    align-items: start;
}

/* ---------- 文章主体 ---------- */
.article-main {
    background: var(--bg-white);
    border-radius: var(--r-xl);
    padding: 40px 44px;
    box-shadow: var(--shadow-sm);
}
.article-breadcrumb {
    font-size: .82rem;
    color: var(--text-light);
    margin-bottom: 20px;
}
.article-breadcrumb a { color: var(--text-light); }
.article-breadcrumb a:hover { color: var(--primary); }
.article-breadcrumb span { margin: 0 6px; color: var(--border); }

.article-cat {
    display: inline-block;
    font-size: .75rem;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: 20px;
    margin-bottom: 14px;
}
.article-cat.badge-build    { background: #dbeafe; color: #1d4ed8; }
.article-cat.badge-software { background: #dcfce7; color: #15803d; }
.article-cat.badge-geo     { background: #ede9fe; color: #6d28d9; }

.article-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.4;
    margin-bottom: 16px;
}
.article-meta {
    display: flex;
    gap: 20px;
    font-size: .82rem;
    color: var(--text-light);
    padding-bottom: 24px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border);
}
.article-meta span { display: inline-flex; align-items: center; gap: 4px; }

.article-body {
    font-size: .95rem;
    line-height: 1.85;
    color: var(--text-mid);
}
.article-body h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 32px 0 14px;
    padding-left: 14px;
    border-left: 4px solid var(--primary);
}
.article-body h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 24px 0 10px;
}
.article-body p { margin-bottom: 16px; }
.article-body ul, .article-body ol {
    margin: 12px 0 16px 20px;
}
.article-body li {
    margin-bottom: 8px;
    line-height: 1.8;
}
.article-body pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px;
    border-radius: var(--r-md);
    overflow-x: auto;
    margin: 16px 0;
    font-size: .85rem;
    line-height: 1.7;
}
.article-body code {
    background: rgba(37,99,235,.08);
    color: var(--primary-dark);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: .88em;
}
.article-body pre code {
    background: none;
    color: inherit;
    padding: 0;
}
.article-body blockquote {
    border-left: 4px solid var(--primary);
    background: rgba(37,99,235,.04);
    padding: 14px 20px;
    margin: 16px 0;
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    color: var(--text-mid);
}
.article-body img {
    max-width: 100%;
    border-radius: var(--r-md);
    margin: 16px 0;
}

/* 文章底部 */
.article-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.article-tag {
    font-size: .8rem;
    color: var(--text-light);
    background: var(--bg-light);
    padding: 4px 12px;
    border-radius: 20px;
    transition: var(--tr);
}
.article-tag:hover { background: rgba(37,99,235,.08); color: var(--primary); }

.article-share {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}
.article-share span {
    font-size: .85rem;
    color: var(--text-light);
    margin-right: 4px;
}
.share-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
    transition: var(--tr);
    cursor: pointer;
}
.share-wechat { background: #d1fae5; }
.share-weibo  { background: #fecaca; }
.share-link   { background: #dbeafe; }
.share-btn:hover { transform: scale(1.12); }

/* ---------- 右侧边栏 ---------- */
.article-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: sticky;
    top: 88px;
}
.as-block {
    background: var(--bg-white);
    border-radius: var(--r-lg);
    padding: 22px;
    box-shadow: var(--shadow-sm);
}
.as-title {
    font-size: .95rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
}
.as-list li {
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
    font-size: .86rem;
}
.as-list li:last-child { border-bottom: none; }
.as-list a {
    color: var(--text-mid);
    transition: color .2s;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.as-list a:hover { color: var(--primary); }

/* 文章目录 */
.as-toc a {
    display: block;
    padding: 5px 0 5px 12px;
    font-size: .84rem;
    color: var(--text-light);
    border-left: 2px solid var(--border);
    transition: var(--tr);
}
.as-toc a:hover,
.as-toc a.active {
    color: var(--primary);
    border-left-color: var(--primary);
    background: rgba(37,99,235,.04);
}

/* ---------- 上一篇/下一篇 ---------- */
.article-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.article-nav-item {
    padding: 16px 18px;
    background: var(--bg-light);
    border-radius: var(--r-md);
    transition: var(--tr);
    display: block;
}
.article-nav-item:hover { background: rgba(37,99,235,.06); }
.article-nav-label {
    font-size: .75rem;
    color: var(--text-light);
    margin-bottom: 4px;
}
.article-nav-title {
    font-size: .88rem;
    font-weight: 600;
    color: var(--text-dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.article-nav-next { text-align: right; }

/* ===================================
   响应式
   =================================== */
@media (max-width: 1024px) {
    .news-list-layout,
    .article-layout {
        grid-template-columns: 1fr;
    }
    .news-sidebar,
    .article-sidebar {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .news-sidebar .sidebar-block,
    .article-sidebar .as-block {
        flex: 1 1 200px;
    }
}

@media (max-width: 768px) {
    .page-banner { padding: 100px 0 40px; }
    .page-banner h1 { font-size: 1.8rem; }

    .news-list-section,
    .article-section { padding: 32px 0 50px; }

    .article-main { padding: 24px 18px; }
    .article-title { font-size: 1.35rem; }

    .news-article-card { padding: 18px 16px; }
    .nac-meta { flex-wrap: wrap; gap: 8px; }

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