:root,
html[data-theme="dark"] {
  color-scheme: dark;
  --bg-page: #090b0e;
  --bg-card: #11161d;
  --bg-chart-area: #090d12;
  --bg-subtle: #161c24;
  --border-color: #1e2633;
  --border-subtle: #1b2330;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-faint: #64748b;
  --accent-brand: #ccff00;
  --accent-brand-text: #000000;
  --chart-grid: rgba(255, 255, 255, 0.08);
  --tooltip-bg: rgba(17, 22, 29, 0.95);
  --tooltip-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 1px rgba(255, 255, 255, 0.1);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg-page: #ffffff;
  --bg-card: #ffffff;
  --bg-chart-area: #fafafa;
  --bg-subtle: #f3f4f6;
  --border-color: #e5e7eb;
  --border-subtle: #f0f0f0;
  --text-main: #111827;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;
  --accent-brand: #6d28d9;
  --accent-brand-text: #ffffff;
  --chart-grid: #e5e7eb;
  --tooltip-bg: #ffffff;
  --tooltip-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

:root {
  --bg-0: var(--bg-page);
  --bg-1: var(--bg-card);
  --bg-2: var(--bg-subtle);
  --bg-community: var(--bg-subtle);
  --text-0: var(--text-main);
  --text-1: var(--text-muted);
  --text-2: var(--text-faint);
  --border: var(--border-color);
  --border-strong: var(--border-color);
  --accent: var(--accent-brand);
  --accent-2: var(--accent-brand);
  --accent-soft: color-mix(in srgb, var(--accent-brand) 16%, transparent);
  --amber: #d3b26a;
  --amber-soft: rgba(211, 178, 106, 0.14);
  --rose: #ee6b57;
  --emerald: #5ee0a8;
  --note: var(--bg-subtle);
  --note-text: var(--text-muted);
  --note-em: var(--text-main);
  --heat: #ff5d4f;
  --glass: color-mix(in srgb, var(--bg-page) 78%, transparent);
  --glass-strong: color-mix(in srgb, var(--bg-card) 92%, transparent);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --app: 430px;
  --top-h: 112px;
  --bot-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --fs-0: 11px;
  --fs-1: 12px;
  --fs-2: 13px;
  --fs-3: 14px;
  --fs-4: 16px;
  --fs-5: 18px;
  --fs-6: 22px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html[data-theme="dark"],
html[data-theme="dark"] body,
html[data-theme="dark"] .app {
  background: #090b0e;
  color: #f8fafc;
}

html[data-theme="light"],
html[data-theme="light"] body,
html[data-theme="light"] .app {
  background: #ffffff;
  color: #111827;
}

html,
body {
  margin: 0;
  font-family: var(--font);
  transition: background-color 0.22s ease, color 0.22s ease;
}

html {
  scroll-padding-top: 72px;
}

body {
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

button,
input {
  font: inherit;
  color: inherit;
}

a {
  color: var(--accent-brand);
}

:focus-visible {
  outline: 2px solid var(--accent-brand);
  outline-offset: 2px;
}

::selection {
  background: color-mix(in srgb, var(--accent-brand) 35%, transparent);
  color: var(--text-main);
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
