/* ============================================================
   59Token 定制主题 · 墨玉鎏金 (Jade Vault)
   注入方式: nginx sub_filter 在 </head> 前插 <link>，本表排在
   index.css 之后加载；关键令牌用 !important 确保盖过其 lab() @supports。
   框架: new-api 前端 = shadcn/ui + Tailwind v4 (令牌化)，故只需覆盖
   :root 设计令牌即可全局级联到登录页与控制台。
   回滚: 删掉 nginx 里注入的那行 sub_filter 即可，本文件不参与则失效。
   ============================================================ */

:root {
  color-scheme: dark !important;

  /* —— 基底：深炭墨绿 —— */
  --background: #06120e !important;
  --foreground: #e9f2ee !important;

  /* —— 卡片/浮层 —— */
  --card: #0c1c17 !important;
  --card-foreground: #e9f2ee !important;
  --popover: #0c1c17 !important;
  --popover-foreground: #e9f2ee !important;

  /* —— 主色：翡翠绿 —— */
  --primary: #10b981 !important;
  --primary-foreground: #04140e !important;

  /* —— 次级：暗玉底 + 鎏金字 —— */
  --secondary: #14352b !important;
  --secondary-foreground: #e7d08a !important;

  --muted: #0f231c !important;
  --muted-foreground: #8fb3a6 !important;

  /* —— accent：菜单/悬停底 —— */
  --accent: #16352b !important;
  --accent-foreground: #f0e6c8 !important;

  --destructive: #e5484d !important;
  --destructive-foreground: #ffffff !important;

  /* —— 描边/输入框/焦点环（金色焦点） —— */
  --border: #1c3a2f !important;
  --input: #1c3a2f !important;
  --input-background: #0a1a15 !important;
  --ring: #d4af37 !important;

  /* —— 圆角：柔和大气 —— */
  --radius: 1rem !important;

  /* —— 侧边栏（控制台） —— */
  --sidebar: #0a1a15 !important;
  --sidebar-foreground: #e9f2ee !important;
  --sidebar-primary: #10b981 !important;
  --sidebar-primary-foreground: #04140e !important;
  --sidebar-accent: #16352b !important;
  --sidebar-accent-foreground: #f0e6c8 !important;
  --sidebar-border: #1c3a2f !important;
  --sidebar-ring: #d4af37 !important;

  /* —— 图表配色：翡翠→鎏金渐变系 —— */
  --chart-1: #10b981 !important;
  --chart-2: #d4af37 !important;
  --chart-3: #22c1a0 !important;
  --chart-4: #e7d08a !important;
  --chart-5: #059669 !important;

  /* —— 字体（保持本地栈，不外链，避免跨境拖慢） —— */
  --font-sans: "Public Sans", "Inter", "PingFang SC", "Microsoft YaHei",
    system-ui, -apple-system, sans-serif !important;
}

/* 暗色类下再钉一遍，防止 .dark{} 令牌回抢（本表更晚加载，双保险） */
.dark {
  --background: #06120e !important;
  --foreground: #e9f2ee !important;
  --card: #0c1c17 !important;
  --primary: #10b981 !important;
  --border: #1c3a2f !important;
  --ring: #d4af37 !important;
}

/* 全局兜底：杜绝任何白底闪烁 */
html,
body {
  background: #06120e !important;
}

::selection {
  background: rgba(212, 175, 55, 0.35);
  color: #fff;
}

/* 高级感滚动条 */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: #0a1a15;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(#1c5c46, #14453a);
  border-radius: 8px;
  border: 2px solid #0a1a15;
}
::-webkit-scrollbar-thumb:hover {
  background: #d4af37;
}

/* ============================================================
   登录 / 注册页（auth）——专属 mesh 渐变 + 玻璃拟态卡
   结构: div.relative.grid.h-svh > .container > div.mx-auto(480px 列)
   ============================================================ */

div.relative.grid.h-svh {
  background:
    radial-gradient(1100px 620px at 12% -8%, rgba(16, 185, 129, 0.20), transparent 60%),
    radial-gradient(900px 520px at 108% 6%, rgba(212, 175, 55, 0.16), transparent 55%),
    radial-gradient(760px 760px at 50% 118%, rgba(5, 150, 105, 0.18), transparent 60%),
    linear-gradient(160deg, #050f0c 0%, #0a1a15 45%, #050f0c 100%) !important;
  background-attachment: fixed !important;
}

/* 居中 480px 列 → 玻璃拟态卡 */
div.relative.grid.h-svh .container > div {
  background: rgba(11, 26, 21, 0.58) !important;
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  backdrop-filter: blur(16px) saturate(130%);
  border: 1px solid rgba(212, 175, 55, 0.22) !important;
  border-radius: 1.25rem !important;
  box-shadow: 0 24px 70px -24px rgba(0, 0, 0, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
  padding: 2.25rem 2rem !important;
}

/* 左上角品牌名 → 鎏金渐变字 */
div.relative.grid.h-svh h1 {
  background: linear-gradient(92deg, #f2e3ab, #d4af37 60%, #b8912b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* 登录页 logo 圆环描金 */
div.relative.grid.h-svh a.absolute img.rounded-full {
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.55),
    0 6px 18px -6px rgba(16, 185, 129, 0.7);
}

/* ============================================================
   全局主按钮：翡翠渐变 + 微光
   ============================================================ */
.bg-primary {
  background-image: linear-gradient(135deg, #14c58e, #059669) !important;
  box-shadow: 0 8px 22px -10px rgba(16, 185, 129, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.bg-primary:hover {
  filter: brightness(1.07);
}

/* 链接/强调文字偏翡翠，避免默认蓝残留 */
a.text-primary,
.text-primary {
  color: #34d399 !important;
}
