/* ============================================================
   RUN·润 移居手册 · 设计 token 层
   配色/字阶/圆角完整移植自 grokbot.yin.wiki 的 design-system/tokens.css
   （shadcn 风格命名约定，浅色为默认，[data-theme="dark"] 切换深色）
   全站唯一的颜色/字号/间距源头，页面不再定义私有变量
   字体：Inter latin 子集本地自托管（SIL OFL），中文回退系统字体
   ============================================================ */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* 字体 */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas,
    monospace;

  /* 字阶 */
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-md: 16px;
  --text-lg: 20px;
  --text-xl: 28px;
  --text-hero: 40px;

  /* 圆角 */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;

  /* 浅色主题（默认） */
  --background: #ffffff;
  --surface: #fafafa;
  --surface-hover: #f4f4f5;
  --muted: #f0f0f2;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);

  --foreground: #18181b;
  --foreground-secondary: #52525b;
  --foreground-tertiary: #a1a1aa;

  --accent: #2e6bff;
  --accent-foreground: #ffffff;
  --accent-muted: rgba(46, 107, 255, 0.08);
  --ring: rgba(46, 107, 255, 0.3);

  --success: #1a9e6f;
  --success-muted: rgba(26, 158, 111, 0.1);
  --warning: #b57d2b;
  --warning-muted: rgba(181, 125, 43, 0.1);
  --danger: #d3454f;
  --danger-muted: rgba(211, 69, 79, 0.08);

  /* 代码语法色（浅色） */
  --code-bg: #f7f7f8;
  --tok-k: #9333ea; /* 关键字 */
  --tok-f: #2563eb; /* 函数 */
  --tok-s: #3d8a40; /* 字符串 */
  --tok-n: #c2410c; /* 数字 */
  --tok-c: #9ca3af; /* 注释 */

  color-scheme: light;
}

[data-theme="dark"] {
  --background: #0a0a0b;
  --surface: #111113;
  --surface-hover: #161619;
  --muted: #1a1a1e;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.13);

  --foreground: #fafafa;
  --foreground-secondary: #a1a1aa;
  --foreground-tertiary: #6d6d76;

  --accent: #5b8cff;
  --accent-foreground: #ffffff;
  --accent-muted: rgba(91, 140, 255, 0.12);
  --ring: rgba(91, 140, 255, 0.4);

  --success: #46b38a;
  --success-muted: rgba(70, 179, 138, 0.12);
  --warning: #dfa556;
  --warning-muted: rgba(223, 165, 86, 0.12);
  --danger: #e06c75;
  --danger-muted: rgba(224, 108, 117, 0.12);

  /* 代码语法色（深色） */
  --code-bg: #0e0e11;
  --tok-k: #c792ea;
  --tok-f: #82aaff;
  --tok-s: #c3e88d;
  --tok-n: #f78c6c;
  --tok-c: #546178;

  color-scheme: dark;
}
