/* =========================================================================
   base.css — 字体、重置、排版、卷轴、通用工具
   ========================================================================= */

@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900; font-display: swap; font-style: normal;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900; font-display: swap; font-style: normal;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  font-size: var(--fs-14);
  line-height: var(--lh);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01";
  letter-spacing: -0.006em;
  overflow: hidden;              /* app shell 管理自身卷动 */
}

h1, h2, h3, h4, h5 { font-weight: 600; line-height: var(--lh-tight); letter-spacing: -0.02em; }

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
svg { display: block; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; padding: 0; }
table { border-collapse: separate; border-spacing: 0; width: 100%; }
[hidden] { display: none !important; }

/* 数字等宽，表格金额对齐 */
.tnum, .num, td.num, th.num { font-variant-numeric: tabular-nums; }

/* ---- 卷轴 ----------------------------------------------------------- */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
  background: var(--line-2); border-radius: 999px;
  border: 3px solid transparent; background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--line-strong); background-clip: padding-box; }
*::-webkit-scrollbar-corner { background: transparent; }

/* ---- 焦点可见 ------------------------------------------------------- */
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-xs); }

/* ---- 文字工具 ------------------------------------------------------- */
.dim { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.mono { font-family: var(--font-mono); font-feature-settings: "zero"; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.up { text-transform: uppercase; letter-spacing: .08em; font-size: var(--fs-11); font-weight: 600; }
.sect-label { color: var(--text-faint); text-transform: uppercase; letter-spacing: .1em;
  font-size: var(--fs-11); font-weight: 600; }

.pos { color: var(--good); } .neg { color: var(--danger); }

/* ---- 布局工具 ------------------------------------------------------- */
.row { display: flex; align-items: center; }
.row.gap { gap: 8px; } .row.gap-sm { gap: 4px; } .row.gap-lg { gap: 16px; }
.col { display: flex; flex-direction: column; }
.between { display: flex; align-items: center; justify-content: space-between; }
.center { display: flex; align-items: center; justify-content: center; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.spacer { flex: 1 1 auto; }

/* ---- 动画 ----------------------------------------------------------- */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(6px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { 100% { background-position: 200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* 骨架载入 */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: var(--r-xs);
}
