/* ============================================================================
 * tokens.css —— 自动生成，请勿手工修改
 *
 * 来源：docs/chip100-redesign/spec/design-tokens.json
 * 生成：docs/chip100-redesign/tools/gen-tokens.py
 *
 * 修改令牌请改 JSON 后重新生成；直接改本文件会在下次生成时被覆盖。
 * ========================================================================== */

:root {
/* ---- 品牌色板 ---- */
  --color-brand-primary-50: #EEF4FF;
  --color-brand-primary-100: #DCE7FF;
  --color-brand-primary-300: #8FB2FF;
  --color-brand-primary-500: #1A6DFF;
  --color-brand-primary-600: #0F55D6;
  --color-brand-primary-700: #0B3C7D;
  --color-brand-primary-900: #06224A;

/* ---- 中性色板 ---- */
  --color-neutral-0: #FFFFFF;
  --color-neutral-25: #FCFCFD;
  --color-neutral-50: #F7F8FA;
  --color-neutral-100: #EEF0F4;
  --color-neutral-200: #DFE3EA;
  --color-neutral-300: #C6CCD7;
  --color-neutral-400: #9AA3B2;
  --color-neutral-500: #6B7484;
  --color-neutral-600: #4C5566;
  --color-neutral-700: #333C4D;
  --color-neutral-800: #1F2733;
  --color-neutral-900: #111721;

/* ---- 语义色（库存状态等）---- */
  --color-semantic-stock-in: #12A150;
  --color-semantic-stock-in-bg: #E9F8EF;
  --color-semantic-stock-future: #F5A524;
  --color-semantic-stock-future-bg: #FEF6E7;
  --color-semantic-stock-out: #E5484D;
  --color-semantic-stock-out-bg: #FDECEC;
  --color-semantic-info: #0B7FD4;
  --color-semantic-success: #12A150;
  --color-semantic-warning: #F5A524;
  --color-semantic-danger: #E5484D;

/* ---- 强调色 ---- */
  --color-accent-signal: #00C2CB;
  --color-accent-violet: #7C5CFF;

/* ---- 图表序列 ---- */
  --color-chart-series-1: #1A6DFF;
  --color-chart-series-2: #00C2CB;
  --color-chart-series-3: #7C5CFF;
  --color-chart-series-4: #F5A524;
  --color-chart-series-5: #E5484D;
  --color-chart-series-6: #12A150;
  --color-chart-grid: #EEF0F4;

/* 状态必须用「颜色 + 图标 + 文字」三重编码，禁止仅用颜色传达信息（WCAG 1.4.1） */

/* ---- 语义别名（模板只引用这一层）---- */
  --color-surface: var(--color-neutral-0);
  --color-surface-raised: var(--color-neutral-25);
  --color-surface-sunken: var(--color-neutral-50);
  --color-border: var(--color-neutral-200);
  --color-text: var(--color-neutral-700);
  --color-text-strong: var(--color-neutral-900);
  --color-text-muted: var(--color-neutral-500);
  --color-link: var(--color-brand-primary-500);

/* ---- 字体 ---- */
  --font-sans: "Inter", "HarmonyOS Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --font-serif: "Source Serif 4", Georgia, serif;
/* 所有型号 / 参数值 / 批号 / 封装 必须使用等宽字体 mono —— 这是元器件站的专业性细节，可显著提升型号可读性与抄录准确率 */

/* ---- 字号阶梯 ---- */
  --text-display-size: 48px;
  --text-display-line-height: 1.15;
  --text-display-weight: 700;
  --text-display-tracking: -0.02em;
  --text-h1-size: 34px;
  --text-h1-line-height: 1.25;
  --text-h1-weight: 700;
  --text-h1-tracking: -0.01em;
  --text-h2-size: 26px;
  --text-h2-line-height: 1.3;
  --text-h2-weight: 650;
  --text-h2-tracking: -0.01em;
  --text-h3-size: 20px;
  --text-h3-line-height: 1.4;
  --text-h3-weight: 600;
  --text-h4-size: 17px;
  --text-h4-line-height: 1.45;
  --text-h4-weight: 600;
  --text-body-lg-size: 16px;
  --text-body-lg-line-height: 1.7;
  --text-body-lg-weight: 400;
  --text-body-size: 14px;
  --text-body-line-height: 1.65;
  --text-body-weight: 400;
  --text-small-size: 13px;
  --text-small-line-height: 1.55;
  --text-small-weight: 400;
  --text-caption-size: 12px;
  --text-caption-line-height: 1.5;
  --text-caption-weight: 500;
  --text-mono-lg-size: 28px;
  --text-mono-lg-line-height: 1.2;
  --text-mono-lg-weight: 600;
  --text-mono-size: 13px;
  --text-mono-line-height: 1.5;
  --text-mono-weight: 500;
/* 现状 base font-size 为 12px 且用 Simsun，严重损害可读性与高级感；建议正文提升至 14px，表格 13px */

/* ---- 间距 ---- */
  --space-base: 8px;
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;
  --container-max: 1440px;
  --container-gutter: 24px;
  --container-gutter-mobile: 16px;
  --container-content-narrow: 880px;

/* ---- 圆角 ---- */
  --radius-none: 0;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 999px;

/* ---- 阴影 ---- */
  --shadow-xs: 0 1px 2px rgba(17,23,33,.06);
  --shadow-sm: 0 2px 8px rgba(17,23,33,.08);
  --shadow-md: 0 8px 24px rgba(17,23,33,.10);
  --shadow-lg: 0 16px 48px rgba(17,23,33,.14);
  --shadow-focus: 0 0 0 3px rgba(26,109,255,.35);
/* 克制使用阴影；高级感来自网格、对齐与字重层级，而非阴影与渐变堆砌 */

/* ---- 网格与断点 ---- */
  --grid-columns: 12;
  --breakpoint-xs: 0;
  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
  --breakpoint-2xl: 1536px;
  /* 断点仅作参考：@media 不支持 var()，请直接写 px 原值 */

/* ---- 动效 ---- */
  --duration-instant: 80ms;
  --duration-fast: 160ms;
  --duration-base: 240ms;
  --duration-slow: 400ms;
  --easing-standard: cubic-bezier(.2,.8,.2,1);
  --easing-decelerate: cubic-bezier(0,.6,.3,1);
/* 全部动效须尊重 prefers-reduced-motion；禁止装饰性动画 */
}

/* ---- 暗色变体（light-first，暗色为覆盖）---- */
[data-theme="dark"] {
  --color-surface: #0B0F16;
  --color-surface-raised: #121826;
  --color-surface-overlay: #1A2233;
  --color-border: #26314A;
  --color-text: #E6EAF2;
  --color-text-muted: #9AA6BF;
  --color-link: #4D8DFF;
}

/* ---- 可访问性基线 ----
 * 标准：WCAG 2.2 AA
 * 正文对比度：>= 4.5:1；大字：>= 3:1
 * 焦点可见：必须可见，使用 focus 令牌
 * 触控目标：>= 44x44px（移动端）
 * 现状无 viewport meta、12px 正文、表格布局，可访问性基线为 0，需从零建立
 */
