/* Design tokens — direction A「清透」. The single source of colour, type and spacing. */
:root {
  color-scheme: light;
  --font-sans: "Inter", "Segoe UI Variable Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --text-xs: 12px; --text-sm: 13px; --text-md: 14px; --text-lg: 16px; --text-xl: 22px; --text-2xl: 28px;
  --leading: 1.55; --leading-tight: 1.3;
  --weight-medium: 550; --weight-strong: 650;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px;
  --space-6: 24px; --space-8: 32px; --space-10: 40px; --space-12: 48px;

  --radius-sm: 6px; --radius: 8px; --radius-lg: 12px; --radius-pill: 999px;
  --control-h: 36px; --control-h-sm: 30px;
  --sidebar-w: 240px; --topbar-h: 60px;
  --content-max: 1200px;

  --bg: #f7f8fa;
  --bg-sunken: #f0f2f5;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-hover: #f5f6f8;
  --text: #161a1d;
  --text-muted: #5f6873;
  --text-subtle: #929ba6;
  --text-inverse: #ffffff;
  --line: #eceef1;
  --line-strong: #dfe3e8;
  --control-border: #dadfe5;

  --accent: #1f6b4a;
  --accent-hover: #185a3e;
  --accent-bright: #2f8f62;
  --accent-soft: #eef7f2;
  --accent-soft-text: #1f6b4a;
  --focus: #2f8f62;

  --kind-skill: #6d4ae0; --kind-skill-soft: #f1edff;
  --kind-mcp: #2f6fe0;   --kind-mcp-soft: #e8f1ff;
  --kind-tool: #c8780e;  --kind-tool-soft: #fff3e2;
  --kind-memory: #0e8f8a; --kind-memory-soft: #e3f6f5;

  --info: #2f6fe0;   --info-soft: #ebf2ff;
  --success: #1f7a4d; --success-soft: #e9f6ef;
  --warning: #a2620a; --warning-soft: #fff4e0;
  --danger: #c4321f;  --danger-soft: #fdeeec; --danger-hover: #a52916;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 14px rgba(16, 24, 40, .06);
  --shadow-lg: 0 18px 48px rgba(16, 24, 40, .16), 0 2px 6px rgba(16, 24, 40, .06);
  --backdrop: rgba(15, 20, 25, .38);

  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur: 140ms;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1214; --bg-sunken: #0b0e10; --surface: #15191c; --surface-raised: #1b2024; --surface-hover: #1e2428;
  --text: #e8ecef; --text-muted: #a1aab3; --text-subtle: #737d87; --text-inverse: #0b0e10;
  --line: #23292e; --line-strong: #2e353b; --control-border: #384047;
  --accent: #3fae78; --accent-hover: #5cc28f; --accent-bright: #5cc28f; --accent-soft: #15291f; --accent-soft-text: #8fdcb3; --focus: #5cc28f;
  --kind-skill: #b9a5ff; --kind-skill-soft: rgba(167, 139, 250, .14);
  --kind-mcp: #93bdff; --kind-mcp-soft: rgba(96, 165, 250, .14);
  --kind-tool: #f6c56b; --kind-tool-soft: rgba(251, 191, 36, .13);
  --kind-memory: #6fd6d0; --kind-memory-soft: rgba(45, 212, 191, .13);
  --info: #93bdff; --info-soft: #172235; --success: #7fd3a6; --success-soft: #142a1f;
  --warning: #f0c069; --warning-soft: #2c2412; --danger: #f2897c; --danger-soft: #331a17; --danger-hover: #f6a79d;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 2px 12px rgba(0,0,0,.35); --shadow-lg: 0 18px 48px rgba(0,0,0,.55);
  --backdrop: rgba(0,0,0,.6);
}
