/* ============================================================
   Nuxare 共享文档样式 · nuxare-docs.css
   适用于全部设计/规范类站点页，统一"黑底渐变绿"外观。
   与 _shared/js/nuxare-components.js (导航/页脚注入) 配套使用。
   需在前方引入 _shared/css/nuxare-fonts.css。
   ============================================================ */

/* ============ Design Tokens ============ */
:root {
    --bg: #060907;
    --bg2: #0B110E;
    --bg3: #101813;
    --ink: #E6F4EE;
    --muted: #8FA99D;
    --faint: #5F7A6D;
    --rule: rgba(12, 200, 163, 0.16);
    --rule-strong: rgba(12, 200, 163, 0.30);
    --accent: #0CC8A3;
    --accent2: #65D31E;
    --grad: linear-gradient(135deg, #0CC8A3 0%, #65D31E 100%);
    --grad-soft: linear-gradient(135deg, rgba(12,200,163,0.16), rgba(101,211,30,0.10));
    --danger: #F87171;
    --warning: #FBBF24;
    --success: #34D399;
    --radius: 10px;
    --font-head: 'BricolageGrotesque', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --font-body: 'InstrumentSans', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --font-mono: 'GeistMono', ui-monospace, Consolas, monospace;
}

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

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Ambient glow background */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(900px 480px at 15% -5%, rgba(12,200,163,0.10), transparent 60%),
        radial-gradient(800px 420px at 90% 10%, rgba(101,211,30,0.07), transparent 60%),
        radial-gradient(700px 500px at 50% 110%, rgba(12,200,163,0.05), transparent 60%);
    pointer-events: none;
}

.wrap {
    max-width: 1060px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============ Nav（由 nuxare-components.js 注入，仅站点顶部导航带 .site-header） ============ */
nav.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    background: rgba(6,9,7,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--rule);
}
nav.site-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--ink);
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 18px;
}
.nav-brand svg {
    width: 84px;
    height: 84px;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
    list-style: none;
}
.nav-links li {
    display: flex;
    align-items: center;
}
.nav-links a {
    display: flex;
    align-items: center;
    line-height: 1;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }
.nav-cta {
    display: inline-flex;
    align-items: center;
    padding: 8px 20px;
    background: var(--grad);
    color: #060907;
    font-weight: 700;
    font-size: 13px;
    border-radius: 6px;
    text-decoration: none;
    transition: opacity 0.2s;
}
.nav-cta:hover { opacity: 0.85; }

/* ============ Hamburger ============ */
.nav-hamburger {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 110;
}
.nav-hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.nav-hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.nav-hamburger.active span:nth-child(2) { opacity: 0; }
.nav-hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

/* ============ Mobile Overlay ============ */
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(6,9,7,0.98);
    z-index: 105;
    align-items: center;
    justify-content: center;
}
.nav-overlay.active { display: flex; }
.nav-overlay-content ul { list-style: none; text-align: center; padding: 0; margin: 0; }
.nav-overlay-content li { margin: 24px 0; }
.nav-overlay-content a {
    color: var(--ink);
    font-size: 22px;
    font-weight: 600;
    text-decoration: none;
    font-family: var(--font-head);
    transition: color 0.2s;
}
.nav-overlay-content a:hover { color: var(--accent); }
.nav-overlay-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--ink);
    cursor: pointer;
    z-index: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.nav-overlay-close:hover { opacity: 1; }

@media (max-width: 768px) {
    .nav-links, .nav-cta { display: none !important; }
    .nav-hamburger { display: flex; }
}

/* ============ Hero ============ */
.hero {
    padding: 140px 0 80px;
    text-align: center;
    position: relative;
}
.hero-logo {
    width: 84px;
    height: 84px;
    margin: 0 auto 22px;
    filter: drop-shadow(0 0 26px rgba(12,200,163,0.45));
    animation: floaty 5s ease-in-out infinite;
}
.hero-logo svg { width: 100%; height: 100%; display: block; }
@keyframes floaty {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 700;
    font-family: var(--font-head);
    margin-bottom: 18px;
}
.hero-kicker::before,
.hero-kicker::after {
    content: "";
    width: 34px;
    height: 1px;
    background: var(--grad);
}
.hero h1 {
    font-family: var(--font-head);
    font-size: clamp(34px, 5.2vw, 54px);
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.01em;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 16px;
}
.hero-sub {
    max-width: 640px;
    margin: 0 auto;
    color: var(--muted);
    font-size: 17px;
}
.hero-meta {
    margin-top: 26px;
    display: flex;
    justify-content: center;
    gap: 26px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--faint);
    font-family: var(--font-mono);
}
.hero-meta span b { color: var(--accent); font-weight: 700; }

/* ============ Section ============ */
section { padding: 52px 0 8px; }
.sec-head { margin-bottom: 30px; }
.sec-num {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--accent2);
    letter-spacing: 0.1em;
    font-weight: 700;
}
.sec-title {
    font-family: var(--font-head);
    font-size: clamp(24px, 3.4vw, 32px);
    font-weight: 700;
    margin-top: 6px;
    letter-spacing: -0.01em;
}
.sec-title::after {
    content: "";
    display: block;
    width: 56px;
    height: 3px;
    background: var(--grad);
    border-radius: 3px;
    margin-top: 14px;
}
.sec-desc {
    color: var(--muted);
    margin-top: 14px;
    max-width: 760px;
}
h2 { /* 独立 h2（无 .sec-title 时）回退 */
    font-family: var(--font-head);
    font-size: 22px;
    font-weight: 700;
    color: var(--ink);
    margin: 30px 0 12px;
}
h3 {
    font-family: var(--font-head);
    font-size: 19px;
    font-weight: 700;
    margin: 30px 0 12px;
    color: var(--ink);
}
h4 {
    font-size: 15px;
    font-weight: 700;
    margin: 20px 0 8px;
    color: var(--accent);
}
p { margin-bottom: 14px; color: #C9DED4; }
p.lead { font-size: 17px; color: var(--ink); }
strong { color: var(--ink); font-weight: 700; }
mark.key { background: none; color: var(--accent); font-weight: 700; }
code {
    font-family: var(--font-mono);
    font-size: 0.86em;
    background: var(--bg3);
    border: 1px solid var(--rule);
    border-radius: 5px;
    padding: 1px 6px;
    color: var(--accent2);
}
ul, ol { margin: 14px 0 18px 22px; color: #C9DED4; }
li { margin-bottom: 8px; line-height: 1.7; }

/* ============ Callout ============ */
.callout {
    border-left: 3px solid var(--accent);
    background: var(--grad-soft);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 16px 20px;
    margin: 20px 0;
    font-size: 15px;
}
.callout.warn { border-left-color: var(--warning); background: rgba(251,191,36,0.07); }
.callout.danger { border-left-color: var(--danger); background: rgba(248,113,113,0.07); }
.callout.important { border-left-color: var(--accent2); background: rgba(101,211,30,0.10); }
.callout b { color: var(--ink); display: block; margin-bottom: 4px; font-size: 15px; }
.callout p { margin: 0; color: #C9DED4; }

/* ============ Cards / grids ============ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 20px 0; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 20px 0; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 20px 0; }
.card {
    background: var(--bg2);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 20px;
}
.card h4 { margin-top: 0; }
.card p { font-size: 14px; color: var(--muted); margin-bottom: 0; }
.card .icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--grad-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 14px;
}

/* ============ Color swatches ============ */
.palette-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 22px 0; }
.swatch { background: var(--bg2); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.swatch-chip { height: 64px; }
.swatch-body { padding: 10px 12px; }
.swatch-name { font-size: 13px; font-weight: 700; color: var(--ink); }
.swatch-hex { font-family: var(--font-mono); font-size: 11px; color: var(--faint); margin-top: 2px; }
.swatch-usage { font-size: 11px; color: var(--muted); margin-top: 4px; }

.gradient-bar { height: 56px; border-radius: var(--radius); border: 1px solid var(--rule); margin: 18px 0; position: relative; }
.grad-main { background: linear-gradient(90deg, #0CC8A3 0%, #65D31E 100%); }
.grad-135 { background: linear-gradient(135deg, #0CC8A3 0%, #65D31E 100%); }
.grad-soft { background: linear-gradient(90deg, rgba(12,200,163,0.16), rgba(101,211,30,0.10)); }
.grad-label {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-mono);
    font-size: 11px;
    color: #04201a;
    font-weight: 700;
    background: rgba(255,255,255,0.85);
    padding: 2px 8px;
    border-radius: 4px;
}
.grad-label.light { color: #0A2E24; }

/* ============ Steps ============ */
.steps { counter-reset: step; margin: 20px 0; }
.step {
    position: relative;
    padding: 16px 18px 16px 58px;
    background: var(--bg2);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    margin-bottom: 12px;
}
.step::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 16px;
    top: 16px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--grad);
    color: #04201a;
    font-weight: 700;
    font-family: var(--font-head);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}
.step b { display: block; margin-bottom: 4px; font-size: 15px; }
.step p { font-size: 13.5px; color: var(--muted); margin: 0; }

/* ============ Tables ============ */
.table-wrap {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 600px;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    margin: 18px 0;
    background: var(--bg2);
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    min-width: 640px;
}
th {
    text-align: left;
    padding: 11px 14px;
    background: var(--bg3);
    color: var(--accent);
    font-weight: 700;
    font-size: 12.5px;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--rule-strong);
    position: sticky;
    top: 0;
    white-space: nowrap;
}
td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--rule);
    color: #C9DED4;
    vertical-align: top;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(12,200,163,0.04); }
td code { white-space: nowrap; }

/* ============ Tag / Badge ============ */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--grad-soft);
    border: 1px solid var(--rule);
    border-radius: 20px;
    font-size: 12.5px;
    color: var(--accent);
    transition: all 0.2s;
}
.tag:hover { border-color: var(--accent); background: rgba(12,200,163,0.12); }

/* ============ Metric Cards ============ */
.metric-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 20px 0; }
.metric-card { background: var(--bg2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px; text-align: center; }
.metric-card .value {
    font-family: var(--font-head);
    font-size: 30px;
    font-weight: 700;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
    margin-bottom: 6px;
}
.metric-card .label {
    font-size: 12px;
    color: var(--muted);
    font-family: var(--font-mono);
    letter-spacing: 0.04em;
}

/* ============ Code block ============ */
.code-block {
    background: var(--bg3);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 16px 18px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.75;
    overflow-x: auto;
    color: #C9DED4;
    margin: 16px 0;
}
.code-block .cm { color: var(--faint); }
.code-block .sel { color: var(--accent2); }
.code-block .prop { color: var(--accent); }

/* ============ Do/Don't ============ */
.dodont-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 20px 0; }
.dodont { background: var(--bg2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px; }
.dodont.do { border-top: 3px solid var(--success); }
.dodont.dont { border-top: 3px solid var(--danger); }
.dodont h4 { margin-top: 0; }
.dodont.do h4 { color: var(--success); }
.dodont.dont h4 { color: var(--danger); }
.dodont ul { margin: 10px 0 0 20px; font-size: 13.5px; }

/* ============ Chart / Figure 容器 ============ */
.fig {
    margin: 20px 0;
    padding: 18px;
    background: var(--bg2);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
}
.fig .fig-title {
    font-family: var(--font-head);
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 12px;
}
.chart {
    width: 100%;
    height: 300px;
    position: relative;
}
.chart.mermaid { height: auto; text-align: center; }

/* ============ Footer (由 nuxare-components.js 注入) ============ */
footer {
    margin-top: 70px;
    padding: 34px 0 60px;
    border-top: 1px solid var(--rule);
}
footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
footer p { font-size: 13px; color: var(--faint); margin: 0; }
footer .tag {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent);
    background: var(--grad-soft);
    border: 1px solid var(--rule);
    padding: 4px 10px;
    border-radius: 6px;
}
.footer-logo { height: 24px; width: auto; filter: drop-shadow(0 0 12px rgba(12,200,163,0.35)); }

/* ============ Responsive ============ */
@media (max-width: 820px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .metric-row { grid-template-columns: repeat(2, 1fr); }
    .palette-grid { grid-template-columns: repeat(2, 1fr); }
    .dodont-grid { grid-template-columns: 1fr; }
    .table-wrap { max-height: 500px; }
}
@media (max-width: 520px) {
    .palette-grid { grid-template-columns: 1fr 1fr; }
    .metric-row { grid-template-columns: 1fr 1fr; }
    .hero { padding: 48px 0 32px; }
    section { padding: 36px 0 4px; }
    .wrap { padding: 0 18px; }
}

/* ============ Print ============ */
@media print {
    body::before { display: none; }
    .hero-logo { break-inside: avoid; }
    section { break-inside: auto; }
}

/* ============ 链接 ============ */
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent2); }

/* ============ Doc 专属组件 ============ */
/* Badge */
.badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 99px;
    background: var(--grad-soft);
    color: var(--accent);
    border: 1px solid var(--rule);
    vertical-align: middle;
    line-height: 1.4;
}
.badge.new { background: var(--grad); color: #04201a; border-color: transparent; }
.badge.gray { background: rgba(120,140,132,0.14); color: var(--muted); border-color: transparent; }

/* Figure / diagram (mermaid) */
figure { margin: 1.4rem 0; text-align: center; }
figcaption {
    font-size: 12.5px;
    color: var(--faint);
    margin-top: 0.5rem;
    font-family: var(--font-mono);
}
.diagram {
    background: var(--bg2);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 1rem;
    overflow-x: auto;
}
.diagram pre,
.diagram .mermaid { background: none; border: none; margin: 0; }
pre.mermaid { background: transparent; border: none; padding: 0; text-align: left; margin: 0; }

/* 裸 pre 代码块（文档正文） */
pre {
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.75;
    background: var(--bg3);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 16px 18px;
    overflow-x: auto;
    color: #C9DED4;
    margin: 16px 0;
}
pre code { background: none; border: none; padding: 0; color: inherit; }
pre .c { color: var(--faint); font-style: italic; }
pre .k { color: var(--accent2); }

/* UI mock 卡片 */
.ui-card {
    background: var(--bg2);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 1.2rem;
}
.ui-card .ui-bar {
    background: var(--bg3);
    border: 1px solid var(--rule);
    border-radius: 8px;
    padding: 0.5rem 0.7rem;
    margin: 0.4rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.ui-modeseg { display: flex; gap: 0.5rem; align-items: center; }

/* 内联色块（span.swatch），与色板卡 div.swatch 区分 */
span.swatch {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: inline-block;
    vertical-align: middle;
    border: 1px solid rgba(255,255,255,0.10);
    flex-shrink: 0;
}
.sw { display: flex; align-items: center; gap: 0.55rem; }

/* Steps（源文档 flex .idx 形态兼容） */
.step .idx {
    flex: 0 0 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--grad);
    color: #04201a;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 正文 TOC 目录 */
/* .toc 是 <nav class="toc">，会误继承顶部导航的 nav { position:fixed }，需显式复位为普通流 */
.toc {
    position: static;
    top: auto;
    left: auto;
    right: auto;
    z-index: auto;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--bg2);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 1.4rem 1.8rem;
    margin: 24px 0 0;
}
.toc h2 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    margin-bottom: 0.9rem;
    font-family: var(--font-head);
}
.toc ol { list-style: none; counter-reset: toc; margin: 0; }
.toc li { counter-increment: toc; margin: 0.35rem 0; font-size: 0.95rem; }
.toc a {
    color: var(--ink);
    text-decoration: none;
    display: flex;
    gap: 0.7rem;
    align-items: baseline;
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
    transition: background 0.15s;
}
.toc a:hover { background: rgba(12,200,163,0.08); color: var(--accent); }
.toc a::before {
    content: counter(toc, decimal-leading-zero);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 700;
}

/* ============ 文档面包屑（子文档页顶部归入开发文档） ============ */
.doc-breadcrumb {
    margin: 0 0 30px;
    font-size: 13px;
    color: var(--faint);
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
}
.doc-breadcrumb a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}
.doc-breadcrumb a:hover { color: var(--accent2); }
.doc-breadcrumb .sep { margin: 0 8px; color: var(--faint); opacity: 0.7; }
.doc-breadcrumb .cur { color: var(--muted); }

/* ============ 文档索引卡片（开发文档目录页） ============ */
.doc-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin: 24px 0 40px;
}
.doc-card {
    display: flex;
    flex-direction: column;
    background: var(--bg2);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 22px 24px;
    text-decoration: none;
    transition: border-color 0.18s, transform 0.18s, background 0.18s;
}
.doc-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    background: var(--bg3);
}
.doc-card .doc-tag {
    align-self: flex-start;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    color: var(--accent2);
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 12px;
}
.doc-card .doc-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--grad-soft);
    border: 1px solid var(--rule);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 14px;
}
.doc-card h3 {
    font-family: var(--font-head);
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 8px;
    letter-spacing: -0.01em;
}
.doc-card p {
    font-size: 14px;
    color: var(--muted);
    margin: 0 0 16px;
    line-height: 1.65;
}
.doc-card .doc-go {
    margin-top: auto;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.doc-card .doc-go::after {
    content: "→";
    transition: transform 0.18s;
}
.doc-card:hover .doc-go::after { transform: translateX(4px); }
@media (max-width: 700px) {
    .doc-grid { grid-template-columns: 1fr; }
}

/* 来源 / 依据列表 */
.doc-sources { margin: 34px 0 10px; }
.doc-sources h2 {
    font-size: 1rem;
    margin-bottom: 0.8rem;
    color: var(--ink);
    font-family: var(--font-head);
}
.doc-sources ol { padding-left: 1.2rem; font-size: 0.85rem; color: var(--muted); }
.doc-sources li { margin-bottom: 0.5rem; overflow-wrap: break-word; word-break: break-all; }
.doc-sources .src-title { color: var(--ink); word-break: normal; }
.doc-sources .src-url {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.8rem;
    color: var(--accent);
    word-break: break-all;
}
sup a { color: var(--accent); text-decoration: none; font-size: 0.72em; font-weight: 700; }
table.phase td:first-child,
table.progress td:first-child {
    font-family: var(--font-mono);
    color: var(--accent);
    font-weight: 700;
    white-space: nowrap;
}

/* 输入（readonly UI mock） */
input[readonly] { font-family: var(--font-mono); font-size: 0.78rem; border: 1px solid var(--rule); border-radius: 6px; padding: 0.28rem 0.5rem; background: var(--bg3); color: var(--ink); }

/* ============================================================
   文档双栏布局（侧栏 + 正文）
   .docs-layout 由各文档页包裹正文，<aside id="docs-side"> 由 JS 注入
   ============================================================ */
.docs-layout {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 84px 24px 60px;
    align-items: start;
}
.docs-main { min-width: 0; }
.docs-main > .wrap { max-width: none; padding: 0; }

.docs-side {
    position: sticky;
    top: 76px;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    padding-right: 8px;
    font-size: 14px;
}
.docs-side::-webkit-scrollbar { width: 6px; }
.docs-side::-webkit-scrollbar-thumb { background: var(--rule-strong); border-radius: 6px; }
.sd-head { margin-bottom: 14px; }
.sd-home {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: 0.04em;
}
.sd-home:hover { color: var(--accent2); }
.sd-group { margin-bottom: 22px; }
.sd-title {
    font-family: var(--font-head);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--faint);
    margin-bottom: 8px;
    padding-left: 10px;
}
.docs-side ul { list-style: none; margin: 0; padding: 0; }
.docs-side li { margin: 0; }
.docs-side a {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 7px;
    color: var(--muted);
    text-decoration: none;
    line-height: 1.4;
    border-left: 2px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.docs-side a span { flex: 1; }
.docs-side a:hover { color: var(--ink); background: rgba(12,200,163,0.07); }
.docs-side a.active {
    color: var(--accent);
    background: rgba(12,200,163,0.12);
    border-left-color: var(--accent);
    font-weight: 600;
}
.sd-tag {
    font-style: normal;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--faint);
    background: rgba(120,140,132,0.14);
    padding: 1px 6px;
    border-radius: 99px;
    white-space: nowrap;
}

/* 移动端侧栏开关 */
.docs-side-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    background: var(--bg2);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 10px 14px;
    color: var(--ink);
    font-family: var(--font-head);
    font-size: 14px;
    cursor: pointer;
    margin: 84px auto 0;
    max-width: 1200px;
    width: calc(100% - 48px);
}
.docs-side-toggle::before { content: "☰"; color: var(--accent); }

@media (max-width: 960px) {
    .docs-layout { grid-template-columns: 1fr; padding-top: 24px; }
    .docs-side {
        position: fixed;
        top: 60px; left: 0; bottom: 0;
        width: 280px;
        max-height: none;
        background: var(--bg2);
        border-right: 1px solid var(--rule);
        padding: 20px 16px;
        transform: translateX(-100%);
        transition: transform 0.25s;
        z-index: 90;
    }
    .docs-layout.side-open .docs-side { transform: translateX(0); }
    .docs-side-toggle { display: inline-flex; }
}

/* 模块参考表 / 目录树等通用增强 */
.tree-block {
    background: var(--bg3);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 16px 18px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.7;
    color: #C9DED4;
    overflow-x: auto;
    white-space: pre;
}
.tree-block .d { color: var(--faint); }
.tree-block .f { color: var(--accent); }
.tree-block .c { color: var(--accent2); }
.mod-table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14px; }
.mod-table th, .mod-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.mod-table th { color: var(--faint); font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; }
.mod-table td code { font-family: var(--font-mono); font-size: 12.5px; color: var(--accent); }
.mod-table tr:hover td { background: rgba(12,200,163,0.05); }
.kv-row { display: grid; grid-template-columns: 170px 1fr; gap: 8px 16px; padding: 7px 0; border-bottom: 1px solid var(--rule); font-size: 14px; }
.kv-row:last-child { border-bottom: none; }
.kv-row .k { color: var(--faint); font-family: var(--font-mono); font-size: 12.5px; }
.kv-row .v { color: var(--ink); }
.kv-row .v code { font-family: var(--font-mono); color: var(--accent); font-size: 12.5px; }
@media (max-width: 600px) { .kv-row { grid-template-columns: 1fr; gap: 2px; } }

/* 小节副标题 */
.sub-h {
    font-family: var(--font-head);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
    margin: 28px 0 6px;
    padding-left: 12px;
    border-left: 3px solid var(--accent);
    letter-spacing: -0.01em;
}
section .card .badge { margin-bottom: 8px; }
section .card h4 { margin-top: 0; font-family: var(--font-head); font-size: 15px; }
section .card p { font-size: 14px; color: var(--muted); margin: 0; }