/* ============================================================
   个人总控台 v2.3 · Design Tokens
   Spec: spec-个人总控台v2.3-2026-08-31 §8
   风格：Linear · 单 accent 克制 · 状态色说话 · 浅色主题
   P0：禁 emoji 图标 / 禁紫粉渐变 / 禁硬编码颜色 / 禁空洞占位
   ============================================================ */

:root {
  /* ---- A1-identity · Surface & Foreground ---- */
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --fg: #0F172A;
  --muted: #64748B;
  --accent: #2563EB;
  --border: #E5E9F0;

  /* ---- A1-identity · Font ---- */
  --font-display: "Inter", "Noto Sans SC", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "Inter", "Noto Sans SC", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;

  /* ---- A1-structure ---- */
  --container-max: 1180px;
  --sidebar-w: 200px;
  --sidebar-drawer-w: 240px;
  --section-y: 18px;
  --section-y-phone: 14px;

  /* ---- A2 · Semantic ---- */
  --success: #22C55E;
  --success-ink: #15803D;
  --success-soft: #DCFCE7;
  --warn: #F59E0B;
  --warn-ink: #92400E;
  --warn-soft: #FEF3C7;
  --danger: #EF4444;
  --danger-ink: #B91C1C;
  --danger-soft: #FEE2E2;
  --accent-on: #FFFFFF;
  --accent-hover: #1D4ED8;
  --accent-active: #1E40AF;
  --accent-soft: #DBEAFE;

  /* ---- A2 · Mono & Motion & Focus ---- */
  --font-mono: "JetBrains Mono", "SF Mono", Consolas, monospace;
  --motion-fast: 150ms;
  --motion-base: 200ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.3);

  /* ---- B-slot ---- */
  --fg-2: #334155;
  --meta: #94A3B8;
  --surface-warm: #F8FAFC;
  --border-soft: #F1F5F9;
  --slate-soft: #F1F5F9;
  --slate-ink: #475569;

  /* ---- C-extension · 四层级（纯色，无渐变） ---- */
  --layer-base: #1E40AF;
  --layer-biz: #059669;
  --layer-grow: #7C3AED;   /* 合规约束：仅纯色/虚线描边，禁止与粉色系渐变 */
  --layer-asset: #D97706;
  --grow-soft: #EDE9FE;
  --grow-ink: #5B21B6;

  /* ---- C-extension · 甘特任务条 ---- */
  --gantt-doing-bg: #FEF3C7;
  --gantt-doing-ink: #92400E;
  --gantt-overdue-bg: #FEE2E2;
  --gantt-overdue-ink: #B91C1C;
  --gantt-done-bg: #DCFCE7;
  --gantt-done-ink: #15803D;
  --gantt-conflict: #7C3AED;  /* 撞车 1.5px dashed 描边 */
  --gantt-weekline: #2563EB;  /* 当前周左边界 */
  --gantt-load: #2563EB;
  --gantt-load-over: #EF4444;

  /* ---- C-extension · 生命周期徽章 ---- */
  --lc-incubate: #94A3B8;
  --lc-active: #2563EB;
  --lc-pause: #F59E0B;
  --lc-merged: #7C3AED;
  --lc-stopped: #64748B;
  --lc-pause-stripe: repeating-linear-gradient(45deg, #FEF3C7 0 4px, #FDE68A 4px 8px);

  /* ---- Typography ---- */
  --text-xs: 11px;
  --text-sm: 12px;
  --text-base: 14px;
  --text-md: 16px;
  --text-lg: 18px;
  --text-xl: 22px;
  --text-2xl: 28px;
  --weight-read: 400;
  --weight-em: 510;
  --weight-ann: 590;
  --leading-body: 1.6;
  --leading-tight: 1.25;

  /* ---- Spacing (4px 网格) ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  /* ---- Radius ---- */
  --radius-btn: 6px;
  --radius-card: 8px;
  --radius-bar: 5px;
  --radius-pill: 999px;

  /* ---- Elevation ---- */
  --elev-flat: none;
  --elev-card: 0 1px 3px rgba(15, 23, 42, 0.06);
  --elev-raised: 0 8px 24px rgba(15, 23, 42, 0.12);

  /* ---- Icon ---- */
  --icon-inline: 16px;
  --icon-button: 20px;
  --icon-solo: 24px;

  /* ---- Layout & a11y ---- */
  --bp-mobile: 700px;
  --touch-min: 44px;
  --z-sticky: 100;
  --z-drawer: 200;
  --z-overlay: 300;
  --z-toast: 400;
}

/* ============================================================
   基础规则（Token 消费层 · 前端直接复用）
   ============================================================ */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
}

/* 所有计数/负载/日期数字：等宽数字 */
.num, .metric b, .gantt-load-n, .steps-xy, .due-n {
  font-variant-numeric: tabular-nums;
}

/* focus-visible 必须保留（a11y 红线） */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-btn);
}

/* 尊重 reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Lucide 图标三档尺寸 */
.icon-i { width: var(--icon-inline); height: var(--icon-inline); stroke-width: 1.5; flex-shrink: 0; }
.icon-b { width: var(--icon-button); height: var(--icon-button); stroke-width: 1.5; flex-shrink: 0; }
.icon-s { width: var(--icon-solo); height: var(--icon-solo); stroke-width: 1.5; flex-shrink: 0; }

@media (max-width: 700px) {
  :root { --section-y: var(--section-y-phone); }
}
