/* ============================================================================
   每日盘盘 — 基础层
   重置、排版、焦点可见性、降级动效、氛围层。
   只定义"全局规则"，不出现任何具体组件。
   ========================================================================== */

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

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-13);
  line-height: 1.6;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 排版：所有数字统一等宽 + 定宽数字，避免刷新时列宽跳动 */
.num,
.num * {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "zero" 1;
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.25; }

/* 展示级的字距收紧只用在纯拉丁/数字标题上，中文标题不收，否则会挤压字面 */
.tight { letter-spacing: -.02em; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

button { font-family: inherit; }

/* 滚动条：终端风细条，不抢视觉 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--surface-4);
  border-radius: 99px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--ink-4); }
* { scrollbar-width: thin; scrollbar-color: var(--surface-4) transparent; }

/* ------------------------------------------------------------ 焦点可见性 */
/* 只对键盘用户显示焦点圈，鼠标点击不出现，避免密集界面到处是描边 */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-1);
}

/* ------------------------------------------------------------ 降级动效 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------------------------------------------------ 屏幕阅读器 */
.sr {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------ 氛围层 */
/* 极克制的渐变网格 + 颗粒。工业风不做花哨背景，只把纯平的死黑
   抬一点点"有空气"的层次。透明度必须压到看不见但感觉得到。 */
.atmos::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(70rem 42rem at 8% -12%, rgba(240, 185, 11, .055), transparent 62%),
    radial-gradient(58rem 40rem at 102% 2%, rgba(61, 126, 255, .045), transparent 58%);
}

.grain::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* 页面内容要在氛围层之上 */
.topbar, .ticker, .layout, .foot { position: relative; z-index: 2; }

/* ------------------------------------------------------ 入场编排（一次） */
/* 3 组错峰，60–120ms 间隔。只动 opacity 与 transform。 */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.enter { animation: rise var(--dur-3) var(--ease) both; }
.enter-1 { animation-delay: 0ms; }
.enter-2 { animation-delay: 80ms; }
.enter-3 { animation-delay: 170ms; }
.enter-4 { animation-delay: 260ms; }

/* 数字刷新时的终端式闪烁，用于最新价 */
@keyframes blink {
  0%   { background-color: var(--accent-glow); }
  100% { background-color: transparent; }
}
.flash { animation: blink 620ms ease-out; }

/* 实时脉冲点 */
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .35; transform: scale(.72); }
}
