/**
 * 文章系统样式 — 朱砂主题
 * 依赖 tool-theme.css 提供的 CSS 变量（body.has-tool-header）
 * 覆盖：文章列表页 / 文章详情页 / 首页最新文章区块
 */

/* ============ 公共容器 ============ */

.article-shell {
    max-width: 760px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem 4rem;
}

.article-shell--wide {
    max-width: 1120px;
}

/* 详情页桌面端：米白纸张卡片，与工具页容器风格统一 */
@media (min-width: 769px) {
    .article-shell--paper {
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: 14px;
        box-shadow: 0 4px 28px rgba(42, 26, 21, 0.06);
        margin-top: 2rem;
        margin-bottom: 3.5rem;
        padding: 2.75rem 3.25rem 3.25rem;
    }
}

/* ============ 列表页头部 ============ */

.articles-hero {
    padding: 3rem 0 2rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}

.articles-hero h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.01em;
    margin-bottom: 0.75rem;
    line-height: 1.25;
}

.articles-hero p {
    font-size: 1.0625rem;
    color: var(--text-light);
    line-height: 1.8;
    max-width: 42em;
}

/* 分类筛选 */

.articles-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.filter-chip {
    padding: 0.4rem 1rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-card);
    color: var(--text-light);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.18s ease;
    font-family: inherit;
    line-height: 1.4;
}

.filter-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-chip.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
}

/* 搜索框 */

.articles-search {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.625rem;
}

.search-input {
    flex: 1;
    min-width: 0;
    padding: 0.65rem 1.125rem;
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--text-dark);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 999px;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(192, 40, 30, 0.08);
}

.search-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.articles-search + .articles-filters {
    margin-top: 0.75rem;
}

/* 标签筛选 */

.tag-filters {
    margin-top: 0.5rem;
}

.tag-chip {
    padding: 0.3rem 0.7rem;
    border: 1px dashed var(--border);
    border-radius: 999px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.18s ease;
    line-height: 1.4;
}

.tag-chip:hover {
    border-color: var(--secondary);
    border-style: solid;
    color: var(--secondary-text);
}

.tag-chip.is-active {
    background: var(--secondary);
    border-color: var(--secondary);
    border-style: solid;
    color: #fff;
    font-weight: 600;
}

/* 筛选状态条 */

.filter-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 0.55rem 1rem;
    background: var(--bg-light);
    border-radius: 8px;
    font-size: 0.8125rem;
    color: var(--text-light);
}

.filter-status[hidden] {
    display: none;
}

.filter-clear {
    margin-left: auto;
    padding: 0.25rem 0.7rem;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-light);
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.filter-clear:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ============ 文章归档（列表页） ============ */

.archive-title {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-dark);
    padding-bottom: 0.875rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.625rem;
}

.archive-total {
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.archive-group + .archive-group {
    margin-top: 2.25rem;
}

.archive-head {
    display: flex;
    align-items: baseline;
    gap: 0.625rem;
    margin-bottom: 0.875rem;
}

.archive-month {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-dark);
    position: relative;
    padding-left: 0.75rem;
    letter-spacing: 0.01em;
}

.archive-month::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.3em;
    width: 3px;
    height: 0.95em;
    background: var(--primary);
    border-radius: 2px;
}

.archive-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.archive-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

/* ============ 文章卡片 ============ */

/* 文章卡：单列紧凑列表式 */

.article-card {
    display: flex;
    flex-direction: column;
    padding: 0.875rem 1.125rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.article-card:hover {
    transform: translateY(-2px);
    border-color: rgba(192, 40, 30, 0.35);
    box-shadow: 0 6px 20px rgba(192, 40, 30, 0.09);
}

.article-card-cat {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--secondary-text);
    background: rgba(184, 132, 46, 0.1);
    padding: 0.18rem 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.75rem;
}

.article-card h3 {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.45;
    color: var(--text-dark);
    margin-bottom: 0.35rem;
    transition: color 0.18s ease;
}

.article-card:hover h3 {
    color: var(--primary);
}

.article-card p {
    font-size: 0.875rem;
    line-height: 1.65;
    color: var(--text-light);
    margin-bottom: 0.55rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: auto;
    font-variant-numeric: tabular-nums;
}

.article-card-meta .dot {
    color: var(--border);
}

.article-empty {
    padding: 3rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9375rem;
}

/* 加载更多（归档页增量展开） */

.load-more {
    text-align: center;
    margin-top: 1.75rem;
}

.btn-load-more {
    font: inherit;
    font-size: 0.9375rem;
    padding: 0.625rem 1.875rem;
    background: var(--bg-card);
    color: var(--text-dark);
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.18s ease;
}

.btn-load-more:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ============ 详情页 ============ */

.article-breadcrumb {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.article-breadcrumb a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.15s ease;
}

.article-breadcrumb a:hover {
    color: var(--primary);
}

.article-breadcrumb .sep {
    color: var(--border);
}

.article-head {
    margin-bottom: 2.25rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--border);
}

.article-head .article-card-cat {
    font-size: 0.8125rem;
    margin-bottom: 1rem;
}

.article-title {
    font-size: 2.125rem;
    font-weight: 700;
    line-height: 1.32;
    letter-spacing: 0.01em;
    color: var(--text-dark);
    margin-bottom: 1rem;
}


.article-lead {
    font-size: 1.0625rem;
    line-height: 1.85;
    color: var(--text-light);
    padding-left: 1rem;
    border-left: 3px solid rgba(192, 40, 30, 0.25);
    margin-bottom: 1.5rem;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.article-meta .dot {
    color: var(--border);
}

/* 文章标签：点击回到列表页并按该标签筛选 */

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.875rem;
}

.article-tag {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-light);
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    line-height: 1.5;
}

.article-tag:hover {
    color: var(--primary);
    background: rgba(192, 40, 30, 0.08);
    border-color: rgba(192, 40, 30, 0.2);
}

/* 目录 */

.article-toc {
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 1.125rem 1.375rem;
    margin-bottom: 2.25rem;
}

.article-toc-title {
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-light);
    text-transform: uppercase;
    margin-bottom: 0.625rem;
}

.article-toc ol {
    margin: 0;
    padding-left: 1.25rem;
    counter-reset: toc;
    list-style: none;
}

.article-toc li {
    counter-increment: toc;
    margin-bottom: 0.35rem;
    line-height: 1.6;
}

.article-toc li::before {
    content: counter(toc) '.';
    color: var(--secondary-text);
    font-weight: 600;
    margin-right: 0.4rem;
    font-size: 0.875rem;
}

.article-toc a {
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: color 0.15s ease;
}

.article-toc a:hover {
    color: var(--primary);
}

/* ============ 正文排版 ============ */

.article-body {
    font-size: 1.0625rem;
    line-height: 1.95;
    color: var(--text-dark);
    letter-spacing: 0.005em;
}

.article-body > *:first-child {
    margin-top: 0;
}

.article-body p {
    margin: 0 0 1.4em;
}

.article-body h2 {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.45;
    color: var(--text-dark);
    margin: 2.75em 0 1em;
    padding-bottom: 0.5em;
    border-bottom: 1px solid var(--border-light);
    scroll-margin-top: 5rem;
    position: relative;
}

.article-body h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 3rem;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

.article-body h3 {
    font-size: 1.1875rem;
    font-weight: 700;
    line-height: 1.5;
    color: var(--primary-dark);
    margin: 2em 0 0.75em;
    scroll-margin-top: 5rem;
}

.article-body h4 {
    font-size: 1.0625rem;
    font-weight: 700;
    margin: 1.75em 0 0.6em;
}

.article-body ul,
.article-body ol {
    margin: 0 0 1.4em;
    padding-left: 1.5rem;
}

.article-body li {
    margin-bottom: 0.6em;
    padding-left: 0.25rem;
}

.article-body li::marker {
    color: var(--primary);
}

.article-body ul li::marker {
    content: '·';
    font-weight: 700;
    font-size: 1.2em;
}

.article-body strong {
    font-weight: 700;
    color: var(--text-dark);
}

.article-body em {
    font-style: normal;
    background: linear-gradient(transparent 62%, rgba(184, 132, 46, 0.28) 0);
    padding: 0 0.1em;
}

.article-body a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px solid rgba(192, 40, 30, 0.3);
    transition: border-color 0.15s ease;
}

.article-body a:hover {
    border-bottom-color: var(--primary);
}

.article-body blockquote {
    margin: 1.75em 0;
    padding: 1rem 1.25rem;
    background: var(--bg-light);
    border-left: 3px solid var(--primary);
    border-radius: 0 8px 8px 0;
    color: var(--text-dark);
    font-size: 1rem;
    line-height: 1.85;
}

.article-body blockquote p:last-child {
    margin-bottom: 0;
}

.article-body blockquote strong {
    color: var(--primary-dark);
}

.article-body code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.875em;
    background: rgba(42, 26, 21, 0.06);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    color: var(--primary-dark);
    word-break: break-word;
}

.article-body pre {
    margin: 1.75em 0;
    padding: 1.125rem 1.25rem;
    background: #F7F2E8;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    overflow-x: auto;
    line-height: 1.85;
}

.article-body pre code {
    background: none;
    padding: 0;
    color: var(--text-dark);
    font-size: 0.9rem;
    line-height: inherit;
}

.article-body hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2.5em 0;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 1.5em 0;
    display: block;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.75em 0;
    font-size: 0.9375rem;
    line-height: 1.7;
    display: block;
    overflow-x: auto;
    white-space: nowrap;
}

.article-body thead {
    background: var(--bg-light);
}

.article-body th {
    text-align: left;
    font-weight: 700;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--border);
    white-space: nowrap;
}

.article-body td {
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--border-light);
    vertical-align: top;
    white-space: normal;
}

.article-body tbody tr:nth-child(even) {
    background: rgba(240, 234, 224, 0.4);
}

/* 提示框 */

.callout {
    margin: 1.75em 0;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    border-left: 3px solid var(--secondary);
    background: rgba(184, 132, 46, 0.08);
    font-size: 1rem;
    line-height: 1.85;
}

.callout-title {
    font-weight: 700;
    color: var(--secondary-text);
    margin-bottom: 0.35rem;
    font-size: 0.875rem;
    letter-spacing: 0.02em;
}

.callout p:last-child {
    margin-bottom: 0;
}

.callout--warn {
    border-left-color: var(--primary);
    background: rgba(192, 40, 30, 0.06);
}

.callout--warn .callout-title {
    color: var(--primary);
}

/* ============ 文末 ============ */

/* 文章页文末（.article-end）不是全站暗色页脚，必须压过 tool-theme.css /
   tool-mobile.css 里的 `body.has-tool-header footer` 暗色规则。
   那条规则特异性 (0,0,1,2) 且带 !important，普通 `footer.article-end`
   (0,0,1,1) 会输掉，所以这里用同构但更高特异性的选择器 (0,0,2,2) 覆盖。 */
body.has-tool-header footer.article-end {
    margin-top: 3.5rem;
    background: transparent !important;
    color: var(--text-dark) !important;
    border: none !important;
    border-top: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    text-align: left !important;
    position: static !important;
    overflow: visible !important;
}

body.has-tool-header footer.article-end::before,
body.has-tool-header footer.article-end::after {
    display: none !important;
}

/* 移动端也要压过 tool-mobile.css 的 body.has-tool-header footer 覆盖 */
@media (max-width: 768px) {
    body.has-tool-header footer.article-end {
        margin-top: 2.5rem;
        padding: 0 !important;
        font-size: inherit !important;
    }
}

/* 1. 系列翻页：左下上一篇、右下下一篇 */

.article-pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.875rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.pager-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.9375rem 1.125rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.18s ease;
    min-width: 0;
}

.pager-item:hover {
    border-color: rgba(192, 40, 30, 0.35);
    box-shadow: 0 4px 16px rgba(192, 40, 30, 0.08);
    transform: translateY(-1px);
}

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

.pager-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: 0.02em;
}

.pager-title {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.55;
    color: var(--text-dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pager-item:hover .pager-title {
    color: var(--primary);
}

/* 2. 相关阅读：三列卡片 */

.article-related {
    margin-top: 2.75rem;
}

.article-related-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.article-related-title::before {
    content: '';
    width: 3px;
    height: 1rem;
    background: var(--primary);
    border-radius: 2px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.related-card {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.875rem 1rem;
    background: var(--bg-light);
    border: 1px solid transparent;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.18s ease;
}

.related-card:hover {
    background: var(--bg-card);
    border-color: rgba(192, 40, 30, 0.3);
}

.related-card-series {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.related-card strong {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.55;
    color: var(--text-dark);
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.18s ease;
}

.related-card:hover strong {
    color: var(--primary);
}

.related-card-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* 3. 文末信息：弱化成一行小字 */

.article-colophon {
    margin-top: 3rem;
    padding-top: 1.25rem;
    border-top: 1px dashed var(--border);
    font-size: 0.75rem;
    line-height: 1.85;
    color: var(--text-muted);
}

.article-colophon p {
    margin-bottom: 0.5rem;
}

.article-colophon p:last-child {
    margin-bottom: 0;
}

.colophon-links a {
    color: var(--text-light);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.15s ease;
}

.colophon-links a:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.colophon-links .dot {
    margin: 0 0.45rem;
    color: var(--border);
}

/* ============ 系列概览（列表页） ============ */

.series-overview {
    margin-bottom: 2.5rem;
}

.series-overview-title {
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-light);
    margin-bottom: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.series-overview-title::before {
    content: '';
    width: 3px;
    height: 0.875rem;
    background: var(--primary);
    border-radius: 2px;
}

.series-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 1.25rem;
}

@media (max-width: 1100px) {
    .series-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* 专题数为奇数时，最后一张铺满整行，避免右下角空出一格 */
.series-grid > .series-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

/* 系列封面卡：紧凑型 —— 彩色侧条 + 名称徽章 + 一行描述 + 进度/入口同行 */

.series-card {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.9375rem 1.125rem 0.875rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--sc, var(--primary));
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: all 0.18s ease;
}

a.series-card {
    text-decoration: none;
    color: inherit;
}

.series-card--compact {
    gap: 0;
    justify-content: center;
    min-height: 4.5rem;
}

.series-card--compact .series-card-head {
    margin: 0;
}

.series-card:hover {
    border-color: var(--sc, var(--primary));
    box-shadow: 0 6px 20px rgba(42, 26, 21, 0.08);
    transform: translateY(-1px);
}

.series-card:active {
    transform: translateY(0) scale(0.99);
}

.series-card.is-active {
    border-color: var(--sc, var(--primary));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--sc, #C0281E) 18%, transparent);
}

.series-card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}

.series-card-name {
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--sc, var(--primary));
}

.series-card-badge {
    flex-shrink: 0;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--sc, var(--primary));
    background: color-mix(in srgb, var(--sc, #C0281E) 9%, transparent);
    padding: 0.14rem 0.55rem;
    border-radius: 999px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.series-card-desc {
    font-size: 0.875rem;
    color: var(--text-light);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.series-card-bar {
    display: block;
    flex: 1;
    min-width: 3rem;
    height: 4px;
    background: var(--bg-light);
    border-radius: 2px;
    overflow: hidden;
}

.series-card-bar i {
    display: block;
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.series-card-foot {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.series-card-cta {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--sc, var(--primary));
    white-space: nowrap;
}

/* ============ 文章卡片上的系列标签 ============ */

.article-card-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.article-card-tags .article-card-cat {
    margin-bottom: 0;
}

.article-card-series {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border: 1px solid;
    border-radius: 4px;
    background: transparent;
    letter-spacing: 0.01em;
}

/* ============ 系列目录（详情页，可折叠） ============ */

.article-series {
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-left: 3px solid var(--primary);
    border-radius: 0 10px 10px 0;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1.5rem;
}

.article-series summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.article-series summary::-webkit-details-marker {
    display: none;
}

.article-series summary::marker {
    content: '';
}

.article-series-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0;
}

.article-series[open] {
    padding-bottom: 1rem;
}

.article-series[open] .article-series-head {
    margin-bottom: 0.75rem;
    padding-bottom: 0.625rem;
    border-bottom: 1px dashed var(--border);
}

.article-series-name {
    font-size: 0.9375rem;
    font-weight: 700;
}

.article-series-progress {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.series-toggle {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.series-toggle::after {
    content: '▾';
    font-size: 0.7rem;
    transition: transform 0.18s ease;
}

.article-series[open] .series-toggle::after {
    transform: rotate(180deg);
}

.article-series-list {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: none;
}

.article-series-list li {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.3rem 0;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-light);
}

.article-series-list a {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    color: var(--text-dark);
    text-decoration: none;
    flex: 1;
    min-width: 0;
    transition: color 0.15s ease;
}

.article-series-list a:hover {
    color: var(--primary);
}

.series-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    font-size: 0.6875rem;
    font-weight: 700;
    border-radius: 4px;
    background: rgba(42, 26, 21, 0.06);
    color: var(--text-light);
    font-variant-numeric: tabular-nums;
    align-self: center;
}

.series-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.article-series-list li.is-current {
    color: var(--primary);
    font-weight: 600;
}

.article-series-list li.is-current .series-num {
    background: var(--primary);
    color: #fff;
}

.article-series-list li.is-current em {
    font-style: normal;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--primary);
    background: rgba(192, 40, 30, 0.1);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    flex-shrink: 0;
    align-self: center;
}

.article-series-list li.is-pending {
    color: var(--text-muted);
    opacity: 0.75;
}

.article-series-list li.is-pending em {
    font-style: normal;
    font-size: 0.6875rem;
    color: var(--text-muted);
    border: 1px dashed var(--border);
    padding: 0.05rem 0.35rem;
    border-radius: 3px;
    flex-shrink: 0;
    align-self: center;
}

/* ============ 首页最新文章区块 ============ */

.latest-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

/* 首页区块的「查看全部」按钮容器 */
.section-more {
    text-align: center;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .latest-articles-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .section-more {
        margin-top: 1.5rem;
    }

    /* 系列卡移动端：单列纵向平铺，整卡全宽，不横滑 */
    .series-grid {
        grid-template-columns: 1fr;
        gap: 0.625rem;
    }

    .series-overview {
        margin-bottom: 1.75rem;
    }

    .series-card {
        padding: 0.875rem 1rem 0.8125rem;
        gap: 0.4rem;
    }

    .series-card-head {
        flex-wrap: nowrap;
        gap: 0.35rem 0.5rem;
    }

    .series-card-name {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .article-series {
        padding: 0.875rem 1rem;
        margin-bottom: 1.5rem;
    }

    .article-series-list li {
        font-size: 0.8125rem;
        padding: 0.35rem 0;
    }

    .series-title {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

/* ============ 响应式 ============ */

@media (max-width: 768px) {
    .article-shell {
        padding: 1.5rem 1rem 3rem;
    }

    .articles-hero {
        padding: 1.75rem 0 1.25rem;
        margin-bottom: 1.5rem;
    }

    .articles-hero h1 {
        font-size: 1.625rem;
    }

    .articles-hero p {
        font-size: 0.9375rem;
    }

    .articles-filters {
        gap: 0.4rem;
        margin-top: 1.125rem;
    }

    .filter-chip {
        padding: 0.35rem 0.85rem;
        font-size: 0.8125rem;
    }

    .article-card {
        padding: 0.8125rem 1rem;
    }

    .article-card p {
        -webkit-line-clamp: 2;
    }

    .archive-title {
        font-size: 1.0625rem;
        margin-bottom: 1.25rem;
    }

    .archive-group + .archive-group {
        margin-top: 1.75rem;
    }

    /* 文末：翻页竖排、推荐单列 */
    .article-pager {
        grid-template-columns: 1fr;
        gap: 0.625rem;
        padding-top: 1.5rem;
    }

    .pager-next {
        text-align: left;
    }

    .article-related {
        margin-top: 2.25rem;
    }

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

    .related-card strong {
        -webkit-line-clamp: 2;
    }

    .article-colophon {
        margin-top: 2.25rem;
        font-size: 0.6875rem;
    }

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

    .article-lead {
        font-size: 0.9375rem;
        padding-left: 0.85rem;
    }

    .article-head {
        margin-bottom: 1.75rem;
        padding-bottom: 1.25rem;
    }

    .article-body {
        font-size: 1rem;
        line-height: 1.9;
    }

    .article-body h2 {
        font-size: 1.25rem;
        margin-top: 2.25em;
    }

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

    .article-body pre {
        padding: 0.875rem 1rem;
        border-radius: 8px;
        font-size: 0.8125rem;
    }

    .article-toc {
        padding: 1rem 1.125rem;
        margin-bottom: 1.75rem;
    }
}

/* ===== 文章首页（专题目录）与专题页 ===== */

/* 专题卡里多出的「最新一篇」行 */
.series-card-latest {
    font-size: 0.8125rem;
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 首页与专题页的归档入口 chips（filter-chip 基础上的链接变体） */
.hub-entry-filters {
    margin-top: 1.25rem;
}

a.hub-all-chip {
    display: inline-block;
    text-decoration: none;
    color: var(--primary);
    background: rgba(192, 40, 30, 0.05);
    border-color: rgba(192, 40, 30, 0.28);
}

a.hub-all-chip:hover {
    background: rgba(192, 40, 30, 0.11);
    border-color: var(--primary);
    color: var(--primary);
}

/* 专题页 hero：系列徽章 + 进度 */
.series-hero-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.series-hero-badge {
    display: inline-block;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 0.18rem 0.7rem;
    border: 1px solid;
    border-radius: 999px;
    background: var(--bg-card);
}

/* 专题页里的待更新卡片 */
.article-card--pending {
    border-style: dashed;
    opacity: 0.62;
}

.article-card--pending .article-card-meta {
    color: var(--text-muted);
    font-style: normal;
}

/* 文章页系列目录尾部的「专题页」入口 */
.article-series-list li.series-more {
    margin-top: 0.35rem;
    padding-top: 0.45rem;
    border-top: 1px dashed var(--border-light, var(--border));
}

.article-series-list li.series-more a {
    color: var(--text-muted);
    font-size: 0.8125rem;
    justify-content: flex-end;
}

.article-series-list li.series-more a:hover {
    color: var(--primary);
}
