/* =========================================================
   Paysphere · 全站样式 v4.0
   ========================================================= */

:root {
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --brand-light: #dbeafe;
    --accent: #7c3aed;
    --gradient: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --border: #e5e7eb;
    --border-light: #f1f5f9;
    --text: #1f2937;
    --text-strong: #0f172a;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #0284c7;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
    --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, .08);
    --shadow-lg: 0 10px 30px rgba(15, 23, 42, .1);
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --nav-h: 64px;
    --sidebar-w: 232px;
}

[data-theme="dark"] {
    --bg: #0b1220;
    --surface: #111827;
    --surface-2: #0f172a;
    --border: #1f2937;
    --border-light: #1f2937;
    --text: #e5e7eb;
    --text-strong: #f3f4f6;
    --text-muted: #9ca3af;
    --text-light: #6b7280;
    --brand-light: rgba(37, 99, 235, .18);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 1px 3px rgba(0, 0, 0, .4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, .5);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, .6);
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    transition: background-color .25s ease, color .25s ease;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 12px;
    font-weight: 700;
    color: var(--text-strong);
    line-height: 1.3;
}
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
h4 { font-size: 15px; }
p { margin: 0 0 10px; }

a {
    color: var(--brand);
    text-decoration: none;
    transition: color .15s ease;
}
a:hover { color: var(--brand-dark); }

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

code, pre {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
}
code {
    background: var(--surface-2);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12.5px;
    color: #1e3a8a;
    word-break: break-all;
}
[data-theme="dark"] code { color: #93c5fd; }
pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 16px 18px;
    border-radius: var(--radius);
    overflow-x: auto;
    font-size: 12.5px;
    line-height: 1.7;
    margin: 12px 0;
    border: 1px solid #1e293b;
}
pre code { background: none; padding: 0; color: inherit; }

/* ---- 容器 ---- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---- 顶部导航 ---- */
.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255,255,255,.88);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
    height: var(--nav-h);
}
[data-theme="dark"] .nav { background: rgba(15, 23, 42, .85); }
.nav .container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 16px;
    color: var(--text-strong);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-brand .logo-mark {
    width: 32px; height: 32px;
    background: var(--gradient);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 15px;
    box-shadow: 0 4px 10px rgba(37, 99, 235, .25);
    flex-shrink: 0;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav-links a {
    display: inline-block;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}
.nav-links a:hover { background: var(--surface-2); color: var(--brand); }
.nav-links a.active { background: var(--brand-light); color: var(--brand); }
.nav-toggle {
    display: none;
    width: 40px; height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    align-items: center; justify-content: center;
}

/* ---- 页脚 ---- */
.footer {
    margin-top: 60px;
    padding: 32px 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13px;
}
.footer .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}
.footer a { color: var(--text-muted); }
.footer a:hover { color: var(--brand); }

/* ---- 按钮 ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    transition: all .15s ease;
    user-select: none;
    white-space: nowrap;
}
.btn:hover { background: var(--border); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn.primary { background: var(--brand); color: #fff; box-shadow: 0 4px 10px rgba(37,99,235,.2); }
.btn.primary:hover { background: var(--brand-dark); }
.btn.gradient { background: var(--gradient); color: #fff; box-shadow: 0 4px 14px rgba(124,58,237,.25); }
.btn.gradient:hover { filter: brightness(1.05); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { background: #b91c1c; }
.btn.ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 5px 11px; font-size: 12.5px; border-radius: var(--radius-sm); }
.btn.block { width: 100%; }

/* ---- 卡片 ---- */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    margin-bottom: 20px;
}
.card h2, .card h3 { margin-top: 0; }

/* ---- 统计卡 ---- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}
.stat::after {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--gradient);
    border-radius: 4px;
}
.stat .stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.stat .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-strong);
    word-break: break-all;
}

/* ---- 表格 ---- */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    background: var(--surface);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}
.table th, .table td {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
.table th {
    background: var(--surface-2);
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--surface-2); }
.table .empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-light);
    font-size: 14px;
}

/* ---- 表单 ---- */
.form-group { margin-bottom: 18px; }
.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
}
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-hint { margin-top: 4px; font-size: 12.5px; color: var(--text-light); }
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="url"], select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
textarea {
    resize: vertical;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 12.5px;
    line-height: 1.6;
    min-height: 100px;
}
input::placeholder, textarea::placeholder { color: var(--text-light); }

/* ---- 提示条 ---- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 13.5px;
    line-height: 1.6;
    border: 1px solid transparent;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.alert.success { background: #ecfdf5; color: #065f46; border-color: #bbf7d0; }
.alert.error   { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert.warn    { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.alert.info    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
[data-theme="dark"] .alert.success { background: rgba(16,185,129,.12); color: #6ee7b7; }
[data-theme="dark"] .alert.error   { background: rgba(239,68,68,.12);  color: #fca5a5; }
[data-theme="dark"] .alert.warn    { background: rgba(245,158,11,.12); color: #fcd34d; }
[data-theme="dark"] .alert.info    { background: rgba(59,130,246,.12); color: #93c5fd; }

/* ---- 徽标 ---- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.6;
    white-space: nowrap;
}
.badge.success { background: #ecfdf5; color: #047857; }
.badge.warn    { background: #fffbeb; color: #b45309; }
.badge.danger  { background: #fef2f2; color: #b91c1c; }
.badge.info    { background: #eff6ff; color: #1d4ed8; }
.badge.muted   { background: #f3f4f6; color: #6b7280; }
[data-theme="dark"] .badge.success { background: rgba(16,185,129,.2); color: #6ee7b7; }
[data-theme="dark"] .badge.warn    { background: rgba(245,158,11,.2); color: #fcd34d; }
[data-theme="dark"] .badge.danger  { background: rgba(239,68,68,.2);  color: #fca5a5; }
[data-theme="dark"] .badge.info    { background: rgba(59,130,246,.2); color: #93c5fd; }
[data-theme="dark"] .badge.muted   { background: #1f2937; color: #9ca3af; }

/* ---- 认证页 ---- */
.auth-wrap {
    min-height: calc(100vh - var(--nav-h));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background:
        radial-gradient(circle at 10% 10%, rgba(37,99,235,.08), transparent 40%),
        radial-gradient(circle at 90% 90%, rgba(124,58,237,.08), transparent 40%),
        var(--bg);
}
.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 36px 34px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
}
.auth-header { text-align: center; margin-bottom: 26px; }
.auth-header .logo-mark {
    width: 52px; height: 52px;
    background: var(--gradient);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 14px;
    color: #fff; font-weight: 800; font-size: 22px;
    box-shadow: 0 8px 20px rgba(37,99,235,.25);
}
.auth-card h2 { margin: 0 0 6px; font-size: 22px; text-align: center; }
.auth-card .sub { color: var(--text-muted); font-size: 13.5px; margin: 0; text-align: center; }
.auth-footer { margin-top: 22px; text-align: center; font-size: 13px; color: var(--text-muted); }

/* ---- 后台布局 ---- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
    width: var(--sidebar-w);
    background: #0f172a;
    color: #cbd5e1;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 40;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px;
    border-bottom: 1px solid #1e293b;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}
.sidebar-brand .logo-mark {
    width: 32px; height: 32px;
    background: var(--gradient);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 14px;
    flex-shrink: 0;
}
.sidebar-nav { flex: 1; padding: 14px 10px; overflow-y: auto; }
.sidebar-nav .group {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #64748b;
    padding: 12px 12px 6px;
    font-weight: 600;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: #cbd5e1;
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 2px;
    transition: all .15s ease;
}
.sidebar-nav a:hover { background: #1e293b; color: #fff; }
.sidebar-nav a.active { background: var(--gradient); color: #fff; box-shadow: 0 4px 12px rgba(37,99,235,.25); }
.sidebar-nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid #1e293b;
    font-size: 12.5px;
    color: #94a3b8;
    flex-shrink: 0;
}
.sidebar-footer a { color: #cbd5e1; display: block; padding: 4px 0; }
.sidebar-footer a:hover { color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 30;
}
.main-header h1 { margin: 0; font-size: 18px; font-weight: 700; }
.header-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.main-content { flex: 1; padding: 26px 28px; min-width: 0; }
.user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 5px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
}
.user-chip .avatar {
    width: 26px; height: 26px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 12px;
}
.sidebar-toggle {
    display: none;
    width: 38px; height: 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    align-items: center; justify-content: center;
    flex-shrink: 0;
}
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .5);
    z-index: 35;
}
.overlay.show { display: block; }

/* ---- 首页 Hero ---- */
.hero {
    text-align: center;
    padding: 70px 0 40px;
    background:
        radial-gradient(circle at 20% 0%, rgba(37,99,235,.12), transparent 45%),
        radial-gradient(circle at 80% 100%, rgba(124,58,237,.12), transparent 45%);
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    background: var(--surface);
    border: 1px solid var(--brand-light);
    border-radius: 999px;
    font-size: 12.5px;
    color: var(--brand);
    font-weight: 500;
    margin-bottom: 18px;
}
.hero h1 {
    font-size: 42px;
    line-height: 1.2;
    margin-bottom: 16px;
    letter-spacing: -.03em;
}
.hero h1 .gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.hero .lead {
    max-width: 660px;
    margin: 0 auto;
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.75;
}
.hero .cta { display: flex; justify-content: center; gap: 12px; margin-top: 30px; flex-wrap: wrap; }

/* ---- Sections ---- */
.section { padding: 40px 0; }
.section-alt {
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.section-title { text-align: center; margin-bottom: 36px; }
.section-title h2 { font-size: 28px; margin-bottom: 8px; }
.section-title p { color: var(--text-muted); font-size: 15px; margin: 0; }

/* ---- Features ---- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.feature {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 26px 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    transition: transform .2s ease, box-shadow .2s ease;
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feature .feature-icon {
    width: 48px; height: 48px;
    background: linear-gradient(135deg, #dbeafe, #ede9fe);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    margin-bottom: 16px;
}
.feature h3 { font-size: 16px; margin-bottom: 8px; }
.feature p { color: var(--text-muted); font-size: 13.5px; line-height: 1.7; margin: 0; }

/* ---- Steps ---- */
.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    counter-reset: step;
    margin-top: 24px;
}
.step {
    position: relative;
    padding: 26px 22px 20px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
}
.step::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    top: -16px; left: 22px;
    width: 34px; height: 34px;
    line-height: 34px;
    text-align: center;
    border-radius: 50%;
    background: var(--gradient);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(37,99,235,.3);
}
.step h3 { font-size: 15px; margin: 10px 0 8px; }
.step p { color: var(--text-muted); font-size: 13px; line-height: 1.7; margin: 0; }

/* ---- 收银台 ---- */
.cashier-wrap {
    min-height: calc(100vh - var(--nav-h));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.cashier {
    width: 100%;
    max-width: 520px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 34px 30px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    text-align: center;
}
.cashier h2 { font-size: 20px; color: var(--text-muted); font-weight: 600; margin-bottom: 6px; }
.cashier .amount {
    font-size: 42px;
    font-weight: 800;
    color: #dc2626;
    margin: 10px 0;
    letter-spacing: -.03em;
}
.cashier .amount::before { content: '¥'; font-size: 24px; margin-right: 4px; color: #dc2626; font-weight: 700; }
.cashier .order-meta {
    background: var(--surface-2);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin: 20px 0 26px;
    text-align: left;
    border: 1px solid var(--border-light);
}
.cashier .order-meta .row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    color: var(--text);
    gap: 12px;
}
.cashier .order-meta .row .k { color: var(--text-muted); flex-shrink: 0; }
.cashier .order-meta .row .v { font-weight: 500; word-break: break-all; text-align: right; }
.channels { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.channel-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    font-size: 15px;
    font-family: inherit;
    font-weight: 500;
    color: var(--text);
    transition: all .15s ease;
}
.channel-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-light); transform: translateY(-1px); }
.channel-btn.alipay:hover { border-color: #1677ff; color: #1677ff; background: #eff6ff; }
.channel-btn.wechat:hover { border-color: #07c160; color: #07c160; background: #f0fdf4; }
.channel-btn .ico {
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px;
    font-size: 15px;
    background: var(--surface-2);
}

/* ---- 二维码 ---- */
.qr-wrap { text-align: center; padding: 20px; }
.qr-wrap h2 { font-size: 17px; margin-bottom: 12px; }
.qr-box {
    display: inline-block;
    padding: 16px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}
.qr-box img, .qr-box canvas { display: block; }
.qr-tip { margin-top: 16px; color: var(--text-muted); font-size: 13.5px; }

/* ---- 文档页 ---- */
.docs-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 32px;
    padding: 30px 0;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}
.docs-side {
    position: sticky;
    top: calc(var(--nav-h) + 20px);
    align-self: start;
    max-height: calc(100vh - var(--nav-h) - 40px);
    overflow-y: auto;
}
.docs-side h4 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-light);
    margin: 18px 0 8px;
    padding-left: 10px;
}
.docs-side ul { list-style: none; padding: 0; margin: 0; }
.docs-side li a {
    display: block;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 13.5px;
    border-left: 2px solid transparent;
}
.docs-side li a:hover { background: var(--surface-2); color: var(--brand); border-left-color: var(--brand); }
.docs-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 34px 38px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    min-width: 0;
    max-width: 100%;
}
.docs-content h1 { margin-top: 0; padding-bottom: 14px; border-bottom: 2px solid var(--border-light); }
.docs-content h2 {
    margin-top: 36px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
    font-size: 20px;
}
.docs-content h3 { margin-top: 24px; font-size: 16px; }
.docs-content ul, .docs-content ol { padding-left: 22px; }
.docs-content li { margin: 5px 0; color: var(--text); }
.docs-content .table { min-width: auto; }

/* ---- 工具类 ---- */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mt-0 { margin-top: 0 !important; } .mt-2 { margin-top: 12px !important; }
.mt-3 { margin-top: 20px !important; } .mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 12px !important; } .mb-3 { margin-bottom: 20px !important; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-sm { font-size: 12.5px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.break-all { word-break: break-all; }
.hidden { display: none !important; }

/* ---- 滚动条 ---- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #334155; }

/* ---- 主题切换 ---- */
.theme-toggle {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 15px;
    transition: all .2s;
    flex-shrink: 0;
}
.theme-toggle:hover { background: var(--brand-light); transform: rotate(15deg); }
.theme-icon { display: none; line-height: 1; }
[data-theme="light"] .theme-icon.sun  { display: inline; }
[data-theme="dark"]  .theme-icon.moon { display: inline; }

/* ---- 响应式 ---- */
@media (max-width: 992px) {
    .hero h1 { font-size: 34px; }
    .steps { grid-template-columns: 1fr; gap: 30px; }
    .sidebar {
        position: fixed;
        left: 0; top: 0; bottom: 0;
        transform: translateX(-100%);
        transition: transform .25s ease;
        width: 260px;
        z-index: 45;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-toggle { display: inline-flex; }
    .main-header { padding: 12px 20px; }
    .main-content { padding: 20px; }
    .docs-layout { grid-template-columns: 1fr; padding: 20px 16px; }
    .docs-side {
        position: static;
        max-height: none;
        padding: 16px;
        background: var(--surface);
        border-radius: var(--radius);
        border: 1px solid var(--border-light);
    }
    .docs-content { padding: 26px 22px; }
}

@media (max-width: 768px) {
    body { font-size: 13.5px; }
    h1 { font-size: 22px; }
    h2 { font-size: 19px; }

    .container { padding: 0 16px; }
    .nav-links { display: none; }
    .nav-links.mobile-open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: var(--nav-h);
        left: 0; right: 0;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        padding: 12px;
        gap: 4px;
        box-shadow: var(--shadow-md);
    }
    .nav-links.mobile-open a { display: block; padding: 12px 16px; border-radius: var(--radius-sm); }
    .nav-toggle { display: inline-flex; }

    .hero { padding: 50px 0 30px; }
    .hero h1 { font-size: 28px; }
    .hero .lead { font-size: 14.5px; }
    .hero .cta { flex-direction: column; align-items: stretch; }
    .hero .cta .btn { width: 100%; }

    .section { padding: 30px 0; }
    .section-title h2 { font-size: 22px; }
    .feature-grid { grid-template-columns: 1fr; gap: 14px; }

    .card { padding: 18px 18px; border-radius: var(--radius); }
    .stat { padding: 16px 18px; }
    .stat .stat-value { font-size: 20px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

    .auth-card { padding: 26px 22px; }

    .cashier { padding: 24px 20px; }
    .cashier .amount { font-size: 34px; }

    .main-header { padding: 10px 16px; flex-wrap: wrap; }
    .main-header h1 { font-size: 16px; }
    .main-content { padding: 16px; }

    .table { min-width: 560px; }
    .table th, .table td { padding: 10px 12px; font-size: 12.5px; }

    .form-row { grid-template-columns: 1fr; }
    .user-chip .name { display: none; }

    .footer { padding: 24px 0; margin-top: 40px; }
    .footer .container { flex-direction: column; text-align: center; }
}

@media (max-width: 576px) {
    .stat-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 24px; }
    .table { min-width: 520px; }
    .cashier .amount { font-size: 30px; }
}

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