/* ============================================================
   YiziMarkdown 帮助中心
   依赖：assets/css/style.css（共用 --blue / --orange 等设计变量）
   ============================================================ */

/* ===== 页头 ===== */
.help-header {
    padding: 104px clamp(16px, 4vw, 32px) 42px;
    background: linear-gradient(180deg, #eef2fb 0%, #f7f9fd 45%, #ffffff 100%);
    border-bottom: 1px solid #eef2f7;
    text-align: center;
}
/* 与首页 hero 一致：内容居中、限宽，保证整站观感统一 */
.help-header-inner { max-width: 820px; margin: 0 auto; }
.help-title {
    font-size: clamp(27px, 4vw, 38px); font-weight: 800;
    letter-spacing: -0.02em; color: var(--dark); line-height: 1.25;
}
/* ===== 搜索 ===== */
.help-search { position: relative; margin: 26px auto 0; max-width: 540px; }
.help-search-input {
    width: 100%; height: 46px; padding: 0 16px 0 44px;
    font-size: 14px; font-family: inherit; color: var(--dark);
    background: #fff; border: 1px solid #dbe3ec; border-radius: 10px;
    outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.help-search-input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(0, 47, 167, 0.08);
}
.help-search-icon {
    position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
    color: #94a3b8; pointer-events: none;
}
.help-search-hint {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
    font-size: 12px; color: #94a3b8;
    border: 1px solid #e2e8f0; border-radius: 4px; padding: 1px 6px;
}
.help-results {
    position: absolute; z-index: 60; top: 54px; left: 0; right: 0;
    max-height: 380px; overflow-y: auto; display: none;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}
.help-results.show { display: block; }
.help-result {
    display: block; padding: 11px 16px; text-decoration: none;
    border-bottom: 1px solid #f1f5f9;
}
.help-result:last-child { border-bottom: none; }
.help-result:hover { background: #f8fafc; }
.help-result-title { font-size: 14px; font-weight: 600; color: var(--dark); }
.help-result-path { font-size: 12px; color: var(--gray); margin-top: 2px; }
.help-result-empty { padding: 18px 16px; font-size: 13px; color: var(--gray); }

/* ===== 布局（内容区与首页一致：1200px） ===== */
.help-layout {
    max-width: 1200px; margin: 0 auto;
    padding: 40px clamp(16px, 4vw, 32px) 80px;
    display: grid; grid-template-columns: 264px minmax(0, 1fr);
    gap: 56px; align-items: start;
}

/* ===== 左侧章节导航（一级 + 二级手风琴） ===== */
.help-sidebar {
    position: sticky; top: 88px; max-height: calc(100vh - 110px);
    overflow-y: auto; padding-right: 4px;
}
.help-nav-group { margin-bottom: 2px; }
.help-nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; border-radius: 9px;
    font-size: 14px; color: var(--gray); text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.help-nav-item:hover { background: #f8fafc; color: var(--dark); }
.help-nav-icon {
    flex: none; width: 18px; height: 18px; color: #94a3b8;
    display: flex; align-items: center; justify-content: center; transition: color 0.15s;
}
.help-nav-icon svg { width: 17px; height: 17px; }
.help-nav-label { flex: 1; min-width: 0; }
.help-nav-chev {
    flex: none; width: 14px; height: 14px; color: #cbd5e1;
    transition: transform 0.25s, color 0.15s;
}
.help-nav-group.open .help-nav-item { color: var(--dark); }
.help-nav-group.open .help-nav-icon,
.help-nav-group.active .help-nav-icon { color: var(--blue); }
.help-nav-group.open .help-nav-chev { transform: rotate(90deg); color: var(--blue); }
.help-nav-group.active .help-nav-item {
    color: var(--blue); font-weight: 600; background: rgba(0, 47, 167, 0.05);
}

/* 二级目录：默认收起，展开时高度过渡 */
.help-nav-subs { max-height: 0; overflow: hidden; transition: max-height 0.28s ease; }
.help-nav-subs a {
    display: block; margin-left: 19px; padding: 6px 10px 6px 21px;
    font-size: 13px; line-height: 1.5; color: var(--gray); text-decoration: none;
    border-left: 2px solid #eef2f7;
    transition: color 0.15s, border-color 0.15s;
}
.help-nav-subs a:hover { color: var(--dark); }
.help-nav-subs a.active { color: var(--blue); border-left-color: var(--blue); font-weight: 600; }

/* 正文大标题图标（与侧栏图标呼应） */
.help-h2-icon {
    flex: none; width: 26px; height: 26px; color: var(--blue);
    display: flex; align-items: center; justify-content: center;
}
.help-h2-icon svg { width: 24px; height: 24px; }

/* ===== 正文 ===== */
.help-content { min-width: 0; font-size: 15px; line-height: 1.85; color: #334155; }
.help-section { padding-bottom: 52px; margin-bottom: 52px; border-bottom: 1px solid #eef2f7; }
.help-section:last-child { border-bottom: none; margin-bottom: 0; }
.help-section h2 {
    display: flex; align-items: center; gap: 10px;
    font-size: 26px; font-weight: 800; color: var(--dark);
    letter-spacing: -0.01em; margin-bottom: 6px; position: relative;
}
.help-section h2 .anchor {
    position: absolute; left: -22px; top: 4px;
    font-size: 20px; color: #cbd5e1; text-decoration: none; opacity: 0;
}
.help-section h2:hover .anchor { opacity: 1; }
.help-lead { color: var(--gray); font-size: 15px; margin-bottom: 22px; }
.help-sub { margin: 30px 0 12px; }
.help-sub h3 {
    font-size: 18px; font-weight: 700; color: var(--dark);
    margin-bottom: 10px; position: relative;
}
.help-content p { margin: 0 0 14px; }
.help-content ul, .help-content ol { margin: 0 0 16px; padding-left: 22px; }
.help-content li { margin-bottom: 7px; }
.help-content strong { color: var(--dark); font-weight: 600; }
.help-content a { color: var(--blue); text-decoration: none; }
.help-content a:hover { text-decoration: underline; }

/* 行内代码与代码块 */
.help-content code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 13px; background: #f1f5f9; color: var(--blue);
    padding: 2px 6px; border-radius: 4px;
}
.help-content pre {
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
    padding: 14px 16px; margin: 0 0 18px; overflow-x: auto;
}
.help-content pre code {
    background: none; color: #334155; padding: 0; font-size: 13px; line-height: 1.7;
}

/* 表格 */
.help-table-wrap { overflow-x: auto; margin: 0 0 18px; }
.help-content table { width: 100%; border-collapse: collapse; font-size: 14px; }
.help-content th {
    text-align: left; background: #f8fafc; color: var(--dark); font-weight: 600;
    padding: 10px 14px; border-bottom: 2px solid #e2e8f0; white-space: nowrap;
}
.help-content td { padding: 10px 14px; border-bottom: 1px solid #eef2f7; vertical-align: top; }
.help-content td:first-child { white-space: nowrap; }

/* 功能表格里的按钮图标（与软件界面同款） */
.tb-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; margin-right: 8px; vertical-align: middle;
    color: var(--blue); background: rgba(0, 47, 167, 0.06); border-radius: 6px;
}
.tb-icon svg { width: 15px; height: 15px; }
.help-content tr:last-child td { border-bottom: none; }

/* 按键 */
kbd {
    display: inline-block; min-width: 22px; text-align: center;
    font-family: inherit; font-size: 12px; font-weight: 600; color: var(--dark);
    background: #fff; border: 1px solid #dbe3ec; border-bottom-width: 2px;
    border-radius: 6px; padding: 1px 7px; margin: 0 1px;
}

/* 提示框 */
.callout {
    display: flex; gap: 12px; margin: 0 0 18px;
    padding: 14px 16px; border-radius: 10px;
    background: #f8fafc; border: 1px solid #e2e8f0;
    font-size: 14px; line-height: 1.75;
}
.callout-icon { flex: none; font-weight: 700; font-size: 14px; line-height: 1.6; }
.callout p { margin: 0; }
.callout p + p { margin-top: 6px; }
.callout-tip { background: rgba(0, 47, 167, 0.04); border-color: rgba(0, 47, 167, 0.16); }
.callout-tip .callout-icon { color: var(--blue); }
.callout-warn { background: rgba(243, 112, 33, 0.05); border-color: rgba(243, 112, 33, 0.22); }
.callout-warn .callout-icon { color: var(--orange); }
.callout-new { background: rgba(16, 185, 129, 0.06); border-color: rgba(16, 185, 129, 0.24); }
.callout-new .callout-icon { color: #0f9d58; }

/* 步骤条 */
.steps { counter-reset: step; list-style: none; margin: 0 0 18px; padding: 0; }
.steps li {
    position: relative; padding-left: 38px; margin-bottom: 14px; counter-increment: step;
}
.steps li::before {
    content: counter(step); position: absolute; left: 0; top: 3px;
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--blue); color: #fff;
    font-size: 13px; font-weight: 700; text-align: center; line-height: 24px;
}
.steps li:last-child { margin-bottom: 0; }

/* 配图 */
.help-figure { margin: 22px 0 26px; }
.help-figure img {
    display: block; margin: 0 auto; max-width: 100%; height: auto;
    border-radius: 12px;
    border: 1px solid #e2e8f0; background: #f8fafc;
}
.help-figure figcaption {
    margin-top: 9px; font-size: 13px; color: var(--gray); text-align: center;
}
.help-shot-ph {
    border: 1.5px dashed #cbd5e1; border-radius: 12px; background: #f8fafc;
    padding: 40px 20px; text-align: center; color: #94a3b8; font-size: 13px;
    line-height: 1.7;
}
.help-shot-ph b { display: block; color: #64748b; font-size: 14px; margin-bottom: 4px; }

/* 主题色板（复用首页主题截图） */
.theme-shot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 0 0 18px; }
.theme-shot { text-align: center; }
.theme-shot img {
    width: 100%; border-radius: 8px; border: 1px solid #e2e8f0; display: block;
    background: #f8fafc;
}
.theme-shot span { display: block; margin-top: 6px; font-size: 13px; color: var(--gray); }

/* ===== 移动端目录按钮 ===== */
.help-fab {
    display: none; position: fixed; right: 18px; bottom: 18px; z-index: 150;
    width: 52px; height: 52px; border-radius: 50%;
    background: var(--blue); color: #fff; border: none; cursor: pointer;
    font-size: 13px; font-weight: 600;
    box-shadow: 0 8px 22px rgba(0, 47, 167, 0.32);
}

/* ===== 响应式 ===== */
@media (max-width: 1000px) {
    .help-layout { grid-template-columns: 232px minmax(0, 1fr); gap: 36px; }
}
@media (max-width: 900px) {
    .help-header { padding-top: 96px; }
    .help-title { font-size: 27px; }
    .help-layout { grid-template-columns: minmax(0, 1fr); padding-top: 28px; }
    .help-sidebar {
        position: fixed; z-index: 160; top: 0; left: 0; bottom: 0; width: 280px;
        background: #fff; padding: 24px 16px; max-height: none;
        box-shadow: 4px 0 24px rgba(15, 23, 42, 0.12);
        transform: translateX(-100%); transition: transform 0.28s ease;
    }
    .help-sidebar.open { transform: translateX(0); }
    .help-fab { display: block; }
    .help-section h2 { font-size: 22px; }
    .help-section h2 .anchor { display: none; }
    .theme-shot-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .help-title { font-size: 23px; }
    .theme-shot-grid { grid-template-columns: 1fr; }
}
