/*
 * Pane 设计令牌
 * 网页原型里是 CSS 变量；WinUI 里对应 XAML 资源，命名和取值一一对应。
 * 玻璃参数按系统 Acrylic 的模型拆分：
 *   --glass-blur          模糊半径（仅网页可调；原生 Acrylic 固定，见 docs/design.md）
 *   --glass-tint-opacity  着色层浓度 ≈ TintOpacity
 *   --glass-lum-opacity   亮度层浓度 ≈ TintLuminosityOpacity
 *   --glass-saturation    饱和度增强
 *   --glass-noise         噪点强度
 * 下面带 "可调" 的变量由 app.js 写到 :root 的内联样式上。
 */

:root {
  /* ---- 玻璃（可调） ---- */
  --glass-blur: 36px;
  --glass-tint-opacity: 0.42;
  --glass-lum-opacity: 0.38;
  --glass-saturation: 1.6;
  --glass-noise: 0.035;
  --glass-highlight: 0.7;   /* 高光边框强度 0~1 */
  --glass-shadow: 0.7;      /* 阴影强度 0~1 */

  /* ---- 圆角（可调） ---- */
  --radius-panel: 20px;
  --radius-item: max(4px, calc(var(--radius-panel) - 8px));
  --radius-control: max(4px, calc(var(--radius-panel) - 10px));
  --radius-chip: 999px;

  /* ---- 动效（可调速度倍率） ---- */
  --motion-speed: 1;
  --dur-fast: calc(120ms * var(--motion-speed));
  --dur-normal: calc(220ms * var(--motion-speed));
  --dur-slow: calc(360ms * var(--motion-speed));
  --ease-smooth: cubic-bezier(0.2, 0, 0, 1);          /* 消失、普通过渡 */
  --ease-spring: cubic-bezier(0.34, 1.36, 0.64, 1);   /* 出现：轻微回弹 */
  --ease-glide: cubic-bezier(0.25, 1.05, 0.35, 1);    /* 选中高亮滑动 */
  --enter-scale: 0.94;
  /* 按下时缩小的比例（WinUI：PanePressScaleButton / IconButton / Swatch） */
  --press-scale-button: 0.97;
  --press-scale-icon: 0.9;
  --press-scale-swatch: 0.92;

  /* ---- 字体 ---- */
  /* 界面字体统一用 MiSans（本机装的是可变字体 "MiSans VF"）；等宽只用于代码类剪贴板内容 */
  --font-ui: "MiSans VF", "Microsoft YaHei UI", "Segoe UI Variable Text", system-ui, sans-serif;   /* 回落顺序同 WinUI 的 PaneFontUi */
  --font-display: "MiSans VF", "Microsoft YaHei UI", "Segoe UI Variable Display", system-ui, sans-serif;
  --font-mono: "Cascadia Mono", "Consolas", "MiSans VF", monospace;
  --font-math: "Cambria Math", "Segoe UI Symbol", "MiSans VF", serif;   /* AI 回答里的公式，同 WinUI 的 PaneFontMath */
  --text-xs: 11px;
  --text-sm: 12px;
  --text-md: 14px;
  --text-lg: 16px;
  --text-search: 20px;
  --text-title: 20px;   /* 标题：设置分区、引导页每一步（2026-10-31 补） */
  --text-hero: 26px;    /* 大标题：引导页 / 卸载的首屏、计算结果（2026-10-31 补） */

  /* ---- 图标（Lucide 描边型，线宽和 MiSans 常规字重相配） ---- */
  --icon-stroke: 1.75;

  /* ---- 控件高度（2026-10-31 补；之前各页写死，实际只用这四档） ----
   * xs 24：小开关式标签、行内小按钮（移出、删规则）、分段里的按钮
   * sm 28：文字按钮、图标按钮、分段整体、紧凑输入框
   * md 32：输入框、下拉框、窗口头部按钮、窗口底部主按钮
   * lg 40：引导页这类大号主按钮
   * 列表行、面板、窗口的高度属于版式，不在这里 */
  --control-xs: 24px;
  --control-sm: 28px;
  --control-md: 32px;
  --control-lg: 40px;

  /* ---- 间距 ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;

  /* ---- 主色（可调，克制） ---- */
  --accent: #5874c9;   /* 雾蓝，2026-10-28 用户选定，和软件图标同色相 */

  /* ---- 状态色（2026-10-31 补）：只用于出错 / 成功的小字、小标签和危险操作的悬停底，不用于大面积 ---- */
  --danger: #e5484d;
  --success: #2f9e5b;
  --warning: #f5a524;   /* 需要留意但不算出错：等待中、提醒 */

  /* ---- 剪贴板标签色点（2026-11-23）：只画 5～10 的小圆点，不做底色；低饱和，深浅色通用。前三个和可选主题色同色 ---- */
  --tag-1: #5874c9;   /* 雾蓝 */
  --tag-2: #17958b;   /* 青碧 */
  --tag-3: #5f8f4e;   /* 苔绿 */
  --tag-4: #c08a3e;   /* 琥珀 */
  --tag-5: #c2607a;   /* 蔷薇 */
  --tag-6: #8a6cc0;   /* 藤紫 */

  /* ---- 浅色 ---- */
  --tint: #f6f6f8;
  --luminosity: #ffffff;
  --text-1: rgb(20 20 24 / 0.92);
  --text-2: rgb(20 20 24 / 0.62);
  --text-3: rgb(20 20 24 / 0.42);
  --stroke: rgb(0 0 0 / 0.08);
  --fill-hover: rgb(0 0 0 / 0.045);
  --fill-selected: rgb(255 255 255 / 0.62);
  --fill-control: rgb(255 255 255 / 0.5);
  --fill-match: rgb(20 20 24 / 0.14);    /* 搜索命中、改名预览里改动的部分：中性浅底，不用主题色 */
  --edge-light: rgb(255 255 255 / calc(0.75 * var(--glass-highlight)));
  --edge-outer: rgb(0 0 0 / calc(0.10 * var(--glass-highlight)));
  --edge-mid: 30%; --edge-low: 10%; --edge-bottom: 45%;  /* 高光边从上到下的强度：顶 100%、30% 处、70% 处、底 */
  --shadow-color: 0 0 0;
  color-scheme: light;
}

/* 跟随系统的深色 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --tint: #1c1c20;
    --luminosity: #0a0a0c;
    --text-1: rgb(255 255 255 / 0.94);
    --text-2: rgb(255 255 255 / 0.64);
    --text-3: rgb(255 255 255 / 0.40);
    --stroke: rgb(255 255 255 / 0.08);
    --fill-hover: rgb(255 255 255 / 0.06);
    --fill-selected: rgb(255 255 255 / 0.12);
    --fill-control: rgb(255 255 255 / 0.07);
    --fill-match: rgb(255 255 255 / 0.14);
    --edge-light: rgb(255 255 255 / calc(0.22 * var(--glass-highlight)));
    --edge-outer: transparent;  /* 2026-10-28：深色不要外圈黑线（亮色、花哨背景上像黑框），改成整圈淡白高光 */
    --edge-mid: 60%; --edge-low: 45%; --edge-bottom: 65%;
    color-scheme: dark;
  }
}

/* 手动深色 */
:root[data-theme="dark"] {
  --tint: #1c1c20;
  --luminosity: #0a0a0c;
  --text-1: rgb(255 255 255 / 0.94);
  --text-2: rgb(255 255 255 / 0.64);
  --text-3: rgb(255 255 255 / 0.40);
  --stroke: rgb(255 255 255 / 0.08);
  --fill-hover: rgb(255 255 255 / 0.06);
  --fill-selected: rgb(255 255 255 / 0.12);
  --fill-control: rgb(255 255 255 / 0.07);
  --fill-match: rgb(255 255 255 / 0.14);
  --edge-light: rgb(255 255 255 / calc(0.22 * var(--glass-highlight)));
  --edge-outer: transparent;  /* 2026-10-28：深色不要外圈黑线（亮色、花哨背景上像黑框），改成整圈淡白高光 */
  --edge-mid: 60%; --edge-low: 45%; --edge-bottom: 65%;
  color-scheme: dark;
}
