/* ============================================================
   设计令牌（Design Tokens）—— 全部色彩、圆角、阴影的唯一来源
   命名遵循 shadcn 语义规范；shadcn 仅作设计语言参考。
   :root 为深色默认，html[data-theme="light"] 覆盖浅色值。
   ============================================================ */

:root {
  color-scheme: dark;

  /* ---- shadcn 语义令牌（深色默认）---- */
  --background: #1c1c1e;
  --foreground: #ffffff;
  --card: #2c2c2e;
  --card-foreground: #ffffff;
  --popover: #2c2c2e;
  --popover-foreground: #ffffff;
  --primary: #0a84ff;
  --primary-foreground: #ffffff;
  --secondary: #3a3a3c;
  --secondary-foreground: #ffffff;
  --muted: #3a3a3c;
  --muted-foreground: rgba(235, 235, 245, 0.6);
  --accent: #48484a;
  --accent-foreground: #ffffff;
  --destructive: #ff453a;
  --destructive-foreground: #ffffff;
  --border: rgba(255, 255, 255, 0.08);
  --input: rgba(255, 255, 255, 0.12);
  --ring: #0a84ff;

  /* ---- 应用扩展令牌 ---- */
  --titlebar: #262628;
  --tertiary-foreground: rgba(235, 235, 245, 0.3);
  --separator: rgba(255, 255, 255, 0.06);

  /* ---- 语义色板（苹果系统色，两主题一致）---- */
  --color-blue: #0a84ff;
  --color-purple: #bf5af2;
  --color-green: #30d158;
  --color-orange: #ff9f0a;
  --color-red: #ff453a;
  --color-cyan: #64d2ff;
  --color-pink: #ff375f;

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

  /* ---- 阴影 ---- */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);

  /* ---- Canvas 用 RGB 三元组（空格分隔，供 JS 拼接 alpha）---- */
  --primary-rgb: 10 132 255;
  --success-rgb: 48 209 88;
  --purple-rgb: 191 90 242;
  --destructive-rgb: 255 69 58;
  --foreground-rgb: 255 255 255;
}

/* ---- 浅色主题覆盖（兼容遗留 .light-theme 类选择器）---- */
html[data-theme="light"],
.light-theme {
  color-scheme: light;

  --background: #ffffff;
  --foreground: #1d1d1f;
  --card: #f5f5f7;
  --card-foreground: #1d1d1f;
  --popover: #f5f5f7;
  --popover-foreground: #1d1d1f;
  --primary: #0a84ff;
  --primary-foreground: #ffffff;
  --secondary: #e5e5ea;
  --secondary-foreground: #1d1d1f;
  --muted: #e5e5ea;
  --muted-foreground: #6e6e73;
  --accent: #d1d1d6;
  --accent-foreground: #1d1d1f;
  --destructive: #ff453a;
  --destructive-foreground: #ffffff;
  --border: rgba(0, 0, 0, 0.08);
  --input: rgba(0, 0, 0, 0.12);
  --ring: #0a84ff;

  --titlebar: #f5f5f7;
  --tertiary-foreground: #86868b;
  --separator: rgba(0, 0, 0, 0.06);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.18);

  --foreground-rgb: 29 29 31;
}

/* 浅色主题滚动条样式（自旧 style.css 迁移） */
html[data-theme="light"] ::-webkit-scrollbar-thumb,
.light-theme ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
}

html[data-theme="light"] ::-webkit-scrollbar-thumb:hover,
.light-theme ::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}
