/* ===========================================
   文章页 — Ledger Warm · article-ledger 壳
   面包屑 + Fraunces 大标题 + 正文 max-width 68ch
   IBM Plex Mono 代码 · 铜色左边框 callout
   =========================================== */

body.docs-theme main,
body.docs-theme main.article-main {
    background: var(--docs-bg);
    min-height: calc(100vh - var(--nav-height) - 8px);
}

body.docs-theme footer {
    background: var(--canvas-alt);
    border-top-color: var(--docs-border);
}

body.docs-theme .footer-social-link {
    background: var(--docs-surface);
    border-color: var(--docs-border);
}

body.docs-theme .footer-social-link:hover {
    background: var(--docs-accent-dim);
    color: var(--docs-accent);
}

/* ===========================================
   article-ledger 壳
   =========================================== */

.article-ledger {
    max-width: calc(var(--docs-content-max) + 280px);
    margin: 0 auto;
    padding: 40px var(--space-md) 88px;
    display: grid;
    grid-template-columns: minmax(0, var(--docs-content-max)) 1fr;
    gap: 48px;
    align-items: start;
}

.article-ledger__main {
    min-width: 0;
    max-width: var(--docs-content-max);
}

.article-ledger__toc {
    position: sticky;
    top: calc(var(--nav-height) + 24px);
    align-self: start;
    width: 200px;
    justify-self: end;
}

.article-ledger__toc-inner {
    padding: 16px 18px;
    background: var(--docs-surface);
    border: 1px solid var(--docs-border);
    border-radius: var(--radius-lg);
}

.article-ledger__toc-toggle {
    display: none;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    color: var(--docs-heading);
    background: var(--docs-surface);
    border: 1px solid var(--docs-border);
    border-radius: var(--radius-md);
    cursor: pointer;
}

.article-ledger__toc-toggle i {
    font-size: 11px;
    color: var(--docs-text-subtle);
    transition: transform var(--transition-fast);
}

.article-ledger__toc-toggle[aria-expanded="true"] i {
    transform: rotate(180deg);
}

/* —— 面包屑 / 标题 —— */
.article-breadcrumb,
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: var(--docs-text-subtle);
    margin-bottom: 16px;
}

.article-breadcrumb a,
.breadcrumb a {
    color: var(--docs-text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.article-breadcrumb a:hover,
.breadcrumb a:hover {
    color: var(--docs-accent);
}

.article-breadcrumb i,
.breadcrumb .separator {
    font-size: 9px;
    opacity: 0.55;
}

.breadcrumb .current {
    color: var(--docs-text-muted);
}

.docs-eyebrow {
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--docs-accent);
    margin-bottom: 8px;
}

.article-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--docs-border);
}

.article-title {
    font-family: var(--font-display);
    font-size: clamp(1.85rem, 3.8vw, 2.5rem);
    font-weight: 600;
    line-height: 1.2;
    color: var(--docs-heading);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
    max-width: var(--docs-content-max);
}

.article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 13px;
    color: var(--docs-text-subtle);
}

.meta-item,
.publish-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.meta-item i {
    font-size: 12px;
    color: var(--docs-accent);
}

/* —— TOC —— */
.docs-toc-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--docs-text-subtle);
    margin-bottom: 10px;
}

.docs-toc-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.docs-toc-list a {
    display: block;
    padding: 5px 0 5px 10px;
    margin-left: -10px;
    border-left: 2px solid transparent;
    border-radius: 0;
    font-size: 12px;
    line-height: 1.45;
    color: var(--docs-text-muted);
    text-decoration: none;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

.docs-toc-list a:hover,
.docs-toc-list a.active {
    color: var(--docs-accent);
    border-left-color: var(--docs-accent);
}

.docs-toc-list .toc-h3 {
    padding-left: 18px;
    font-size: 11px;
}

/* —— 正文 prose —— */
.article-content,
.article-prose,
.content-body {
    max-width: var(--docs-content-max);
}

.article-intro {
    font-size: 16px;
    line-height: var(--docs-line-height);
    color: var(--docs-text);
    margin-bottom: 32px;
    padding: 16px 20px;
    background: var(--docs-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--docs-border);
    border-left: 3px solid var(--docs-accent);
}

.content-section,
.content-block {
    margin-bottom: 40px;
    padding-bottom: 36px;
    border-bottom: 1px dashed var(--docs-border);
    scroll-margin-top: calc(var(--nav-height) + 20px);
}

.content-section:last-of-type,
.content-block:last-of-type {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.article-content h2,
.article-prose h2,
.content-section h2,
.content-block h2 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--docs-heading);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--docs-border);
    letter-spacing: -0.01em;
    scroll-margin-top: calc(var(--nav-height) + 20px);
}

.article-content h3,
.article-prose h3,
.content-section h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--docs-heading);
    margin: 24px 0 10px;
    scroll-margin-top: calc(var(--nav-height) + 20px);
}

.article-content p,
.article-prose p,
.content-section p,
.content-block p {
    font-size: 15px;
    line-height: var(--docs-line-height);
    color: var(--docs-text);
    margin-bottom: 14px;
}

.article-content ul,
.article-prose ul,
.content-section ul,
.content-block ul,
.doc-list,
.content-section ol {
    margin-bottom: 16px;
    padding-left: 0;
}

.article-content ul,
.article-prose ul,
.content-section ul,
.content-block ul,
.doc-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.content-section ol {
    padding-left: 1.4em;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.content-section ol li {
    font-size: 15px;
    line-height: var(--docs-line-height);
    color: var(--docs-text);
    padding-left: 4px;
}

.content-section ol li::marker {
    color: var(--docs-accent);
    font-weight: 600;
}

.article-content li,
.article-prose li,
.content-section li,
.content-block li,
.doc-list li {
    position: relative;
    padding-left: 20px;
    font-size: 15px;
    line-height: var(--docs-line-height);
    color: var(--docs-text);
}

.article-content li::before,
.article-prose li::before,
.content-section li::before,
.content-block li::before,
.doc-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.65em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--docs-accent);
    opacity: 0.75;
}

.article-content strong,
.article-prose strong {
    color: var(--docs-heading);
    font-weight: 600;
}

/* —— 代码 —— */
.article-content code,
.article-prose code,
.content-section code,
.content-block code {
    font-family: var(--font-code);
    font-size: 0.88em;
    padding: 2px 6px;
    background: var(--docs-code-bg);
    border: 1px solid var(--docs-border);
    border-radius: 4px;
    color: var(--docs-accent);
}

.article-content pre,
.article-prose pre {
    font-family: var(--font-code);
    font-size: 13px;
    line-height: 1.6;
    padding: 16px 18px;
    background: var(--docs-code-bg);
    border: 1px solid var(--docs-border);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    margin: 16px 0;
    color: var(--docs-text);
}

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

/* —— 表格 —— */
.docs-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
    background: var(--docs-surface);
    border: 1px solid var(--docs-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.docs-table th,
.docs-table td {
    border-bottom: 1px solid var(--docs-border);
    padding: 11px 14px;
    text-align: left;
    line-height: 1.5;
}

.docs-table tr:last-child td {
    border-bottom: none;
}

.docs-table th {
    background: var(--canvas-alt);
    color: var(--docs-heading);
    font-weight: 600;
    font-size: 13px;
}

.docs-table td {
    color: var(--docs-text);
}

.docs-table .highlight {
    color: var(--docs-accent);
    font-weight: 600;
    font-family: var(--font-code);
}

.docs-table tr.total-row {
    background: var(--docs-accent-dim);
    font-weight: 600;
}

.docs-table tr.total-row td {
    color: var(--docs-heading);
}

/* —— callout / tip（铜色左边框） —— */
.tip-box,
.docs-callout {
    background: var(--docs-surface);
    border: 1px solid var(--docs-border);
    border-left: 3px solid var(--docs-accent);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin: 16px 0;
}

.tip-box ul,
.docs-callout ul {
    margin-bottom: 0;
}

.tip-box p:last-child,
.docs-callout p:last-child {
    margin-bottom: 0;
}

/* —— 文章导航 —— */
.article-nav {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 16px;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--docs-border);
    max-width: var(--docs-content-max);
}

.nav-btn,
.article-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: var(--docs-surface);
    border: 1px solid var(--docs-border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--docs-text-muted);
    font-size: 14px;
    font-weight: 500;
    transition: border-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
    flex: 1;
    max-width: 48%;
}

.nav-btn:hover,
.article-nav .nav-link:not(.disabled):hover {
    border-color: var(--docs-accent);
    color: var(--docs-accent);
    box-shadow: 0 2px 8px rgba(180, 83, 9, 0.08);
}

.nav-btn.disabled,
.article-nav .nav-link.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.nav-btn i,
.article-nav .nav-link i {
    font-size: 11px;
    color: var(--docs-accent);
}

.nav-prev {
    margin-right: auto;
}

.nav-next {
    margin-left: auto;
    justify-content: flex-end;
}

/* —— 相关 / 反馈 —— */
.related-articles {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px dashed var(--docs-border);
    max-width: var(--docs-content-max);
}

.related-articles h3,
.related-articles h4 {
    font-size: 11px;
    font-weight: 600;
    color: var(--docs-text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 16px;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.article-card {
    padding: 16px 18px;
    background: var(--docs-surface);
    border: 1px solid var(--docs-border);
    border-radius: var(--radius-lg);
    transition: border-color var(--transition-fast);
}

.article-card:hover {
    border-color: var(--docs-accent);
}

.article-card h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: none;
    letter-spacing: normal;
    color: var(--docs-heading);
}

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

.article-card h4 a:hover {
    color: var(--docs-accent);
}

.article-card p {
    font-size: 13px;
    line-height: 1.5;
    color: var(--docs-text-muted);
    margin: 0;
}

.feedback-section {
    margin-top: 40px;
    padding: 28px 24px;
    background: var(--docs-surface);
    border: 1px solid var(--docs-border);
    border-left: 3px solid var(--docs-accent);
    border-radius: var(--radius-lg);
    text-align: center;
    max-width: var(--docs-content-max);
}

.feedback-section h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--docs-heading);
    margin-bottom: 8px;
}

.feedback-section p {
    font-size: 14px;
    color: var(--docs-text-muted);
    margin-bottom: 16px;
}

.feedback-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.feedback-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 500;
    color: var(--docs-heading);
    background: var(--docs-bg);
    border: 1px solid var(--docs-border-strong);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.feedback-btn:hover {
    border-color: var(--docs-accent);
    color: var(--docs-accent);
    background: var(--docs-accent-dim);
}

/* —— legacy 隐藏 —— */
.docs-shell,
.docs-sidebar,
.docs-page-header {
    display: contents;
}

.content-zh,
.content-en,
#zh-content,
#en-content {
    color: inherit;
}

.article-sidebar,
.share-buttons {
    display: none;
}

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

@media (max-width: 1024px) {
    .article-ledger {
        grid-template-columns: 1fr;
        gap: 0;
        padding-top: 32px;
    }

    .article-ledger__toc {
        position: static;
        width: 100%;
        justify-self: stretch;
        order: -1;
        margin-bottom: 8px;
    }

    .article-ledger__toc-inner {
        display: none;
    }

    .article-ledger__toc-inner.is-open {
        display: block;
    }

    .article-ledger__toc-toggle {
        display: flex;
    }
}

@media (max-width: 768px) {
    .article-ledger {
        padding: 28px var(--space-md) 60px;
    }

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

    .article-nav {
        flex-direction: column;
    }

    .nav-btn,
    .article-nav .nav-link {
        max-width: none;
        width: 100%;
    }

    .nav-prev,
    .nav-next {
        margin: 0;
    }

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

@media (max-width: 480px) {
    .article-intro {
        font-size: 15px;
        padding: 14px 16px;
    }

    .article-content h2,
    .content-section h2 {
        font-size: 1.2rem;
    }
}
