/* 茄紫工作台 —— 语义令牌替换块（浅色 + 深色）
 *
 * 用法：把 web/src/styles.css 里的 `@theme inline` 颜色映射段、`:root`、`.dark`
 * 三段按本文件替换即可；其余部分（@font-face、@utility、@layer base、动效 keyframes）
 * 保持原样。本文件只出现 web/src/styles.css 中真实存在的变量名。
 *
 * 纪律：品牌紫只做「动作 / 选中 / 激活」锚点，大面积面色一律用紫灰中性阶；
 *       三级面层级 = 轨道(#d5bfe4) < 画布紫色洗面 < 面板纯白。
 */

@theme inline {
  /* 与原文一致的颜色映射，仅 `--brand` 家族沿用变量链路，不新增旁路 */
  --color-brand-ink: var(--brand-ink);
  --color-sidebar-ring: var(--sidebar-ring);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar: var(--sidebar);
  --color-chart-5: var(--chart-5);
  --color-chart-4: var(--chart-4);
  --color-chart-3: var(--chart-3);
  --color-chart-2: var(--chart-2);
  --color-chart-1: var(--chart-1);
  --color-ring: var(--ring);
  --color-input: var(--input);
  --color-border: var(--border);
  --color-destructive: var(--destructive);
  --color-accent-foreground: var(--accent-foreground);
  --color-accent: var(--accent);
  --color-muted-foreground: var(--muted-foreground);
  --color-muted: var(--muted);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-secondary: var(--secondary);
  --color-primary-foreground: var(--primary-foreground);
  --color-primary: var(--primary);
  --color-popover-foreground: var(--popover-foreground);
  --color-popover: var(--popover);
  --color-card-foreground: var(--card-foreground);
  --color-card: var(--card);
  --color-foreground: var(--foreground);
  --color-background: var(--background);
  --color-brand: var(--brand);
  --color-brand-foreground: var(--brand-foreground);
  --color-brand-soft: var(--brand-soft);
  --color-surface-chat-soft: var(--surface-chat-soft);
  --color-surface-chat-selected: var(--surface-chat-selected);
  --color-mention: var(--mention);
  --color-ink: var(--ink);
  --color-surface-rail: var(--surface-rail);
  --color-interactive: var(--interactive);
  --color-channel-icon: var(--channel-icon);
}

:root {
  /* ——— 面层级：轨道 #d5bfe4 < 画布洗面 #f1e8f8→#e9dbf3 < 面板纯白 ——— */
  /* 内容面/面板/卡片统一纯白：纯白是最高层，画布的紫色只出现在 8px 缝隙里。 */
  --background: #ffffff;
  /* 正文色由 #060607 抬到 Carbon #1d1c1d：中文 14px 下少一点硬黑，对比度仍有 16.99:1。 */
  --foreground: #1d1c1d;
  --card: #ffffff;
  --card-foreground: #1d1c1d;
  --popover: #ffffff;
  --popover-foreground: #1d1c1d;
  /* 他人消息气泡：淡紫中性面，与纯白面板拉开 1.25:1，替代原来的灰蓝 #ebedef。 */
  --secondary: #ece2f3;
  --secondary-foreground: #1d1c1d;
  /* 最轻洗面（浅底气泡 / hover 底）：比 secondary 再淡一档，不承担层级职责。 */
  --muted: #f5f0f9;
  /* 次级文字（时间戳/成员数/预览）整体加深一档：在他人气泡 #ece2f3 上从 4.4:1 提到 5.06:1。 */
  --muted-foreground: #655c6d;
  /* 悬停/次要 chip 面：比 secondary 深一档（1.11:1），保证 hover 与静默面可区分。 */
  --accent: #e3d6ed;
  --accent-foreground: #1d1c1d;
  /* 危险色加深到 #b3261e：白底文字 6.54:1，也满足浅红底(#b3261e/10%)上的文字可读。 */
  --destructive: #b3261e;
  /* 1px 装饰细线：仅分割大面，不承担控件边界职责（1.43:1）。 */
  --border: #ded4e7;
  /* 输入框边界由 #dcdee1 提到 #9c8aa8：1.4.11 要求控件边界 ≥3:1，实测 3.17:1。 */
  --input: #9c8aa8;
  --ring: var(--brand);
  /* 与原文件一致：primary 链路沿用 brand，不引入第二套主色变量。 */
  --primary: var(--brand);
  --primary-foreground: var(--brand-foreground);
  /* 图表五色改为同族紫色阶 + 蓝 + 琥珀：全部 ≥4.5:1（白底），不再是 0 chroma 灰阶。 */
  --chart-1: #611f69;
  --chart-2: #8a2fa6;
  --chart-3: #b03fc9;
  --chart-4: #1264a3;
  --chart-5: #a15c00;
  /* 圆角收敛：8px 基准 → 按钮/输入 8、卡片/气泡/弹窗 11.2、面板 14.4、抽屉 17.6、徽标胶囊 20.8。 */
  --radius: 0.5rem;
  /* 主色取参考 Slack Aubergine #611f69，白字 11:1；只用于实心动作、选中行与激活项。 */
  --brand: #611f69;
  --brand-foreground: #ffffff;
  /* 选中洗面：茄紫 12% 叠加在任意底色上，深浅两套同构。 */
  --brand-soft: rgb(97 31 105 / 0.12);
  /* 选中行文字：Plum Shadow #3d0157，压在同族洗面上仍 12.68:1。 */
  --brand-ink: #3d0157;
  /* 自己的消息气泡：淡茄紫洗面 #f1e3f8，文字取 Plum Shadow #3d0157（12.75:1）。 */
  --message-self: #f1e3f8;
  --message-self-foreground: #3d0157;
  /* 引用/回复底：比他人气泡更淡，避免两条气泡层次打架。 */
  --surface-chat-soft: #f7f2fa;
  /* 会话行选中底：与 --brand-soft 视觉等强，叠加后不改变文字对比。 */
  --surface-chat-selected: #efe3f7;
  /* @提及取参考 Iris #730394：白底 9.68:1，气泡底上仍 ≥7.8:1。 */
  --mention: #730394;
  --ink: #1d1c1d;
  /* 轨道底色：同时是未读徽标 ring 的取色（workspace-rail.tsx:102/159），二者必须同色。 */
  --surface-rail: #d5bfe4;
  /* 应用画布：紫色洗面梯度，让 md:my-2 的缝隙与圆角面板可见（面板/画布 1.19~1.32:1）。 */
  --workspace-background: linear-gradient(180deg, #f1e8f8, #e9dbf3);
  --workspace-rail-background: var(--surface-rail);
  --workspace-header-background: var(--background);
  /* chrome 图标色：由 #4e5058 换成紫灰 #574d61，白底 7.96:1。 */
  --interactive: #574d61;
  /* 弱图标/弱说明文字：由 #80848e（白底 3.9:1，不达标）加深到 #665c6f（6.32:1）。 */
  --channel-icon: #665c6f;
  /* sidebar 家族当前无组件引用（死令牌），取值与上面同族，便于后续接入不改观感。 */
  --sidebar: #f7f2fa;
  --sidebar-foreground: #1d1c1d;
  --sidebar-primary: var(--brand);
  --sidebar-primary-foreground: var(--brand-foreground);
  --sidebar-accent: #ece2f3;
  --sidebar-accent-foreground: #1d1c1d;
  --sidebar-border: #ded4e7;
  --sidebar-ring: var(--ring);
}

.dark {
  /* ——— 深色 = 深茄紫舞台：轨道 #3a2245 提亮做锚，面板 #211426 不再同色 ——— */
  --background: #211426;
  --foreground: #f3ecf8;
  --card: #2a1b31;
  --card-foreground: #f3ecf8;
  --popover: #2c1d33;
  --popover-foreground: #f3ecf8;
  --secondary: #33223b;
  --secondary-foreground: #f3ecf8;
  --muted: #2a1b30;
  /* 深色次级文字 #b6a8c1：面板上 7.85:1、气泡上 6.53:1。 */
  --muted-foreground: #b6a8c1;
  --accent: #3d2946;
  --accent-foreground: #f3ecf8;
  /* 深色危险色用亮红 #ff9aa0：面板上 8.7:1，10% 淡红底上 5.79:1。 */
  --destructive: #ff9aa0;
  /* 细线与控件边界改用参考 Lavender Mist 低透明度，而不是中性白 alpha（深紫底上更协调）。 */
  --border: rgb(234 200 254 / 0.14);
  /* 控件边界 45% lavender（≈#7b6587）：面板上 3.4:1，满足 1.4.11。 */
  --input: rgb(234 200 254 / 0.45);
  --ring: var(--brand);
  --chart-1: #c77ee8;
  --chart-2: #a978e0;
  --chart-3: #e0a0ff;
  --chart-4: #6aa9e0;
  --chart-5: #e8bb63;
  /* 深色主色上提为亮紫 #c77ee8 + 深茄紫字：填充上 6.43:1，且与面板 6.35:1。 */
  --brand: #c77ee8;
  --brand-foreground: #240f2b;
  /* 与浅色同源，显式声明以免依赖 :root 继承（原文件在 .dark 中省略）。 */
  --primary: var(--brand);
  --primary-foreground: var(--brand-foreground);
  --brand-soft: rgb(199 126 232 / 0.18);
  --brand-ink: #e6c3f7;
  --mention: #dda6ff;
  --message-self: #3c2147;
  --message-self-foreground: #f6e9fd;
  --surface-chat-soft: #341f3c;
  --surface-chat-selected: #3f2749;
  --ink: #f3ecf8;
  /* 深色轨道 #3a2245：修掉原来 #e3e5e8 造成的「深色下一条浅色竖带」，同时仍是徽标 ring 取色。 */
  --surface-rail: #3a2245;
  --workspace-background: linear-gradient(180deg, #2c1a34, #1a0f1f);
  --workspace-rail-background: var(--surface-rail);
  --workspace-header-background: var(--background);
  --interactive: #cfc3d8;
  --channel-icon: #b0a3bc;
  --sidebar: #2a1b31;
  --sidebar-foreground: #f3ecf8;
  --sidebar-accent: #3d2946;
  --sidebar-accent-foreground: #f3ecf8;
  --sidebar-border: rgb(234 200 254 / 0.14);
  --sidebar-ring: var(--ring);
  --sidebar-primary: var(--brand);
  --sidebar-primary-foreground: var(--brand-foreground);
}
