/*
 * goodapi 控制台配色覆盖（只改颜色，不动布局、字体、圆角）
 * 由 Caddy 注入到 api.goodapi.com.cn 的 New API 页面。色值与官网 web/app/src/styles/globals.css 对齐。
 * 只在用户未手动选择主题预设时生效（body 无 data-theme-preset）；选了预设则回到 New API 原生表现。
 * 派生 token（color-mix）必须在 body 上重新声明，否则会沿用 :root 上按原配色算好的值。
 */
body:not([data-theme-preset]) {
  --background: #f7f7f4;
  --foreground: #171719;
  --card: #ffffff;
  --card-foreground: #171719;
  --popover: #ffffff;
  --popover-foreground: #171719;
  --primary: #171719;
  --primary-foreground: #f7f7f4;
  --secondary: #ece9e1;
  --secondary-foreground: #171719;
  --muted: #eeede8;
  --muted-foreground: #5f5e66;
  --accent: #fde7d2;
  --accent-foreground: #3a211c;
  --destructive: #d64545;
  --destructive-foreground: #ffffff;
  --success: #2f8f6b;
  --success-foreground: #ffffff;
  --warning: #b7791f;
  --warning-foreground: #ffffff;
  --info: #3d7fc0;
  --info-foreground: #ffffff;
  --neutral: #8a8890;
  --neutral-foreground: #171719;
  --border: #dedcd5;
  --input: #d6d4cc;
  --ring: #ff8f69;
  --chart-1: #f0764d;
  --chart-2: #4fae9b;
  --chart-3: #5a9fd6;
  --chart-4: #8f7ce8;
  --chart-5: #d9b52f;
  --overview-accent-1: #f0764d;
  --overview-accent-2: #4fae9b;
  --overview-accent-3: #8f7ce8;
  --sidebar: #f3f1ec;
  --sidebar-foreground: #171719;
  --sidebar-primary: #171719;
  --sidebar-primary-foreground: #f7f7f4;
  --sidebar-accent: #ece9e1;
  --sidebar-accent-foreground: #171719;
  --sidebar-border: #dedcd5;
  --sidebar-ring: #ff8f69;
  --skeleton-base: #eeede8;
  --skeleton-highlight: #f7f7f4;
  --table-row: var(--card);
  --table-header: color-mix(in oklch, var(--foreground) 2.5%, var(--card));
  --table-header-hover: color-mix(in oklch, var(--foreground) 4%, var(--card));
  --table-disabled: color-mix(in oklch, var(--foreground) 3%, var(--card));
  --table-disabled-hover: color-mix(in oklch, var(--foreground) 4.5%, var(--card));
  --table-disabled-border: color-mix(in oklch, var(--foreground) 16%, var(--card));
}

.dark body:not([data-theme-preset]) {
  --background: #111318;
  --foreground: #f2f1f4;
  --card: #17181d;
  --card-foreground: #f2f1f4;
  --popover: #1b1c22;
  --popover-foreground: #f2f1f4;
  --primary: #f2f1f4;
  --primary-foreground: #111318;
  --secondary: #24252c;
  --secondary-foreground: #f2f1f4;
  --muted: #1f2026;
  --muted-foreground: #a8a6ae;
  --accent: #3a2d26;
  --accent-foreground: #ffe3cf;
  --destructive: #f06a6a;
  --destructive-foreground: #111318;
  --success: #5cc29a;
  --success-foreground: #111318;
  --warning: #e8b04a;
  --warning-foreground: #111318;
  --info: #7fb4e6;
  --info-foreground: #111318;
  --neutral: #8a8890;
  --neutral-foreground: #111318;
  --border: #2d2e36;
  --input: #35363f;
  --ring: #ff8f69;
  --chart-1: #ff8f69;
  --chart-2: #8fd1c4;
  --chart-3: #a2d0f1;
  --chart-4: #b9abf8;
  --chart-5: #f1d45f;
  --overview-accent-1: #ff8f69;
  --overview-accent-2: #8fd1c4;
  --overview-accent-3: #b9abf8;
  --sidebar: #0e1014;
  --sidebar-foreground: #f2f1f4;
  --sidebar-primary: #f2f1f4;
  --sidebar-primary-foreground: #111318;
  --sidebar-accent: #24252c;
  --sidebar-accent-foreground: #f2f1f4;
  --sidebar-border: #2d2e36;
  --sidebar-ring: #ff8f69;
  --skeleton-base: #1f2026;
  --skeleton-highlight: #2a2b32;
  --table-row: var(--card);
  --table-header: color-mix(in oklch, var(--foreground) 5%, var(--card));
  --table-header-hover: color-mix(in oklch, var(--foreground) 8%, var(--card));
  --table-disabled: color-mix(in oklch, var(--foreground) 6%, var(--card));
  --table-disabled-hover: color-mix(in oklch, var(--foreground) 8.5%, var(--card));
  --table-disabled-border: color-mix(in oklch, var(--foreground) 22%, var(--card));
}

body:not([data-theme-preset]) ::selection {
  background: color-mix(in oklab, #ff8f69 40%, transparent);
}
