/* ============================================================================
 * tokens.css —— 数据中心设计令牌（AUTO-GENERATED，禁止手改）
 *
 * 唯一源：design/tokens.json
 * 生成器：ci/gen-tokens.mjs
 * 校验器：ci/verify-tokens.mjs（三份 sha256 必须相同 + 源哈希必须匹配）
 * source-sha256: 9e4139d683406e22c2fd2866d663bbe0457a0d5b9cf0b352886736788a21260b
 * 规范：docs/ui/01-数据中心UI设计规范.md §3
 * ========================================================================== */

:root {
  /* 颜色 */
  --c-canvas: #F5F7FA;
  --c-surface: #FFFFFF;
  --c-surface-2: #F9FAFB;
  --c-border: #E4E7EC;
  --c-border-strong: #D0D5DD;
  --c-text: #101828;
  --c-text-2: #475467;
  --c-text-3: #667085;
  --c-text-disabled: #98A2B3;
  --c-accent: #2563EB;
  --c-accent-hover: #1D4ED8;
  --c-accent-soft: #EFF4FF;
  --c-accent-border: #BFD3FE;
  --c-on-accent: #FFFFFF;
  --c-ok: #047857;
  --c-ok-bg: #ECFDF5;
  --c-ok-border: #A7F3D0;
  --c-warn: #B45309;
  --c-warn-bg: #FFFBEB;
  --c-warn-border: #FDE68A;
  --c-err: #B91C1C;
  --c-err-bg: #FEF2F2;
  --c-err-border: #FECACA;
  --c-info: #0369A1;
  --c-info-bg: #F0F9FF;
  --c-info-border: #BAE6FD;
  --c-dry: #7C3AED;
  --c-mask: rgba(16,24,40,.5);
  --focus-ring: 0 0 0 3px rgba(37,99,235,.18);

  /* 图表色（固定顺序） */
  --chart-1: #2563EB;
  --chart-2: #0D9488;
  --chart-3: #D97706;
  --chart-4: #7C3AED;
  --chart-5: #DB2777;
  --chart-6: #64748B;

  /* 字体 / 字号 / 行高 / 字重 */
  --font-sans: -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Hiragino Sans GB","Microsoft YaHei","Noto Sans SC",sans-serif;
  --font-mono: ui-monospace,"SFMono-Regular",Consolas,"Cascadia Mono",monospace;
  --fs-12: 12px;
  --fs-13: 13px;
  --fs-14: 14px;
  --fs-16: 16px;
  --fs-20: 20px;
  --fs-24: 24px;
  --lh-12: 18px;
  --lh-13: 20px;
  --lh-14: 22px;
  --lh-16: 24px;
  --lh-20: 28px;
  --lh-24: 32px;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;

  /* 间距（4px 基数） */
  --sp-4: 4px;
  --sp-8: 8px;
  --sp-12: 12px;
  --sp-16: 16px;
  --sp-20: 20px;
  --sp-24: 24px;
  --sp-32: 32px;
  --sp-40: 40px;
  --sp-48: 48px;

  /* 圆角 / 阴影 / 层级 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(16,24,40,.05);
  --shadow-pop: 0 12px 32px rgba(16,24,40,.16);
  --shadow-modal: 0 24px 64px rgba(16,24,40,.24);
  --z-sticky: 10;
  --z-dropdown: 20;
  --z-drawer: 30;
  --z-modal: 40;
  --z-toast: 50;

  /* 尺寸与布局 */
  --control-h: 32px;
  --control-h-sm: 28px;
  --layout-topbar: 56px;
  --layout-nav: 208px;
  --layout-nav-collapsed: 64px;
  --layout-context: 240px;
  --layout-page-header: 64px;
  --layout-toolbar: 48px;
  --layout-pager: 52px;
  --row-h: 40px;
  --row-h-compact: 32px;
  --content-prose-max: 880px;

  /* 动效 */
  --motion-fast: 120ms;
  --motion-base: 180ms;
  --motion-slow: 240ms;
  --motion-ease: cubic-bezier(.2,0,0,1);
}

[data-theme="dark"] {
  --c-canvas: #0B1220;
  --c-surface: #111827;
  --c-surface-2: #1F2937;
  --c-border: #334155;
  --c-border-strong: #475569;
  --c-text: #E5E7EB;
  --c-text-2: #CBD5E1;
  --c-text-3: #94A3B8;
  --c-text-disabled: #64748B;
  --c-accent: #60A5FA;
  --c-accent-hover: #93C5FD;
  --c-accent-soft: #172554;
  --c-accent-border: #1E40AF;
  --c-on-accent: #0B1220;
  --c-ok: #6EE7B7;
  --c-ok-bg: #052E22;
  --c-ok-border: #065F46;
  --c-warn: #FCD34D;
  --c-warn-bg: #3A2A05;
  --c-warn-border: #92400E;
  --c-err: #FDA29B;
  --c-err-bg: #3B1219;
  --c-err-border: #991B1B;
  --c-info: #7DD3FC;
  --c-info-bg: #082F49;
  --c-info-border: #075985;
  --c-dry: #C4B5FD;
  --c-mask: rgba(0,0,0,.6);
  --focus-ring: 0 0 0 3px rgba(96,165,250,.28);
}

/* 断点（CSS 变量不能用于媒体查询，这里只留文档值；页面用 §4.5 的固定断点）
 *   bp-wide = 1440px
 *   bp-desktop = 1280px
 *   bp-laptop = 1024px
 *   bp-tablet = 768px
 */

@media (prefers-reduced-motion: reduce) {
  :root {
    --motion-fast: 0ms;
    --motion-base: 0ms;
    --motion-slow: 0ms;
  }
}
