/* ═══════════════════════════════════════════════════════════════
   New API · 墨绿暗色主题 + 霞鹜文楷
   直接覆盖 shadcn/ui 的 CSS 变量（New API 实际使用的体系）
   取样自用户截图：纯黑 #000000 / 页面底 #111612 / 卡片 #131914
                   主色绿 #2B674E / 数字白 #AAACA7
   ═══════════════════════════════════════════════════════════════ */

@font-face {
  font-family: "LXGW";
  src: url("/__theme/lxgw-ui.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ══════ 强制覆盖 .dark（New API 暗色是 .dark 类）══════ */
html.dark, .dark, :root.dark, html[class*="dark"] {
  color-scheme: dark !important;

  /* 底色 —— 墨绿调近黑 */
  --background: #0A0F0C !important;
  --foreground: #D8DED9 !important;

  /* 卡片 —— 比底稍亮 */
  --card: #131914 !important;
  --card-foreground: #E8EDE9 !important;
  --popover: #161C17 !important;
  --popover-foreground: #E8EDE9 !important;

  /* 主色 —— 墨绿 */
  --primary: #2B674E !important;
  --primary-foreground: #EAF2ED !important;

  --secondary: #1A211C !important;
  --secondary-foreground: #A8C4B4 !important;
  --muted: #161C17 !important;
  --muted-foreground: #8A9990 !important;
  --accent: #1F4A38 !important;
  --accent-foreground: #BFE0CD !important;

  --destructive: #B85C50 !important;
  --destructive-foreground: #FBEAE7 !important;
  --success: #3A8666 !important;
  --success-foreground: #EAF2ED !important;
  --warning: #B8873C !important;
  --warning-foreground: #1A1409 !important;
  --info: #4A8FA8 !important;
  --info-foreground: #E8F2F5 !important;
  --neutral: #7A8A80 !important;
  --neutral-foreground: #0A0F0C !important;

  --border: #1F2822 !important;
  --input: #26302A !important;
  --ring: #3A8666 !important;

  /* 侧栏 */
  --sidebar: #0C1210 !important;
  --sidebar-foreground: #B8C4BD !important;
  --sidebar-primary: #2B674E !important;
  --sidebar-primary-foreground: #EAF2ED !important;
  --sidebar-accent: #1A3A2C !important;
  --sidebar-accent-foreground: #BFE0CD !important;
  --sidebar-border: #1F2822 !important;
  --sidebar-ring: #3A8666 !important;

  /* 图表配色（墨绿系渐变）*/
  --chart-1: #3A8666 !important;
  --chart-2: #5FA88A !important;
  --chart-3: #2B674E !important;
  --chart-4: #7BC4A0 !important;
  --chart-5: #1E4A38 !important;

  --skeleton-base: #161C17 !important;
  --skeleton-highlight: #1F2822 !important;

  --radius: 1rem;

  /* 字体变量（New API 用 --font-body / --font-ui-sans）*/
  --font-ui-sans: "LXGW", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif !important;
  --font-body: var(--font-ui-sans) !important;
}

/* ══════ 全局字体 ══════ */
html, body, #root, button, input, select, textarea,
h1, h2, h3, h4, h5, h6, p, span, div, a, li, td, th, label {
  font-family: "LXGW", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ══════ 背景穹顶光晕 ══════ */
html, body {
  background-color: #0A0F0C !important;
}
body {
  background-image:
    radial-gradient(1100px 560px at 50% -8%, rgba(43,103,78,.16), transparent 62%),
    radial-gradient(760px 380px at 100% 100%, rgba(43,103,78,.07), transparent 72%) !important;
  background-attachment: fixed !important;
}

/* ══════ 大数字等宽 ══════ */
[class*="tabular"], [class*="balance"], [class*="credit"],
[class*="amount"], [class*="stat"], table td {
  font-variant-numeric: tabular-nums;
}

/* ══════ 圆角与描边细化 ══════ */
[class*="rounded-"] {
  border-color: #1F2822;
}

/* ══════ 按钮质感 ══════ */
button:not([disabled]) {
  transition: background-color .16s ease, border-color .16s ease, transform .1s ease, opacity .16s ease;
}
button:not([disabled]):active {
  transform: scale(.985);
}

/* ══════ 输入框聚焦光晕 ══════ */
input:focus, textarea:focus, select:focus,
[class*="input"]:focus-within {
  border-color: #3A8666 !important;
  box-shadow: 0 0 0 3px rgba(58,134,102,.14) !important;
  outline: none !important;
}

/* ══════ 滚动条 ══════ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #232C26; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #2E3A33; }

/* ══════ 文字选中 ══════ */
::selection { background: rgba(58,134,102,.40); color: #EAF2ED; }

/* ══════ 顶部导航毛玻璃 ══════ */
header, [class*="app-header"], [class*="AppHeader"] {
  background-color: rgba(10,15,12,.86) !important;
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid rgba(31,40,34,.9) !important;
}

/* ══════ 卡片 hover 微光 ══════ */
[class*="rounded-"]:has(> [class*="text-muted"]) {
  transition: border-color .2s ease, background-color .2s ease;
}

/* ══════ 表格 ══════ */
table { border-color: #1F2822 !important; }
thead { background: #161C17 !important; }
tbody tr { transition: background-color .12s ease; }
tbody tr:hover { background: rgba(43,103,78,.07) !important; }

/* ══════ 弹窗遮罩 ══════ */
[class*="fixed"][class*="inset-0"] {
  background-color: rgba(3,6,4,.72) !important;
  backdrop-filter: blur(4px);
}

/* ══════ 骨架屏 ══════ */
[class*="animate-pulse"] {
  background-color: #161C17 !important;
}
