
/* ═══════════════════════════════════════════════════════
   1. DESIGN TOKENS — 原始层（primitive）
   中性色统一带 hue 270 的冷调，与靛蓝主色同色系，
   避免"死灰"；chroma 控制在 0.01 上下，可感知但不抢戏。
   ═══════════════════════════════════════════════════════ */
:root {
  --n-0:  oklch(100% 0 0);
  --n-1:  oklch(99% 0.003 270);
  --n-2:  oklch(99.6% 0.002 270);
  --n-3:  oklch(97% 0.004 270);
  --n-4:  oklch(93% 0.006 270);
  --n-5:  oklch(87% 0.009 270);
  --n-6:  oklch(70% 0.012 270);
  --n-7:  oklch(52% 0.014 270);
  --n-8:  oklch(42% 0.016 270);
  --n-9:  oklch(30% 0.018 270);
  --n-10: oklch(20% 0.020 270);

  /* 主色 —— 靛蓝（hue 276），保留原品牌连续性 */
  --p-1: oklch(97% 0.020 276);
  --p-2: oklch(93% 0.045 276);
  --p-3: oklch(86% 0.090 276);
  --p-4: oklch(76% 0.140 276);
  --p-5: oklch(66% 0.175 276);
  --p-6: oklch(57% 0.195 276);
  --p-7: oklch(49% 0.180 276);
  --p-8: oklch(41% 0.155 276);

  /* 语义色：底 + 文字 + 实心三件套，文字色已满足 WCAG AA 4.5:1 */
  --s-bg: oklch(96% 0.035 155);  --s-fg: oklch(38% 0.110 155);  --s-solid: oklch(50% 0.130 155);
  --w-bg: oklch(96% 0.045 75);   --w-fg: oklch(42% 0.105 70);   --w-solid: oklch(58% 0.140 70);
  --e-bg: oklch(96% 0.030 25);   --e-fg: oklch(43% 0.160 25);   --e-solid: oklch(53% 0.190 25);
  --i-bg: oklch(96% 0.025 250);  --i-fg: oklch(42% 0.140 250);  --i-solid: oklch(55% 0.170 250);

  /* ── 语义层：暗色模式只改这一层 ── */
  --bg:        var(--n-1);
  --surface:   var(--n-2);
  --surface-2: var(--n-3);
  --surface-3: var(--n-4);
  --border:      var(--n-4);
  --border-str:  var(--n-5);
  --text:      var(--n-9);
  --text-2:    var(--n-8);
  --text-3:    var(--n-7);
  --heading:   var(--n-10);
  --brand:     var(--p-6);
  --brand-hov: var(--p-7);
  --brand-soft:var(--p-1);
  --on-brand:  #fff;

  /* 字阶：模块化 1.25（major third），固定 rem 保证数据界面可预测 */
  --t-xs:   .75rem;
  --t-sm:   .8125rem;
  --t-base: .875rem;
  --t-md:   1rem;
  --t-lg:   1.125rem;
  --t-xl:   1.25rem;
  --t-2xl:  1.5rem;
  --t-3xl:  1.875rem;
  --t-4xl:  2.375rem;

  /* 字重：只用标准值。550/650 在多数字体下会被回退，层级不可靠 */
  --w-reg: 400; --w-med: 500; --w-semi: 600; --w-bold: 700;

  /* 间距：4pt 基准 */
  --sp-1: .25rem;  --sp-2: .5rem;   --sp-3: .75rem;  --sp-4: 1rem;
  --sp-5: 1.25rem; --sp-6: 1.5rem;  --sp-8: 2rem;    --sp-10: 2.5rem;
  --sp-12: 3rem;   --sp-16: 4rem;

  --r-xs: 4px; --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px; --r-full: 999px;

  /* 阴影：低饱和多层。看得见影子的地方通常就太重了 */
  --e-1: 0 1px 2px oklch(20% 0.02 270 / .06);
  --e-2: 0 1px 3px oklch(20% 0.02 270 / .08), 0 1px 2px oklch(20% 0.02 270 / .04);
  --e-3: 0 4px 12px oklch(20% 0.02 270 / .08), 0 1px 3px oklch(20% 0.02 270 / .05);
  --e-4: 0 12px 32px oklch(20% 0.02 270 / .12), 0 4px 8px oklch(20% 0.02 270 / .06);
  --ring: 0 0 0 3px oklch(57% 0.195 276 / .18);

  /* 层级：语义化，避免 9999 魔法数字打架 */
  --z-dropdown: 100; --z-sticky: 200; --z-backdrop: 300;
  --z-modal: 400;    --z-toast: 500;  --z-tooltip: 600;

  /* 动效：指数缓动（ease-out），不回弹 */
  --ease: cubic-bezier(.16, 1, .3, 1);
  --dur: .15s; --dur-2: .28s;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei UI", "Source Han Sans SC", sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

/* ── 暗色模式：不是简单反转，而是重新设计层级 ──
   深色下阴影失效 → 用更亮的表面表达"更高"；
   正文略降字重（同字重在深底上显得更重）；主色提亮维持对比度。 */
[data-theme="dark"] {
  --n-1:  oklch(14% 0.010 270);
  --n-2:  oklch(17.5% 0.011 270);
  --n-3:  oklch(21% 0.012 270);
  --n-4:  oklch(27% 0.013 270);
  --n-5:  oklch(35% 0.014 270);
  --n-6:  oklch(48% 0.012 270);
  --n-7:  oklch(58% 0.012 270);
  --n-8:  oklch(76% 0.010 270);
  --n-9:  oklch(90% 0.008 270);
  --n-10: oklch(97% 0.006 270);

  --p-6: oklch(65% 0.170 276);
  --p-7: oklch(72% 0.150 276);
  --p-1: oklch(26% 0.055 276);
  --p-3: oklch(40% 0.100 276);

  --s-bg: oklch(22% 0.045 155); --s-fg: oklch(80% 0.110 155);
  --w-bg: oklch(23% 0.045 70);  --w-fg: oklch(83% 0.105 75);
  --e-bg: oklch(23% 0.050 25);  --e-fg: oklch(82% 0.110 25);
  --i-bg: oklch(23% 0.045 250); --i-fg: oklch(82% 0.100 250);

  --on-brand: oklch(15% 0.02 276);

  --e-1: 0 1px 2px oklch(0% 0 0 / .4);
  --e-2: 0 1px 3px oklch(0% 0 0 / .5);
  --e-3: 0 4px 12px oklch(0% 0 0 / .45);
  --e-4: 0 12px 32px oklch(0% 0 0 / .6);
  --ring: 0 0 0 3px oklch(65% 0.170 276 / .25);
}

/* ═══════

/* ═══════ 兼容别名层：旧语义名 → v3 值 ═══════
   未重写的页面（projects/djc/card.php、select.css 等）仍引用
   --brand-500 / --err-700 这批旧名。别名统一指向 v3 原始层，
   暗色模式由原始层重定义自动生效，无需在此重复。 */
:root {
  --bg-accent: var(--brand-soft);
  --border-2: var(--border-str);
  --brand-50:  var(--p-1);  --brand-100: var(--p-1);  --brand-200: var(--p-3);
  --brand-400: var(--p-5);  --brand-500: var(--p-6);  --brand-600: var(--p-7);
  --brand-700: var(--p-8);
  --err-50:  var(--e-bg);  --err-500:  var(--e-solid);  --err-700:  var(--e-fg);
  --warn-50: var(--w-bg);  --warn-500: var(--w-solid);  --warn-700: var(--w-fg);
  --ok-50:   var(--s-bg);  --ok-500:   var(--s-solid);  --ok-700:   var(--s-fg);
  --info-50: var(--i-bg);  --info-500: var(--i-solid);  --info-700: var(--i-fg);
  --gray-0:   var(--n-0);  --gray-25:  var(--n-1);   --gray-50:  var(--n-2);
  --gray-100: var(--n-3);  --gray-200: var(--n-4);   --gray-300: var(--n-5);
  --gray-400: var(--n-6);  --gray-500: var(--n-7);   --gray-600: var(--n-7);
  --gray-700: var(--n-8);  --gray-800: var(--n-9);   --gray-900: var(--n-10);
  --f-xs: var(--t-xs);   --f-sm: var(--t-sm);   --f-base: var(--t-base);
  --f-md: var(--t-md);   --f-lg: var(--t-lg);   --f-xl:  var(--t-xl);
  --f-2xl: var(--t-2xl); --f-3xl: var(--t-3xl);
  --s-1: var(--sp-1);  --s-2: var(--sp-2);  --s-3: var(--sp-3);  --s-4: var(--sp-4);
  --s-5: var(--sp-5);  --s-6: var(--sp-6);  --s-8: var(--sp-8);  --s-10: var(--sp-10);
  --s-12: var(--sp-12); --s-16: var(--sp-16);
  --sh-xs: var(--e-1); --sh-sm: var(--e-2); --sh-md: var(--e-3);
  --sh-lg: var(--e-4); --sh-brand: var(--ring);
}

/* ═══════ 旧组件层（保留未重写页面依赖的类）═══════ */
/* ---------- 暗色主题 ---------- */


/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

body {
  font-family: var(--font);
  font-size: var(--f-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* 焦点可见性：键盘导航必须有明确指示，鼠标点击不显示 */
:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ---------- 布局 ---------- */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--s-6) var(--s-4);
  /* 顶部与底部的柔和光晕，替代原先两个固定圆形伪元素 */
  background:
    radial-gradient(900px 420px at 50% -12%, var(--bg-accent) 0%, transparent 62%),
    var(--bg);
}
.page--top { justify-content: flex-start; }

.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.gap-1 { gap: var(--s-1); } .gap-2 { gap: var(--s-2); }
.gap-3 { gap: var(--s-3); } .gap-4 { gap: var(--s-4); }
.gap-6 { gap: var(--s-6); }
.between { justify-content: space-between; }
.center { justify-content: center; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.mt-2 { margin-top: var(--s-2); } .mt-3 { margin-top: var(--s-3); }
.mt-4 { margin-top: var(--s-4); } .mt-6 { margin-top: var(--s-6); }
.mt-8 { margin-top: var(--s-8); }
.mb-3 { margin-bottom: var(--s-3); } .mb-4 { margin-bottom: var(--s-4); }
.mb-6 { margin-bottom: var(--s-6); }

/* ---------- 品牌标识 ---------- */
.brand-mark {
  width: 52px; height: 52px;
  border-radius: 15px;
  background: linear-gradient(140deg, var(--brand-500) 0%, var(--brand-700) 100%);
  display: grid; place-items: center;
  box-shadow: var(--sh-brand);
  flex-shrink: 0;
}
.brand-mark--sm { width: 40px; height: 40px; border-radius: 12px; }
.brand-mark--sm svg { width: 22px; height: 22px; }

/* ---------- 卡片 ---------- */
.card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-md);
  padding: var(--s-10) var(--s-8);
}
.card--sm { padding: var(--s-8) var(--s-6); }
.card--flat { box-shadow: var(--sh-xs); }

/* ---------- 排版 ---------- */
.eyebrow {
  font-size: var(--f-xs);
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--text-3);
  text-transform: uppercase;
}
.title {
  font-size: var(--f-2xl);
  font-weight: 650;
  letter-spacing: -.02em;
  line-height: 1.25;
  color: var(--text);
}
.title--sm { font-size: var(--f-xl); }
.title--lg { font-size: var(--f-3xl); }
.subtitle {
  font-size: var(--f-md);
  color: var(--text-2);
  line-height: 1.55;
}
.muted { color: var(--text-2); }
.fine { font-size: var(--f-xs); color: var(--text-3); }
.mono { font-family: var(--font-mono); font-size: var(--f-sm); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  height: 44px;
  padding: 0 var(--s-5);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-size: var(--f-md);
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              transform var(--dur) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn--primary {
  background: var(--brand-500);
  color: #fff;
}
.btn--primary:hover:not(:disabled) {
  background: var(--brand-600);
  box-shadow: var(--sh-brand);
}

.btn--ghost {
  background: var(--surface);
  border-color: var(--border-2);
  color: var(--text);
}
.btn--ghost:hover:not(:disabled) {
  border-color: var(--brand-400);
  color: var(--brand-600);
  background: var(--brand-50);
}

.btn--danger {
  background: var(--surface);
  border-color: var(--err-500);
  color: var(--err-700);
}
.btn--danger:hover:not(:disabled) { background: var(--err-50); }

.btn--block { width: 100%; }
.btn--sm { height: 34px; padding: 0 var(--s-3); font-size: var(--f-sm); border-radius: var(--r-sm); }
.btn--lg { height: 50px; font-size: 16px; border-radius: var(--r-lg); }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: var(--s-2); }
.label { font-size: var(--f-sm); font-weight: 550; color: var(--text); }

.input,
.textarea,
.select {
  width: 100%;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px var(--s-4);
  font-size: var(--f-md);
  color: var(--text);
  transition: border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              background var(--dur) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .textarea:hover, .select:hover { border-color: var(--border-2); }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--brand-500);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .13);
}
.textarea { resize: vertical; min-height: 96px; line-height: 1.6; }
.select { cursor: pointer; appearance: none; padding-right: var(--s-8);
  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='%239ca3af' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

/* 带图标的输入框 */
.input-group { position: relative; display: flex; align-items: center; }
.input-group .ico {
  position: absolute; left: 14px;
  color: var(--text-3);
  display: flex; pointer-events: none;
  transition: color var(--dur) var(--ease);
}
.input-group .input, .input-group .textarea { padding-left: 42px; }
.input-group:focus-within .ico { color: var(--brand-500); }
/* textarea 的图标要贴顶，否则会和第一行文字重叠 */
.input-group--area .ico { top: 14px; align-items: flex-start; }
.input-group--area .textarea { padding-top: 13px; }

/* ---------- 提示条 ---------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: 12px var(--s-4);
  border-radius: var(--r-md);
  font-size: var(--f-base);
  line-height: 1.55;
  border: 1px solid transparent;
}
.alert__ico { flex-shrink: 0; margin-top: 2px; }
.alert--ok   { background: var(--ok-50);   color: var(--ok-700);   border-color: color-mix(in srgb, var(--ok-500) 22%, transparent); }
.alert--err  { background: var(--err-50);  color: var(--err-700);  border-color: color-mix(in srgb, var(--err-500) 22%, transparent); }
.alert--warn { background: var(--warn-50); color: var(--warn-700); border-color: color-mix(in srgb, var(--warn-500) 24%, transparent); }
.alert--info { background: var(--info-50); color: var(--info-700); border-color: color-mix(in srgb, var(--info-500) 22%, transparent); }

/* ---------- 徽章 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: var(--f-xs);
  font-weight: 550;
  white-space: nowrap;
}
.badge--brand { background: var(--brand-50);  color: var(--brand-700); }
.badge--ok    { background: var(--ok-50);    color: var(--ok-700); }
.badge--err   { background: var(--err-50);   color: var(--err-700); }
.badge--warn  { background: var(--warn-50);  color: var(--warn-700); }
.badge--muted { background: var(--gray-100); color: var(--gray-600); }

/* ---------- 进度条 ---------- */
.progress {
  height: 8px;
  background: var(--gray-100);
  border-radius: var(--r-full);
  overflow: hidden;
}
[data-theme="dark"] .progress { background: var(--surface-2); }
.progress__bar {
  height: 100%;
  border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--brand-400), var(--brand-600));
  transition: width .5s var(--ease);
}

/* ---------- 分割线 ---------- */
.divider {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  color: var(--text-3);
  font-size: var(--f-xs);
}
.divider::before, .divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}

/* ---------- 主题切换按钮 ---------- */
.theme-toggle {
  position: absolute;
  top: var(--s-4); right: var(--s-4);
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.theme-toggle:hover { color: var(--brand-600); border-color: var(--brand-400); }
.theme-toggle .ico-moon { display: none; }
[data-theme="dark"] .theme-toggle .ico-sun  { display: none; }
[data-theme="dark"] .theme-toggle .ico-moon { display: block; }

/* ---------- 页脚 ---------- */
.foot { text-align: center; font-size: var(--f-xs); color: var(--text-3); }

/* ---------- 表格 ---------- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.table { width: 100%; border-collapse: collapse; font-size: var(--f-sm); }
.table th {
  text-align: left;
  padding: 11px var(--s-4);
  background: var(--surface-2);
  color: var(--text-2);
  font-weight: 550;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 12px var(--s-4);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface-2); }

/* ---------- 提示气泡 ---------- */
.toast {
  position: absolute;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(8px);
  background: var(--gray-900);
  color: #fff;
  font-size: var(--f-sm);
  padding: 9px 18px;
  border-radius: var(--r-full);
  box-shadow: var(--sh-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
  z-index: 9999;
}
.toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .card { padding: var(--s-8) var(--s-5); border-radius: var(--r-lg); }
  .card--sm { padding: var(--s-6) var(--s-4); }
  .page { padding: var(--s-4) var(--s-3); }
  .title { font-size: var(--f-xl); }
  .title--lg { font-size: var(--f-2xl); }
}

/* ---------- 尊重系统的减弱动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
2. RESET & BASE ═══════ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

body {
  font-family: var(--font);
  font-size: var(--t-base);
  font-weight: var(--w-reg);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-kerning: normal;
}
/* 键盘用户必须看到焦点；鼠标点击不该出现难看的焦点框 */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: var(--r-xs); }
::selection { background: var(--p-3); color: var(--heading); }

/* ═══════ 3. LAYOUT ═══════ */
.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: var(--sp-6); }
.container--narrow { max-width: 440px; }
.container--mid { max-width: 880px; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.g-1{gap:var(--sp-1)} .g-2{gap:var(--sp-2)} .g-3{gap:var(--sp-3)}
.g-4{gap:var(--sp-4)} .g-6{gap:var(--sp-6)} .g-8{gap:var(--sp-8)}
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* ═══════ 4. TYPOGRAPHY ═══════ */
.h-hero { font-size: var(--t-4xl); font-weight: var(--w-bold); line-height: 1.15; letter-spacing: -.03em; color: var(--heading); }
.h1 { font-size: var(--t-2xl); font-weight: var(--w-semi); line-height: 1.3; letter-spacing: -.02em; color: var(--heading); }
.h2 { font-size: var(--t-xl); font-weight: var(--w-semi); line-height: 1.35; letter-spacing: -.01em; color: var(--heading); }
.h3 { font-size: var(--t-lg); font-weight: var(--w-semi); line-height: 1.4; color: var(--heading); }
.h4 { font-size: var(--t-md); font-weight: var(--w-semi); line-height: 1.45; color: var(--heading); }
.lead { font-size: var(--t-md); line-height: 1.65; color: var(--text-2); }
.small { font-size: var(--t-sm); color: var(--text-2); }
.caption { font-size: var(--t-xs); color: var(--text-3); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.eyebrow { font-size: var(--t-xs); font-weight: var(--w-semi); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }

/* ═══════ 5. COMPONENTS ═══════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  height: 40px; padding-inline: var(--sp-4);
  border: 1px solid transparent; border-radius: var(--r-md);
  font-size: var(--t-base); font-weight: var(--w-med); white-space: nowrap;
  cursor: pointer; user-select: none;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
              color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--brand); color: var(--on-brand); }
.btn--primary:hover:not(:disabled) { background: var(--brand-hov); box-shadow: var(--e-2); }
.btn--secondary { background: var(--surface); border-color: var(--border-str); color: var(--text); }
.btn--secondary:hover:not(:disabled) { background: var(--surface-2); border-color: var(--n-6); }
.btn--ghost { background: transparent; color: var(--text-2); }
.btn--ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn--danger { background: var(--e-solid); color: #fff; }
.btn--danger:hover:not(:disabled) { filter: brightness(1.08); }
.btn--link { height: auto; padding: 0; background: none; color: var(--brand); font-size: var(--t-sm); }
.btn--link:hover { text-decoration: underline; }
.btn--sm { height: 32px; padding-inline: var(--sp-3); font-size: var(--t-sm); border-radius: var(--r-sm); }
.btn--lg { height: 48px; padding-inline: var(--sp-6); font-size: var(--t-md); border-radius: var(--r-lg); }
.btn--block { width: 100%; }

/* 图标按钮：视觉 32px，触控区扩到 44px（WCAG 2.5.5） */
.icon-btn {
  width: 32px; height: 32px; position: relative;
  display: inline-grid; place-items: center;
  border: 1px solid transparent; border-radius: var(--r-md);
  background: transparent; color: var(--text-2); cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.icon-btn::before { content: ''; position: absolute; inset: -6px; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.field { display: flex; flex-direction: column; gap: var(--sp-2); }
.label { font-size: var(--t-sm); font-weight: var(--w-med); color: var(--text); }
.hint { font-size: var(--t-xs); color: var(--text-3); }
.input, .select, .textarea {
  width: 100%; background: var(--surface); color: var(--text);
  border: 1px solid var(--border-str); border-radius: var(--r-md);
  padding: 9px var(--sp-3); font-size: var(--t-md);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--n-6); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.input[aria-invalid="true"] { border-color: var(--e-solid); }
.textarea { resize: vertical; min-height: 88px; line-height: 1.6; }
.select { appearance: none; cursor: pointer; padding-right: var(--sp-8);
  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='%23718090' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
.input--mono { font-family: var(--font-mono); font-size: var(--t-sm); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--e-1); }
.card--pad { padding: var(--sp-6); }
.card--pad-lg { padding: var(--sp-8); }
.card-head { padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); }

/* 徽章：色 + 文字双编码，色觉障碍也能分辨 */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: var(--r-full);
  font-size: var(--t-xs); font-weight: var(--w-med); white-space: nowrap; line-height: 1.7;
}
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge--plain::before { display: none; }
.badge--ok    { background: var(--s-bg); color: var(--s-fg); }
.badge--warn  { background: var(--w-bg); color: var(--w-fg); }
.badge--err   { background: var(--e-bg); color: var(--e-fg); }
.badge--info  { background: var(--i-bg); color: var(--i-fg); }
.badge--brand { background: var(--brand-soft); color: var(--p-7); }
.badge--muted { background: var(--surface-3); color: var(--text-2); }

.alert {
  display: flex; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md); font-size: var(--t-base); line-height: 1.55; border: 1px solid transparent;
}
.alert svg { flex-shrink: 0; margin-top: 2px; }
.alert--ok   { background: var(--s-bg); color: var(--s-fg); border-color: oklch(50% 0.13 155 / .22); }
.alert--warn { background: var(--w-bg); color: var(--w-fg); border-color: oklch(58% 0.14 70 / .26); }
.alert--err  { background: var(--e-bg); color: var(--e-fg); border-color: oklch(53% 0.19 25 / .22); }
.alert--info { background: var(--i-bg); color: var(--i-fg); border-color: oklch(55% 0.17 250 / .22); }

.progress { height: 6px; background: var(--surface-3); border-radius: var(--r-full); overflow: hidden; }
.progress__bar { height: 100%; border-radius: var(--r-full); background: var(--brand); transition: width .5s var(--ease); }
.progress--lg { height: 10px; }

/* 表格：数据密集场景的主力组件 */
.table-wrap { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.tbl-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--t-base); }
.table th {
  text-align: left; padding: 10px var(--sp-4); background: var(--surface-2);
  color: var(--text-2); font-size: var(--t-sm); font-weight: var(--w-med);
  white-space: nowrap; border-bottom: 1px solid var(--border);
}
.table td { padding: 12px var(--sp-4); border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface-2); }
.table th.r, .table td.r { text-align: right; }
.table--dense th { padding: 7px var(--sp-3); }
.table--dense td { padding: 8px var(--sp-3); font-size: var(--t-sm); }

.stat { padding: var(--sp-5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.stat__k { font-size: var(--t-sm); color: var(--text-3); }
.stat__v { font-size: var(--t-2xl); font-weight: var(--w-semi); color: var(--heading); font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.25; margin-top: var(--sp-1); }
.stat__d { font-size: var(--t-xs); color: var(--text-3); margin-top: var(--sp-1); }
.stat__d--up { color: var(--s-fg); }

/* 空状态：教育性，不是干巴巴的"暂无数据" */
.empty { padding: var(--sp-12) var(--sp-6); text-align: center; }
.empty__ico { width: 44px; height: 44px; margin: 0 auto var(--sp-4); display: grid; place-items: center; border-radius: var(--r-lg); background: var(--surface-2); color: var(--text-3); }
.empty__t { font-size: var(--t-md); font-weight: var(--w-semi); color: var(--heading); }
.empty__d { font-size: var(--t-base); color: var(--text-2); margin-top: var(--sp-1); max-width: 34ch; margin-inline: auto; }

.skel { background: var(--surface-3); border-radius: var(--r-sm); animation: pulse 1.6s var(--ease) infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .5 } }
@keyframes spin { to { transform: rotate(360deg) } }
.spinner { width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }

.tabs { display: flex; gap: var(--sp-1); border-bottom: 1px solid var(--border); }
.tab {
  padding: var(--sp-3) var(--sp-4); margin-bottom: -1px; font-size: var(--t-base);
  font-weight: var(--w-med); color: var(--text-2); background: none;
  border: none; border-bottom: 2px solid transparent; cursor: pointer;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.tab__n { font-size: var(--t-xs); color: var(--text-3); margin-left: 5px; font-variant-numeric: tabular-nums; }

.sidenav { display: flex; flex-direction: column; gap: 2px; }
.sidenav__i {
  display: flex; align-items: center; gap: var(--sp-3); padding: 8px var(--sp-3);
  border-radius: var(--r-md); font-size: var(--t-base); color: var(--text-2); cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.sidenav__i:hover { background: var(--surface-2); color: var(--text); }
.sidenav__i[aria-current="page"] { background: var(--brand-soft); color: var(--p-7); font-weight: var(--w-med); }
.sidenav__g { font-size: var(--t-xs); font-weight: var(--w-semi); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: var(--sp-4) var(--sp-3) var(--sp-2); }

.topbar { position: sticky; top: 0; z-index: var(--z-sticky); background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--border); }
.topbar__in { display: flex; align-items: center; gap: var(--sp-4); height: 56px; }
.logo { display: flex; align-items: center; gap: var(--sp-2); font-weight: var(--w-semi); color: var(--heading); letter-spacing: -.01em; }
.logo__m { width: 28px; height: 28px; border-radius: var(--r-sm); background: linear-gradient(140deg, var(--p-5), var(--p-7)); display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.brandmark { width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(140deg, var(--p-5), var(--p-8)); display: grid; place-items: center; color: #fff; box-shadow: 0 6px 20px oklch(57% 0.195 276 / .3); }

.toast {
  position: fixed; left: 50%; bottom: var(--sp-8); z-index: var(--z-toast);
  transform: translateX(-50%) translateY(10px); background: var(--n-10); color: var(--n-1);
  font-size: var(--t-base); padding: 10px var(--sp-5); border-radius: var(--r-full);
  box-shadow: var(--e-4); opacity: 0; pointer-events: none;
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}
.toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }
/* ═══════
7. 页面样式 ═══════ */
.land-hero { padding: var(--sp-16) 0 var(--sp-12); text-align: center; }
.land-hero__t { max-width: 15ch; margin-inline: auto; }
.land-hero__d { max-width: 52ch; margin: var(--sp-5) auto 0; }
.land-cta { display: flex; gap: var(--sp-3); justify-content: center; margin-top: var(--sp-8); }
/* 信任条：用真实数字替代空洞口号 */
.trust { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-8); margin-top: var(--sp-12); padding-top: var(--sp-8); border-top: 1px solid var(--border); }
.trust__i { text-align: center; }
.trust__v { font-size: var(--t-2xl); font-weight: var(--w-semi); color: var(--heading); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.trust__k { font-size: var(--t-sm); color: var(--text-3); margin-top: 2px; }
/* 特性区：编号 + 文字，避免"大圆角图标堆"的模板感 */
.feat { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--sp-5); }
.feat__i { padding: var(--sp-6); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.feat__n { font-size: var(--t-xs); font-weight: var(--w-semi); color: var(--brand); letter-spacing: .06em; }
.feat__t { font-size: var(--t-md); font-weight: var(--w-semi); color: var(--heading); margin-top: var(--sp-3); }
.feat__d { font-size: var(--t-base); color: var(--text-2); margin-top: var(--sp-2); line-height: 1.6; }
.section { padding: var(--sp-12) 0; }
.section--alt { background: var(--surface-2); border-block: 1px solid var(--border); }

.auth { min-height: calc(100vh - 130px); display: grid; place-items: center; padding: var(--sp-8) var(--sp-4); }
.auth__box { width: 100%; max-width: 400px; }
.auth__head { text-align: center; margin-bottom: var(--sp-8); }
.auth__alt { text-align: center; margin-top: var(--sp-6); font-size: var(--t-sm); color: var(--text-2); }

/* 提交页：状态机可视化 */
.ss-row { display: flex; align-items: flex-start; gap: var(--sp-3); }
.ss-dot { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; border: 2px solid var(--border-str); color: var(--text-3); font-size: 11px; font-weight: var(--w-semi); }
.ss-row[data-s="done"] .ss-dot { background: var(--s-solid); border-color: var(--s-solid); color: #fff; }
.ss-row[data-s="active"] .ss-dot { border-color: var(--brand); color: var(--brand); }
.ss-t { font-size: var(--t-base); font-weight: var(--w-med); color: var(--text-3); }
.ss-row[data-s="done"] .ss-t, .ss-row[data-s="active"] .ss-t { color: var(--heading); }
.ss-d { font-size: var(--t-sm); color: var(--text-3); margin-top: 1px; }
.ss-line { width: 2px; height: 14px; background: var(--border); margin-left: 10px; }
.ss-row[data-s="done"] + .ss-line { background: var(--s-solid); }

.ring { position: relative; width: 132px; height: 132px; margin-inline: auto; }
.ring svg { transform: rotate(-90deg); }
.ring__bg { fill: none; stroke: var(--surface-3); stroke-width: 9; }
.ring__fg { fill: none; stroke: var(--brand); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset .6s var(--ease); }
.ring__t { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring__n { font-size: var(--t-2xl); font-weight: var(--w-semi); color: var(--heading); font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1; }
.ring__d { font-size: var(--t-xs); color: var(--text-3); margin-top: 4px; }

.shell { display: grid; grid-template-columns: 220px 1fr; gap: var(--sp-8); align-items: start; }
.wrap-in { max-width: 1200px; margin-inline: auto; padding: var(--sp-8) var(--sp-6); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--sp-4); }
.toolbar { display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; }
.search { position: relative; }
.search .input { padding-left: 34px; height: 34px; font-size: var(--t-base); }
.search__ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
/* 批量条：选中后浮出，不常驻占位 */
.bulkbar { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-4); background: var(--brand-soft); border: 1px solid var(--p-3); border-radius: var(--r-md); font-size: var(--t-sm); }

.swatch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: var(--sp-3); }
.swatch { border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.swatch__c { height: 54px; }
.swatch__m { padding: var(--sp-2) var(--sp-3); font-size: var(--t-xs); }
.swatch__n { font-weight: var(--w-semi); color: var(--heading); }
.swatch__v { color: var(--text-3); font-family: var(--font-mono); font-size: 11px; }
.spec-row { display: flex; align-items: baseline; gap: var(--sp-4); padding: var(--sp-3) 0; border-bottom: 1px solid var(--border); }
.spec-row:last-child { border-bottom: none; }
.spec-row__l { width: 128px; flex-shrink: 0; font-size: var(--t-sm); color: var(--text-2); }
.demo-box { padding: var(--sp-6); border: 1px dashed var(--border-str); border-radius: var(--r-lg); background: var(--surface-2); }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .shell__nav { display: none; }
}
@media (max-width: 640px) {
  .container { padding-inline: var(--sp-4); }
  .land-hero { padding: var(--sp-10) 0 var(--sp-8); }
  .h-hero { font-size: var(--t-3xl); }
  .land-cta { flex-direction: column; }
  .trust { gap: var(--sp-6); }
  .wrap-in { padding: var(--sp-5) var(--sp-4); }
  .section { padding: var(--sp-8) 0; }
  .card--pad-lg { padding: var(--sp-6) var(--sp-5); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
