/* ============================================================
   问渠 · 基础层
   设计语言：深墨 + 鎏金 + 宋体大标题 + 等宽数字
   本文件：主题变量 / 重置 / 排版 / 通用原子类
   ============================================================ */

/* ---------- 本地字体（拉丁部分与参考站一致） ---------- */
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/geist-var.woff2") format("woff2");
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/geist-mono-var.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("../fonts/source-serif.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url("../fonts/source-serif-italic.woff2") format("woff2");
}

:root {
  --font-sans: "Geist", "Noto Sans SC", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  --font-serif: "Source Serif 4", "Noto Serif SC", "Source Han Serif SC", "STZhongsong", "华文中宋", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --font-display: "Source Serif 4", "Noto Serif SC", "Source Han Serif SC", "方正小标宋简体", "FZXiaoBiaoSong-B05S", "STZhongsong", "华文中宋", "Songti SC", "SimSun", serif;
  --font-mono: "Geist Mono", "JetBrains Mono", "Cascadia Mono", "SF Mono", Consolas, "Courier New", monospace;

  --radius-xs: 6px;
  --radius-sm: 9px;
  --radius: 13px;
  --radius-lg: 18px;
  --radius-xl: 26px;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0e0a06;
  --bg-deep: #090603;
  --surface: #17120d;
  --surface-2: #1e1811;
  --surface-3: #272016;
  --surface-hover: #221b13;
  --overlay: rgba(8, 5, 2, .72);

  --line: #33281a;
  --line-2: #4a3a25;
  --line-strong: #6f5530;

  --ink: #f7edd4;
  --ink-2: #ddceb1;
  --ink-3: #9e8f74;
  --ink-4: #6d5f4a;
  --ink-on-gold: #1a1207;

  --gold: #d9b767;
  --gold-bright: #f0d79a;
  --gold-deep: #a8792a;
  --gold-soft: rgba(217, 183, 103, .10);
  --gold-line: rgba(217, 183, 103, .26);

  --ruby: #d85762;
  --ruby-soft: rgba(216, 87, 98, .12);
  --green: #85b26e;
  --green-soft: rgba(133, 178, 110, .12);
  --teal: #6fb3a4;
  --blue: #83a8cf;
  --violet: #b79bd6;
  --amber: #d9a45b;

  --shadow-sm: 0 1px 0 rgba(0, 0, 0, .45);
  --shadow-card: 0 22px 44px -32px rgba(0, 0, 0, .95);
  --shadow-pop: 0 30px 70px -30px rgba(0, 0, 0, .9);

  --glow-a: rgba(191, 142, 54, .13);
  --glow-b: rgba(139, 31, 42, .08);
  --grid-line: rgba(217, 183, 103, .028);
  --sheen: linear-gradient(115deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, 0) 42%);
}

:root[data-theme="light"] {
  color-scheme: light;

  --bg: #f4efe4;
  --bg-deep: #ece4d3;
  --surface: #fcf8ee;
  --surface-2: #f7f1e3;
  --surface-3: #efe6d2;
  --surface-hover: #f6efdd;
  --overlay: rgba(30, 22, 12, .38);

  --line: #e2d6bd;
  --line-2: #d3c2a0;
  --line-strong: #b8a173;

  --ink: #1c150d;
  --ink-2: #3d3327;
  --ink-3: #7a6b56;
  --ink-4: #a3947d;
  --ink-on-gold: #1a1207;

  --gold: #a8792a;
  --gold-bright: #8b6118;
  --gold-deep: #6e4910;
  --gold-soft: rgba(168, 121, 42, .09);
  --gold-line: rgba(168, 121, 42, .30);

  --ruby: #8b1f2a;
  --ruby-soft: rgba(139, 31, 42, .08);
  --green: #4a6e3f;
  --green-soft: rgba(74, 110, 63, .09);
  --teal: #3f7a6e;
  --blue: #3c6485;
  --violet: #5c3a6e;
  --amber: #8b6118;

  --shadow-sm: 0 1px 0 rgba(26, 20, 14, .04);
  --shadow-card: 0 22px 44px -34px rgba(60, 40, 10, .35);
  --shadow-pop: 0 30px 70px -30px rgba(60, 40, 10, .28);

  --glow-a: rgba(200, 160, 80, .18);
  --glow-b: rgba(139, 31, 42, .05);
  --grid-line: rgba(120, 90, 40, .038);
  --sheen: linear-gradient(115deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 46%);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 520px at 82% -8%, var(--glow-a), transparent 62%),
    radial-gradient(760px 520px at -6% 108%, var(--glow-b), transparent 60%),
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: auto, auto, 84px 84px, 84px 84px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  top: -340px;
  right: -260px;
  width: 940px;
  height: 940px;
  pointer-events: none;
  z-index: 0;
  opacity: .5;
  background: repeating-radial-gradient(circle at center,
    transparent 0 47px,
    var(--gold-line) 48px,
    transparent 49px);
  mask-image: radial-gradient(circle at center, #000 0 26%, transparent 64%);
  -webkit-mask-image: radial-gradient(circle at center, #000 0 26%, transparent 64%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.9' numOctaves='2' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0.55 0 0 0 0 0.45 0 0 0 0 0.28 0 0 0 0.035 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

#app { position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img, svg { display: block; }
input, select, textarea { font: inherit; color: inherit; }

::selection { background: var(--gold); color: var(--ink-on-gold); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 99px;
  border: 3px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--line-strong); }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }

/* 中文衬线字体（华文中宋等）没有独立粗体，关闭合成粗体更接近思源宋体的观感 */
h1, h2, h3, h4, .font-display, .serif, .brand-title, .home-title, .page-title { font-synthesis: none; }

h1.display, .font-display { font-family: var(--font-serif); font-weight: 600; }

p { margin: 0; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- 排版原子 ---------- */
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.serif { font-family: var(--font-serif); }
.muted { color: var(--ink-3); }
.dim { color: var(--ink-4); }
.gold { color: var(--gold); }
.ruby { color: var(--ruby); }
.green { color: var(--green); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.tiny { font-size: 11px; }
.small { font-size: 12px; }
.fs-13 { font-size: 13px; }
.fs-15 { font-size: 15px; }
.fs-18 { font-size: 18px; }
.fs-22 { font-size: 22px; }

.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.col { display: flex; flex-direction: column; }
.gap-2 { gap: 2px; } .gap-3 { gap: 3px; } .gap-4 { gap: 4px; }
.gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; }
.gap-12 { gap: 12px; } .gap-14 { gap: 14px; } .gap-16 { gap: 16px; }
.gap-20 { gap: 20px; } .gap-24 { gap: 24px; }
.grow { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }
.center { display: flex; align-items: center; justify-content: center; }
.hidden { display: none !important; }

.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; } .mb-24 { margin-bottom: 24px; }

/* ---------- 动效 ---------- */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse-soft { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes shimmer {
  from { background-position: -220% 0; }
  to { background-position: 220% 0; }
}
@keyframes pop-in {
  0% { opacity: 0; transform: scale(.96) translateY(8px); }
  100% { opacity: 1; transform: none; }
}

.anim-in { animation: fade-up .45s var(--ease-out) both; }
.anim-fade { animation: fade-in .3s var(--ease) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}


