/* ===== PointerZ 帮助文档样式 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --text: #1f2937;
    --text-light: #4b5563;
    --text-muted: #6b7280;
    --text-faint: #9ca3af;
    --bg: #ffffff;
    --bg-soft: #f9fafb;
    --bg-sidebar: #fbfbfd;
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --code-bg: #f4f4f5;
    --code-text: #c678dd;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / .05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);
    --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --header-h: 60px;
    --sidebar-w: 280px;
    --content-w: 880px;
    /* 顶部标题容器：max-width 1400px、左右内边距 24px，目录栏左边与标题左边对齐 */
    --sidebar-left: max(24px, calc((100% - 1400px) / 2 + 24px));
}

html { scroll-behavior: smooth; font-size: 16px; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ===== 顶部导航 ===== */
.docs-header {
    position: fixed; top: 0; left: 0; right: 0; height: var(--header-h);
    z-index: 100;
    background: rgba(255,255,255,.85);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}
.docs-header-inner {
    max-width: 1400px; height: 100%; margin: 0 auto;
    padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between;
}
.docs-brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 17px; }
.docs-brand:hover { color: var(--primary); }
.docs-brand-logo svg { width: 30px; height: 30px; display: block; }
.docs-brand-logo img { width: 30px; height: 30px; display: block; border-radius: 7px; }
.docs-brand em { font-style: normal; font-weight: 500; color: var(--text-muted); font-size: 14px; margin-left: 4px; }
.docs-header-actions { display: flex; align-items: center; gap: 18px; }
.docs-link { color: var(--text-light); font-size: 14px; font-weight: 500; }
.docs-link:hover { color: var(--primary); }
.docs-sidebar-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--text); padding: 6px; }
.docs-sidebar-toggle svg { width: 22px; height: 22px; }

/* ===== 布局 ===== */
.docs-layout { padding-top: var(--header-h); }

.docs-sidebar {
    position: fixed; top: var(--header-h); bottom: 0;
    /* 左边与顶部标题（品牌 logo）左边对齐 */
    left: var(--sidebar-left);
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 24px 12px 48px 16px;
}
.docs-nav { font-size: 14px; }
.docs-nav-group { margin-bottom: 20px; }
.docs-nav-group-title {
    font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    color: var(--text-faint);
    padding: 6px 10px;
}
.docs-nav-item {
    display: block;
    padding: 7px 10px;
    border-radius: 6px;
    color: var(--text-light);
    line-height: 1.45;
    transition: all .15s;
    cursor: pointer;
}
.docs-nav-item:hover { background: var(--border-light); color: var(--text); }
.docs-nav-item.active { background: rgba(99,102,241,.1); color: var(--primary); font-weight: 600; }
.docs-nav-item.active::before { content: ''; display: inline-block; width: 3px; height: 14px; background: var(--primary); border-radius: 2px; margin-right: 8px; vertical-align: -2px; }

.docs-main {
    /* 与目录栏整体居中：紧跟侧栏右侧，左边距 = 侧栏左边距 + 侧栏宽；空间不足时紧贴侧栏 */
    margin-left: max(var(--sidebar-w), calc((100% - var(--content-w) - var(--sidebar-w)) / 2 + var(--sidebar-w)));
    max-width: var(--content-w);
    padding: 32px 48px 64px;
}
.docs-breadcrumb {
    font-size: 13px; color: var(--text-faint); margin-bottom: 14px;
}
.docs-breadcrumb span + span::before { content: '/'; margin: 0 8px; color: var(--border); }
.docs-breadcrumb .crumb-cur { color: var(--text-light); }

/* ===== 内容排版 ===== */
.docs-content { min-height: 60vh; }
.docs-content h1 {
    font-size: 34px; font-weight: 800; line-height: 1.25; letter-spacing: -.01em;
    margin: 0 0 8px;
}
.docs-content .lead {
    font-size: 17px; color: var(--text-light); margin: 8px 0 28px; padding-bottom: 20px; border-bottom: 1px solid var(--border-light);
}
.docs-content h2 {
    font-size: 24px; font-weight: 700; margin: 40px 0 14px; padding-top: 8px;
    border-top: 1px solid var(--border-light); padding-top: 28px;
}
.docs-content h3 { font-size: 18px; font-weight: 600; margin: 26px 0 10px; color: var(--text); }
.docs-content h4 { font-size: 15px; font-weight: 600; margin: 18px 0 8px; }
.docs-content p { margin: 0 0 14px; color: var(--text); }
.docs-content ul, .docs-content ol { margin: 0 0 16px; padding-left: 22px; }
.docs-content li { margin: 6px 0; }
.docs-content li::marker { color: var(--primary); }
.docs-content strong { font-weight: 600; }
.docs-content a { font-weight: 500; }
.docs-content code {
    font-family: 'SFMono-Regular', 'JetBrains Mono', Consolas, Monaco, monospace;
    font-size: 13px; background: var(--code-bg); color: var(--code-text);
    padding: 2px 6px; border-radius: 5px;
}
.docs-content pre {
    background: #1e1e2e; color: #abb2bf; padding: 18px 20px; border-radius: 10px;
    overflow-x: auto; margin: 0 0 18px; font-size: 13px; line-height: 1.6;
}
.docs-content pre code { background: none; color: inherit; padding: 0; font-size: inherit; }
.docs-content blockquote {
    border-left: 4px solid var(--primary); background: rgba(99,102,241,.06);
    padding: 12px 18px; border-radius: 0 8px 8px 0; margin: 0 0 18px;
    color: var(--text-light);
}
.docs-content blockquote p { margin: 0; }
.docs-content table { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 14px; }
.docs-content th, .docs-content td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; }
.docs-content th { background: var(--bg-soft); font-weight: 600; }
.docs-content tr:nth-child(even) td { background: var(--bg-soft); }
.docs-content hr { border: none; border-top: 1px solid var(--border-light); margin: 28px 0; }

/* 图片/插图 */
.docs-img { width: 100%; border: 1px solid var(--border); border-radius: 10px; margin: 18px 0; box-shadow: var(--shadow); display: block; }
.docs-figcap { font-size: 13px; color: var(--text-faint); text-align: center; margin: -8px 0 22px; }
.docs-callout {
    display: flex; gap: 12px; padding: 14px 16px; border-radius: 8px;
    margin: 0 0 18px; background: rgba(99,102,241,.06); border: 1px solid rgba(99,102,241,.18);
}
.docs-callout .ic { flex: 0 0 auto; color: var(--primary); font-size: 18px; line-height: 1.6; }
.docs-callout .bd { color: var(--text-light); }
.docs-callout.warn { background: rgba(245,158,11,.08); border-color: rgba(245,158,11,.25); }
.docs-callout.warn .ic { color: #f59e0b; }
.docs-callout.tip { background: rgba(16,185,129,.08); border-color: rgba(16,185,129,.25); }
.docs-callout.tip .ic { color: #10b981; }

/* 步骤 */
.docs-steps { list-style: none; padding: 0; counter-reset: step; margin: 0 0 18px; }
.docs-steps > li { position: relative; padding: 0 0 16px 40px; counter-increment: step; }
.docs-steps > li::before {
    content: counter(step); position: absolute; left: 0; top: 0;
    width: 26px; height: 26px; border-radius: 50%; background: var(--gradient); color: #fff;
    font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}

/* 键盘按键样式 */
kbd {
    font-family: 'SFMono-Regular', Consolas, Monaco, monospace; font-size: 12px;
    background: var(--bg-soft); border: 1px solid var(--border); border-bottom-width: 2px;
    border-radius: 6px; padding: 2px 7px; color: var(--text); box-shadow: var(--shadow-sm);
}

/* 加载 / 错误 */
.docs-loading { color: var(--text-muted); padding: 40px 0; text-align: center; }
.docs-error { padding: 24px; background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; border-radius: 8px; }

/* 上下篇翻页 */
.docs-pager { display: flex; justify-content: space-between; gap: 16px; margin: 48px 0 24px; }
.docs-pager a {
    flex: 1; display: block; padding: 16px 20px; border: 1px solid var(--border); border-radius: 10px;
    transition: all .2s; background: var(--bg);
}
.docs-pager a:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.docs-pager .pl { text-align: left; }
.docs-pager .pr { text-align: right; }
.docs-pager .dir { font-size: 12px; color: var(--text-faint); }
.docs-pager .ttl { font-size: 15px; font-weight: 600; color: var(--text); margin-top: 2px; }
.docs-pager a:hover .ttl { color: var(--primary); }

/* 页脚 */
.docs-footer { border-top: 1px solid var(--border-light); padding-top: 20px; color: var(--text-faint); font-size: 13px; }
.docs-footer p { margin: 0 0 4px; }
.docs-footer a { color: inherit; text-decoration: none; }
.docs-footer a:hover { text-decoration: underline; }
.docs-footer-meta { font-size: 12px; }

/* 遮罩（移动端） */
.docs-mask { display: none; }

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
    .docs-main { padding: 28px 32px 56px; }
}
@media (max-width: 768px) {
    :root { --sidebar-w: 260px; }
    .docs-sidebar { transform: translateX(-100%); transition: transform .25s ease; z-index: 90; left: 0; }
    .docs-sidebar.open { transform: translateX(0); box-shadow: var(--shadow-md); }
    .docs-sidebar-toggle { display: inline-flex; }
    .docs-main { margin-left: 0; padding: 24px 20px 48px; }
    .docs-mask { display: none; position: fixed; inset: var(--header-h) 0 0 0; background: rgba(0,0,0,.35); z-index: 80; }
    .docs-mask.show { display: block; }
    .docs-content h1 { font-size: 26px; }
    .docs-content h2 { font-size: 20px; }
    .docs-pager { flex-direction: column; }
}
