/* 安澜 AI · 深色主题覆盖（复刻 AgentBridge 色板，隐藏 New API 默认蓝白主题） */
html.dark, .dark {
  --background: #1c1c1b !important;
  --foreground: #f3f0ee !important;
  --card: #242321 !important;
  --card-foreground: #f3f0ee !important;
  --popover: #31302f !important;
  --popover-foreground: #f3f0ee !important;
  --primary: #ffb59e !important;
  --primary-foreground: #390b00 !important;
  --secondary: #49473f !important;
  --secondary-foreground: #f3f0ee !important;
  --muted: #31302f !important;
  --muted-foreground: #cbc6bc !important;
  --accent: #541400 !important;
  --accent-foreground: #ffdbd0 !important;
  --destructive: #ffb4ab !important;
  --destructive-foreground: #690005 !important;
  --success: #5edac7 !important;
  --success-foreground: #00201c !important;
  --warning: #f6be5c !important;
  --warning-foreground: #1d1c15 !important;
  --info: #7df7e3 !important;
  --info-foreground: #00201c !important;
  --neutral: #cbc6bc !important;
  --neutral-foreground: #1d1c15 !important;
  --border: #f3f0ee1f !important;
  --input: #f3f0ee29 !important;
  --ring: #ffb59e !important;
  --chart-1: #ffb59e !important;
  --chart-2: #7df7e3 !important;
  --chart-3: #d97757 !important;
  --chart-4: #cbc6bc !important;
  --chart-5: #09a493 !important;
  --sidebar: #242321 !important;
  --sidebar-foreground: #f3f0ee !important;
  --sidebar-primary: #ffb59e !important;
  --sidebar-primary-foreground: #390b00 !important;
  --sidebar-accent: #31302f !important;
  --sidebar-accent-foreground: #f3f0ee !important;
  --sidebar-border: #f3f0ee1f !important;
  --sidebar-ring: #ffb59e !important;
  --skeleton-base: #31302f !important;
  --skeleton-highlight: #49473f !important;
  --table-row: #242321 !important;
}

/* 强制页面背景与文字色，避免浅色残留 */
html.dark body,
html.dark #root {
  background-color: #1c1c1b !important;
  color: #f3f0ee !important;
}

/* 顶部导航、侧栏等使用主题色 */
html.dark a { color: #ffb59e !important; }

/* 让浏览器地址栏/主题色也一致 */
html.dark { color-scheme: dark !important; }

/* ===== v2 修复：桃色底按钮文字对比度（落地页「开始使用」等 bg-primary 元素）===== */
.bg-primary,
[class*="bg-primary"] {
  color: #1c1c1b !important;
}
.bg-primary:hover,
[class*="bg-primary"]:hover {
  color: #1c1c1b !important;
  filter: brightness(1.05);
}

/* ===== v3 修复：豁免带桃色底的按钮链接（html.dark a 一刀切规则的例外）===== */
html.dark a[class*="bg-primary"],
html.dark button[class*="bg-primary"],
html.dark [data-slot="button"][class*="bg-primary"],
html.dark a[class*="bg-primary"] *,
html.dark [data-slot="button"][class*="bg-primary"] * {
  color: #1c1c1b !important;
}
html.dark a[class*="bg-primary"]:hover,
html.dark [data-slot="button"][class*="bg-primary"]:hover {
  color: #1c1c1b !important;
  filter: brightness(1.06);
}
