/* ===========================================
   帮助中心 — Ledger Warm
   顶栏章节下拉 + 单栏正文 + 右侧浮动 TOC（mobile 折叠）
   =========================================== */

body.docs-theme 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);
}

/* —— 页头 —— */
.page-header {
    padding: 48px 0 32px;
    background: linear-gradient(180deg, var(--docs-surface) 0%, var(--docs-bg) 100%);
    border-bottom: 1px solid var(--docs-border);
}

.page-header--docs {
    padding: 48px 0 28px;
}

.page-container-wide {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.page-header-docs-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
    gap: 28px;
    align-items: end;
}

.page-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: var(--docs-text-subtle);
    margin-bottom: 14px;
}

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

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

.page-breadcrumb i {
    font-size: 9px;
    opacity: 0.55;
}

.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;
}

.page-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 3.5vw, 2.35rem);
    font-weight: 600;
    line-height: 1.2;
    color: var(--docs-heading);
    letter-spacing: -0.02em;
}

.page-lead {
    font-size: 15px;
    line-height: var(--docs-line-height);
    color: var(--docs-text-muted);
    max-width: 52ch;
    margin-top: 12px;
}

.search-box-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    background: var(--docs-surface);
    border: 1px solid var(--docs-border);
    border-radius: var(--radius-pill);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-box-inline:focus-within {
    border-color: var(--docs-accent);
    box-shadow: 0 0 0 3px var(--docs-accent-dim);
}

.search-box-inline i {
    font-size: 14px;
    color: var(--docs-text-subtle);
}

.search-box-inline input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    font-family: var(--font-body);
    color: var(--docs-heading);
    background: transparent;
    min-width: 0;
}

.search-box-inline input::placeholder {
    color: var(--docs-text-subtle);
}

/* —— 工具栏：章节下拉 —— */
.help-content-section {
    padding: 0;
}

.help-ledger {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 28px var(--space-md) 80px;
}

.help-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--docs-border);
}

.help-chapter-select {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.help-chapter-select label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--docs-text-subtle);
    white-space: nowrap;
}

.help-chapter-select select {
    flex: 1;
    max-width: 320px;
    padding: 10px 14px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    color: var(--docs-heading);
    background: var(--docs-surface);
    border: 1px solid var(--docs-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237C8A9E' d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.help-chapter-select select:focus {
    outline: none;
    border-color: var(--docs-accent);
    box-shadow: 0 0 0 3px var(--docs-accent-dim);
}

.help-toc-toggle {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    color: var(--docs-text-muted);
    background: var(--docs-surface);
    border: 1px solid var(--docs-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color var(--transition-fast), color var(--transition-fast);
}

.help-toc-toggle:hover {
    border-color: var(--docs-accent);
    color: var(--docs-accent);
}

/* —— 正文区：单栏 + 右侧浮动 TOC —— */
.help-body-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    position: relative;
}

.help-main-content {
    max-width: var(--docs-content-max);
    margin: 0 auto;
    width: 100%;
}

.help-toc-float {
    position: fixed;
    top: calc(var(--nav-height) + 24px);
    right: max(16px, calc((100vw - var(--container-max)) / 2 - 220px));
    width: 200px;
    max-height: calc(100vh - var(--nav-height) - 48px);
    overflow-y: auto;
    padding: 16px 18px;
    background: var(--docs-surface);
    border: 1px solid var(--docs-border);
    border-radius: var(--radius-lg);
    z-index: 10;
}

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

.help-toc-float nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.help-toc-float a {
    display: block;
    padding: 5px 0 5px 10px;
    margin-left: -10px;
    border-left: 2px solid transparent;
    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);
}

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

.help-toc-float .toc-group-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--docs-text-subtle);
    margin: 12px 0 4px;
    padding-left: 0;
}

.help-toc-float .toc-group-label:first-child {
    margin-top: 0;
}

/* —— 精选文档 —— */
.articles-nav {
    margin-bottom: 36px;
    padding-bottom: 28px;
    border-bottom: 1px dashed var(--docs-border);
}

.articles-nav h3 {
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--docs-text-subtle);
    margin-bottom: 14px;
}

.article-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.article-link-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    background: var(--docs-surface);
    border: 1px solid var(--docs-border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

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

.article-link-card i {
    font-size: 17px;
    color: var(--docs-accent);
    flex-shrink: 0;
    margin-top: 2px;
}

.article-link-content strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--docs-heading);
    margin-bottom: 3px;
}

.article-link-content span {
    font-size: 13px;
    color: var(--docs-text-muted);
    line-height: 1.45;
}

/* —— 内容块 —— */
.content-block {
    margin-bottom: 36px;
    padding-bottom: 32px;
    border-bottom: 1px dashed var(--docs-border);
    scroll-margin-top: calc(var(--nav-height) + 20px);
}

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

.content-block h2 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--docs-heading);
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.content-block p {
    font-size: 15px;
    line-height: var(--docs-line-height);
    color: var(--docs-text);
}

.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);
}

.help-cta {
    margin-top: 36px;
    padding: 24px;
    background: var(--docs-surface);
    border: 1px solid var(--docs-border);
    border-radius: var(--radius-lg);
    text-align: center;
}

.help-cta p {
    font-size: 15px;
    color: var(--docs-text-muted);
    margin-bottom: 16px;
}

body.docs-theme .btn-secondary {
    background: var(--docs-surface);
    color: var(--docs-heading);
    border-color: var(--docs-border-strong);
}

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

/* —— 响应式 —— */
@media (max-width: 1100px) {
    .help-toc-float {
        display: none;
        position: static;
        width: 100%;
        max-height: none;
        margin-bottom: 24px;
        right: auto;
    }

    .help-toc-float.is-open {
        display: block;
    }

    .help-toc-toggle {
        display: inline-flex;
    }
}

@media (max-width: 900px) {
    .page-header-docs-inner {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 768px) {
    .page-header {
        padding: 36px 0 24px;
    }

    .help-chapter-select {
        flex-direction: column;
        align-items: stretch;
    }

    .help-chapter-select select {
        max-width: none;
    }

    .help-toolbar {
        flex-wrap: wrap;
    }
}

@media (min-width: 1101px) {
    .help-body-wrap {
        padding-right: 220px;
    }
}
