/* ==========================================================================
   共识Token · Design System
   A restrained enterprise console: precise spacing, quiet borders, one accent.
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;

  --brand:        #3556F0;
  --brand-strong: #2440D4;
  --brand-soft:   #EEF1FE;
  --brand-ring:   rgba(53, 86, 240, .28);
  --accent:       #00A98F;
  --accent-soft:  #E6F7F3;

  --bg:           #F6F7FA;
  --bg-elevated:  #FFFFFF;
  --surface:      #FFFFFF;
  --surface-2:    #FAFBFD;
  --surface-3:    #F1F3F8;
  --border:       #E4E7EF;
  --border-strong:#D2D7E4;

  --text:         #0E1524;
  --text-dim:     #4E586E;
  --text-mute:    #8590A6;
  --text-invert:  #FFFFFF;

  --ok:           #12805C;
  --ok-soft:      #E4F5EE;
  --warn:         #9A6200;
  --warn-soft:    #FDF3E0;
  --danger:       #C0322B;
  --danger-soft:  #FDECEA;

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --shadow-1: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .04);
  --shadow-2: 0 4px 10px -2px rgba(16, 24, 40, .07), 0 12px 28px -8px rgba(16, 24, 40, .10);
  --shadow-3: 0 18px 48px -12px rgba(16, 24, 40, .22);

  --nav-h: 62px;
  --sidebar-w: 236px;
  --page-max: 1200px;
  --ease: cubic-bezier(.32, .72, 0, 1);
}

[data-theme="dark"] {
  --brand:        #6E86FF;
  --brand-strong: #8A9DFF;
  --brand-soft:   #171C33;
  --brand-ring:   rgba(110, 134, 255, .34);
  --accent:       #2FD3B4;
  --accent-soft:  #0E2A28;

  --bg:           #0A0E19;
  --bg-elevated:  #10151F;
  --surface:      #111725;
  --surface-2:    #151B2B;
  --surface-3:    #1B2233;
  --border:       #232C40;
  --border-strong:#313D56;

  --text:         #E9ECF4;
  --text-dim:     #A2ACC2;
  --text-mute:    #6E7A93;
  --text-invert:  #0A0E19;

  --ok:           #35D0A0;
  --ok-soft:      #0E2A23;
  --warn:         #E0A83C;
  --warn-soft:    #2C2312;
  --danger:       #F0736B;
  --danger-soft:  #2E1614;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 6px 18px -4px rgba(0, 0, 0, .5);
  --shadow-3: 0 22px 54px -14px rgba(0, 0, 0, .7);
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5 { margin: 0; font-weight: 640; letter-spacing: -.018em; line-height: 1.24; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
code, pre, kbd { font-family: var(--font-mono); }
::selection { background: var(--brand-ring); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.noscript { padding: 48px; text-align: center; color: var(--text-dim); }

.app-root { min-height: 100%; display: flex; flex-direction: column; }

/* ---------- 3. Layout helpers ---------- */
.wrap { width: 100%; max-width: var(--page-max); margin: 0 auto; padding: 0 28px; }
.stack   { display: flex; flex-direction: column; }
.row     { display: flex; align-items: center; }
.between { display: flex; align-items: center; justify-content: space-between; }
.gap-4  { gap: 4px; }  .gap-6  { gap: 6px; }  .gap-8  { gap: 8px; }
.gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; }
.gap-24 { gap: 24px; } .gap-32 { gap: 32px; }
.grow { flex: 1 1 auto; min-width: 0; }
.center { align-items: center; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; } .mt-48 { margin-top: 48px; } .mt-64 { margin-top: 64px; }
.hidden { display: none !important; }
.mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dim { color: var(--text-dim); }
.mute { color: var(--text-mute); }
.small { font-size: 12.5px; }
.center-text { text-align: center; }
.right { text-align: right; }

/* ---------- 4. Typography ---------- */
.display {
  font-size: clamp(30px, 3.5vw, 50px);
  line-height: 1.08;
  letter-spacing: -.032em;
  font-weight: 680;
  text-wrap: balance;
}
.h1 { font-size: 30px; letter-spacing: -.028em; }
.h2 { font-size: 21px; letter-spacing: -.02em; }
.h3 { font-size: 16px; letter-spacing: -.012em; }
.lede { font-size: 16.5px; line-height: 1.62; color: var(--text-dim); }
.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: .13em;
  text-transform: uppercase; color: var(--brand);
}
.section-head { max-width: 660px; }
.section-head p { margin-top: 12px; }

/* ---------- 5. Buttons ---------- */
.btn {
  --btn-h: 38px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--btn-h); padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px; font-weight: 560; letter-spacing: -.008em;
  cursor: pointer; white-space: nowrap;
  transition: background .16s var(--ease), border-color .16s var(--ease),
              box-shadow .16s var(--ease), transform .1s var(--ease), color .16s var(--ease);
}
.btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-loading { opacity: .55; pointer-events: none; }
.btn-primary {
  background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .12);
}
.btn-primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-danger { color: var(--danger); border-color: var(--border-strong); background: var(--surface); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-sm { --btn-h: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { --btn-h: 46px; padding: 0 22px; font-size: 15px; border-radius: var(--radius); }
.btn-block { width: 100%; }
.btn-icon { --btn-h: 32px; width: 32px; padding: 0; }
.btn .spin {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 6. Forms ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.label { font-size: 13px; font-weight: 560; color: var(--text-dim); }
.label .req { color: var(--danger); margin-left: 3px; }
.hint { font-size: 12.5px; color: var(--text-mute); line-height: 1.5; }
.input, .select, .textarea {
  width: 100%; min-height: 38px; padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease), background .16s var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--text-mute); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3.5px var(--brand-ring);
}
.textarea { min-height: 88px; resize: vertical; font-family: var(--font-mono); font-size: 13px; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238590A6' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 34px;
}
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1 1 auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.check { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; font-size: 13.5px; }
.check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.field-error { font-size: 12.5px; color: var(--danger); }
.input.is-invalid { border-color: var(--danger); }

/* ---------- 7. Cards / surfaces ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}
.card-pad { padding: 22px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.card-head h3 { font-size: 15px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.panel-title { font-size: 15px; font-weight: 620; letter-spacing: -.012em; }
.divider { height: 1px; background: var(--border); border: 0; margin: 0; }

/* ---------- 8. Badges / chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px;
  border-radius: 999px;
  font-size: 12px; font-weight: 580; letter-spacing: -.004em;
  background: var(--surface-3); color: var(--text-dim); border: 1px solid transparent;
}
.badge-ok     { background: var(--ok-soft);     color: var(--ok); }
.badge-warn   { background: var(--warn-soft);   color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-brand  { background: var(--brand-soft);  color: var(--brand); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 13px; color: var(--text-dim);
}
.kbd {
  display: inline-block; padding: 1px 6px; border-radius: 5px;
  border: 1px solid var(--border-strong); border-bottom-width: 2px;
  background: var(--surface-2); font-size: 11.5px; font-family: var(--font-mono);
}

/* ---------- 9. Tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
table.data th {
  padding: 10px 16px; text-align: left; white-space: nowrap;
  font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-mute); background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
table.data td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: var(--surface-2); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.actions { text-align: right; white-space: nowrap; }
.empty-state { padding: 56px 24px; text-align: center; color: var(--text-mute); }
.empty-state .icon { margin: 0 auto 14px; width: 40px; height: 40px; color: var(--border-strong); }

/* ---------- 10. Stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.dash-split { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.stat {
  padding: 18px 20px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-1);
}
.stat .k { font-size: 12.5px; color: var(--text-mute); font-weight: 540; display: flex; align-items: center; gap: 6px; }
.stat .v {
  margin-top: 10px; font-size: 26px; font-weight: 650; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.stat .v small { font-size: 14px; font-weight: 560; color: var(--text-mute); margin-left: 4px; letter-spacing: 0; }
.stat .sub { margin-top: 7px; font-size: 12.5px; color: var(--text-mute); }

/* ---------- 11. Landing ---------- */
.nav {
  position: sticky; top: 0; z-index: 60; height: var(--nav-h);
  backdrop-filter: saturate(180%) blur(14px);
  background: color-mix(in srgb, var(--bg-elevated) 82%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav-inner { height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 7px 12px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 540; color: var(--text-dim);
  transition: background .16s var(--ease), color .16s var(--ease);
}
.nav-links a:hover, .nav-links a.active { background: var(--surface-3); color: var(--text); }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; flex: none; }
.brand-name { font-size: 15.5px; font-weight: 660; letter-spacing: -.022em; }
.brand-name b { color: var(--brand); font-weight: 660; }

.hero {
  position: relative; overflow: hidden; color: #EAF0FF;
  background:
    radial-gradient(1100px 520px at 78% -10%, rgba(79, 107, 255, .40), transparent 62%),
    radial-gradient(820px 480px at 8% 6%, rgba(0, 201, 167, .20), transparent 58%),
    linear-gradient(168deg, #0B1120 0%, #0C1424 46%, #0A1A2B 100%);
}
.hero::before {
  content: ""; position: absolute; inset: 0; opacity: .5;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(760px 420px at 62% 12%, #000 20%, transparent 78%);
}
.hero-inner { position: relative; padding: 86px 0 92px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 52px; align-items: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 13px;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .06); color: #C7D3F5; font-size: 12.5px; font-weight: 540;
}
.hero h1 { margin-top: 20px; }
.hero .lede { color: #A9B6D6; margin-top: 20px; max-width: 560px; font-size: 16.5px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-cta .btn-primary { box-shadow: 0 10px 30px -10px rgba(53, 86, 240, .8); }
.hero-cta .btn-outline {
  background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .22); color: #EAF0FF;
}
.hero-cta .btn-outline:hover { background: rgba(255, 255, 255, .11); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 40px; padding-top: 26px; border-top: 1px solid rgba(255, 255, 255, .10); }
.hero-meta .m .v { font-size: 19px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hero-meta .m .k { font-size: 12.5px; color: #8E9CBE; margin-top: 2px; }

.term {
  border-radius: var(--radius-lg); overflow: hidden;
  background: #080D18; border: 1px solid rgba(255, 255, 255, .10);
  box-shadow: 0 30px 70px -22px rgba(0, 0, 0, .8);
}
.term-bar {
  display: flex; align-items: center; gap: 8px; padding: 11px 14px;
  background: rgba(255, 255, 255, .04); border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.term-bar .lights { display: flex; gap: 6px; }
.term-bar .lights i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .16); }
.term-bar .title { font-size: 12px; color: #7C8AA8; font-family: var(--font-mono); margin-left: 6px; }
.term-body { padding: 18px; font-family: var(--font-mono); font-size: 12.6px; line-height: 1.85; color: #C3CFE8; overflow-x: auto; }
.term-body .c { color: #5C6A88; }
.term-body .p { color: #4FD8B4; }
.term-body .k { color: #8FA6FF; }
.term-body .s { color: #E4C07A; }
.term-tabs { display: flex; gap: 4px; padding: 10px 12px 0; background: rgba(255, 255, 255, .02); }
.term-tabs button {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  padding: 7px 12px; border-radius: 8px 8px 0 0; color: #8B99B8; font-size: 12.5px; font-weight: 540;
}
.term-tabs button.on { background: #080D18; color: #EAF0FF; }

.section { padding: 84px 0; }
.section.tint { background: var(--bg-elevated); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.feature { padding: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.feature .ic {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); margin-bottom: 16px;
}
.feature h3 { font-size: 15px; }
.feature p { margin-top: 9px; color: var(--text-dim); font-size: 13.5px; line-height: 1.62; }
.product {
  padding: 28px; border-radius: var(--radius-lg); border: 1px solid var(--border);
  background: var(--surface); box-shadow: var(--shadow-1); position: relative; overflow: hidden;
}
.product::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}
.product .tag { font-family: var(--font-mono); font-size: 12px; color: var(--text-mute); }
.product h3 { font-size: 19px; margin-top: 10px; }
.product ul { margin: 18px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 11px; }
.product li { display: flex; gap: 10px; font-size: 13.5px; color: var(--text-dim); }
.product li svg { flex: none; margin-top: 4px; color: var(--accent); }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; counter-reset: s; }
.step { counter-increment: s; }
.step .n {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); font-size: 13px; font-weight: 640; margin-bottom: 14px;
}
.step .n::before { content: counter(s); }
.step h4 { font-size: 14.5px; }
.step p { margin-top: 8px; color: var(--text-dim); font-size: 13.5px; }
.code-block {
  position: relative; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface-2); overflow: hidden;
}
.code-block pre { margin: 0; padding: 16px; overflow-x: auto; font-size: 12.6px; line-height: 1.75; }
.code-block .copy {
  position: absolute; top: 9px; right: 9px; opacity: 0; transition: opacity .16s var(--ease);
}
.code-block:hover .copy { opacity: 1; }
.faq { border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  padding: 18px 0; cursor: pointer; font-size: 14.5px; font-weight: 560; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--text-mute); font-size: 18px; font-weight: 400; }
.faq details[open] summary::after { content: "−"; }
.faq .a { padding: 0 0 20px; color: var(--text-dim); font-size: 13.8px; max-width: 780px; line-height: 1.7; }
.footer { padding: 44px 0 56px; border-top: 1px solid var(--border); color: var(--text-mute); font-size: 13px; }
.footer-grid { display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; }

/* ---------- 12. Auth ---------- */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.auth-aside {
  position: relative; overflow: hidden; padding: 56px 60px; color: #EAF0FF;
  background:
    radial-gradient(760px 420px at 88% 4%, rgba(79, 107, 255, .38), transparent 60%),
    radial-gradient(600px 380px at 4% 92%, rgba(0, 201, 167, .20), transparent 60%),
    linear-gradient(160deg, #0B1120, #0B1A2B);
  display: flex; flex-direction: column; justify-content: space-between;
}
.auth-aside .quote { font-size: 24px; line-height: 1.45; letter-spacing: -.02em; font-weight: 600; max-width: 460px; }
.auth-aside .who { margin-top: 22px; color: #93A1C2; font-size: 13.5px; }
.auth-aside .ticks { display: flex; flex-direction: column; gap: 14px; margin-top: 36px; }
.auth-aside .ticks div { display: flex; gap: 11px; align-items: center; color: #B9C5E2; font-size: 13.5px; }
.auth-main { display: grid; place-items: center; padding: 48px 28px; background: var(--bg); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 25px; letter-spacing: -.028em; }
.auth-card .sub { margin-top: 10px; color: var(--text-dim); font-size: 14px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; margin-top: 30px; }
.auth-sep { display: flex; align-items: center; gap: 14px; color: var(--text-mute); font-size: 12.5px; margin: 4px 0; }
.auth-sep::before, .auth-sep::after { content: ""; height: 1px; background: var(--border); flex: 1; }
.auth-foot { margin-top: 26px; text-align: center; font-size: 13.5px; color: var(--text-dim); }
.auth-foot a { color: var(--brand); font-weight: 560; }
.alert {
  display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm);
  font-size: 13px; line-height: 1.55; border: 1px solid transparent;
}
.alert-danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 26%, transparent); }
.alert-ok     { background: var(--ok-soft);     color: var(--ok);     border-color: color-mix(in srgb, var(--ok) 26%, transparent); }
.alert-warn   { background: var(--warn-soft);   color: var(--warn);   border-color: color-mix(in srgb, var(--warn) 26%, transparent); }
.alert-info   { background: var(--brand-soft);  color: var(--brand);  border-color: color-mix(in srgb, var(--brand) 24%, transparent); }

/* ---------- 13. Console shell ---------- */
.console { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  border-right: 1px solid var(--border); background: var(--bg-elevated);
  padding: 18px 14px; display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .brand { padding: 6px 8px 18px; }
.side-group { margin-top: 16px; padding: 0 10px 8px; font-size: 11.5px; font-weight: 620; letter-spacing: .1em; text-transform: uppercase; color: var(--text-mute); }
.side-link {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px;
  border-radius: var(--radius-sm); color: var(--text-dim);
  font-size: 13.6px; font-weight: 540; cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.side-link:hover { background: var(--surface-3); color: var(--text); }
.side-link.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.side-link svg { flex: none; opacity: .9; }
.side-link .tail { margin-left: auto; font-size: 11.5px; }
.side-foot { margin-top: auto; padding-top: 18px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--nav-h); position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 0 26px; border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elevated) 86%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
}
.page { padding: 28px 26px 64px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: 22px; letter-spacing: -.024em; }
.page-head p { margin-top: 7px; color: var(--text-dim); font-size: 13.6px; }
.page-narrow { max-width: 900px; }
.balance-chip {
  display: inline-flex; align-items: center; gap: 9px; height: 34px; padding: 0 13px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  font-size: 13px; font-variant-numeric: tabular-nums;
}
.balance-chip .lbl { color: var(--text-mute); }
.balance-chip .amt { font-weight: 640; letter-spacing: -.01em; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 620;
  background: linear-gradient(140deg, var(--brand), var(--accent));
}
.menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 208px; z-index: 70;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-3); padding: 6px;
}
.menu-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  border-radius: var(--radius-xs); font-size: 13.5px; color: var(--text-dim); cursor: pointer;
}
.menu-item:hover { background: var(--surface-3); color: var(--text); }
.menu-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.relative { position: relative; }

/* ---------- 14. Charts ---------- */
.chart { width: 100%; height: 220px; display: block; overflow: visible; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .axis-label { fill: var(--text-mute); font-size: 11px; font-family: var(--font-sans); }
.chart .area { fill: url(#areaGrad); }
.chart .line { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .bar { fill: var(--brand); opacity: .85; }
.chart .bar:hover { opacity: 1; }
.chart .hover-line { stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 3 3; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12.5px; color: var(--text-dim); }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 7px; }
.bar-list { display: flex; flex-direction: column; gap: 14px; }
.bar-item .top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 7px; gap: 12px; }
.bar-item .track { height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar-item .fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--accent)); }

/* ---------- 15. Progress / misc ---------- */
.progress { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--brand); border-radius: 999px; transition: width .3s var(--ease); }
.progress.warn > i { background: var(--warn); }
.progress.danger > i { background: var(--danger); }
.kv { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 12px 18px; font-size: 13.5px; }
.kv dt { color: var(--text-mute); }
.kv dd { margin: 0; }
.skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 37%, var(--surface-3) 63%);
  background-size: 400% 100%; animation: shimmer 1.3s ease infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.sk-line { height: 12px; margin: 8px 0; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--brand); animation: spin .7s linear infinite; }
.loading-row { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 48px; color: var(--text-mute); }

/* ---------- 16. Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  background: rgba(10, 15, 28, .48); backdrop-filter: blur(3px); padding: 24px;
  animation: fade .16s var(--ease);
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-3);
  animation: rise .2s var(--ease);
}
.modal.wide { max-width: 720px; }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.99); } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px 0; }
.modal-head h3 { font-size: 17px; }
.modal-head p { margin-top: 6px; color: var(--text-dim); font-size: 13.4px; }
.modal-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* ---------- 17. Toasts ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: flex-start; gap: 11px; min-width: 268px; max-width: 400px;
  padding: 13px 15px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-3);
  font-size: 13.5px; animation: slideIn .22s var(--ease);
}
@keyframes slideIn { from { opacity: 0; transform: translateX(14px); } }
.toast.ok     { border-left: 3px solid var(--ok); }
.toast.error  { border-left: 3px solid var(--danger); }
.toast.info   { border-left: 3px solid var(--brand); }
.toast.warn   { border-left: 3px solid var(--warn); }
.toast .msg { flex: 1 1 auto; line-height: 1.5; }

/* ---------- 18. Responsive ---------- */
@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .grid-3, .steps { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .stat-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .dash-split { grid-template-columns: minmax(0, 1fr); }
  .auth-shell { grid-template-columns: minmax(0, 1fr); }
  .auth-aside { display: none; }
}
@media (max-width: 860px) {
  .wrap { padding: 0 18px; }
  .console { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; z-index: 120; left: 0; top: 0; width: 264px;
    transform: translateX(-102%); transition: transform .24s var(--ease); box-shadow: var(--shadow-3);
  }
  .sidebar.open { transform: none; }
  .nav-links { display: none; }
  .grid-2, .grid-3, .steps, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .stat-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-inner { padding: 56px 0 64px; }
  .section { padding: 56px 0; }
  .page { padding: 20px 16px 56px; }
  .topbar { padding: 0 16px; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 4px 0; }
  .kv dd { margin-bottom: 10px; }
  .hero-cta .btn, .hero-cta .btn-lg { flex: 1 1 100%; }
  .footer-grid { flex-direction: column; gap: 24px; }
  .footer-grid .gap-64 { gap: 32px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head .row { flex-wrap: wrap; }
  .code-block pre { font-size: 11.8px; }
  .input-group { flex-wrap: wrap; }
  .modal { max-width: 100%; }
}
@media (max-width: 480px) {
  .term-tabs { flex-wrap: wrap; }
  .term-body { font-size: 11.6px; }
  .hero-meta { gap: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
