/* beryllium theme — token layer (v3 · aiapipay-inspired light-teal).
 *
 * Only VALUES live here (colors, radii, shadows, spacing, type scale). No component shapes.
 * Swapping this one file re-skins the whole site: components reference tokens, never raw
 * numbers. A new theme = a new set of numbers, zero HTML/CSS edits.
 *
 * v3 换肤：默认改为「浅色 teal」（对齐 aiapipay 的 SaaS 观感）——浅灰底 #f7f9fb、
 * 白卡片、teal 主色 #14b8a6/#0d9488，柔和阴影、大圆角。深色仍可用 data-theme="dark"
 * 一键切回（boot.js 读取 localStorage，默认 light）。
 *
 * 无障碍（WCAG AA，g89 会逐文本节点实测）：
 *   * --accent(#0d9488) 只用于**填充**（按钮底/进度条），其上文字用 --on-accent 深色。
 *   * 正文小字用 --text(#0f172a)/--text-dim(#475569)，对白底对比充足（≥4.5:1）；
 *     --text-faint(#64748b) 在最浅面板上仍 ≥4.5:1。
 *   * 深色主题同样保证小字对比度（见 html[data-theme="dark"]）。
 */
:root {
  /* ---- surfaces & lines（浅色 SaaS 观感）---- */
  --bg: #f7f9fb;            /* 页面底：极浅冷灰 */
  --bg-elev: #ffffff;       /* 卡片/面板：纯白 */
  --bg-elev2: #f1f5f9;      /* 次级面板/sunken 输入 */
  --bg-sunken: #eef2f6;
  --border: #e2e8f0;        /* 浅描边 */
  --border-strong: #cbd5e1;

  /* ---- text ---- */
  --text: #0f172a;          /* 主文字（近黑蓝）*/
  --text-dim: #475569;      /* 次要文字 */
  --text-faint: #59616e;    /* 弱化小字（#fff 6.25 / elev2 5.71，均 ≥4.5）*/

  /* ---- brand + semantic（teal 系）---- */
  --accent: #0d9488;        /* teal-600：按钮/填充（其上用 --on-accent 深字）*/
  --accent-2: #0f766e;      /* teal-700：渐变尾/hover */
  --accent-text: #0f766e;   /* 白底上可读的 teal 文本（~5.0:1）*/
  --accent-ink: #0b5d56;    /* 叠在 accent-soft 半透明底上的更深文本（pill.ok 专用，≥4.5:1）*/
  --on-accent: #04231a;     /* 亮 teal 填充上的文字（深色，≥6.7:1）*/
  --accent-soft: rgba(20, 184, 166, .12);
  --accent-line: rgba(13, 148, 136, .38);

  --danger: #b91c1c;  --danger-soft: rgba(185, 28, 28, .10);  --danger-line: rgba(185, 28, 28, .34);
  --warn:   #92400e;  --warn-soft:   rgba(146, 64, 14, .10);   --warn-line:   rgba(146, 64, 14, .32);
  --info:   #1d4ed8;  --info-soft:   rgba(29, 78, 216, .10);  --info-line:   rgba(29, 78, 216, .32);

  /* ---- radii（大圆角，对齐 aiapipay）---- */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  /* ---- elevation（浅底柔和阴影）---- */
  --shadow: 0 10px 34px rgba(15, 23, 42, .10);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, .16);
  --grad: linear-gradient(135deg, #2dd4bf 0%, #22c9bd 55%, #14b8a6 100%);
  --grad-soft: linear-gradient(135deg, rgba(20,184,166,.14), rgba(13,148,136,.05));
  --grad-brand: linear-gradient(120deg, #0d9488 0%, #0ea5e9 55%, #6366f1 100%);
  /* 白底「渐变文字」专用：必须够深，否则 background-clip:text 后不可读（g89 实测）*/
  --grad-text: linear-gradient(120deg, #0d6e5f 0%, #0e7490 55%, #4338ca 100%);
  --grad-text-green: linear-gradient(120deg, #0d6e5f 0%, #0f766e 100%);

  /* ---- type scale ---- */
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 15px;
  --fs-md: 16px;
  --fs-lg: 18px;
  --fs-xl: 22px;
  --fs-2xl: 28px;
  --fs-3xl: 34px;
  --fs-4xl: 46px;
  --fs-hero: clamp(34px, 5vw, 56px);
  --fw-normal: 400; --fw-medium: 550; --fw-semibold: 650; --fw-bold: 750; --fw-black: 800;
  --lh-tight: 1.15; --lh-base: 1.55; --lh-loose: 1.7;

  /* ---- spacing scale ---- */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-7: 28px; --sp-8: 34px;
  --sp-9: 44px; --sp-10: 60px; --sp-11: 80px;

  /* ---- layout ---- */
  --container: 1120px;
  --container-wide: 1200px;
  --container-narrow: 820px;
  --gutter: 20px;

  /* ---- motion & layers ---- */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur: .2s;
  --transition: all var(--dur) var(--ease);
  --z-nav: 50; --z-toast: 100; --z-modal: 200;

  /* ---- fonts（对齐 aiapipay：系统无衬线 + 等宽）---- */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  --mono: "SF Mono", "Cascadia Code", Consolas, "Courier New", monospace;
}

/* Dark theme: 同一套变量名，换一组数字。所有组件自动跟着切，无需改任何 HTML/CSS。 */
html[data-theme="dark"] {
  --bg: #0f1115;
  --bg-elev: #171a21;
  --bg-elev2: #1e222b;
  --bg-sunken: #0b0d11;
  --border: #2a2f3a;
  --border-strong: #3a4150;
  --text: #e8ecf1;
  --text-dim: #9aa4b2;
  --text-faint: #86909c;
  --accent: #14b8a6;
  --accent-2: #0d9488;
  --accent-text: #2dd4bf;   /* 深底上可读 teal */
  --accent-ink: #7df0e2;    /* 深色主题下 pill.ok 用更亮文本 */
  --on-accent: #04231a;
  --accent-soft: rgba(20, 184, 166, .14);
  --accent-line: rgba(20, 184, 166, .40);
  --danger: #f87171;  --danger-soft: rgba(248, 113, 113, .14);  --danger-line: rgba(248, 113, 113, .40);
  --warn:   #fbbf24;  --warn-soft:   rgba(251, 191, 36, .14);   --warn-line:   rgba(251, 191, 36, .40);
  --info:   #60a5fa;  --info-soft:   rgba(96, 165, 250, .14);   --info-line:   rgba(96, 165, 250, .40);
  --shadow: 0 10px 40px rgba(0, 0, 0, .45);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, .3);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, .55);
  --grad: linear-gradient(135deg, #2dd4bf 0%, #22c9bd 55%, #14b8a6 100%);
  --grad-soft: linear-gradient(135deg, rgba(45,212,191,.18), rgba(13,148,136,.06));
  --grad-brand: linear-gradient(120deg, #2dd4bf 0%, #38bdf8 60%, #a371f7 100%);
  --grad-text: linear-gradient(120deg, #2dd4bf 0%, #38bdf8 60%, #a371f7 100%);
  --grad-text-green: linear-gradient(120deg, #2dd4bf 0%, #5eead4 100%);
}

/* Respect users who ask for less motion. */
@media (prefers-reduced-motion: reduce) {
  :root { --dur: .001s; }
}
