/* 帮助文档页面（archive-help_doc.php / single-help_doc.php 共用） */

.help-docs-page {
    min-height: 100vh;
    background: #f7f8fb;
}

/*
 * 覆盖主站 .content-area 的 column 规则。目录和文章必须处于同一行，
 * 否则长目录会把文章整体挤到视窗下方。
 */
.content-area.help-content-area {
    display: grid;
    grid-template-columns: 272px minmax(0, 1fr);
    align-items: start;
    min-height: 100vh;
    padding: 0;
    background: #f7f8fb;
    flex-direction: row;
}

/* ---------------- 左侧目录树 ---------------- */

.help-tree-col {
    box-sizing: border-box;
    width: 272px;
    height: 100vh;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 210px;
    overflow: hidden;
    background: #fff;
    border-right: 1px solid #eceef3;
}

.help-tree {
    box-sizing: border-box;
    height: 100%;
    overflow-y: auto;
    scrollbar-color: #c5cbd5 transparent;
    scrollbar-width: thin;
    background: #fff;
    border: 0;
    border-radius: 0;
    padding: 28px 18px 38px;
    font-size: 14px;
}

.help-tree::-webkit-scrollbar {
    width: 8px;
}

.help-tree::-webkit-scrollbar-thumb {
    background: #c5cbd5;
    border: 2px solid #fff;
    border-radius: 99px;
}

.help-tree-home {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 12px;
    margin-bottom: 14px;
    border-radius: 9px;
    color: #20232a;
    font-weight: 700;
}

.help-tree-home:hover,
.help-tree-post:hover {
    color: #ff385c;
    background: transparent;
}

.help-tree-home.is-current {
    color: #ff385c;
    background: transparent;
}

.help-tree-group {
    margin-top: 18px;
}

.help-tree-group-name {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 6px 12px 7px;
    border: 0;
    background: transparent;
    color: #8c94a1;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-align: left;
}

/* 子分类的组标题：比一级分类弱一档 */
.help-tree-group-name.is-sub {
    color: #b5b5b5;
    padding-left: 24px;
}

.help-tree-group-name:hover {
    color: #ff385c;
}

.help-tree-group-name:focus-visible,
.help-tree-toggle:focus-visible {
    outline: 2px solid #ff9bad;
    outline-offset: 2px;
    border-radius: 7px;
}

.help-tree-folder-icon {
    width: 14px;
    color: #f1a200;
    font-size: 13px;
}

.help-tree-chevron {
    margin-left: auto;
    color: #aeb5c0;
    font-size: 10px;
    transition: transform .18s ease;
}

.help-tree-group-name.is-collapsed .help-tree-chevron,
.help-tree-post-toggle.is-collapsed .fa-chevron-down {
    transform: rotate(-90deg);
}

.help-tree-group-content[hidden],
.help-tree-posts[hidden] {
    display: none;
}

.help-tree-posts {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* 子文章（多级子文档）缩进一档 */
.help-tree-posts--nested {
    margin-left: 14px;
    padding-left: 6px;
    border-left: 1px solid #f0f0f0;
}

.help-tree-posts li {
    list-style: none;
    margin: 0;
}

.help-tree-post-row {
    display: flex;
    align-items: stretch;
}

.help-tree-post-toggle,
.help-tree-leaf-spacer {
    flex: 0 0 27px;
    width: 27px;
}

.help-tree-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #9ca4b0;
    cursor: pointer;
}

.help-tree-post-toggle:hover {
    background: #fff1f3;
    color: #ff385c;
}

.help-tree-post-toggle .fa-chevron-down {
    font-size: 10px;
    transition: transform .18s ease;
}

.help-tree-post {
    display: flex;
    flex: 1;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
    padding: 8px 12px 8px 2px;
    border-radius: 8px;
    color: #4d5664;
    line-height: 1.5;
    transition: color .18s ease, background-color .18s ease, transform .18s ease;
}

.help-tree-post span {
    min-width: 0;
}

.help-tree-post-icon {
    flex: 0 0 auto;
    margin-top: .28em;
    color: #9ca4b0;
    font-size: 13px;
}

.help-tree-post.is-current {
    color: #ff385c;
    background: transparent;
    font-weight: 600;
}

.help-tree-post.is-current .help-tree-post-icon {
    color: #ff385c;
}

.help-tree-post:hover {
    transform: translateX(2px);
}

/* ---------------- 右侧主体 ---------------- */

.help-main {
    grid-column: 2;
    min-width: 0;
    width: 100%;
    max-width: 1120px;
    box-sizing: border-box;
    margin: 0 auto;
    padding: 56px clamp(32px, 5vw, 76px) 76px;
}

.help-page-title {
    margin: 0 0 10px;
    font-size: clamp(28px, 3vw, 36px);
    letter-spacing: -.035em;
    color: #20232a;
}

.help-lead {
    max-width: 620px;
    margin: 0 0 30px;
    color: #687180;
    font-size: 15px;
    line-height: 1.8;
}

.help-empty {
    color: #999;
}

.help-card {
    background: #fff;
    border: 1px solid #e9ecf1;
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(34, 42, 54, .035);
    padding: 24px 28px;
    margin-bottom: 18px;
}

.help-card-title {
    margin: 0 0 4px;
    font-size: 17px;
    color: #333;
}

.help-card-desc {
    margin: 0 0 10px;
    color: #888;
    font-size: 13px;
}

.help-card-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 26px;
}

.help-card-list li {
    margin: 0;
    list-style: none;
}

.help-card-list a {
    color: #3a6df0;
    line-height: 1.9;
}

.help-card-list a:hover {
    color: #ff385c;
}

/* ---------------- 文章正文 ---------------- */

.help-article {
    background: #fff;
    border: 1px solid #e9ecf1;
    border-radius: 18px;
    box-shadow: 0 14px 38px rgba(34, 42, 54, .055);
    padding: clamp(30px, 5vw, 52px);
}

.help-article-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    box-sizing: border-box;
    margin: 0 0 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fff1f3;
    color: #ff385c;
    font-size: 12px;
    font-weight: 700;
}

.help-article-parent {
    margin: 0 0 8px;
    font-size: 13px;
}

.help-article-parent a {
    color: #888;
}

.help-article-parent a:hover {
    color: #ff385c;
}

.help-article-title {
    margin: 0 0 28px;
    padding-bottom: 22px;
    border-bottom: 1px solid #eceef3;
    font-size: clamp(28px, 3.2vw, 38px);
    line-height: 1.25;
    letter-spacing: -.035em;
    color: #20232a;
}

.help-article-body {
    font-size: 16px;
    line-height: 1.9;
    color: #3f4753;
}

.help-article-body h3 {
    margin: 34px 0 12px;
    font-size: 20px;
    line-height: 1.4;
    color: #252a33;
}

.help-article-body ul {
    margin: 10px 0 16px;
    padding-left: 22px;
}

.help-article-body li {
    margin: 6px 0;
    list-style: disc;
}

.help-article-body a {
    color: #3a6df0;
}

.help-article-body a:hover {
    color: #ff385c;
}

.help-article-body code {
    padding: 1px 6px;
    background: #f5f6fa;
    border-radius: 5px;
    font-size: 13px;
}

.help-article-nav {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 38px;
    padding-top: 22px;
    border-top: 1px solid #eceef3;
    font-size: 14px;
}

.help-article-nav a {
    color: #3a6df0;
}

.help-article-nav a:hover {
    color: #ff385c;
}

.help-next {
    margin-left: auto;
}

/* 窄屏：目录树折叠到正文上方 */
@media (max-width: 960px) {
    .content-area.help-content-area {
        display: block;
        min-height: auto;
    }

    .help-tree-col {
        width: 100%;
        position: static;
        height: min(48svh, 420px);
        border-right: 0;
        border-bottom: 1px solid #eceef3;
    }

    .help-tree {
        padding: 20px 16px 26px;
    }

    .help-main {
        grid-column: auto;
        padding: 32px 16px 52px;
    }

    .help-article {
        border-radius: 14px;
        padding: 26px 22px;
    }
}
