/**
 * 帮助中心 — 微信文档风格公开页
 * 参考：https://developers.weixin.qq.com/doc/subscription/guide/h5/
 */

:root {
    --help-accent: #07c160;
    --help-accent-dark: #06ad56;
    --help-accent-soft: rgba(7, 193, 96, 0.08);
    --help-text: #1f2329;
    --help-muted: #646a73;
    --help-border: #e5e6eb;
    --help-bg: #f7f8fa;
    --help-panel: #ffffff;
    --help-sidebar-w: 260px;
    --help-topbar-h: 56px;
    --help-font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.ydh-help-body {
    margin: 0;
    font-family: var(--help-font);
    color: var(--help-text);
    background: var(--help-bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--help-accent-dark);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.ydh-help-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: var(--help-topbar-h);
    background: var(--help-panel);
    border-bottom: 1px solid var(--help-border);
}

.ydh-help-topbar-inner {
    height: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ydh-help-brand {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    color: var(--help-text);
    text-decoration: none;
    font-weight: 600;
}

.ydh-help-brand:hover {
    text-decoration: none;
    color: var(--help-accent-dark);
}

.ydh-help-brand-mark {
    font-size: 1.05rem;
}

.ydh-help-brand-sep {
    color: var(--help-border);
    font-weight: 400;
}

.ydh-help-brand-sub {
    font-size: 0.95rem;
    color: var(--help-muted);
    font-weight: 500;
}

.ydh-help-top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ydh-help-top-link,
.ydh-help-nav-toggler {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid var(--help-border);
    border-radius: 6px;
    background: var(--help-panel);
    color: var(--help-text);
    font-size: 0.875rem;
    cursor: pointer;
    text-decoration: none;
}

.ydh-help-top-link:hover,
.ydh-help-nav-toggler:hover {
    border-color: var(--help-accent);
    color: var(--help-accent-dark);
    text-decoration: none;
}

.ydh-help-nav-toggler {
    display: none;
}

.ydh-help-shell {
    display: flex;
    max-width: 1280px;
    margin: 0 auto;
    min-height: calc(100vh - var(--help-topbar-h));
}

.ydh-help-sidebar {
    position: sticky;
    top: var(--help-topbar-h);
    align-self: flex-start;
    width: var(--help-sidebar-w);
    flex: 0 0 var(--help-sidebar-w);
    height: calc(100vh - var(--help-topbar-h));
    overflow-y: auto;
    background: var(--help-panel);
    border-right: 1px solid var(--help-border);
    padding: 20px 0 32px;
}

.ydh-help-nav-group {
    margin-bottom: 18px;
}

.ydh-help-nav-group-title {
    padding: 4px 20px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--help-muted);
    text-transform: none;
}

.ydh-help-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ydh-help-nav-link {
    display: block;
    padding: 7px 20px 7px 22px;
    color: var(--help-text);
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    text-decoration: none;
}

.ydh-help-nav-sub {
    list-style: none;
    margin: 0;
    padding: 0 0 4px;
}

.ydh-help-nav-link--sub {
    padding-left: 34px;
    font-size: 0.85rem;
    color: var(--help-muted);
}

.ydh-help-nav-link.is-ancestor {
    color: var(--help-accent-dark);
    font-weight: 600;
}

.ydh-help-toc {
    margin: 0 0 1.25rem;
    padding-left: 1.25rem;
}

.ydh-help-toc li {
    margin: 0.35rem 0;
}

.ydh-help-nav-link:hover {
    background: var(--help-bg);
    color: var(--help-accent-dark);
    text-decoration: none;
}

.ydh-help-nav-link.is-active {
    background: var(--help-accent-soft);
    color: var(--help-accent-dark);
    border-left-color: var(--help-accent);
    font-weight: 600;
}

.ydh-help-backdrop {
    display: none;
}

.ydh-help-main {
    flex: 1 1 auto;
    min-width: 0;
    padding: 28px 36px 64px;
}

.ydh-help-article {
    max-width: 820px;
}

.ydh-help-breadcrumb {
    font-size: 0.8125rem;
    color: var(--help-muted);
    margin-bottom: 12px;
}

.ydh-help-breadcrumb a {
    color: var(--help-muted);
}

.ydh-help-bc-sep {
    margin: 0 6px;
    color: #c9cdd4;
}

.ydh-help-bc-current {
    color: var(--help-text);
}

.ydh-help-h1 {
    margin: 0 0 20px;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.02em;
}

.ydh-help-content h2 {
    margin: 1.75rem 0 0.75rem;
    padding-top: 0.5rem;
    font-size: 1.2rem;
    font-weight: 650;
    border-top: 1px solid var(--help-border);
}

.ydh-help-content h2:first-child {
    border-top: 0;
    padding-top: 0;
    margin-top: 0;
}

.ydh-help-content h3 {
    margin: 1.25rem 0 0.5rem;
    font-size: 1.05rem;
    font-weight: 600;
}

.ydh-help-content p,
.ydh-help-content ul,
.ydh-help-content ol,
.ydh-help-content table {
    margin: 0 0 0.9rem;
}

.ydh-help-content ul,
.ydh-help-content ol {
    padding-left: 1.35rem;
}

.ydh-help-content li {
    margin-bottom: 0.35rem;
}

.ydh-help-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: var(--help-panel);
}

.ydh-help-content th,
.ydh-help-content td {
    border: 1px solid var(--help-border);
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}

.ydh-help-content th {
    background: var(--help-bg);
    font-weight: 600;
}

.ydh-help-figure {
    margin: 0 0 1.25rem;
    padding: 0;
    border: 1px solid var(--help-border);
    border-radius: 10px;
    background: var(--help-panel);
    overflow: hidden;
}

.ydh-help-figure-img {
    display: block;
    width: 100%;
    height: auto;
    vertical-align: top;
    background: #f5f7fa;
}

.ydh-help-figure-cap {
    margin: 0;
    padding: 10px 14px;
    border-top: 1px solid var(--help-border);
    font-size: 0.8125rem;
    color: var(--help-muted);
    line-height: 1.5;
    background: var(--help-bg);
}

.ydh-help-tip,
.ydh-help-warn {
    margin: 0 0 1rem;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.ydh-help-tip {
    background: var(--help-accent-soft);
    border: 1px solid rgba(7, 193, 96, 0.25);
    color: #1a5c38;
}

.ydh-help-warn {
    background: #fff7e8;
    border: 1px solid #ffe0a3;
    color: #8a5a00;
}

.ydh-help-muted {
    color: var(--help-muted);
}

.ydh-help-kbd {
    display: inline-block;
    padding: 1px 6px;
    border: 1px solid var(--help-border);
    border-radius: 4px;
    background: var(--help-bg);
    font-size: 0.85em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.ydh-help-article-foot {
    margin-top: 2.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--help-border);
    color: var(--help-muted);
    font-size: 0.8125rem;
}

/* 窄屏：抽屉目录 */
@media (max-width: 899.98px) {
    .ydh-help-nav-toggler {
        display: inline-flex;
    }

    .ydh-help-shell {
        display: block;
    }

    .ydh-help-sidebar {
        position: fixed;
        left: 0;
        top: var(--help-topbar-h);
        z-index: 50;
        width: min(86vw, 300px);
        transform: translateX(-105%);
        transition: transform 0.2s ease;
        box-shadow: 8px 0 24px rgba(15, 23, 42, 0.12);
        border-right: 0;
    }

    body.ydh-help-nav-open .ydh-help-sidebar {
        transform: translateX(0);
    }

    .ydh-help-backdrop {
        display: block;
        position: fixed;
        inset: var(--help-topbar-h) 0 0 0;
        z-index: 45;
        background: rgba(15, 23, 42, 0.35);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    body.ydh-help-nav-open .ydh-help-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .ydh-help-main {
        padding: 20px 16px 48px;
    }

    .ydh-help-h1 {
        font-size: 1.45rem;
    }

    .ydh-help-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* —— 全站右侧固定帮助入口 —— */
.ydh-help-fab {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1060;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 0.18em;
    padding: 14px 8px;
    border: 1px solid var(--ydh-border, #e8e8e8);
    border-right: 0;
    border-radius: 8px 0 0 8px;
    background: #fff;
    color: var(--ydh-green-dark, #096dd9);
    box-shadow: -2px 4px 16px rgba(15, 23, 42, 0.08);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.2;
    cursor: pointer;
}

.ydh-help-fab:hover,
.ydh-help-fab:focus-visible {
    background: var(--ydh-green-light, #e6f4ff);
    color: var(--ydh-green-dark, #096dd9);
    text-decoration: none;
    outline: none;
}

.ydh-help-fab-icon {
    writing-mode: horizontal-tb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1rem;
    height: 1.1rem;
    margin-bottom: 8px;
    font-size: 0.95rem;
    letter-spacing: 0;
}

body.ydh-help-body .ydh-help-fab,
body.ydh-page-screen-live .ydh-help-fab {
    display: none !important;
}

@media (max-width: 899.98px) {
    .ydh-help-fab {
        top: auto;
        bottom: 88px;
        transform: none;
        writing-mode: horizontal-tb;
        letter-spacing: 0;
        padding: 10px 12px;
        border-radius: 999px 0 0 999px;
        box-shadow: -2px 4px 14px rgba(15, 23, 42, 0.12);
    }

    .ydh-help-fab-icon {
        margin: 0 4px 0 0;
        width: auto;
        height: auto;
    }
}
