/* ============================================================
   AI 股票引擎 · 设计令牌 (Design Tokens)
   风格定位：机构级深色交易终端 + 克制的高光细节
   色彩语义：中国市场 —— 红涨 / 绿跌
   ============================================================ */

:root {
  /* ---------- 背景层级 ---------- */
  --bg:            #070A10;
  --bg-grid:       #0A0E16;
  --surface-1:     #0F1522;
  --surface-2:     #141B2A;
  --surface-3:     #1A2233;
  --surface-hi:    #202A3D;

  /* ---------- 描边 ---------- */
  --border:        rgba(255, 255, 255, .065);
  --border-2:      rgba(255, 255, 255, .10);
  --border-3:      rgba(255, 255, 255, .16);

  /* ---------- 文本 ---------- */
  --t1:            #E9EEF7;
  --t2:            #97A3B8;
  --t3:            #5E6A80;
  --t4:            #3B4453;

  /* ---------- 涨跌语义 ---------- */
  --up:            #F6465D;
  --up-deep:       #C22E44;
  --up-soft:       rgba(246, 70, 93,  .13);
  --up-line:       rgba(246, 70, 93,  .32);

  --down:          #12B886;
  --down-deep:     #0B8A63;
  --down-soft:     rgba(18, 184, 134, .13);
  --down-line:     rgba(18, 184, 134, .32);

  --flat:          #8A93A6;

  /* ---------- 品牌 / 状态 ---------- */
  --accent:        #4C7DFF;
  --accent-hi:     #6B93FF;
  --accent-soft:   rgba(76, 125, 255, .13);
  --accent-line:   rgba(76, 125, 255, .34);

  --gold:          #D9A85C;
  --gold-soft:     rgba(217, 168, 92, .13);

  --warn:          #F5A524;
  --warn-soft:     rgba(245, 165, 36, .13);

  --danger:        #F6465D;
  --success:       #12B886;
  --info:          #4C7DFF;
  --purple:        #8B7BF7;
  --purple-soft:   rgba(139, 123, 247, .13);

  /* ---------- 圆角 ---------- */
  --r-xs: 6px;
  --r-sm: 9px;
  --r-md: 13px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-full: 999px;

  /* ---------- 阴影 ---------- */
  --sh-1: 0 1px 2px rgba(0,0,0,.4);
  --sh-2: 0 4px 16px rgba(0,0,0,.35);
  --sh-3: 0 12px 40px rgba(0,0,0,.5);
  --sh-glow: 0 0 0 1px rgba(76,125,255,.28), 0 8px 30px rgba(76,125,255,.16);
  --inset-hi: inset 0 1px 0 rgba(255,255,255,.05);

  /* ---------- 字体 ---------- */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
               "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --font-num:  "SF Mono", "JetBrains Mono", "Roboto Mono", ui-monospace,
               "PingFang SC", -apple-system, sans-serif;

  /* ---------- 动效 ---------- */
  --ease-out:  cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);
  --t-fast: 140ms;
  --t-base: 240ms;
  --t-slow: 480ms;

  /* ---------- 布局 ---------- */
  --sidebar-w: 236px;
  --topbar-h: 62px;
}

/* ============================================================
   Reset
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

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

body {
  background: var(--bg);
  color: var(--t1);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh;
  overflow-x: hidden;
}

img, svg, video, canvas { display: block; max-width: 100%; }
button, input, select, textarea {
  font: inherit; color: inherit; background: none; border: none; outline: none;
}
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
table { border-collapse: collapse; width: 100%; }

::selection { background: rgba(76,125,255,.32); color: #fff; }

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.09);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.18); background-clip: content-box; }

/* ============================================================
   排版
   ============================================================ */
h1, h2, h3, h4 { font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 28px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
h4 { font-size: 14px; }

.num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "zero" 1;
  letter-spacing: -.02em;
}
.mono { font-family: var(--font-num); }

.up   { color: var(--up)   !important; }
.down { color: var(--down) !important; }
.flat { color: var(--flat) !important; }

.t1 { color: var(--t1); }
.t2 { color: var(--t2); }
.t3 { color: var(--t3); }

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--t3);
}

/* ============================================================
   工具类
   ============================================================ */
.row   { display: flex; align-items: center; }
.row-c { display: flex; align-items: center; justify-content: center; }
.row-b { display: flex; align-items: center; justify-content: space-between; }
.col   { display: flex; flex-direction: column; }
.wrap  { flex-wrap: wrap; }
.grow  { flex: 1 1 auto; min-width: 0; }

.g-4  { gap: 4px; }  .g-6  { gap: 6px; }
.g-8  { gap: 8px; }  .g-12 { gap: 12px; }
.g-16 { gap: 16px; } .g-20 { gap: 20px; }
.g-24 { gap: 24px; } .g-32 { gap: 32px; }

.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} .mt-32{margin-top:32px}
.mb-4{margin-bottom:4px} .mb-8{margin-bottom:8px}
.mb-12{margin-bottom:12px} .mb-16{margin-bottom:16px} .mb-24{margin-bottom:24px}

.fs-11{font-size:11px} .fs-12{font-size:12px} .fs-13{font-size:13px}
.fs-15{font-size:15px} .fs-18{font-size:18px} .fs-22{font-size:22px}
.fs-28{font-size:28px} .fs-34{font-size:34px}

.fw-4{font-weight:400} .fw-5{font-weight:500} .fw-6{font-weight:600} .fw-7{font-weight:700}

.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.nowrap { white-space: nowrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }

/* 焦点可见性 */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* ============================================================
   动效基元
   ============================================================ */
@keyframes fadeUp   { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn  { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes pulseRing{
  0%   { box-shadow: 0 0 0 0 rgba(18,184,134,.5); }
  70%  { box-shadow: 0 0 0 7px rgba(18,184,134,0); }
  100% { box-shadow: 0 0 0 0 rgba(18,184,134,0); }
}
@keyframes breathe  { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes shimmer  { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
@keyframes tickerUp {
  0%   { background-color: rgba(246,70,93,.26); }
  100% { background-color: transparent; }
}
@keyframes tickerDown {
  0%   { background-color: rgba(18,184,134,.26); }
  100% { background-color: transparent; }
}
@keyframes spin     { to { transform: rotate(360deg); } }
@keyframes drawLine { from { stroke-dashoffset: var(--dash, 800); } to { stroke-dashoffset: 0; } }
@keyframes marquee  { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
}
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
