/* ==========================================================================
   万象AI (WanXiang AI) 2.0 · Apple Design System (HIG 级极简与克制美学)
   视觉规范：基于 SF Pro 字阶、超椭圆 Squircle 曲率、材质毛玻璃与无感直达
   ========================================================================== */

/* ==========================================================================
   全局滚动条（浅灰细条，hover 更浅更克制）
   ========================================================================== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--gray-200);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gray-150); /* hover 时更浅 */
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:active {
  background: var(--gray-250);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-corner { background: transparent; }

/* 调色板：组件里不再写死色值，统一引用这里的变量（语义变量见下方 :root） */
:root {
  --amber-300: #ffb340;
  --amber-500: #f59e0b;
  --black: #000000;
  --blue-400: #2997ff;
  --blue-600: #0071e3;
  --coral-500: #ff6a3d;
  --emerald-500: #10b981;
  --gray-50: #f5f5f7;
  --gray-150: #d8dce3;
  --gray-200: #c7ccd6;
  --gray-250: #c0c5cf;
  --gray-300: #aeaeb2;
  --gray-400: #a1a1a6;
  --gray-800: #2c2c2e;
  --gray-850: #1c1c1e;
  --gray-950: #0a0a0c;
  --green-300: #7ddb6e;
  --green-500: #34c759;
  --orange-500: #ff9500;
  --red-500: #ff3b30;
  --rose-600: #e0245e;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --white: #ffffff;
}

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "PingFang SC",
    "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;

  /* 基础色板 (Apple 经典温润中性基底) */
  --bg: #f5f5f7;                 /* Apple 舞台浅灰色基底 */
  --bg-subtle: #e8e8ed;          /* 凹陷面与次级背景 */
  --fg: #1d1d1f;                 /* Apple 标志性近黑色，饱满温和 */
  --fg-muted: #515154;           /* 次级正文标签 */
  --fg-subtle: #6e6e73;          /* 三级辅助灰色（白底对比度 ≥4.5） */

  /* 侧栏专用色板 (macOS Finder / Settings 质感) */
  --sidebar-w: 250px;
  --sidebar-bg: #fbfbfd;
  --sidebar-border: rgba(0, 0, 0, 0.08);
  --sidebar-item-hover: rgba(0, 0, 0, 0.04);
  --sidebar-active-bg: rgba(0, 113, 227, 0.08);
  --sidebar-active-text: #0071e3;

  /* 卡片与组件 (Apple Squircle 连续曲率) */
  --card: #ffffff;
  --card-border: rgba(0, 0, 0, 0.06);
  --line: rgba(0, 0, 0, 0.06);

  /* 语义状态色（用于文字，浅底对比度 ≥4.5） */
  --ok-fg: #1f7a35;
  --ok-bg: rgba(52, 199, 89, 0.12);
  --warn-fg: #b45309;
  --warn-bg: rgba(255, 149, 0, 0.12);
  --danger-fg: #c4161c;
  --danger-bg: rgba(255, 59, 48, 0.1);

  /* 品牌色阶 (Apple System Blue，极简克制) */
  --apple-blue: #0071e3;
  --apple-blue-hover: #0077ed;
  --brand: #0071e3;
  --brand-hover: #0077ed;
  --brand-gradient: linear-gradient(180deg, #0077ed 0%, #0071e3 100%);
  --brand-soft: rgba(0, 113, 227, 0.08);
  --brand-glow: rgba(0, 113, 227, 0.18);
  --brand-solid: #0071e3;        /* 白字按钮底色（白字对比度 ≥4.5） */

  /* 间距与连续圆角 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 9999px;

  /* Apple 微投影系统 */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.03);
  --shadow-card: 0 2px 10px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-hover: 0 12px 30px -4px rgba(0, 0, 0, 0.08), 0 4px 12px -2px rgba(0, 0, 0, 0.03);
  --shadow-floating: 0 20px 48px -10px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.04);
}

html[data-theme="dark"] {
  /* 苹果深色 OLED 材质体系 */
  --bg: #000000;                 /* Apple OLED 纯黑背景 */
  --bg-subtle: #161617;          /* Apple 深色二级背景 */
  --fg: #f5f5f7;                 /* 主文本纯净高对比 */
  --fg-muted: #a1a1a6;           /* 次级正文淡灰 */
  --fg-subtle: #8e8e93;           /* 辅助文字（黑底对比度 ≥4.5） */

  --sidebar-bg: #111112;
  --sidebar-border: rgba(255, 255, 255, 0.1);
  --sidebar-item-hover: rgba(255, 255, 255, 0.05);
  --sidebar-active-bg: rgba(41, 151, 255, 0.15);
  --sidebar-active-text: #2997ff;

  --card: #161617;
  --card-border: rgba(255, 255, 255, 0.1);
  --line: rgba(255, 255, 255, 0.08);

  --ok-fg: #34c759;
  --ok-bg: rgba(52, 199, 89, 0.2);
  --warn-fg: #ff9f0a;
  --warn-bg: rgba(255, 159, 10, 0.2);
  --danger-fg: #ff6961;
  --danger-bg: rgba(255, 69, 58, 0.2);

  --apple-blue: #2997ff;
  --apple-blue-hover: #47a6ff;
  --brand: #2997ff;
  --brand-hover: #47a6ff;
  --brand-gradient: linear-gradient(180deg, #0077ed 0%, #0071e3 100%);
  --brand-soft: rgba(41, 151, 255, 0.15);
  --brand-glow: rgba(41, 151, 255, 0.25);
  --brand-solid: #0071e3;        /* 深色模式白字按钮同样用深一档的蓝 */

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 2px 10px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 12px 30px -4px rgba(0, 0, 0, 0.7);
  --shadow-floating: 0 20px 48px -10px rgba(0, 0, 0, 0.85);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--fg);
  background-color: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.2s, color 0.2s;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

