/* ============================================================
   万象云桥数智员工官网 · /docs 无品牌裸版手册（嵌入 PC 客户端 / 客户系统 iframe）
   不含任何品牌元素；复用 style.css 变量与 .doc-content/.help-tree 组件。
   打印导出：@media print 全部转白底黑字，隐藏侧栏/目录/工具条。
   ============================================================ */

/* ---------- 布局：左树 + 正文 ---------- */
.docs-body {
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
}
.docs-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100vh;
}
.docs-side {
    border-right: 1px solid var(--line);
    background: var(--bg-2);
    padding: 18px 14px 32px;
    overflow-y: auto;
    max-height: 100vh;
    position: sticky;
    top: 0;
}
.docs-search { margin-bottom: 10px; }
.docs-search input { width: 100%; }
.docs-empty { color: var(--muted); font-size: 13px; padding: 8px 4px; }

.docs-main {
    padding: 28px 36px 60px;
    min-width: 0;
}

/* ---------- 侧栏分组（details 折叠） ---------- */
.docs-group { margin: 2px 0; }
.docs-group summary {
    cursor: pointer;
    font-size: 13px;
    color: var(--muted);
    letter-spacing: 1px;
    padding: 6px 10px;
    border-radius: 8px;
    user-select: none;
    list-style: none;
}
.docs-group summary::-webkit-details-marker { display: none; }
.docs-group summary::before { content: '▸ '; }
.docs-group[open] summary::before { content: '▾ '; }
.docs-group summary:hover { color: var(--text); background: rgba(0, 122, 255, .08); }
.docs-group .help-tree a { padding-left: 26px; }

/* ---------- 窄屏抽屉按钮（宽屏隐藏） ---------- */
.docs-menu-btn {
    display: none;
    margin: 0 0 14px;
    padding: 7px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
}

/* ---------- 本页目录 ---------- */
.docs-toc {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg-2);
    padding: 12px 18px;
    margin: 16px 0;
    font-size: 13.5px;
}
.docs-toc b { display: block; color: var(--muted); font-size: 12px; letter-spacing: 1px; margin-bottom: 6px; }
.docs-toc ul { list-style: none; margin: 0; padding: 0; }
.docs-toc li { margin: 2px 0; }
.docs-toc li.docs-toc-l3 { padding-left: 16px; }
.docs-toc li.docs-toc-l4 { padding-left: 32px; }
.docs-toc a { color: var(--muted); text-decoration: none; }
.docs-toc a:hover { color: var(--primary-hover); }

/* ---------- 工具条 ---------- */
.docs-toolbar { display: flex; justify-content: flex-end; margin-bottom: 6px; }
.docs-print {
    padding: 6px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--muted);
    font-size: 12.5px;
    cursor: pointer;
}
.docs-print:hover { color: var(--text); border-color: var(--primary); }

/* ---------- 文章排版微调（在 .doc-content 基础上） ---------- */
.docs-article { max-width: 860px; }
.docs-article h1 { margin-top: 4px; }
.docs-article img { max-width: 100%; height: auto; }

/* ---------- 窄屏：侧栏变抽屉 ---------- */
@media (max-width: 860px) {
    .docs-layout { grid-template-columns: 1fr; }
    .docs-menu-btn { display: inline-block; }
    .docs-side {
        position: fixed;
        z-index: 50;
        left: 0; top: 0; bottom: 0;
        width: 280px;
        transform: translateX(-100%);
        transition: transform .22s ease;
        box-shadow: var(--shadow);
    }
    .docs-side.open { transform: translateX(0); }
    .docs-main { padding: 18px 18px 48px; }
}

/* ---------- 打印 / 导出 PDF：白底黑字，只留正文 ---------- */
@media print {
    :root {
        --bg: #ffffff; --bg-2: #ffffff; --panel: #ffffff; --panel-2: #ffffff;
        --text: #1a1a1a; --muted: #555555;
        --line: rgba(0, 0, 0, .18);
        --shadow: none;
    }
    body.docs-body { background: #fff; color: #1a1a1a; }
    .docs-side, .docs-menu-btn, .docs-toolbar, .docs-toc { display: none !important; }
    .docs-layout { display: block; min-height: 0; }
    .docs-main { padding: 0; }
    .docs-article { max-width: 100%; }
    .doc-content p, .doc-content li { color: #333; }
    .doc-content h2 { border-left-color: #1a73e8; }
    .doc-content a { color: #1a73e8; text-decoration: none; }
    .doc-content img { border-color: rgba(0, 0, 0, .15); }
    .doc-content blockquote { background: #f5f7fa; color: #444; }
    .doc-content code { background: #f2f4f8; color: #0b6e64; border-color: rgba(0, 0, 0, .12); }
    .doc-content pre, .doc-content table th, .doc-content table td { background: #fafbfc; }
    h1, h2, h3, h4 { page-break-after: avoid; }
    img, table, pre { page-break-inside: avoid; }
}
