/* 公开 API 文档页：自带样式，不依赖后台样式表 */

:root {
    --docs-bg: #0b1220;
    --docs-panel: #0f172a;
    --docs-panel-2: #131c2e;
    --docs-border: #1e2c44;
    --docs-text: #e6edf7;
    --docs-muted: #8b9bb4;
    --docs-primary: #38bdf8;
    --docs-primary-2: #6366f1;
    --docs-ok: #34d399;
    --docs-radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body.docs-body {
    margin: 0;
    background: var(--docs-bg);
    color: var(--docs-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.docs-body a { color: var(--docs-primary); text-decoration: none; }
.docs-body a:hover { text-decoration: underline; }
.docs-body code {
    background: #0a1322; border: 1px solid var(--docs-border);
    padding: 1px 6px; border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px; color: #a5d8ff;
}

.docs-layout { display: flex; min-height: 100vh; }

/* ---------- 左侧导航 ---------- */
.docs-sidebar {
    width: 250px; flex: 0 0 250px;
    background: var(--docs-panel);
    border-right: 1px solid var(--docs-border);
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.docs-brand { padding: 24px 22px; border-bottom: 1px solid var(--docs-border); }
.docs-brand .brand-name { font-size: 15px; font-weight: 600; letter-spacing: .01em; }
.docs-brand .brand-sub {
    margin-top: 4px; color: var(--docs-muted);
    font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
}
.docs-nav { padding: 18px 12px 48px; }
.docs-nav-group { margin-bottom: 22px; }
.docs-nav-title {
    padding: 0 10px 8px; color: var(--docs-muted);
    font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
}
.docs-nav-item {
    display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
    padding: 7px 10px; border-radius: 7px;
    color: #c3cfe2; font-size: 13px;
}
.docs-nav-item:hover { background: #121d31; color: #fff; text-decoration: none; }
.docs-nav-item.active { background: #14243c; color: #fff; font-weight: 500; }
.docs-nav-item .muted { color: var(--docs-muted); font-size: 11px; }

/* ---------- 右侧正文 ---------- */
.docs-main {
    flex: 1; min-width: 0;
    max-width: 1000px; padding: 34px 44px 90px;
}

.docs-header {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding-bottom: 18px; margin-bottom: 6px;
    border-bottom: 1px solid var(--docs-border);
}
.docs-header h1 { font-size: 24px; font-weight: 600; letter-spacing: -.01em; }
.docs-header .tag {
    display: inline-flex; align-items: center; height: 20px; padding: 0 8px;
    border: 1px solid #2a4a6f; border-radius: 999px;
    background: #10243b; color: var(--docs-primary); font-size: 11px; font-weight: 600;
}
.docs-header-links { margin-left: auto; display: flex; gap: 16px; font-size: 13px; }

.docs-section { padding: 28px 0; border-bottom: 1px solid var(--docs-border); }
.docs-section:last-of-type { border-bottom: 0; }
.docs-section h2 {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    font-size: 18px; font-weight: 600; margin-bottom: 14px;
}
.docs-section h2 .method {
    display: inline-flex; align-items: center; height: 20px; padding: 0 7px;
    border-radius: 5px; background: rgba(52, 211, 153, .14);
    border: 1px solid rgba(52, 211, 153, .32);
    color: var(--docs-ok); font-size: 10px; font-weight: 700; letter-spacing: .06em;
}
.docs-section h2 code { font-size: 13px; color: var(--docs-muted); background: none; border: 0; padding: 0; }
.docs-section h3 { font-size: 14px; font-weight: 600; margin: 20px 0 10px; color: #cbd8ea; }
.docs-section p { font-size: 13px; line-height: 1.85; margin-bottom: 10px; }
.docs-section .muted { color: var(--docs-muted); }
.docs-section .small { font-size: 12px; }

.code-block {
    margin: 0; padding: 14px 16px;
    background: #08111f; border: 1px solid var(--docs-border); border-radius: 10px;
    color: #cfe3ff; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px; line-height: 1.75; overflow-x: auto; white-space: pre;
}

.table-scroll { overflow-x: auto; }
.docs-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.docs-table th {
    text-align: left; padding: 9px 10px;
    border-bottom: 1px solid var(--docs-border);
    color: var(--docs-muted); font-size: 12px; font-weight: 500; white-space: nowrap;
}
.docs-table td {
    padding: 10px; border-bottom: 1px solid #16233a;
    vertical-align: top; line-height: 1.7;
}
.docs-table tr:last-child td { border-bottom: 0; }
.docs-table code { white-space: nowrap; }

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 24px; }
.kv > div { display: flex; gap: 10px; font-size: 13px; }
.kv dt { color: var(--docs-muted); flex: 0 0 auto; }
.kv dd { color: var(--docs-text); }

.docs-quality { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.docs-quality h3 { margin-top: 0; }
.docs-quality ol { margin: 0; padding-left: 20px; font-size: 13px; line-height: 2.05; }

.docs-footer {
    margin-top: 44px; padding-top: 18px;
    border-top: 1px solid var(--docs-border);
    color: var(--docs-muted); font-size: 12px;
}

/* ---------- 移动端 ---------- */
@media (max-width: 860px) {
    .docs-layout { flex-direction: column; }
    .docs-sidebar {
        width: 100%; flex: none; height: auto;
        position: static; border-right: 0; border-bottom: 1px solid var(--docs-border);
    }
    .docs-brand { padding: 16px 18px; }
    .docs-nav {
        display: flex; gap: 20px; padding: 10px 16px 14px;
        overflow-x: auto;
    }
    .docs-nav-group { margin-bottom: 0; flex: 0 0 auto; }
    .docs-nav-title { padding-left: 0; }
    .docs-nav-item { white-space: nowrap; padding: 6px 8px; }
    .docs-main { padding: 20px 18px 64px; }
    .docs-header h1 { font-size: 20px; }
    .docs-header-links { width: 100%; margin-left: 0; }
}
