/* 概念通 共享设计 token (tokens.css) —— P1
 * 全站 token 真源。本文件在各页 <link> 于 inline <style> 之前引入,故:
 *  - 各页现有 :root(同名 --primary/--bg 等)仍生效,不被覆盖 → 零视觉回归;
 *  - 新代码与后续清理统一引用 --gnt-* 命名;
 *  - 全局 tabular-nums 让所有数字列对齐不抖;
 *  - reduced-motion 兜底,为 P2/P3 动效预留无障碍出口。
 */
:root {
  /* 品牌色(全站唯一规范) */
  --gnt-primary: #4361ee;
  --gnt-primary-strong: #3a51c7;
  --gnt-primary-light: #eef0ff;
  /* 中性面 */
  --gnt-bg: #ffffff;
  --gnt-bg2: #f8f9fa;
  --gnt-card: #ffffff;
  --gnt-border: #e6e8ee;
  --gnt-text: #1a1d28;
  --gnt-sub: #6b7280;
  /* A 股涨跌:红涨 / 绿跌 */
  --gnt-up: #e0413a;
  --gnt-down: #1ba784;
  /* 语义 */
  --gnt-success: #16a34a;
  --gnt-warning: #d97706;
  --gnt-danger: #dc2626;

  /* 圆角 scale */
  --gnt-radius-sm: 6px;
  --gnt-radius-md: 8px;
  --gnt-radius-lg: 12px;
  --gnt-radius-pill: 999px;

  /* 阴影 scale (低透明纯黑,贴合现有语言) */
  --gnt-shadow-sm: 0 1px 3px rgba(0, 0, 0, .06);
  --gnt-shadow-md: 0 4px 12px rgba(0, 0, 0, .10);
  --gnt-shadow-lg: 0 8px 32px rgba(0, 0, 0, .15);

  /* 间距 scale */
  --gnt-space-1: 4px;
  --gnt-space-2: 8px;
  --gnt-space-3: 12px;
  --gnt-space-4: 16px;
  --gnt-space-5: 24px;
  --gnt-space-6: 32px;

  /* 字体与正文节奏：页面可通过别名复用，避免各模板各写一套。 */
  --gnt-font-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --gnt-font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  --gnt-text-xs: 12px;
  --gnt-text-sm: 13px;
  --gnt-text-md: 15px;
  --gnt-line-body: 1.55;
}

/* 全局:数字等宽对齐。tabular-nums 只影响数字字形宽度,对中文/字母无副作用。
   解决 admin/个股/概念表格的百分比、市值、价格列随数据变化左右抖动。 */
table td,
table th,
.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* 无障碍:尊重 reduced-motion(为后续动效预留) */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* 无障碍(P3):键盘聚焦可见轮廓。:focus-visible 只在键盘导航时出现,
   不影响鼠标点击的视觉(鼠标点击不显示轮廓,避免干扰)。 */
:focus-visible {
  outline: 2px solid var(--gnt-primary, #4361ee);
  outline-offset: 2px;
  border-radius: 3px;
}

/* 无障碍(P3):视觉隐藏但屏幕阅读器可见。用于 h1/标签等语义补全。 */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
