/* new-api 主题：参考 Salesforce Invoices 稿
 * 冰蓝底 + 白卡片 + 炭黑侧栏 + 唯一强调色柠檬绿 #D9F94A（只用在选中态/主按钮）
 * 大圆角 + 胶囊按钮；不用毛玻璃/半透明蒙版。
 * 由 proxy.py 注入；删掉注入层即恢复官方样式。 */

html:root, html.light, html:root.light {
  --brand-lime: #d9f94a;
  --brand-ink: #0b0b0b;
  --brand-navy: #16181d;
  --brand-ice: #eef3f9;

  --radius: 1.125rem !important;
  --background: #ffffff !important;      /* 主内容区=白色大卡（坐在炭黑外壳上） */
  --foreground: #0b0b0b !important;
  --card: #f2f6fb !important;            /* 内层卡片=浅冰蓝（参考稿 KPI 区） */
  --card-foreground: #0b0b0b !important;
  --popover: #ffffff !important;
  --popover-foreground: #0b0b0b !important;
  --primary: #0b0b0b !important;          /* 主按钮：黑底白字（参考稿 Payout now） */
  --primary-foreground: #ffffff !important;
  --secondary: #e4ebf3 !important;
  --secondary-foreground: #0b0b0b !important;
  --muted: #e9eff6 !important;
  --muted-foreground: #6b7380 !important;
  --accent: #d9f94a !important;           /* 选中/悬停：柠檬绿 */
  --accent-foreground: #0b0b0b !important;
  --border: #dde4ec !important;
  --input: #dde4ec !important;
  --ring: #3b82f6 !important;             /* 参考稿里唯一的蓝：焦点框 */

  /* 侧栏：炭黑面板 */
  --sidebar: #16181d !important;
  --sidebar-foreground: #c9ced6 !important;
  --sidebar-primary: #d9f94a !important;
  --sidebar-primary-foreground: #0b0b0b !important;
  --sidebar-accent: #d9f94a !important;
  --sidebar-accent-foreground: #0b0b0b !important;
  --sidebar-border: #262a31 !important;
  --sidebar-ring: #d9f94a !important;
}

body { background: #e3edf8 !important; }

/* 标题：粗、紧 */
h1, h2, h3 { letter-spacing: -0.02em; }
h2.text-2xl, h1.text-2xl, h1.text-3xl { font-weight: 800 !important; }

/* 按钮与输入框：胶囊 */
button[data-slot="button"], a[data-slot="button"], [data-slot="button"] { border-radius: 9999px !important; }
input[data-slot="form-control"], input[data-slot="input"], [data-slot="select-trigger"],
textarea { border-radius: 14px !important; background: #fff !important; }
input[data-slot="form-control"], input[data-slot="input"] { height: 2.5rem !important; padding-inline: 14px !important; }

/* 卡片：白底、大圆角、无硬边，靠极浅阴影分层 */
[data-slot="card"] {
  border-radius: 22px !important;
  border-color: transparent !important;
  background: #f2f6fb !important;
  box-shadow: none !important;
}

/* 侧栏菜单：选中项柠檬绿胶囊 */
[data-sidebar="menu-button"] { border-radius: 9999px !important; }
[data-sidebar="menu-button"][aria-current="page"],
[data-sidebar="menu-button"][data-status="active"] {
  background: var(--brand-lime) !important;
  color: var(--brand-ink) !important;
  font-weight: 600 !important;
}
[data-sidebar="menu-button"]:not([aria-current="page"]):not([data-status="active"]):hover {
  background: #23272e !important;
  color: #fff !important;
}
[data-sidebar="group-label"] { color: #8b93a1 !important; }
/* 工具栏按钮统一高度 */
main [data-slot="button"][data-size="sm"] { height: 2.125rem !important; padding-inline: 14px !important; }

/* 表格：表头小灰字，行间细分隔 */
[data-slot="table"] thead th { color: #6b7380 !important; font-weight: 500 !important; font-size: 12px; }
[data-slot="table-row"]:hover { background: #f4f8fc !important; }

/* Tab：选中柠檬绿 */
[data-slot="tabs-list"] { border-radius: 9999px !important; background: #e4ebf3 !important; }
[data-slot="tabs-trigger"] { border-radius: 9999px !important; }
[data-slot="tabs-trigger"][data-state="active"] { background: var(--brand-lime) !important; color: var(--brand-ink) !important; }

/* 徽标/状态胶囊 */
[data-slot="badge"] { border-radius: 9999px !important; }

/* ===== 控制台外壳：和官网统一成「冰蓝底 + 悬浮黑胶囊顶栏」 =====
 * 顶栏离顶 12px、左右 24px、高 56px（与公开页 nav 完全同尺寸）
 * 顶栏总占位 = 12 + 56 = 68px，侧栏/主卡片的起始位置都跟着这个变量走 */
html:root { --app-header-height: 68px !important; }
#root div[class*="group/sidebar-wrapper"] {
  background: #e3edf8 !important;
  --sidebar-width: 14.5rem !important;
}
#root header.sticky { height: 68px !important; }
#root header.sticky > div {
  margin: 12px 24px 0 !important;
  height: 56px !important;
  background: #16181d !important;
  border-radius: 9999px !important;
  padding-inline: 10px 8px !important;
}
/* 侧栏：独立的炭黑圆角卡，左边缘与顶栏胶囊对齐（x=24） */
#root div.fixed[class*="top-[var(--app-header-height"] {
  padding: 8px 8px 8px 24px !important;
}
#root [data-sidebar="sidebar"] { border-radius: 22px !important; }
/* 主内容白卡：右边缘与顶栏胶囊对齐 */
#root main[class*="peer-data-[variant=inset]"] {
  margin: 8px 24px 8px 0 !important;
}

/* 控制台顶栏：去掉侧栏收起按钮、搜索框
 * 收起按钮只在电脑宽屏隐藏；手机上侧栏默认收起，要靠它打开菜单，所以保留 */
@media (min-width: 768px) {
  #root header.sticky [data-slot="sidebar-trigger"] { display: none !important; }
}
#root header.sticky button[aria-label="搜索"] { display: none !important; }

/* 顶栏：坐在炭黑胶囊上 → 文字改浅色 */
header.sticky { color: #f3f4f6 !important; }
header.sticky span.truncate { color: #ffffff !important; font-weight: 700 !important; }
header.sticky .font-mono { color: #8b93a1 !important; }
header.sticky a.text-muted-foreground { color: #aab1bc !important; }
header.sticky a.text-muted-foreground:hover { color: #ffffff !important; }
header.sticky a.text-muted-foreground.active {
  color: #0b0b0b !important; background: #d9f94a; border-radius: 9999px; padding: 4px 12px;
}
header.sticky button { color: #e5e7eb !important; }
header.sticky button[data-slot="button"][data-variant="outline"],
header.sticky [data-slot="button"].border {
  background: #23272e !important; border-color: #2f343c !important; color: #aab1bc !important;
}

/* 去掉官方的半透明磨砂/装饰渐变（禁"糊感"），改实色白卡 */
main .backdrop-blur, #root .backdrop-blur { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
#root main [class*="bg-background/"] { background-color: #f2f6fb !important; border-color: transparent !important; }
#root [class*="bg-[radial-gradient"], #root [class*="from-background/"] { background-image: none !important; }
#root [class*="bg-[linear-gradient(135deg"] { background-image: none !important; background-color: #f4f8fc !important; }

/* ================= 公开页面（首页 / 模型广场 / 排行榜 / 关于） =================
 * 这些页面写死了蓝紫渐变、光晕、网格底纹，不走主题变量，需逐条覆盖。 */

/* 页面底色：冰蓝 */
body:has(header.fixed) { background: #e3edf8 !important; }
#root div.bg-background.min-h-svh { background: #e3edf8 !important; }

/* 去掉光晕、网格底纹、磨砂 */
#root [class*="-z-10"][class*="opacity-"],
#root [class*="opacity-20"][class*="radial"], #root [class*="opacity-[0.10]"],
#root [class*="bg-[linear-gradient(to_right,var(--border)"],
#root [class*="h-[600px]"][class*="pointer-events-none"],
#root [class*="inset-x-0 top-0"][class*="pointer-events-none"][class*="absolute"] { display: none !important; }
#root [class*="backdrop-blur"] { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }

/* 顶部导航：参考稿的黑色胶囊导航条 */
header.fixed nav {
  background: #16181d !important; border-radius: 9999px !important;
  margin-top: 12px; padding-inline: 10px 8px !important; height: 56px !important;
}
header.fixed nav a, header.fixed nav button { color: #c9ced6 !important; }
header.fixed nav a.group span, header.fixed nav a.group { color: #ffffff !important; font-weight: 700; }
header.fixed nav a[class*="rounded-lg"] { border-radius: 9999px !important; }
header.fixed nav a[class*="rounded-lg"]:hover { background: #23272e !important; color: #fff !important; }
header.fixed nav a[class*="rounded-lg"].active,
header.fixed nav a[class*="rounded-lg"][aria-current="page"] {
  background: #d9f94a !important; color: #0b0b0b !important;
}
/* 登录按钮：白底黑字（柠檬绿只留给"当前页"，避免撞色） */
header.fixed nav a[href="/sign-in"], header.fixed nav a[href="/dashboard"][data-slot="button"] {
  background: #ffffff !important; color: #0b0b0b !important; font-weight: 600 !important;
}
/* 右侧图标按钮（语言/主题/通知/菜单）：深灰底 + 白图标 */
#root header.fixed nav button[class*="rounded-lg"]:not([class*="px-"]):not(:has(span.truncate)),
#root header.fixed nav button[data-slot="dropdown-menu-trigger"],
#root header.fixed nav button[data-slot="popover-trigger"] {
  background-color: #23272e !important; color: #ffffff !important;
  border-radius: 9999px !important; border-color: #2f343c !important;
}
#root header.fixed nav button[class*="rounded-lg"]:hover { background-color: #2f343c !important; }

/* 渐变大标题 → 实色黑字 + 柠檬绿荧光笔底 */
#root .bg-clip-text.text-transparent {
  background-image: none !important; -webkit-text-fill-color: #0b0b0b !important; color: #0b0b0b !important;
  background: linear-gradient(transparent 62%, #d9f94a 62%, #d9f94a 92%, transparent 92%) !important;
  -webkit-background-clip: border-box !important; background-clip: border-box !important;
  padding-inline: 4px;
}

/* 蓝色点缀 → 墨黑/柠檬绿（代码高亮里的 sky 色保留） */
#root [class*="text-blue-600"], #root [class*="text-blue-500"] { color: #0b0b0b !important; }
/* 公开页头部/工具栏的深底按钮与圆形图标按钮统一 */
header.fixed button[class*="rounded-full"], header.fixed a[class*="rounded-full"] {
  background: #23272e !important; border-color: #2f343c !important; color: #fff !important;
}
#root [class*="bg-blue-500/"], #root [class*="bg-blue-400/"] { background-color: #d9f94a !important; }
#root [class*="border-blue-500/"], #root [class*="border-blue-400/"] { border-color: #c4e33a !important; }
#root .bg-blue-400, #root .bg-blue-500 { background-color: #0b0b0b !important; }
#root [class*="hover:bg-blue-"]:hover { background-color: #d9f94a !important; }
#root [class*="border-b-blue"], #root [class*="border-blue-500"]:not([class*="/"]) { border-color: #0b0b0b !important; }

/* 半透明浅底块 → 实色白卡；分区带 → 白底 */
#root section [class*="bg-muted/"], #root div[class*="relative z-10 border-y"] { background-color: #ffffff !important; }
#root section [class*="bg-white/"] { background-color: #ffffff !important; }
#root section [class*="rounded-2xl"], #root section [class*="rounded-xl"] { border-radius: 22px !important; }
#root section [class*="shadow-[0_20px"] { box-shadow: 0 10px 30px -18px rgba(15, 23, 42, .25) !important; }

/* 顶部导航防跳动：
 * 1) 始终给滚动条留位，长短页面切换时内容不再左右挪 10px
 * 2) 关掉官方"滚动后导航收窄下移"的 700ms 动画，导航尺寸位置固定不变 */
html { scrollbar-gutter: stable !important; }
#root header.fixed > div {
  max-width: 80rem !important;
  padding: 0 24px !important;
  transition: none !important;
}
#root header.fixed nav {
  transition: none !important;
  height: 56px !important;
  margin-top: 12px !important;
}

/* 滚动入场动画的卡片默认直接显示（避免截图/慢网下出现大片空白） */
#root [class*="will-change-[transform,opacity]"].opacity-0 { opacity: 1 !important; transform: none !important; }

/* 页脚 */
footer { background: #16181d !important; color: #c9ced6 !important; border: 0 !important; }
footer * { color: #aab1bc !important; }
footer a.group span, footer a.group { color: #ffffff !important; }

/* 登录/注册页：主按钮与输入框同高 */
#root form.grid.gap-4 button[type="submit"] { height: 2.5rem !important; font-weight: 600 !important; }
