/* ===== 操作手册帮助页 =====================================================
   与检索页共用一套配色（style.css 的 :root 变量原样搬过来，帮助页可能被单独
   打开，不依赖 style.css）。提示框那四种底色沿用手册自己的深蓝/青体系——
   手册里「底色 = 信息性质」是它的核心约定，换色会把这个约定弄丢。
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }

:root {
    --bg: #f4f1eb;
    --sidebar-bg: #2c2416;
    --gold: #c8b87a;
    --brown: #5a3e1b;
    --brown-dark: #3d2b0a;
    --border: #e8dfc8;
    --white: #fff;
    --text: #2c2416;
    --muted: #8c7755;
    --main: #1F3A5F;      /* 手册主色 深蓝 */
    --accent: #0E7C86;    /* 手册强调 青 */
}

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.75;
}

/* ===== 顶栏 ===== */
.help-bar {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    background: var(--sidebar-bg);
    color: #f0e6c8;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .18);
}

.help-back,
.help-back:visited {
    color: #f0e6c8;
    text-decoration: none;
    font-size: 14px;
    padding: 5px 12px;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 16px;
    white-space: nowrap;
    transition: background .18s;
}
.help-back:hover { background: rgba(255, 255, 255, .14); }

.help-bar-title {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    letter-spacing: .5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.help-nav-toggle {
    display: none;
    background: rgba(255, 255, 255, .14);
    color: #f0e6c8;
    border: none;
    border-radius: 16px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
}

/* ===== 布局 ===== */
.help-layout {
    display: flex;
    align-items: flex-start;
    max-width: 1280px;
    margin: 0 auto;
}

.help-nav {
    position: sticky;
    top: 53px;
    flex: 0 0 268px;
    width: 268px;
    max-height: calc(100vh - 53px);
    overflow-y: auto;
    padding: 18px 8px 40px 18px;
}

.help-nav-head {
    font-size: 12px;
    letter-spacing: 2px;
    color: var(--muted);
    padding: 0 10px 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}

.help-nav-list { display: flex; flex-direction: column; }

.help-nav-list a {
    display: block;
    color: var(--brown);
    text-decoration: none;
    font-size: 13.5px;
    line-height: 1.5;
    padding: 5px 10px;
    border-left: 2px solid transparent;
    border-radius: 0 6px 6px 0;
    transition: background .16s, color .16s;
}
.help-nav-list a:hover { background: var(--white); }
.help-nav-list a.nav-h1 {
    font-weight: 700;
    color: var(--brown-dark);
    margin-top: 8px;
}
.help-nav-list a.nav-h2 { padding-left: 22px; font-size: 13px; color: var(--muted); }
.help-nav-list a.active {
    background: var(--white);
    border-left-color: var(--gold);
    color: var(--brown-dark);
    font-weight: 600;
}

.help-main {
    flex: 1;
    min-width: 0;
    padding: 22px 26px 80px;
}

.manual {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 34px 40px 46px;
    box-shadow: 0 2px 10px rgba(90, 62, 27, .05);
}

/* ===== 封面 ===== */
.cover {
    text-align: center;
    padding: 12px 0 30px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 30px;
}
.cover-brand { font-size: 26px; font-weight: 700; color: var(--main); letter-spacing: 2px; }
.cover-ver   { font-size: 17px; font-weight: 700; color: var(--accent); margin-top: 2px; }
.cover-doc   { font-size: 21px; font-weight: 700; color: var(--text); margin: 18px 0 20px; letter-spacing: 4px; }
.cover-meta  { display: inline-flex; flex-direction: column; gap: 4px; font-size: 13.5px; color: var(--muted); }
.cover-meta-item span { color: var(--brown); }
.cover-meta-item span::after { content: "："; }

/* ===== 标题 ===== */
.sec-h1 {
    font-size: 21px;
    color: var(--main);
    margin: 44px 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
    letter-spacing: 1px;
}
.sec-h1:first-child { margin-top: 0; }
.sec-h2 {
    font-size: 17px;
    color: var(--main);
    margin: 30px 0 10px;
    padding-left: 10px;
    border-left: 4px solid var(--accent);
}

/* ===== 正文 ===== */
.manual p { margin: 10px 0; text-align: justify; }
.manual p code,
.manual li code,
.manual dt code,
.manual dd code,
.manual td code,
.manual th code {
    font-family: Consolas, "Courier New", monospace;
    font-size: .92em;
    background: #f5f5f5;
    padding: 1px 5px;
    border-radius: 3px;
    color: #b03030;
}
.manual strong { color: var(--brown-dark); }

.manual ul, .manual ol { margin: 10px 0; padding-left: 26px; }
.manual li { margin: 5px 0; }

.manual dl { margin: 12px 0; }
.manual dt { font-weight: 700; color: var(--brown-dark); margin-top: 10px; }
.manual dd { margin: 2px 0 0 26px; }

.doc-end { text-align: center; color: var(--muted); margin-top: 46px; letter-spacing: 4px; }

/* ===== 提示框（底色 = 信息性质，手册的核心约定） ===== */
.callout {
    margin: 14px 0;
    padding: 11px 16px;
    border-left: 4px solid var(--accent);
    border-radius: 6px;
    background: #EAF3FB;
    font-size: 14.5px;
}
.callout-label {
    display: inline-block;
    font-weight: 700;
    margin-right: 10px;
    color: var(--accent);
}
.callout-warn   { background: #FDF3E3; border-left-color: #B06A00; }
.callout-warn   .callout-label { color: #B06A00; }
.callout-danger { background: #FBECEC; border-left-color: #B02A2A; }
.callout-danger .callout-label { color: #B02A2A; }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; margin: 14px 0 20px; }
.manual-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    background: var(--white);
}
.manual-table th, .manual-table td {
    border: 1px solid #d8dee5;
    padding: 7px 10px;
    text-align: left;
    vertical-align: top;
    line-height: 1.6;
}
.manual-table th { background: #DCE6F1; color: var(--main); font-weight: 700; white-space: nowrap; }
.manual-table tbody tr:nth-child(even) { background: #fafbfd; }

/* ===== 插图 ===== */
.manual figure { margin: 18px 0; text-align: center; }
.manual figure img {
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--white);
}
.manual figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* ===== 页脚 ===== */
.help-foot { text-align: center; padding: 26px 0 0; }
.help-foot a, .help-foot a:visited { color: var(--brown); font-size: 14px; text-decoration: none; }
.help-foot a:hover { text-decoration: underline; }

/* ===== 窄屏 ===== */
@media (max-width: 900px) {
    body { font-size: 15px; }
    .help-nav-toggle { display: block; }
    .help-nav {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 82%;
        max-width: 300px;
        max-height: none;
        z-index: 70;
        background: var(--white);
        padding: 20px 10px 40px;
        transform: translateX(-102%);
        transition: transform .26s ease;
        box-shadow: 2px 0 14px rgba(0, 0, 0, .18);
    }
    .help-nav.open { transform: translateX(0); }
    .help-main { padding: 14px 12px 60px; }
    .manual { padding: 20px 16px 30px; border-radius: 8px; }
    .sec-h1 { font-size: 19px; }
    .sec-h2 { font-size: 16px; }
    .cover-brand { font-size: 22px; }
    .cover-doc { font-size: 18px; letter-spacing: 2px; }
}

/* ===== 打印 ===== */
@media print {
    .help-bar, .help-nav, .help-foot { display: none !important; }
    body { background: #fff; }
    .help-main { padding: 0; }
    .manual { border: none; box-shadow: none; padding: 0; }
    .sec-h1 { break-before: page; }
    .callout, .manual-table, .manual figure { break-inside: avoid; }
}
