/* ============================================================
   toptok — new-api 主题覆盖层 v2
   ------------------------------------------------------------
   设计语言：单色工程图纸（取自 api_relay/site）
     ink #0b0b0b / paper #ffffff / graphite #4a4a4a / ash #6f6f6f
     hair #e2e2e2 / hair-soft #f0f0f0 / fog #f6f6f6

   为什么 v1 失效（实测证据）：
     new-api 在 <body> 上挂 data-theme-preset（默认 lavender-dream）
     与 .uu-dark，预设块在 body 层重新定义整套变量。
     CSS 自定义属性按继承计算，body 自身声明胜于 html 继承，
     因此写在 html.dark 上的覆盖会被 body 预设抢回（与优先级无关）。
     → v2 改为直接在 body 层声明，并使用 !important 压过预设块。

   纪律：
   1. 不修改 index.6d59eed364.css 编译产物，仅增量覆盖
   2. 覆盖链：html.dark body / body[data-theme-preset] / body.uu-dark 全覆盖
   3. 圆角全部收敛为 2px 系，阴影归零，强调色靠反色
   ============================================================ */

/* ---------- 字体（首页同源，file:// 亦可） ---------- */
@font-face {
  font-family: "Archivo";
  src: url("/landing/fonts/archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: "PlexMono";
  src: url("/landing/fonts/plexmono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: "PlexMono";
  src: url("/landing/fonts/plexmono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
  font-style: normal;
}

/* ============================================================
   1. 深色（墨黑）— 覆盖所有 body 形态
   ============================================================ */
html.dark body,
html.dark body[data-theme-preset],
html.dark body.uu-dark,
html.dark body.uu-dark[data-theme-preset],
html.dark body[class] {
  --background: #0b0b0b !important;
  --foreground: #f4f4f4 !important;

  --card: #121212 !important;
  --card-foreground: #f4f4f4 !important;
  --popover: #121212 !important;
  --popover-foreground: #f4f4f4 !important;

  --primary: #f4f4f4 !important;
  --primary-foreground: #0b0b0b !important;
  --secondary: #1f1f1f !important;
  --secondary-foreground: #f4f4f4 !important;

  --muted: #1a1a1a !important;
  --muted-foreground: #a8a8a8 !important;
  --accent: #242424 !important;
  --accent-foreground: #f4f4f4 !important;

  --destructive: #d94a4a !important;
  --destructive-foreground: #ffffff !important;
  --success: #3fa96a !important;
  --success-foreground: #0b0b0b !important;
  --warning: #d99a3f !important;
  --warning-foreground: #0b0b0b !important;
  --info: #6f6f6f !important;
  --info-foreground: #f4f4f4 !important;
  --neutral: #6f6f6f !important;
  --neutral-foreground: #f4f4f4 !important;

  --border: #2a2a2a !important;
  --input: #2a2a2a !important;
  --ring: #f4f4f4 !important;

  /* 圆角收敛 */
  --radius: 2px !important;
  --radius-xs: 2px !important;
  --radius-sm: 2px !important;
  --radius-md: 2px !important;
  --radius-lg: 2px !important;
  --radius-xl: 2px !important;
  --radius-2xl: 2px !important;
  --radius-3xl: 2px !important;
  --radius-full: 2px !important;
  --cell-radius: 2px !important;

  /* 侧边栏 */
  --sidebar: #0f0f0f !important;
  --sidebar-foreground: #f4f4f4 !important;
  --sidebar-primary: #f4f4f4 !important;
  --sidebar-primary-foreground: #0b0b0b !important;
  --sidebar-accent: #1f1f1f !important;
  --sidebar-accent-foreground: #f4f4f4 !important;
  --sidebar-border: #2a2a2a !important;
  --sidebar-ring: #f4f4f4 !important;

  /* 图表：灰阶梯度 */
  --chart-1: #f4f4f4 !important;
  --chart-2: #c8c8c8 !important;
  --chart-3: #a8a8a8 !important;
  --chart-4: #6f6f6f !important;
  --chart-5: #4a4a4a !important;

  /* 表格 */
  --table-header-bg: #131313 !important;
  --table-header: #f4f4f4 !important;
  --table-row: #0b0b0b !important;

  background-color: #0b0b0b !important;
  color: #f4f4f4 !important;
}

/* ============================================================
   2. 浅色（纸白）— 覆盖所有 body 形态
   ============================================================ */
html:not(.dark) body,
html:not(.dark) body[data-theme-preset],
html:not(.dark) body.uu-dark,
html:not(.dark) body.uu-dark[data-theme-preset],
html:not(.dark) body[class] {
  --background: #ffffff !important;
  --foreground: #0b0b0b !important;

  --card: #ffffff !important;
  --card-foreground: #0b0b0b !important;
  --popover: #ffffff !important;
  --popover-foreground: #0b0b0b !important;

  --primary: #0b0b0b !important;
  --primary-foreground: #ffffff !important;
  --secondary: #f0f0f0 !important;
  --secondary-foreground: #0b0b0b !important;

  --muted: #f6f6f6 !important;
  --muted-foreground: #6f6f6f !important;
  --accent: #f0f0f0 !important;
  --accent-foreground: #0b0b0b !important;

  --destructive: #c0392b !important;
  --destructive-foreground: #ffffff !important;
  --success: #2e8b57 !important;
  --success-foreground: #ffffff !important;
  --warning: #b8860b !important;
  --warning-foreground: #ffffff !important;
  --info: #4a4a4a !important;
  --info-foreground: #ffffff !important;
  --neutral: #6f6f6f !important;
  --neutral-foreground: #ffffff !important;

  --border: #e2e2e2 !important;
  --input: #e2e2e2 !important;
  --ring: #0b0b0b !important;

  --radius: 2px !important;
  --radius-xs: 2px !important;
  --radius-sm: 2px !important;
  --radius-md: 2px !important;
  --radius-lg: 2px !important;
  --radius-xl: 2px !important;
  --radius-2xl: 2px !important;
  --radius-3xl: 2px !important;
  --radius-full: 2px !important;
  --cell-radius: 2px !important;

  --sidebar: #ffffff !important;
  --sidebar-foreground: #0b0b0b !important;
  --sidebar-primary: #0b0b0b !important;
  --sidebar-primary-foreground: #ffffff !important;
  --sidebar-accent: #f0f0f0 !important;
  --sidebar-accent-foreground: #0b0b0b !important;
  --sidebar-border: #e2e2e2 !important;
  --sidebar-ring: #0b0b0b !important;

  --chart-1: #0b0b0b !important;
  --chart-2: #4a4a4a !important;
  --chart-3: #6f6f6f !important;
  --chart-4: #a8a8a8 !important;
  --chart-5: #d4d4d4 !important;

  --table-header-bg: #f6f6f6 !important;
  --table-header: #0b0b0b !important;
  --table-row: #ffffff !important;

  background-color: #ffffff !important;
  color: #0b0b0b !important;
}

/* ============================================================
   3. 排版：主字体换 Archivo，数字/代码用等宽
   ============================================================ */
body,
body.uu-dark,
body[data-theme-preset] {
  --font-ui-sans: "Archivo", "PingFang SC", "Hiragino Sans GB",
    "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif !important;
  --font-body: var(--font-ui-sans) !important;
  font-family: "Archivo", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC",
    "Microsoft YaHei", system-ui, sans-serif !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

code,
pre,
kbd,
samp,
.font-mono,
table {
  font-family: "PlexMono", ui-monospace, SFMono-Regular, Consolas,
    "Liberation Mono", monospace !important;
}

/* 标题收紧字距，工程图纸气质 */
h1,
h2,
h3 {
  letter-spacing: -0.021em !important;
}

/* ============================================================
   4. 组件层：阴影归零、圆角收敛、聚焦环改反色
   ============================================================ */

/* 4.1 阴影一律去掉（工程图纸不用投影表达层级） */
html.dark .shadow,
html.dark .shadow-sm,
html.dark .shadow-md,
html.dark .shadow-lg,
html.dark .shadow-xl,
html.dark .shadow-2xl,
html:not(.dark) .shadow,
html:not(.dark) .shadow-sm,
html:not(.dark) .shadow-md,
html:not(.dark) .shadow-lg,
html:not(.dark) .shadow-xl,
html:not(.dark) .shadow-2xl {
  box-shadow: none !important;
}

/* 4.2 圆角全面收敛为直角系 */
html.dark [class*="rounded"],
html:not(.dark) [class*="rounded"] {
  border-radius: 2px !important;
}

/* 4.3 输入框聚焦：用反色描边环替代彩色光晕 */
html.dark input:focus-visible,
html.dark textarea:focus-visible,
html.dark select:focus-visible {
  outline: 2px solid #f4f4f4 !important;
  outline-offset: 1px !important;
  box-shadow: none !important;
}
html:not(.dark) input:focus-visible,
html:not(.dark) textarea:focus-visible,
html:not(.dark) select:focus-visible {
  outline: 2px solid #0b0b0b !important;
  outline-offset: 1px !important;
  box-shadow: none !important;
}

/* 4.4 主按钮：墨黑/纸白纯色，hover 变灰阶 */
html.dark .btn-primary,
html.dark button[class*="bg-primary"] {
  background-color: #f4f4f4 !important;
  color: #0b0b0b !important;
}
html.dark .btn-primary:hover,
html.dark button[class*="bg-primary"]:hover {
  background-color: #d4d4d4 !important;
}
html:not(.dark) .btn-primary,
html:not(.dark) button[class*="bg-primary"] {
  background-color: #0b0b0b !important;
  color: #ffffff !important;
}
html:not(.dark) .btn-primary:hover,
html:not(.dark) button[class*="bg-primary"]:hover {
  background-color: #2c2c2c !important;
}

/* 4.5 表格：hairline 分隔，表头等宽小字 */
table {
  border-color: var(--border) !important;
}
th {
  font-size: 12px !important;
  font-weight: 500 !important;
  letter-spacing: 0.04em !important;
  text-transform: none;
}

/* 4.6 链接与选中态 */
::selection {
  background: #0b0b0b;
  color: #ffffff;
}
html.dark ::selection {
  background: #f4f4f4;
  color: #0b0b0b;
}

/* 4.7 滚动条：低调灰阶 */
html.dark ::-webkit-scrollbar-thumb {
  background: #2a2a2a;
  border-radius: 0;
}
html.dark ::-webkit-scrollbar-thumb:hover {
  background: #3d3d3d;
}
html.dark ::-webkit-scrollbar-track {
  background: #0b0b0b;
}
html:not(.dark) ::-webkit-scrollbar-thumb {
  background: #d4d4d4;
  border-radius: 0;
}
html:not(.dark) ::-webkit-scrollbar-track {
  background: #f6f6f6;
}
