:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;

  /* Main Web Shell semantic tokens — V3.0 原型 assets/app.css 浅色值（逐值对齐） */
  --bg: #F6F2EB;                 /* canvas */
  --surface: #ffffff;            /* surface */
  --surface-2: #FBF9F5;          /* surfaceMuted */
  --surface-3: #F1EAE0;
  --text: #211D18;               /* text */
  --muted: #8B8378;              /* textSecondary */
  --line: #E9E1D5;               /* line */
  --line-strong: #DCCFC0;
  --brand: #FF4D3A;              /* primary */
  --brand-strong: #E8253F;       /* primaryStrong */
  --primary-soft: #FFF0F0;       /* primarySoft */
  --tech: #8B5CF6;               /* tech */
  --tech-soft: rgba(139,92,246,.08);          /* techSoft */
  --blue: #2F6FED;               /* info */
  --success: #1E9E6A;
  --success-soft: #eaf8f2;
  --warning: #E8930C;
  --warning-soft: #fff6df;
  --danger: #E8442E;
  --danger-soft: #fff0f2;

  /* Legacy aliases (keep — used by styles.css / v4-shell.css / pages) */
  --bg-elevated: var(--surface);
  --panel-solid: var(--surface);
  --bg-soft: var(--surface-2);
  --panel: rgba(255, 255, 255, 0.94);
  --panel-strong: var(--surface-3);
  --text-strong: #211D18;
  --muted-2: #B9B0A3;
  --accent: var(--brand);
  --accent-2: var(--brand-strong);
  --accent-soft: var(--primary-soft);
  --green: var(--success);
  --gold: var(--warning);

  /* Navigation surfaces — 深墨绿双主题固定（V3.0 原型 rail/context 色值） */
  --sidebar: #221C15;
  --sidebar-raised: #3A2D1E;
  --sidebar-text: #F3EBDD;
  --sidebar-text-secondary: #B8A88F;
  --sidebar-line: rgba(255, 255, 255, 0.06);
  --topbar-bg: rgba(255, 255, 255, 0.94);

  /* V4 Shell aliases */
  --primary: var(--accent);
  --border: var(--line);
  --text-secondary: var(--muted);

  --shadow: 0 12px 36px rgba(20, 34, 29, 0.10);
  --shadow-soft: 0 1px 2px rgba(20, 34, 29, 0.04);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-xl: 28px;
  --content: 1600px;
  --topbar: 64px;
  --sidebar-width: 272px;
}

[data-theme="dark"] {
  color-scheme: dark;

  /* Main Web Shell semantic tokens — V3.0 原型 assets/app.css 深色值（逐值对齐） */
  --bg: #171310;                 /* canvas — never pure black */
  --surface: #141e1b;            /* surface */
  --surface-2: #192622;          /* surfaceMuted */
  --surface-3: #20302b;
  --text: #eef4f1;               /* text */
  --muted: #98a9a2;              /* textSecondary */
  --line: #3a2d1e;               /* line */
  --line-strong: #3c5149;
  --brand: #ff729d;              /* primary */
  --brand-strong: #ff8dae;       /* primaryStrong */
  --primary-soft: #3a2020;       /* primarySoft */
  --tech: #73d5b5;               /* tech */
  --tech-soft: #15342b;          /* techSoft */
  --blue: #70a8ff;               /* info */
  --success: #55c99b;
  --success-soft: #15352b;
  --warning: #e0a64c;
  --warning-soft: #392d18;
  --danger: #f07886;
  --danger-soft: #3a2025;

  /* Legacy aliases (keep — used by styles.css / v4-shell.css / pages) */
  --bg-elevated: var(--surface);
  --panel-solid: var(--surface);
  --bg-soft: var(--surface-2);
  --panel: rgba(34, 28, 21, 0.95);
  --panel-strong: var(--surface-3);
  --text-strong: #ffffff;
  --muted-2: #7c8b84;
  --accent: var(--brand);
  --accent-2: var(--brand-strong);
  --accent-soft: #3a1f29;
  --green: var(--success);
  --gold: var(--warning);

  /* Navigation surfaces — deep ink green, never pure black */
  --sidebar: #07100d;
  --sidebar-raised: #10201a;
  --sidebar-text: #d8e5df;
  --sidebar-text-secondary: #789087;
  --sidebar-line: rgba(255, 255, 255, 0.06);
  --topbar-bg: rgba(20, 30, 27, 0.95);

  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.22);
  --radius-lg: 24px;
}
