:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-darker: #1e3a8a;
    --primary-light: #dbeafe;
    --primary-lighter: #eff6ff;
    --accent: #0ea5e9;
    --accent-light: #7dd3fc;
    --ink: #0f172a;
    --ink-2: #1e293b;
    --ink-3: #334155;
    --muted: #64748b;
    --muted-2: #94a3b8;
    --line: #e2e8f0;
    --line-2: #f1f5f9;
    --bg: #f8fafc;
    --bg-2: #f1f5f9;
    --card: #ffffff;
    --ok: #16a34a;
    --ok-bg: #f0fdf4;
    --ok-border: #bbf7d0;
    --warn-bg: #fefce8;
    --warn-border: #fde047;
    --warn-ink: #854d0e;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;
    --info-bg: #eff6ff;
    --info-border: #bfdbfe;
    --info-ink: #1e40af;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .04);
    --shadow: 0 4px 6px -1px rgba(15, 23, 42, .07), 0 2px 4px -2px rgba(15, 23, 42, .06);
    --shadow-md: 0 10px 15px -3px rgba(15, 23, 42, .08), 0 4px 6px -4px rgba(15, 23, 42, .06);
    --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, .12), 0 8px 10px -6px rgba(15, 23, 42, .08);
    --shadow-xl: 0 25px 50px -12px rgba(15, 23, 42, .25);
    --shadow-glow: 0 0 0 4px rgba(37, 99, 235, .12);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    --mono: "SFMono-Regular", "Cascadia Code", Consolas, "Liberation Mono", Menlo, "Courier New", monospace;
    --container: 1200px;
    --header-h: 64px;
    --ease: cubic-bezier(.4, 0, .2, 1);
    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --dur: .22s;
}

*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.65;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img, svg, video { max-width: 100%; display: block; }
img { height: auto; }

html, body { overflow-x: hidden; overflow-x: clip; }

a { color: var(--primary); text-decoration: none; transition: color var(--dur) var(--ease); }
a:hover { text-decoration: underline; color: var(--primary-dark); }

button { font-family: inherit; }

::selection { background: var(--primary-light); color: var(--primary-dark); }

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

h1, h2, h3, h4, h5 {
    line-height: 1.3;
    color: var(--ink);
    font-weight: 700;
    letter-spacing: -.01em;
}
h1 { font-size: clamp(1.85rem, 1.4rem + 1.6vw, 2.6rem); margin: 0 0 16px; }
h2 { font-size: clamp(1.4rem, 1.15rem + 1vw, 1.85rem); margin: 0 0 20px; }
h3 { font-size: 1.18rem; margin: 24px 0 10px; }
h4 { font-size: 1rem; margin: 16px 0 8px; }
p { margin: 0 0 12px; }
ul, ol { padding-left: 22px; margin: 0 0 12px; }
li { margin-bottom: 6px; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, .85);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line);
    transition: box-shadow var(--dur) var(--ease);
}
.site-header.scrolled { box-shadow: var(--shadow-sm); }

.nav-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
    gap: 16px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
    flex-shrink: 0;
}
.logo svg { transition: transform var(--dur) var(--ease); }
.logo:hover { text-decoration: none; color: var(--primary-dark); }
.logo:hover svg { transform: rotate(-8deg) scale(1.05); }

.site-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.site-nav a {
    color: var(--ink-3);
    font-size: .94rem;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
    white-space: nowrap;
}
.site-nav a:hover {
    color: var(--primary);
    text-decoration: none;
    background: var(--primary-lighter);
}
.site-nav a.active { color: var(--primary); background: var(--primary-light); }

.nav-logout { display: inline; margin: 0; }
.nav-link-btn {
    background: none;
    border: none;
    padding: 8px 14px;
    font: inherit;
    font-size: .94rem;
    font-weight: 500;
    color: var(--ink-3);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--dur) var(--ease);
}
.nav-link-btn:hover { color: var(--danger); background: var(--danger-bg); }

.nav-burger {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    padding: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
    -webkit-tap-highlight-color: transparent;
    flex: none;
}
.nav-burger:hover { background: var(--primary-lighter); border-color: var(--primary-light); }
.nav-burger.open { border-color: var(--primary); box-shadow: var(--shadow-glow); }
.nav-burger span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--ink-2);
    border-radius: 2px;
    transition: transform .3s var(--ease), opacity .2s var(--ease), background var(--dur) var(--ease);
}
.nav-burger.open span { background: var(--primary); }

main { flex: 1 0 auto; }

.hero {
    background:
        radial-gradient(circle at 80% 20%, rgba(56, 189, 248, .28), transparent 45%),
        radial-gradient(circle at 15% 85%, rgba(37, 99, 235, .35), transparent 40%),
        linear-gradient(135deg, #0b1120 0%, #172554 45%, #1e40af 80%, #2563eb 100%);
    color: #e2e8f0;
    padding: clamp(56px, 8vw, 96px) 0 clamp(64px, 9vw, 104px);
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(148, 163, 184, .07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, .07) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse 90% 80% at 50% 40%, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 40%, #000 30%, transparent 75%);
    pointer-events: none;
}
.hero::after {
    content: "";
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(56, 189, 248, .25), transparent 70%);
    top: -200px;
    right: -100px;
    pointer-events: none;
    animation: floaty 14s ease-in-out infinite;
}
@keyframes floaty {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-30px, 30px); }
}
.hero .container { position: relative; z-index: 1; }

.hero-grid {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 48px;
    align-items: center;
}
.hero h1 {
    color: #fff;
    font-size: clamp(2rem, 1.5rem + 2.4vw, 3rem);
    letter-spacing: -.02em;
    margin-bottom: 18px;
}
.hero h1 em {
    font-style: normal;
    background: linear-gradient(90deg, #7dd3fc, #38bdf8 60%, #818cf8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero .subtitle {
    font-size: clamp(1rem, .95rem + .25vw, 1.1rem);
    color: #cbd5e1;
    max-width: 560px;
    margin-bottom: 24px;
}
.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0 28px;
}
.hero-badges span {
    font-size: .82rem;
    padding: 6px 14px;
    border: 1px solid rgba(148, 163, 184, .35);
    border-radius: 999px;
    color: #cbd5e1;
    backdrop-filter: blur(6px);
    transition: all var(--dur) var(--ease);
    background: rgba(15, 23, 42, .2);
}
.hero-badges span:hover {
    border-color: var(--accent-light);
    color: #e0f2fe;
    transform: translateY(-2px);
}
.hero-ctas {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}
.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 8px;
    padding-top: 24px;
    border-top: 1px solid rgba(148, 163, 184, .22);
}
.hero-stats .hs b {
    display: block;
    font-size: clamp(1.15rem, 1rem + .4vw, 1.5rem);
    font-weight: 800;
    color: #fff;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}
.hero-stats .hs span { font-size: .8rem; color: #94a3b8; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 26px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: .98rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
    text-decoration: none;
    line-height: 1.2;
    white-space: nowrap;
    user-select: none;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 6px 18px rgba(37, 99, 235, .35);
}
.btn-primary:hover { background: var(--primary-dark); color: #fff; box-shadow: 0 10px 24px rgba(37, 99, 235, .45); }
.btn-ghost {
    background: rgba(255, 255, 255, .04);
    color: #fff;
    border: 1px solid rgba(226, 232, 240, .55);
    backdrop-filter: blur(4px);
}
.btn-ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; border-color: #fff; }
.btn-outline {
    background: #fff;
    color: var(--primary);
    border: 1px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-lighter); }
.btn-block { display: flex; width: 100%; }
.btn-lg { padding: 14px 32px; font-size: 1.05rem; }
.btn-sm {
    padding: 8px 14px;
    font-size: .85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink-3);
    cursor: pointer;
    font-weight: 500;
    transition: all var(--dur) var(--ease);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-sm:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-lighter); }
.btn-sm.danger:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-bg); }
.btn[disabled], .btn.disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.demo-panel {
    background: rgba(255, 255, 255, .98);
    color: var(--ink);
    border-radius: var(--radius-xl);
    box-shadow: 0 30px 60px -15px rgba(2, 6, 23, .55), 0 0 0 1px rgba(255, 255, 255, .08);
    padding: 24px;
    backdrop-filter: blur(8px);
}
.demo-tabs {
    display: flex;
    gap: 6px;
    background: var(--bg-2);
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 18px;
}
.demo-tab {
    flex: 1;
    padding: 10px 8px;
    text-align: center;
    font-size: .9rem;
    font-weight: 600;
    color: var(--muted);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--dur) var(--ease);
    font-family: inherit;
}
.demo-tab:hover { color: var(--primary); }
.demo-tab.active {
    color: var(--primary);
    background: #fff;
    box-shadow: var(--shadow-sm);
}
.demo-stage { min-height: 160px; display: flex; flex-direction: column; justify-content: center; }
.demo-pane { display: none; }
.demo-pane.active { display: block; animation: fadeIn var(--dur) var(--ease); }
.demo-tip {
    font-size: .82rem;
    color: var(--muted);
    margin: 14px 0 0;
    text-align: center;
    line-height: 1.5;
}
.demo-token {
    margin-top: 12px;
    padding: 10px 12px;
    background: var(--ok-bg);
    border: 1px solid var(--ok-border);
    border-radius: var(--radius-sm);
    font-family: var(--mono);
    font-size: .8rem;
    color: var(--ok);
    word-break: break-all;
    display: none;
    line-height: 1.5;
}
.demo-token.err {
    background: var(--danger-bg);
    border-color: var(--danger-border);
    color: var(--danger);
    font-family: inherit;
}
.demo-quota { display: block; margin-top: 4px; font-weight: 600; color: var(--ink); }
.demo-gate { align-items: center; text-align: center; }
.demo-gate-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: clamp(18px, 4vw, 30px) clamp(12px, 3vw, 20px);
    animation: fadeIn var(--dur) var(--ease);
}
.demo-gate-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    color: var(--primary);
    background: var(--bg-2);
    box-shadow: inset 0 0 0 1px var(--border, #e2e8f0);
}
.demo-gate-inner h3 { margin: 0; font-size: 1.05rem; color: var(--ink); }
.demo-gate-inner p {
    margin: 0;
    font-size: .86rem;
    color: var(--muted);
    line-height: 1.6;
    max-width: 320px;
}
.demo-gate-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 6px;
}
@media (max-width: 480px) {
    .demo-gate-actions { flex-direction: column; width: 100%; }
    .demo-gate-actions .btn { width: 100%; }
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2.5px solid var(--primary-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.demo-loading { text-align: center; color: var(--muted); font-size: .9rem; padding: 30px 0; }

.section { padding: clamp(56px, 8vw, 88px) 0; }
.section-alt { background: #fff; }
.section-head {
    text-align: center;
    max-width: 680px;
    margin: 0 auto 48px;
}
.section-head p { color: var(--muted); font-size: 1.02rem; }
.section-head .eyebrow {
    display: inline-block;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--primary);
    background: var(--primary-light);
    border-radius: 999px;
    padding: 5px 16px;
    margin-bottom: 16px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
.card-grid.three { grid-template-columns: repeat(3, 1fr); }
.card {
    position: relative;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
    overflow: hidden;
}
.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity var(--dur) var(--ease);
}
.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: #bfdbfe;
}
.card:hover::before { opacity: 1; }
.card .icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: var(--primary-light);
    color: var(--primary);
    margin-bottom: 16px;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.card:hover .icon {
    background: var(--primary);
    color: #fff;
    transform: scale(1.05) rotate(-4deg);
}
.card h3 { margin: 0 0 8px; font-size: 1.1rem; }
.card p { color: var(--muted); font-size: .93rem; margin: 0; line-height: 1.6; }

.stats-band {
    background:
        radial-gradient(circle at 85% 15%, rgba(125, 211, 252, .2), transparent 50%),
        linear-gradient(120deg, #172554, #1d4ed8 60%, #2563eb);
    color: #fff;
    padding: clamp(48px, 6vw, 64px) 0;
    position: relative;
    overflow: hidden;
}
.stats-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    text-align: center;
}
.stat { padding: 12px 8px; }
.stat .num {
    font-size: clamp(2rem, 1.6rem + 1.6vw, 2.8rem);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    background: linear-gradient(180deg, #fff, #bfdbfe);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.stat .num small { font-size: 1.3rem; font-weight: 700; color: var(--accent-light); background: none; -webkit-text-fill-color: var(--accent-light); }
.stat .label { color: #bfdbfe; font-size: .94rem; margin-top: 6px; }

.cta-band {
    background:
        radial-gradient(circle at 50% 120%, rgba(56, 189, 248, .25), transparent 55%),
        linear-gradient(135deg, #0b1120, #172554 70%, #1e40af);
    color: #fff;
    text-align: center;
    padding: clamp(56px, 8vw, 80px) 0;
    position: relative;
    overflow: hidden;
}
.cta-band::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(148, 163, 184, .06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, .06) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse 60% 70% at 50% 100%, #000, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 100%, #000, transparent 70%);
    pointer-events: none;
}
.cta-band .container { position: relative; z-index: 1; }
.cta-band h2 { color: #fff; font-size: clamp(1.6rem, 1.3rem + 1.4vw, 2.1rem); margin-bottom: 14px; }
.cta-band p { color: #cbd5e1; max-width: 580px; margin: 0 auto 28px; font-size: 1rem; }

.flow-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    counter-reset: step;
}
.flow-step {
    position: relative;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 36px 26px 26px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.flow-step:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.flow-step::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    top: -18px;
    left: 26px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-weight: 800;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px rgba(37, 99, 235, .4);
}
.flow-step h3 { margin-top: 10px; font-size: 1.1rem; }
.flow-step p { color: var(--muted); font-size: .93rem; }

.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
}
.reveal.visible { opacity: 1; transform: none; }

pre {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: var(--radius);
    padding: 18px 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-family: var(--mono);
    font-size: .84rem;
    line-height: 1.7;
    margin: 14px 0 18px;
    border: 1px solid #1e293b;
    white-space: pre;
    word-wrap: normal;
    tab-size: 4;
    max-width: 100%;
    scrollbar-width: thin;
    scrollbar-color: #475569 transparent;
}
pre::-webkit-scrollbar { height: 8px; width: 8px; }
pre::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
pre::-webkit-scrollbar-track { background: transparent; }
pre code { font-family: inherit; background: none; color: inherit; padding: 0; font-size: inherit; border: none; }

.code-block {
    margin: 16px 0 20px;
    border-radius: var(--radius);
    overflow: hidden;
    background: #0f172a;
    border: 1px solid #1e293b;
    box-shadow: var(--shadow-sm);
}
.code-block pre {
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 16px 20px 18px;
}
.code-block-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 10px 7px 16px;
    background: #16203a;
    border-bottom: 1px solid #1e293b;
}
.code-dots { display: inline-flex; gap: 6px; flex: none; }
.code-dots i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: block;
}
.code-dots i:nth-child(1) { background: #f87171; }
.code-dots i:nth-child(2) { background: #fbbf24; }
.code-dots i:nth-child(3) { background: #34d399; }
.code-lang {
    flex: 1;
    min-width: 0;
    font-family: var(--mono);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: 1.2px;
    color: #7d8aa5;
    text-transform: uppercase;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.copy-btn {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: color var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.copy-btn:hover { color: #e2e8f0; background: rgba(148, 163, 184, .14); border-color: #334155; }
.copy-btn.copied { color: #34d399; background: rgba(52, 211, 153, .12); border-color: rgba(52, 211, 153, .4); }
.copy-btn.copy-failed { color: #f87171; background: rgba(248, 113, 113, .12); border-color: rgba(248, 113, 113, .4); }
code {
    font-family: var(--mono);
    font-size: .88em;
    background: var(--primary-lighter);
    color: var(--primary-darker);
    padding: 2px 6px;
    border-radius: 5px;
    border: 1px solid var(--primary-light);
}

.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); border: 1px solid var(--line); }
table.tbl {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: .92rem;
    min-width: 480px;
}
table.tbl th, table.tbl td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}
table.tbl th {
    background: var(--bg-2);
    font-weight: 600;
    white-space: nowrap;
    color: var(--ink-2);
    position: sticky;
    top: 0;
}
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tr:hover td { background: var(--bg); }
table.tbl td code { font-size: .85em; }

.docpage { background: #fff; flex: 1 0 auto; }
.docpage-grid {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    align-items: start;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
    gap: 32px;
}

.docside { position: relative; }
.docside-inner {
    position: sticky;
    top: var(--header-h);
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    padding: 24px 0 32px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
.docside-inner::-webkit-scrollbar { width: 6px; }
.docside-inner::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.docside-inner::-webkit-scrollbar-track { background: transparent; }
.docside-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    min-height: 66px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
    margin-bottom: 28px;
}
.docside-title svg { color: var(--muted); }

.dt-group { padding: 2px 0; }
.dt-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    font-size: .9rem;
    font-weight: 600;
    color: var(--ink-2);
    cursor: pointer;
    user-select: none;
    border-radius: var(--radius-sm);
    transition: all var(--dur) var(--ease);
}
.dt-label:hover { color: var(--primary); background: var(--primary-lighter); }
.dt-label .dt-arrow {
    width: 7px;
    height: 7px;
    border-right: 1.6px solid var(--muted-2);
    border-bottom: 1.6px solid var(--muted-2);
    transform: rotate(-45deg);
    transition: transform var(--dur) var(--ease);
    flex: none;
    margin-right: 4px;
}
.dt-group.open .dt-label .dt-arrow { transform: rotate(45deg); }
.dt-items { display: none; padding: 2px 0 6px; }
.dt-group.open .dt-items { display: block; }
.dt-items a {
    display: block;
    padding: 7px 12px 7px 26px;
    font-size: .87rem;
    color: var(--muted);
    border-left: 3px solid transparent;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    transition: all var(--dur) var(--ease);
    margin-left: 4px;
}
.dt-items a:hover { color: var(--primary); text-decoration: none; background: var(--primary-lighter); }
.dt-items a.active {
    color: var(--primary);
    background: var(--primary-light);
    border-left-color: var(--primary);
    font-weight: 600;
}
.dt-link {
    display: block;
    padding: 9px 12px;
    font-size: .9rem;
    font-weight: 600;
    color: var(--ink-2);
    border-radius: var(--radius-sm);
}
.dt-link:hover { color: var(--primary); text-decoration: none; background: var(--primary-lighter); }

.docmain { min-width: 0; padding: 24px 0 80px; }
.docmain-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    margin-bottom: 28px;
    position: static;
}
.doc-crumb { font-size: .86rem; color: var(--muted); }
.doc-crumb a { color: var(--primary); }
.doc-crumb i { font-style: normal; margin: 0 6px; color: #cbd5e1; }
.doc-crumb b { color: var(--ink-2); font-weight: 600; }
.doc-search { display: flex; width: 280px; max-width: 100%; }
.doc-search input {
    flex: 1;
    min-width: 0;
    padding: 9px 14px;
    border: 1px solid var(--line);
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    font-size: .9rem;
    font-family: inherit;
    background: var(--bg);
    transition: all var(--dur) var(--ease);
}
.doc-search input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: var(--shadow-glow);
}
.doc-search button {
    flex: none;
    width: 44px;
    border: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--dur) var(--ease);
}
.doc-search button:hover { background: var(--primary-dark); }

.docs-content section { margin-bottom: 48px; scroll-margin-top: 120px; }
.docs-content h1 { margin-bottom: 20px; font-size: clamp(1.6rem, 1.3rem + 1vw, 2rem); }
.docs-content h2 {
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-light);
    font-size: 1.35rem;
    margin: 32px 0 16px;
}
.docs-content h3 { font-size: 1.05rem; margin: 20px 0 10px; color: var(--ink-2); }
.docs-content p { color: var(--ink-3); line-height: 1.75; }
.docs-content ul, .docs-content ol { padding-left: 22px; }
.docs-content li { margin-bottom: 6px; color: var(--ink-3); }
.note {
    background: var(--primary-lighter);
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 12px 16px;
    font-size: .9rem;
    margin: 16px 0;
    color: var(--ink-2);
}
.note-warn { background: var(--warn-bg); border-left-color: #eab308; color: var(--warn-ink); }

.api-endpoint {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin: 14px 0 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-xs);
    font-family: var(--mono);
    font-size: .85rem;
    min-width: 0;
}
.method-badge {
    flex: none;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .5px;
    line-height: 1.5;
    font-family: var(--mono);
}
.method-get { background: #e8f7ee; color: #18a058; border: 1px solid #b7e5c6; }
.method-post { background: #fdf3e2; color: #d9820b; border: 1px solid #f5d9a8; }
.api-url {
    flex: 1;
    min-width: 0;
    color: var(--ink-2);
    word-break: break-all;
    line-height: 1.5;
}
.api-url b { color: var(--ink); font-weight: 600; }

.h-anchor {
    opacity: 0;
    margin-left: 8px;
    font-size: .85em;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    transition: opacity var(--dur) var(--ease);
    vertical-align: middle;
}
h2:hover .h-anchor, h3:hover .h-anchor, .h-anchor:focus { opacity: 1; text-decoration: none; }

.doc-badge {
    display: inline-block;
    vertical-align: middle;
    margin-left: 8px;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--primary-lighter);
    border: 1px solid var(--primary-light);
    color: var(--primary-dark);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .5px;
}

.faq-code {
    display: inline-block;
    vertical-align: middle;
    margin-left: 8px;
    padding: 2px 9px;
    border-radius: 6px;
    background: #fdf3e2;
    border: 1px solid #f5d9a8;
    color: #d9820b;
    font-family: var(--mono);
    font-size: .78rem;
    font-weight: 700;
}
.faq-code.err { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }

.faq-item {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 24px 26px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    scroll-margin-top: 120px;
    transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.faq-item:hover { box-shadow: var(--shadow); border-color: #bfdbfe; }
.faq-item h3 {
    margin: 0 0 16px;
    color: var(--primary-dark);
    font-size: 1.08rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
}
.faq-item h3::before {
    content: "";
    flex: none;
    width: 4px;
    height: 18px;
    border-radius: 2px;
    background: var(--primary);
    margin-right: 10px;
}
.faq-item h4 {
    font-size: .92rem;
    margin: 16px 0 8px;
    color: var(--ink);
    font-weight: 700;
}
.faq-item h4::before { content: "▸ "; color: var(--primary); }
.faq-item ul { margin: 0 0 8px; padding-left: 20px; }
.faq-item li { font-size: .92rem; color: var(--ink-3); margin-bottom: 5px; line-height: 1.65; }
.faq-item p { font-size: .92rem; color: var(--ink-3); }
.faq-item pre { font-size: .8rem; }
.faq-empty {
    display: none;
    text-align: center;
    color: var(--muted);
    padding: 48px 0;
    font-size: 1rem;
    background: var(--bg);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    margin-bottom: 20px;
}
.faq-empty a { color: var(--primary); font-weight: 600; }

.auth-wrap {
    max-width: 460px;
    margin: clamp(32px, 6vw, 64px) auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    padding: clamp(28px, 4vw, 40px) clamp(24px, 4vw, 38px);
    box-shadow: var(--shadow-lg);
}
.auth-wrap h1 { font-size: 1.6rem; text-align: center; margin-bottom: 6px; }
.auth-sub { text-align: center; color: var(--muted); font-size: .92rem; margin-bottom: 28px; }
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-size: .9rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--ink-2);
}
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: .95rem;
    font-family: inherit;
    background: #fff;
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
    color: var(--ink);
}
.form-group input::placeholder { color: var(--muted-2); }
.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}
.form-hint { font-size: .82rem; color: var(--muted); margin-top: 6px; line-height: 1.5; overflow-wrap: break-word; }
.form-check {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: .88rem;
    color: var(--ink-2);
    line-height: 1.5;
}
.form-check input { margin-top: 3px; flex: none; }

.alert {
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: .9rem;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.55;
    border: 1px solid transparent;
}
.alert::before {
    content: "";
    flex: none;
    width: 4px;
    align-self: stretch;
    border-radius: 2px;
    background: currentColor;
    opacity: .8;
}
.alert-error { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }
.alert-ok { background: var(--ok-bg); border-color: var(--ok-border); color: var(--ok); }
.alert-info { background: var(--info-bg); border-color: var(--info-border); color: var(--info-ink); }
.alert-warn { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-ink); }

.captcha-box { margin: 18px 0 6px; }

.register-guide {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px dashed var(--line);
    text-align: center;
}
.register-guide p { color: var(--ink-2); font-size: .92rem; }

.modal-mask {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(4px);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-mask.open { display: flex; animation: fadeIn var(--dur) var(--ease); }
.modal {
    background: #fff;
    border-radius: var(--radius-lg);
    max-width: 440px;
    width: 100%;
    padding: 30px 28px;
    box-shadow: var(--shadow-xl);
    animation: modalIn .25s var(--ease-out);
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(16px) scale(.96); }
    to { opacity: 1; transform: none; }
}
.modal h3 { margin: 0 0 12px; font-size: 1.2rem; }
.modal p { color: var(--ink-2); font-size: .92rem; line-height: 1.65; }
.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 22px;
    flex-wrap: wrap;
}

.dash-page { padding-top: 32px; padding-bottom: 56px; }
.dash-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin: 20px 0 0;
}
.dash-card .form-hint.spaced { margin-bottom: 10px; }
.dash-card .form-hint.label { margin: 14px 0 12px; }
.cred-form { display: inline; }
.dash-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.dash-actions .form-hint { margin: 0; flex: 1 1 auto; min-width: 200px; }
.dash-actions form { flex: none; }
.dash-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 26px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--dur) var(--ease);
    min-width: 0;
}
.dash-card:hover { box-shadow: var(--shadow); }
.dash-card.full { grid-column: 1 / -1; }
.dash-card h2 { font-size: 1.15rem; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.kv {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed var(--line);
    font-size: .94rem;
    gap: 12px;
}
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; color: var(--ink); text-align: right; word-break: break-all; }
.cred-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.cred-value {
    flex: 1;
    min-width: 200px;
    font-family: var(--mono);
    font-size: .8rem;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    word-break: break-all;
    color: var(--ink-2);
    line-height: 1.5;
}
.cred-secure {
    margin-top: 18px;
    padding: 14px 16px;
    background: var(--info-bg);
    border: 1px solid var(--info-border);
    border-radius: var(--radius-sm);
}
.cred-secure-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .88rem;
    font-weight: 700;
    color: var(--info-ink);
    margin-bottom: 8px;
}
.cred-secure ul { margin: 0; padding-left: 20px; }
.cred-secure li { font-size: .82rem; color: var(--ink-3); line-height: 1.65; margin-bottom: 4px; }
.cred-secure li:last-child { margin-bottom: 0; }

.pref-label {
    font-size: .95rem;
    font-weight: 700;
    color: var(--ink-2);
    margin: 14px 0 10px;
}
.mode-pref {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 4px;
}
.pref-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px 12px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    cursor: pointer;
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
    -webkit-tap-highlight-color: transparent;
}
.pref-card:hover { border-color: #93c5fd; transform: translateY(-2px); box-shadow: var(--shadow); }
.pref-card:focus-within { box-shadow: var(--shadow-glow); }
.pref-card input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.pref-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid var(--muted-2);
    background: #fff;
    color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--dur) var(--ease);
}
.pref-card.checked .pref-check {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, .4);
}
.pref-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--primary-lighter);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}
.pref-icon svg { width: 22px; height: 22px; }
.pref-name { display: block; font-size: .92rem; font-weight: 600; color: var(--ink); line-height: 1.4; }
.pref-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: .76rem;
    color: var(--muted);
    line-height: 1.5;
    margin-top: 4px;
}
.mode-status { font-size: .85rem; font-weight: 600; }
.mode-status.ok { color: var(--ok); }
.mode-status.err { color: var(--danger); }

.site-footer {
    background: #0b1120;
    color: #94a3b8;
    padding: 56px 0 24px;
    margin-top: auto;
    flex: none;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: 36px;
    padding-bottom: 32px;
    border-bottom: 1px solid #1e293b;
}
.footer-brand p { color: #94a3b8; font-size: .92rem; margin: 12px 0 0; line-height: 1.6; }
.footer-logo { color: #fff; font-size: 1.05rem; margin-bottom: 4px; }
.footer-col h4 { color: #e2e8f0; font-size: .95rem; margin: 0 0 14px; }
.footer-col a {
    display: block;
    color: #94a3b8;
    font-size: .88rem;
    padding: 5px 0;
    transition: color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.footer-col a:hover { color: #fff; text-decoration: none; transform: translateX(3px); }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 22px;
    font-size: .82rem;
}
.footer-nodes {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-light);
}
.footer-nodes b { color: #e0f2fe; font-weight: 600; margin-left: 2px; }

.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: var(--ink);
    color: #fff;
    padding: 12px 22px;
    border-radius: var(--radius);
    font-size: .9rem;
    z-index: 300;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { background: var(--ok); }
.toast.err { background: var(--danger); }

.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--primary);
    color: #fff;
    padding: 10px 16px;
    z-index: 200;
    border-radius: 0 0 var(--radius-sm) 0;
    text-decoration: none;
    font-size: .9rem;
}
.skip-link:focus { top: 0; color: #fff; }

#backToTop {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    z-index: 90;
    transition: background var(--dur) var(--ease), transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
    opacity: 0;
}
#backToTop.show { display: flex; opacity: .92; }
#backToTop:hover { background: var(--primary-dark); transform: translateY(-3px); opacity: 1; }
#backToTop:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.doc-toc-btn {
    display: none;
    position: fixed;
    right: 20px;
    bottom: 76px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    z-index: 95;
    transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
    -webkit-tap-highlight-color: transparent;
}
.doc-toc-btn:hover { background: var(--primary-dark); transform: translateY(-3px); }

.doc-mask {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .5);
    backdrop-filter: blur(2px);
    z-index: 240;
    opacity: 0;
    transition: opacity .25s var(--ease);
}
.doc-mask.open { opacity: 1; }

.doc-drawer-close {
    display: none;
    width: 32px;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--ink-2);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all var(--dur) var(--ease);
    -webkit-tap-highlight-color: transparent;
}
.doc-drawer-close:hover { color: var(--danger); border-color: var(--danger-border); background: var(--danger-bg); }

@media (max-width: 1024px) {
    :root { --header-h: 60px; }
    .hero-grid { grid-template-columns: 1fr; gap: 36px; }
    .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 24px; }
    .card-grid { grid-template-columns: repeat(2, 1fr); }
    .card-grid.three { grid-template-columns: repeat(2, 1fr); }
    .docpage-grid { grid-template-columns: 220px minmax(0, 1fr); gap: 24px; padding: 0 20px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); row-gap: 36px; }
    .dash-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
}

@media (max-width: 900px) {
    .nav-burger { display: flex; }
    .nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-burger.open span:nth-child(2) { opacity: 0; }
    .nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
    .site-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        flex-wrap: nowrap;
        background: #fff;
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow-lg);
        padding: 10px 12px 14px;
        max-height: calc(100vh - var(--header-h) - 8px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        opacity: 0;
        transform: translateY(-10px);
        visibility: hidden;
        pointer-events: none;
        transition: opacity .22s var(--ease), transform .22s var(--ease), visibility 0s linear .22s;
    }
    .site-nav.open {
        opacity: 1;
        transform: none;
        visibility: visible;
        pointer-events: auto;
        transition: opacity .22s var(--ease), transform .22s var(--ease);
    }
    .site-nav a { padding: 12px 14px; border-radius: var(--radius-sm); }
    .site-nav a:hover { background: var(--primary-lighter); }
    .nav-logout { display: block; padding: 0; }
    .nav-link-btn {
        display: block;
        width: 100%;
        text-align: left;
        padding: 12px 14px;
        border-radius: var(--radius-sm);
    }
}

@media (max-width: 768px) {
    .container { padding: 0 18px; }
    .docpage-grid { padding: 0 18px; }

    .hero { padding: 48px 0 56px; }
    .hero-ctas .btn { flex: 1 1 auto; }
    .section { padding: 56px 0; }
    .card-grid, .card-grid.three, .stats-grid, .flow-steps { grid-template-columns: 1fr; }
    .docpage-grid { grid-template-columns: 1fr; gap: 0; padding: 0 18px; }
    .doc-toc-btn { display: flex; right: 14px; bottom: 66px; width: 40px; height: 40px; }
    .doc-mask { display: block; visibility: hidden; pointer-events: none; }
    .doc-mask.open { visibility: visible; pointer-events: auto; }
    .doc-drawer-close { display: inline-flex; }
    .docside {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(320px, 86vw);
        background: #fff;
        box-shadow: var(--shadow-xl);
        transform: translateX(105%);
        transition: transform .28s var(--ease);
        z-index: 250;
        margin: 0;
        border: none;
        visibility: hidden;
    }
    .docside.drawer-open { transform: none; visibility: visible; }
    .docside-inner {
        position: static;
        max-height: none;
        height: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 8px 14px 24px;
    }
    .docside-title { padding: 12px 8px; margin-bottom: 4px; min-height: 0; }
    .docside-title > svg { display: none; }
    .docmain { padding: 16px 0 56px; }
    .docmain-top {
        position: static;
        padding: 12px 0;
        margin-bottom: 20px;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    .doc-search { width: 100%; }
    .docs-content section { scroll-margin-top: 24px; }
    .docs-content h2 { font-size: 1.2rem; }
    .faq-item { padding: 20px 18px; }
    .auth-wrap { margin: 24px 14px; padding: 26px 20px; }
    .dash-page { padding-top: 20px; padding-bottom: 40px; }
    .dash-card { padding: 20px 16px; }
    .cred-row { flex-direction: column; align-items: stretch; }
    .cred-row .btn-sm { width: 100%; justify-content: center; }
    .cred-row .cred-form { width: 100%; }
    .cred-value { min-width: 0; font-size: .78rem; }
    .mode-pref { grid-template-columns: 1fr; gap: 10px; }
    .pref-card { padding: 14px 14px 12px; }
    .pref-icon { width: 40px; height: 40px; margin-bottom: 8px; border-radius: 12px; }
    .pref-desc { font-size: .76rem; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; padding-bottom: 24px; }
    .footer-bottom { justify-content: center; text-align: center; }
    #backToTop { right: 14px; bottom: 14px; width: 40px; height: 40px; }
}

@media (max-width: 480px) {
    .container { padding: 0 14px; }
    .docpage-grid { padding: 0 14px; }
    .hero-stats { grid-template-columns: 1fr 1fr; gap: 16px; }
    .hero-badges span { font-size: .76rem; padding: 5px 10px; }
    .footer-grid { grid-template-columns: 1fr; }
    .demo-panel { padding: 18px; }
    .demo-tab { font-size: .82rem; padding: 9px 4px; }
    .kv { flex-direction: column; align-items: flex-start; gap: 4px; }
    .kv .v { text-align: left; }
    .cred-row { flex-direction: column; align-items: stretch; }
    .cred-row .btn-sm { width: 100%; justify-content: center; }
    .modal { padding: 24px 20px; }
    .modal-actions { flex-direction: column-reverse; }
    .modal-actions .btn, .modal-actions .btn-sm { width: 100%; }
    .dash-card { padding: 20px 16px; }
    .flow-step { padding: 30px 20px 22px; }
    .flow-step::before { width: 34px; height: 34px; font-size: .98rem; }
    pre { padding: 14px 16px; font-size: .78rem; }
    table.tbl { font-size: .86rem; }
    table.tbl th, table.tbl td { padding: 10px 12px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (hover: none) {
    .card:hover, .flow-step:hover, .faq-item:hover, .dash-card:hover { transform: none; }
    .logo:hover svg { transform: none; }
}

@media print {
    .site-header, .site-footer, .docside, #backToTop, .toast, .skip-link,
    .hero-ctas, .cta-band, .demo-panel, .nav-burger, .doc-search, .copy-btn,
    .doc-toc-btn, .doc-mask, .mode-pref, .cred-row .btn-sm, .dash-actions form { display: none !important; }
    body { background: #fff; color: #000; font-size: 11pt; line-height: 1.5; }
    .container, .docpage-grid { max-width: 100% !important; padding: 0 !important; margin: 0 !important; }
    .docpage-grid, .dash-grid { display: block !important; }
    .card, .dash-card, .faq-item, .flow-step { box-shadow: none !important; border: 1px solid #ccc !important; break-inside: avoid; page-break-inside: avoid; }
    .hero, .stats-band { background: #fff !important; color: #000 !important; padding: 16px 0 !important; }
    .hero h1, .hero .subtitle, .stats-grid .num, .stats-grid .label, .section-head h2 { color: #000 !important; }
    .hero h1 em, .stat .num, .stat .num small { color: #000 !important; -webkit-text-fill-color: #000 !important; background: none !important; }
    .hero-stats, .stats-grid { border-color: #ccc !important; }
    .hero-badges span { border-color: #ccc !important; color: #000 !important; background: none !important; }
    a { color: #000 !important; text-decoration: underline; }
    a[href]:after { content: " (" attr(href) ")"; font-size: .8em; color: #555; }
    a[href^="#"]:after, a[href^="javascript"]:after { content: ""; }
    pre { background: #f5f5f5 !important; color: #000 !important; border: 1px solid #ccc !important; white-space: pre-wrap; word-wrap: break-word; }
    .code-block { background: #fff !important; border: 1px solid #ccc !important; box-shadow: none !important; }
    .code-block-head { background: #eee !important; border-bottom: 1px solid #ccc !important; }
    .code-lang { color: #333 !important; }
    .code-dots i { background: #999 !important; }
    .docs-content h2 { page-break-after: avoid; }
    .reveal { opacity: 1 !important; transform: none !important; }
}

@media (min-width: 1440px) {
    :root { --container: 1240px; }
    .hero .container { max-width: 1280px; }
}
