/* 帮助中心 — 左侧目录 + 窄卡片内容区 */

:root {
    --hc-brand: #0fbbd8;
    --hc-brand-dark: #067db2;
    --hc-gradient: linear-gradient(90deg, #0fbbd8, #067db2);
    --hc-page-bg: #f0f7fb;
    --hc-card: #ffffff;
    --hc-border: #e6edf3;
    --hc-text: #2a3441;
    --hc-text-muted: #7b8794;
    --hc-radius: 12px;
    --hc-shadow: 0 4px 18px rgba(6, 125, 178, 0.07);
}

html:has(.help-shell),
body.page-helpcenter {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body.page-helpcenter,
body.page-helpcenter .site-main,
.help-shell {
    background: var(--hc-page-bg) !important;
}

body.page-helpcenter {
    text-align: left !important;
}

body.page-helpcenter .header,
body.page-helpcenter .container {
    min-width: 0 !important;
    max-width: 100% !important;
}

.help-shell {
    box-sizing: border-box;
    width: 100%;
    min-height: 560px;
    padding: 28px 0 64px;
    text-align: left;
}

.help-shell *,
.help-shell *::before,
.help-shell *::after {
    box-sizing: border-box;
}

.help-shell .help-page.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding-left: 15px;
    padding-right: 15px;
    float: none;
}

.help-main {
    display: flex;
    align-items: flex-start;
    gap: 28px;
    max-width: 1100px;
    margin: 0 auto;
}

/* —— 左侧目录（占位 + 视口固定） —— */
.help-toc-slot {
    flex: 0 0 232px;
    width: 232px;
    min-height: 1px;
}

.help-toc {
    width: 232px;
    padding: 0;
    background: var(--hc-card);
    border: 1px solid var(--hc-border);
    border-radius: 14px;
    box-shadow: var(--hc-shadow);
    z-index: 30;
    overflow: hidden;
}

@media (min-width: 992px) {
    .help-toc {
        position: fixed;
        top: 200px; /* 由 JS 按首张卡片对齐覆盖 */
        max-height: none;
        overflow: hidden; /* 不出现内部滚动条；末端由 JS 整体上移 */
    }
}

.help-toc__title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 14px 16px;
    background: #f7fbfd;
    border-bottom: 1px solid var(--hc-border);
    font-size: 13px;
    font-weight: 700;
    color: var(--hc-text);
    letter-spacing: 0.02em;
}

.help-toc__title i {
    color: var(--hc-brand-dark);
    font-size: 15px;
    opacity: 0.85;
}

.help-toc__body {
    padding: 12px 10px 14px;
}

.help-toc__group {
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 10px;
    background: #fafcfd;
    border: 1px solid #eef3f7;
}

.help-toc__group:last-child {
    margin-bottom: 0;
}

.help-toc__group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 0 0 6px;
    padding: 7px 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--hc-text);
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.help-toc__group-title i {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 187, 216, 0.1);
    color: var(--hc-brand-dark);
    font-size: 12px;
}

.help-toc__group-title:hover {
    color: var(--hc-brand-dark);
    background: rgba(15, 187, 216, 0.06);
}

.help-toc__group-title.is-active {
    color: var(--hc-brand-dark);
    background: rgba(15, 187, 216, 0.1);
}

.help-toc__list {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: toc-item;
}

.help-toc__list li {
    margin: 0;
    counter-increment: toc-item;
}

.help-toc__list a {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 8px 8px 8px;
    border-radius: 8px;
    color: var(--hc-text-muted);
    font-size: 12px;
    line-height: 1.45;
    text-decoration: none;
    transition: color 0.15s ease, background 0.15s ease;
}

.help-toc__list a::before {
    content: counter(toc-item, decimal-leading-zero);
    flex: 0 0 auto;
    min-width: 20px;
    margin-top: 1px;
    color: #a0adb8;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.help-toc__list a:hover {
    color: var(--hc-brand-dark);
    background: rgba(255, 255, 255, 0.9);
}

.help-toc__list a.is-active {
    color: var(--hc-brand-dark);
    background: #fff;
    box-shadow: 0 1px 4px rgba(6, 125, 178, 0.08);
    font-weight: 600;
}

.help-toc__list a.is-active::before {
    color: var(--hc-brand-dark);
}

/* —— 右侧内容 —— */
.help-content {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 720px;
}

.help-hero {
    margin-bottom: 20px;
    padding: 2px 0 0;
}

.help-hero__title {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--hc-text);
    text-shadow: none;
}

.help-hero__desc {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--hc-text-muted);
}

/* —— 分区 —— */
.help-section {
    --hc-accent: #0aa3c0;
    --hc-accent-dark: #067db2;
    --hc-accent-soft: rgba(15, 187, 216, 0.08);
    margin-bottom: 22px;
    scroll-margin-top: 96px;
}

.help-section[hidden] {
    display: none !important;
}

.help-section__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
    padding: 0 2px;
}

.help-section__icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--hc-accent-soft);
    color: var(--hc-accent-dark);
    font-size: 15px;
}

.help-section__title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--hc-text);
    text-shadow: none;
}

.help-section__count {
    margin-left: 2px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--hc-accent-soft);
    color: var(--hc-accent-dark);
    font-size: 12px;
    font-weight: 600;
}

.help-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.help-item {
    margin: 0;
    padding: 0;
    background: var(--hc-card);
    border: 1px solid var(--hc-border);
    border-radius: var(--hc-radius);
    box-shadow: var(--hc-shadow);
    overflow: hidden;
    text-align: left !important;
    scroll-margin-top: 96px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.help-item:hover {
    border-color: rgba(15, 187, 216, 0.35);
    box-shadow: 0 8px 22px rgba(6, 125, 178, 0.1);
}

.help-item.is-active {
    border-color: rgba(15, 187, 216, 0.45);
    background: #f3fafc;
    box-shadow: 0 8px 22px rgba(6, 125, 178, 0.1);
}

.help-item.is-active .help-item__head {
    background: rgba(15, 187, 216, 0.1);
    border-left-color: #0aa3c0;
}

.help-item.is-active .help-item__no {
    background: rgba(15, 187, 216, 0.18);
    color: var(--hc-brand-dark);
}

.help-item.is-active .help-item__q {
    color: var(--hc-brand-dark);
}

.help-item.is-flash {
    border-color: rgba(15, 187, 216, 0.55);
    box-shadow: 0 0 0 3px rgba(15, 187, 216, 0.14);
}

.help-item__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #f7fbfd;
    border-bottom: 1px solid var(--hc-border);
    border-left: 3px solid rgba(15, 187, 216, 0.55);
}

.help-item__no {
    flex: 0 0 auto;
    min-width: 28px;
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 187, 216, 0.1);
    color: var(--hc-accent-dark);
    font-size: 12px;
    font-weight: 700;
}

.help-item__q {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--hc-text);
    text-shadow: none;
}

.help-item__a {
    margin: 0;
    padding: 14px 16px 16px 19px;
    color: var(--hc-text-muted);
    font-size: 14px;
    line-height: 1.8;
    text-align: left !important;
}

.help-item__a p {
    margin: 0 0 8px;
    text-align: left !important;
}

.help-item__a p:last-child {
    margin-bottom: 0;
}

.help-item__a .help-item__lead {
    color: var(--hc-text);
    font-weight: 600;
}

.help-item__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.help-item__list li {
    position: relative;
    padding-left: 22px;
    margin: 0 0 8px;
    text-align: left !important;
}

.help-item__list li:last-child {
    margin-bottom: 0;
}

.help-item__list li::before {
    content: attr(data-index);
    position: absolute;
    left: 0;
    top: 0;
    color: var(--hc-accent-dark);
    font-weight: 700;
    font-size: 13px;
}

/* —— 响应式 —— */
@media (max-width: 991px) {
    html:has(.help-shell),
    body.page-helpcenter,
    body.page-helpcenter .header {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .help-shell {
        padding: 18px 0 48px;
    }

    .help-main {
        flex-direction: column;
        gap: 16px;
        max-width: 100%;
    }

    .help-toc-slot {
        width: 100%;
        flex: none;
    }

    .help-toc {
        position: static;
        width: 100%;
        max-height: none;
        overflow: visible;
    }

    .help-toc__body {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .help-toc__group {
        margin-bottom: 0;
    }

    .help-toc__list {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }

    .help-toc__list a {
        background: #fff;
        padding: 6px 8px;
    }

    .help-content {
        max-width: 100%;
    }

    .help-hero__title {
        font-size: 22px;
    }

    .help-item__head {
        padding: 12px 14px;
    }

    .help-item__q {
        font-size: 14px;
    }

    .help-item__a {
        padding: 12px 14px 14px 17px;
        font-size: 13px;
    }
}

@media (max-width: 576px) {
    .help-item__head {
        align-items: flex-start;
    }
}
