/* ===== 喜拓剧织 · DW 主题覆盖 for New API =====
   口径：只覆盖 CSS 变量与少量外观，不动布局与组件结构。
   变量来自 new-api 的 shadcn/Tailwind 体系（--background/--primary/--border ...）；
   new-api 自带 [data-theme-preset=...] 多套预设与 .dark，故这里用 !important 兜住优先级。 */

:root,
:root.dark,
html.dark,
[data-theme-preset],
html[data-theme-preset] {
  --radius: 0.625rem !important;

  /* 底色：与官网 #0a0c11 一致 */
  --background: #0a0c11 !important;
  --foreground: #e9e7e2 !important;

  --card: #10131a !important;
  --card-foreground: #e9e7e2 !important;
  --popover: #10131a !important;
  --popover-foreground: #e9e7e2 !important;

  /* 主色：DW 金 */
  --primary: #d4a24e !important;
  --primary-foreground: #1a1206 !important;

  --secondary: #171b23 !important;
  --secondary-foreground: #e9e7e2 !important;

  --muted: #171b23 !important;
  --muted-foreground: #939aa7 !important;

  --accent: rgba(212, 162, 78, .14) !important;
  --accent-foreground: #f0c674 !important;

  --destructive: #e05252 !important;

  --border: #232a37 !important;
  --input: #232a37 !important;
  --ring: #d4a24e !important;

  --chart-1: #f0c674 !important;
  --chart-2: #d4a24e !important;
  --chart-3: #a97f38 !important;
  --chart-4: #7d8fa6 !important;
  --chart-5: #5c6577 !important;

  --sidebar: #0c0e13 !important;
  --sidebar-foreground: #e9e7e2 !important;
  --sidebar-primary: #d4a24e !important;
  --sidebar-primary-foreground: #1a1206 !important;
  --sidebar-accent: rgba(212, 162, 78, .12) !important;
  --sidebar-accent-foreground: #f0c674 !important;
  --sidebar-border: #232a37 !important;
  --sidebar-ring: #d4a24e !important;
}

/* 强制暗色底，避免首屏闪白 */
html { color-scheme: dark; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif !important;
  /* 顶部一层极淡金色光晕，和官网同款气质 */
  background-image: radial-gradient(ellipse 80% 42% at 50% -8%, rgba(212, 162, 78, .07), transparent 72%) !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
}

/* 顶栏：半透明毛玻璃 + 金色描边感，贴合官网 header */
body > div > header,
header.sticky {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background-color: rgba(10, 12, 17, .72) !important;
  border-bottom-color: #232a37 !important;
}

/* 主按钮 hover 微金光，呼应官网 CTA */
button[class*="bg-primary"]:hover,
a[class*="bg-primary"]:hover {
  box-shadow: 0 10px 28px -12px rgba(212, 162, 78, .65);
}

/* 滚动条 */
* { scrollbar-color: #2a3140 #0a0c11; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #2a3140; border-radius: 6px; }
*::-webkit-scrollbar-thumb:hover { background: #3a4356; }

/* ---------- 收口：new-api 首页硬编码的蓝紫渐变 → DW 金 ---------- */
/* new-api 用的是 Tailwind 原子类 from-blue-400 / via-violet-400 / to-purple-500，
   不跟随 CSS 变量，必须按类名覆盖。 */
[class*="from-blue-400"][class*="bg-clip-text"],
[class*="from-blue-400"][class*="to-purple-500"],
[class*="from-blue-500"][class*="to-purple"],
[class*="from-indigo"][class*="bg-clip-text"] {
  background-image: linear-gradient(100deg, #f0c674 0%, #d4a24e 52%, #b9873c 100%) !important;
}

/* 品牌 logo 底色（new-api 的圆形图标）也压成金色系，避免紫蓝跳色 */
img[alt*="New API" i],
img[src*="logo"] {
  filter: none;
}

/* ---------- 图标收色：菜单/导航里的彩色图标统一跟随文字色 ----------
   new-api 给每个菜单项配了专属颜色（绿/蓝/紫/橙），在 DW 的克制配色里显得杂。
   只动图标，不动语义提示（成功/失败 toast、图表）。 */
aside a > svg,
aside button > svg,
aside a > span > svg,
aside button > span > svg {
  color: inherit !important;
}
aside a > svg *,
aside button > svg * {
  color: inherit !important;
  stroke: currentColor;
}
