/* ============================================================
   橘猫AI · 站点主题 v2（2026-11-03）
   参考 api.zxcbug.com dashboard 的视觉语言：
   - 浅灰画布 + 纯白卡片 + 极淡描边 + 近乎无阴影
   - 大圆角、宽松行高、指标数字等宽对齐
   - 侧边栏选中态用圆角色块（不是左侧竖条）
   仅覆盖视觉层，不改布局/功能
   ============================================================ */

/* ── 基础色板（橘猫橙 + 浅灰画布）──────────────────────────── */
:root,
html body[data-theme-preset] {
  --background: oklch(0.985 0.003 60) !important;
  --card: oklch(1 0 0) !important;
  --popover: oklch(1 0 0) !important;
  --border: oklch(0.932 0.004 60) !important;
  --input: oklch(0.945 0.004 60) !important;

  --primary: oklch(0.705 0.171 47) !important;
  --primary-foreground: oklch(1 0 0) !important;
  --ring: oklch(0.705 0.171 47 / 45%) !important;
  --secondary: oklch(0.965 0.022 62) !important;
  --secondary-foreground: oklch(0.34 0.06 48) !important;
  --accent: oklch(0.968 0.026 62) !important;
  --accent-foreground: oklch(0.38 0.08 46) !important;
  --muted: oklch(0.965 0.006 60) !important;
  --chart-1: oklch(0.705 0.171 47) !important;
  --chart-2: oklch(0.78 0.13 78) !important;
  --chart-3: oklch(0.62 0.12 35) !important;
  --chart-4: oklch(0.84 0.10 88) !important;
  --chart-5: oklch(0.55 0.09 40) !important;

  --radius: 0.625rem !important;
}

html.dark body[data-theme-preset] {
  --background: oklch(0.185 0.006 55) !important;
  --card: oklch(0.225 0.008 55) !important;
  --popover: oklch(0.235 0.008 55) !important;
  --border: oklch(0.295 0.008 55) !important;
  --input: oklch(0.31 0.008 55) !important;

  --primary: oklch(0.745 0.155 52) !important;
  --primary-foreground: oklch(0.18 0.03 50) !important;
  --secondary: oklch(0.29 0.024 52) !important;
  --secondary-foreground: oklch(0.94 0.02 62) !important;
  --accent: oklch(0.31 0.028 52) !important;
  --accent-foreground: oklch(0.96 0.018 62) !important;
  --muted: oklch(0.27 0.008 55) !important;
}

/* ── 画布与卡片：参考站那种「白卡片浮在浅灰底上」───────────── */
body {
  background-color: var(--background);
}

[data-slot='card'] {
  border-color: var(--border);
  box-shadow:
    0 1px 1px oklch(0.2 0.02 50 / 2.5%),
    0 2px 8px oklch(0.2 0.02 50 / 3%) !important;
  border-radius: var(--radius);
}

/* 卡片之间呼吸感更足（参考站卡片间距明显） */
[data-slot='card-header'] {
  padding-bottom: 0.5rem;
}

/* ── 指标数字：等宽对齐 + 收紧字距（参考站的核心观感）─────── */
[data-slot='card'] [data-slot='card-title'] + div,
[data-slot='card'] .text-3xl,
[data-slot='card'] .text-2xl,
[data-slot='card'] [data-metric-value] {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  font-feature-settings: 'tnum' 1;
}

/* ── 侧边栏：选中态改圆角色块（参考站风格，取代左侧竖条）──── */
[data-slot='sidebar'] a[data-active='true'],
[data-slot='sidebar'] [aria-current='page'] {
  background: var(--secondary) !important;
  color: var(--secondary-foreground) !important;
  border-radius: calc(var(--radius) - 2px);
}
/* 去掉 v1 加的左侧竖条 */
[data-slot='sidebar'] a[data-active='true']::before,
[data-slot='sidebar'] [aria-current='page']::before {
  display: none !important;
  content: none !important;
}

/* 侧边栏整体用纯白，跟画布拉开层次 */
[data-slot='sidebar'] {
  background: var(--card);
  border-right: 1px solid var(--border);
}

/* ── 表格：行高更宽松，表头弱化（参考站表头是浅灰小字）────── */
thead th {
  font-weight: 500 !important;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  background: oklch(0.975 0.004 60);
  letter-spacing: 0.01em;
}
html.dark thead th {
  background: oklch(0.245 0.008 55);
}
tbody td {
  padding-block: 0.85rem;
  font-variant-numeric: tabular-nums;
}
tbody tr:hover {
  background: oklch(0.972 0.012 62 / 55%);
}
html.dark tbody tr:hover {
  background: oklch(0.28 0.014 54 / 55%);
}

/* ── 按钮：圆角统一，主按钮实心橘色 ──────────────────────── */
button,
a[data-slot='button'] {
  border-radius: calc(var(--radius) - 2px);
}

/* ── 输入框：浅灰填充（参考站输入框几乎无边框）───────────── */
input[type='text'],
input[type='email'],
input[type='password'],
input[type='search'],
input:not([type]) {
  background: oklch(0.982 0.004 60);
}
html.dark input[type='text'],
html.dark input[type='email'],
html.dark input[type='password'],
html.dark input[type='search'],
html.dark input:not([type]) {
  background: oklch(0.245 0.008 55);
}

/* ── 滚动条 ─────────────────────────────────────────────── */
* {
  scrollbar-width: thin;
}
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-thumb {
  background: oklch(0.78 0.01 55 / 45%);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: oklch(0.68 0.02 55 / 60%);
}

/* ── 品牌区 ─────────────────────────────────────────────── */
header img[alt*='logo' i],
[data-slot='sidebar'] img,
a[href='/'] > img {
  border-radius: 0.5rem;
}
