/* ============================================================================
   小牛人选股 · 全站 VI 统一层
   ----------------------------------------------------------------------------
   设计目标
     1. 建立单一声源的字号阶梯，终结「25 种字号、907 处声明」的失控状态
     2. 中文可读性兜底：任何界面文字不小于 12px，正文与数据统一 14px
     3. 金融数据可纵向比对：全站数字启用等宽字形（tabular-nums）
     4. 收敛视觉语言：圆角、阴影、间距、交互态全部回到同一套令牌

   加载位置
     必须在各页面自身样式表之后加载（本层为覆盖层）。
     回滚方式：删除页面里的 vi.css 引用即可，本层不改动任何原有文件。

   字号映射（原值 → 新值，按语义而非盲目替换）
     9px  → 11px  纯装饰（版本号等，极少量）
     10px → 12px  角标、标签
     11px → 12px  次要说明文字
     12px → 13px  表头、辅助数据
     13px → 14px  正文、列表数据
     14px → 15px  强调数据
     15px → 16px  卡片标题
     16px+ → 保持  标题区
   ============================================================================ */

/* ==========================================================================
   §1  设计令牌
   ========================================================================== */
:root {
  /* ---- 字体族 ---- */
  --vi-font-sans: 'Inter', 'PingFang SC', 'HarmonyOS Sans SC', 'Microsoft YaHei',
                  'Source Han Sans SC', system-ui, -apple-system, sans-serif;
  --vi-font-num: 'SF Mono', 'JetBrains Mono', 'Roboto Mono', ui-monospace,
                 Consolas, 'Menlo', monospace;

  /* ---- 字号阶梯（8 档）---- */
  --vi-fs-2xs: 11px;   /* 极小：版本号、纯装饰角标 */
  --vi-fs-xs:  12px;   /* 小：标签、单位、辅助说明 */
  --vi-fs-sm:  13px;   /* 次小：表头、次要数据 */
  --vi-fs-md:  14px;   /* 正文基准：列表数据、正文 */
  --vi-fs-lg:  16px;   /* 强调：卡片标题、关键数据 */
  --vi-fs-xl:  18px;   /* 区块标题 */
  --vi-fs-2xl: 22px;   /* 页面主标题 */
  --vi-fs-3xl: 28px;   /* 大数字 */

  /* ---- 字重 ---- */
  --vi-fw-normal: 400;
  --vi-fw-medium: 500;
  --vi-fw-semibold: 600;
  --vi-fw-bold: 700;

  /* ---- 行高 ---- */
  --vi-lh-tight: 1.3;   /* 单行数据、按钮 */
  --vi-lh-snug: 1.45;   /* 紧凑多行 */
  --vi-lh-base: 1.6;    /* 正文 */

  /* ---- 间距阶梯（4px 网格）---- */
  --vi-sp-1: 4px;
  --vi-sp-2: 8px;
  --vi-sp-3: 12px;
  --vi-sp-4: 16px;
  --vi-sp-5: 20px;
  --vi-sp-6: 24px;
  --vi-sp-8: 32px;

  /* ---- 圆角 ---- */
  --vi-r-xs: 4px;
  --vi-r-sm: 6px;
  --vi-r-md: 10px;
  --vi-r-lg: 14px;
  --vi-r-pill: 999px;

  /* ---- 控件高度 ---- */
  --vi-h-sm: 28px;
  --vi-h-md: 34px;
  --vi-h-lg: 40px;

  /* ---- 语义色（中国股市口径：红涨绿跌）---- */
  --vi-up:   #dc2626;    /* 涨 */
  --vi-down: #16a34a;    /* 跌 */
  --vi-flat: #6b7280;    /* 平 */

  /* ---- 品牌色 ---- */
  --vi-brand:      #2563eb;   /* 主色：交互与选中 */
  --vi-brand-deep: #1d4ed8;
  --vi-brand-soft: rgba(37, 99, 235, 0.08);
  --vi-accent:     #d97706;   /* 强调橙：小牛人产品线标识 */

  /* ---- 焦点环（可访问性）---- */
  --vi-focus: 0 0 0 2px #fff, 0 0 0 4px rgba(37, 99, 235, 0.45);
}

/* ==========================================================================
   §2  全局基础
   ========================================================================== */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--vi-font-sans);
  font-size: var(--vi-fs-md);
  line-height: var(--vi-lh-base);
  font-weight: var(--vi-fw-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* 数值类元素统一等宽字形 —— 保证价格、涨跌幅纵向对齐 */
[class*="price"], [class*="change"], [class*="pct"], [class*="amount"],
[class*="turnover"], [class*="cap"], [class*="score"], [class*="score-text"],
[class*="data-value"], [class*="stat"], [class*="index-value"],
[class*="conf-val"], [class*="risk-val"], [class*="win-count"],
[class*="advice-price"], [class*="ref-price"], [class*="-num"],
[class*="ratio"], [class*="percent"], .mono, .num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}

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

/* 滚动条统一 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(107, 114, 128, 0.28);
  border-radius: var(--vi-r-pill);
}
::-webkit-scrollbar-thumb:hover { background: rgba(107, 114, 128, 0.45); }

/* ==========================================================================
   §2.5  文字色可读性修正（WCAG AA 对比度）
   --------------------------------------------------------------------------
   原三级文字色在白底上的对比度：
     --text-primary   #1f2937  → 14.7:1  达标
     --text-secondary #6b7280  →  4.7:1  达标
     --text-muted     #9ca3af  →  2.5:1  ✗ 不达标（却被用于数据标签等小字）
   WCAG AA 要求正文与小字不低于 4.5:1，故将三档重新拉开并全部提到线以上，
   同时保持「主要 / 次要 / 辅助」的层级递进关系不变。
   ========================================================================== */
:root {
  --text-primary:   #1f2937;   /* 14.7 : 1 */
  --text-secondary: #4b5563;   /*  7.5 : 1 */
  --text-muted:     #6b7280;   /*  4.7 : 1 */
}

/* ==========================================================================
   §3  字号阶梯落地 —— 按语义分区覆盖
   ========================================================================== */

/* ---- 3.1 顶栏 ---- */
.topbar-brand,
.topbar-logo + *,
.bull-brand, .ding-brand {
  font-size: var(--vi-fs-lg);   /* 品牌名 16px */
  font-weight: var(--vi-fw-bold);
  letter-spacing: 0.2px;
}

.topbar-logo, .bull-logo, .ding-logo {
  font-size: 20px;
}

/* 版本号：唯一允许 11px 的位置 */
.topbar-version, .ding-version-tag, .bull-version-tag, .cache-badge {
  font-size: var(--vi-fs-2xs);
  line-height: 1.4;
  padding: 1px 6px;
  border-radius: var(--vi-r-xs);
  font-weight: var(--vi-fw-medium);
  letter-spacing: 0.2px;
}

/* 顶部导航 */
.topbar-nav-item, .bull-nav-item, .ding-nav-item, .nav-item {
  font-size: var(--vi-fs-sm);
  font-weight: var(--vi-fw-medium);
  min-height: 30px;
  padding: 5px 13px;
  border-radius: var(--vi-r-sm);
  line-height: var(--vi-lh-tight);
}

/* 周期切换 */
.period-btn, .period-group button, .bull-period-btn, .ding-period-btn {
  font-size: var(--vi-fs-sm);
  font-weight: var(--vi-fw-medium);
  min-height: var(--vi-h-sm);
  min-width: 40px;
  padding: 5px 10px;
  border-radius: var(--vi-r-sm);
  line-height: var(--vi-lh-tight);
}

/* 顶栏信息区（股票名 / 价格 / 涨跌 / 时间） */
.stock-info, .stock-info b, .stock-name {
  font-size: var(--vi-fs-lg);
  font-weight: var(--vi-fw-semibold);
}
#stockPrice, #stockChange, .stock-info .price, .stock-info .change {
  font-size: var(--vi-fs-lg);
  font-weight: var(--vi-fw-bold);
  line-height: var(--vi-lh-tight);
}
#updateTime, .stock-info .time, .update-time {
  font-size: var(--vi-fs-xs);
  line-height: var(--vi-lh-tight);
}

/* 顶栏搜索 */
.search-box, .search-box input, .search-input, #searchInput {
  font-size: var(--vi-fs-md);
  line-height: var(--vi-lh-tight);
}
.search-btn, .search-box button {
  font-size: var(--vi-fs-md);
  font-weight: var(--vi-fw-medium);
  min-height: var(--vi-h-md);
}
.search-dropdown, .search-dropdown * {
  font-size: var(--vi-fs-sm);
}

/* 登录按钮 */
.user-btn, .login-btn, .logout-link, .bull-user-btn, .bull-logout-link,
.ding-user-btn, .ding-logout-link, .research-btn {
  font-size: var(--vi-fs-sm);
  font-weight: var(--vi-fw-medium);
  min-height: var(--vi-h-sm);
}

/* ---- 3.2 侧栏 ---- */
.sb-section-title, .sidebar-section-title, .panel-title,
.bull-section-title, .ding-section-title {
  font-size: var(--vi-fs-sm);
  font-weight: var(--vi-fw-bold);
  letter-spacing: 0.6px;
  line-height: var(--vi-lh-tight);
}
.sb-section-arrow, .sb-section-link {
  font-size: var(--vi-fs-sm);
  line-height: var(--vi-lh-tight);
}

/* 键值数据格（最新价 / 涨跌幅 / 成交量 …）*/
.data-label, .stat-label, .metric-label, .kv-label {
  font-size: var(--vi-fs-xs);
  color: var(--text-muted, #9ca3af);
  line-height: var(--vi-lh-tight);
  margin-bottom: var(--vi-sp-1);
}
.data-value, .stat-value, .metric-value, .kv-value {
  font-size: var(--vi-fs-lg);
  font-weight: var(--vi-fw-bold);
  line-height: var(--vi-lh-tight);
}

/* ---- 3.3 列表 / 表格（跨 wl- / bull-wl- / ding-wl- 三套平行组件）---- */
[class*="-list-header"], [class*="list-header"] {
  font-size: var(--vi-fs-xs);
  font-weight: var(--vi-fw-medium);
  line-height: var(--vi-lh-tight);
  letter-spacing: 0.3px;
}

/* 名称 / 代码 —— 列表主标识 */
[class*="-item-name"], [class*="-item-code"], [class*="stock-name"] {
  line-height: var(--vi-lh-tight);
}
[class*="-item-name"] { font-size: var(--vi-fs-md); font-weight: var(--vi-fw-medium); }
[class*="-item-code"] { font-size: var(--vi-fs-xs); font-weight: var(--vi-fw-normal); }

/* 核心数据：最新价 / 涨跌 / 涨跌幅 —— 由 11px 提到 14px */
[class*="-item-price"], [class*="-item-change"], [class*="-item-pct"],
[class*="-item-turnover"], [class*="-item-amount"] {
  font-size: var(--vi-fs-md);
  font-weight: var(--vi-fw-medium);
  line-height: var(--vi-lh-tight);
}
[class*="-item-price"] { font-weight: var(--vi-fw-semibold); }

/* 次级行 / 子项 */
[class*="-sub-item"], [class*="-item-sub"], [class*="-item-extra"] {
  font-size: var(--vi-fs-xs);
  line-height: var(--vi-lh-snug);
}

/* 行内信号、技术、参考价标签 */
[class*="-signal-tag"], [class*="-tech-tag"], [class*="-ref-price"],
[class*="-mini-ind"], [class*="-dim-badge"], [class*="-layer-tag"],
[class*="-verdict-tag"], [class*="-base-tag"], [class*="-evidence-tag"] {
  font-size: var(--vi-fs-2xs);
  line-height: 1.5;
  font-weight: var(--vi-fw-medium);
  border-radius: var(--vi-r-xs);
}

/* 排序按钮 */
[class*="-sort-btn"] {
  font-size: var(--vi-fs-xs);
  font-weight: var(--vi-fw-medium);
  min-height: 26px;
  line-height: var(--vi-lh-tight);
}

/* 快捷标签（顶栏快速标签栏）*/
[class*="-qtag"] {
  font-size: var(--vi-fs-xs);
  font-weight: var(--vi-fw-medium);
  min-height: 26px;
  line-height: var(--vi-lh-tight);
}
[class*="-qtag-price"] { font-size: var(--vi-fs-2xs); }

/* 汇总条 */
[class*="-summary"], [class*="-summary"] * {
  font-size: var(--vi-fs-xs);
  line-height: var(--vi-lh-tight);
}

/* 批量操作条 */
[class*="-batch-enter"], [class*="-batch-info"], [class*="-batch-del"],
[class*="-batch-move"], [class*="-batch-cancel"], [class*="-batch-selectall"] {
  font-size: var(--vi-fs-xs);
  font-weight: var(--vi-fw-medium);
  min-height: 26px;
  line-height: var(--vi-lh-tight);
}

/* 分页 */
[class*="-page-info"], [class*="-page-btn"], [class*="pagination"] {
  font-size: var(--vi-fs-xs);
  line-height: var(--vi-lh-tight);
}
[class*="-page-btn"] { min-height: 28px; min-width: 28px; }

/* 操作按钮（迷你走势 / 持仓 / 提醒 / 移动 / 删除 / 加自选 / 分析 …）
   注意：-item-analysis 与 -item-detail 是承载结果的**空容器**，
   不是按钮，不能给 min-height，否则每行被额外撑高。 */
[class*="-item-chart"], [class*="-item-holding"], [class*="-item-alert"],
[class*="-item-move"], [class*="-item-del"], [class*="-item-enter"],
[class*="-analysis-btn"] {
  font-size: var(--vi-fs-xs);
  font-weight: var(--vi-fw-medium);
  min-height: 26px;
  line-height: var(--vi-lh-tight);
}

/* 持仓标记 */
[class*="-holding-label"], [class*="-holding-info"] {
  font-size: var(--vi-fs-2xs);
  line-height: var(--vi-lh-tight);
}

/* 列表空态 */
[class*="-empty"], .empty-state .text, .empty-state .hint {
  font-size: var(--vi-fs-md);
  line-height: var(--vi-lh-snug);
}
.empty-state .hint, [class*="-empty-hint"] {
  font-size: var(--vi-fs-sm);
}

/* ---- 3.4 分析结果区（建议价 / 理由 / 风险 / 置信度）---- */
[class*="-advice-price"], [class*="-advice-price"] strong {
  font-size: var(--vi-fs-lg);
  font-weight: var(--vi-fw-bold);
  line-height: var(--vi-lh-tight);
}
[class*="-advice-reasons"], [class*="-advice-warnings"],
[class*="-advice-row"], [class*="-detail-row"], [class*="-signal-row"] {
  font-size: var(--vi-fs-sm);
  line-height: var(--vi-lh-snug);
}
[class*="-confidence"], [class*="-conf-label"], [class*="-conf-val"] {
  font-size: var(--vi-fs-xs);
  line-height: var(--vi-lh-tight);
}
[class*="-verdict-layer"], [class*="-verdict-cap"], [class*="-verdict-row"] {
  font-size: var(--vi-fs-xs);
  line-height: var(--vi-lh-snug);
}
[class*="-dims-row"], [class*="-dim-badge"] b {
  font-size: var(--vi-fs-xs);
  line-height: var(--vi-lh-tight);
}

/* ---- 3.5 通用文本工具类 ---- */
.hint, .tip, .note, .helper, .subtitle, .desc, .meta, .unit {
  font-size: var(--vi-fs-xs);
  line-height: var(--vi-lh-snug);
}
.label, .tag, .badge, .chip {
  font-size: var(--vi-fs-xs);
  line-height: 1.5;
}
h1, .h1 { font-size: var(--vi-fs-2xl); font-weight: var(--vi-fw-bold); line-height: 1.35; }
h2, .h2 { font-size: var(--vi-fs-xl);  font-weight: var(--vi-fw-bold); line-height: 1.4; }
h3, .h3 { font-size: var(--vi-fs-lg);  font-weight: var(--vi-fw-semibold); line-height: 1.45; }
h4, .h4 { font-size: var(--vi-fs-md);  font-weight: var(--vi-fw-semibold); line-height: 1.5; }

/* ==========================================================================
   §4  顶栏布局
   ========================================================================== */
/* 顶栏高度控制：字号提升后需要更多空间，但看盘工具垂直空间宝贵，
   故顶栏总高控制在 ~86px（原 62px），仅增加必要呼吸感，不侵占图表区。 */
.topbar-row1 {
  padding: var(--vi-sp-2) var(--vi-sp-5);
  gap: var(--vi-sp-3);
  min-height: 46px;
}
.topbar-row2 {
  padding: 0 var(--vi-sp-5) var(--vi-sp-2) var(--vi-sp-5);
  gap: var(--vi-sp-3);
}

/* 顶部导航选中态：由描边升级为实心块 + 柔和阴影，层级更明确 */
.topbar-nav-item.active,
.bull-nav-item.active,
.ding-nav-item.active {
  background: linear-gradient(135deg, var(--vi-brand-deep), var(--vi-brand));
  color: #fff;
  font-weight: var(--vi-fw-semibold);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
}
.topbar-nav-item:hover,
.bull-nav-item:hover,
.ding-nav-item:hover {
  background: var(--vi-brand-soft);
  color: var(--vi-brand);
}

/* 周期按钮：修复 hover 时「白字 + 近白底」导致文字不可见的问题 */
.period-btn:hover,
.period-group button:hover {
  background: var(--vi-brand-soft);
  color: var(--vi-brand);
}
.period-btn.active,
.period-group button.active {
  background: linear-gradient(135deg, var(--vi-brand-deep), var(--vi-brand));
  color: #fff;
  font-weight: var(--vi-fw-semibold);
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.25);
}

/* ==========================================================================
   §5  侧栏布局
   ========================================================================== */
.sb-section-head, .sidebar-section-head {
  padding: var(--vi-sp-2) var(--vi-sp-3);
  min-height: 36px;
}
.sb-section-body, .sidebar-section-body {
  padding: var(--vi-sp-3);
}
.data-grid, .stat-grid {
  gap: var(--vi-sp-2);
}
.data-item, .stat-item, .kv-item {
  padding: var(--vi-sp-2);
  border-radius: var(--vi-r-sm);
}

/* ==========================================================================
   §6  列表行布局
   --------------------------------------------------------------------------
   两条实测教训（务必遵守）：
   ① 不要用 `[class*="-item"]` —— 它会命中 .wl-item-left / .wl-item-price-col
      等所有子元素，把每个都撑到 44px，单行暴涨到 105px。
   ② 不要改列表行的 gap / padding / 列 min-width —— 自选股面板宽 420px，
      原布局已按该宽度精确分配列宽，再插入 gap 与 padding 会把名称列挤到 0
      （实测「贵州茅台」被压缩至不可见）。因此本区只提升字号，布局交给原样式。
   ========================================================================== */
.wl-item, .bull-wl-item, .ding-wl-item,
[class*="-result-item"], [class*="-scan-item"] {
  min-height: 44px;
}
/* 行容器仅保证不塌陷，不覆盖 padding/gap */
[class*="-item-main"] {
  min-height: 44px;
}
[class*="-list-header"] {
  min-height: 32px;
}
[class*="-sort-bar"] {
  gap: var(--vi-sp-1);
  padding: var(--vi-sp-1) var(--vi-sp-2);
  margin-bottom: var(--vi-sp-2);
  border-radius: var(--vi-r-sm);
}
[class*="-quick-tags-bar"] {
  gap: var(--vi-sp-2);
}
[class*="-pagination"] {
  gap: var(--vi-sp-2);
}
/* 承载分析结果的空容器不占位 */
[class*="-item-analysis"]:empty,
[class*="-item-detail"]:empty {
  display: none;
}

/* ==========================================================================
   §7  按钮
   ========================================================================== */
button, .btn, [class*="-btn"]:not([class*="-sort-btn"]):not([class*="-page-btn"]) {
  font-family: var(--vi-font-sans);
  font-size: var(--vi-fs-sm);
  font-weight: var(--vi-fw-medium);
  line-height: var(--vi-lh-tight);
  border-radius: var(--vi-r-sm);
  transition: background-color .15s ease, color .15s ease,
              border-color .15s ease, box-shadow .15s ease;
  cursor: pointer;
}
button:disabled, .btn:disabled, [class*="-btn"].disabled {
  opacity: .5;
  cursor: not-allowed;
}
.btn-primary, .primary-btn, [class*="-btn-primary"] {
  background: linear-gradient(135deg, var(--vi-brand-deep), var(--vi-brand));
  color: #fff;
  border: none;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.25);
}
.btn-primary:hover, .primary-btn:hover, [class*="-btn-primary"]:hover {
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.35);
  filter: brightness(1.05);
}

/* ==========================================================================
   §8  徽标 / 标签
   ========================================================================== */
[class*="badge"], [class*="-tag"], [class*="chip"] {
  border-radius: var(--vi-r-xs);
  font-weight: var(--vi-fw-medium);
  line-height: 1.5;
}

/* 涨跌语义色统一（红涨绿跌）*/
.up, .red, .positive, [class*="-up"]:not([class*="flash"]) {
  color: var(--vi-up);
}
.down, .green, .negative, [class*="-down"]:not([class*="flash"]) {
  color: var(--vi-down);
}

/* ==========================================================================
   §9  卡片与容器
   ========================================================================== */
.card, .panel, [class*="-card"], [class*="-panel"] {
  border-radius: var(--vi-r-lg);
}

/* ==========================================================================
   §10  表单
   ========================================================================== */
/* 排除 checkbox / radio / 各类可勾选控件，避免被 min-height 拉伸变形 */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
select, textarea, .input {
  font-family: var(--vi-font-sans);
  font-size: var(--vi-fs-md);
  line-height: var(--vi-lh-tight);
  border-radius: var(--vi-r-sm);
  min-height: var(--vi-h-md);
}
input[type="checkbox"], input[type="radio"] {
  width: 15px;
  height: 15px;
  cursor: pointer;
}
input::placeholder, textarea::placeholder {
  font-size: var(--vi-fs-md);
  color: var(--text-muted, #9ca3af);
}
label, .field-label, .form-label {
  font-size: var(--vi-fs-sm);
  font-weight: var(--vi-fw-medium);
  line-height: var(--vi-lh-snug);
}

/* ==========================================================================
   §11  弹层 / 抽屉
   ========================================================================== */
[class*="modal"], [class*="dialog"], [class*="popup"], [class*="dropdown"],
[class*="ctx-menu"], [class*="menu"] {
  font-size: var(--vi-fs-sm);
}
[class*="modal-title"], [class*="dialog-title"] {
  font-size: var(--vi-fs-lg);
  font-weight: var(--vi-fw-semibold);
  line-height: var(--vi-lh-snug);
}
[class*="-mini-chart-header"], [class*="-mini-chart-close"] {
  font-size: var(--vi-fs-xs);
  line-height: var(--vi-lh-tight);
}

/* ==========================================================================
   §12  登录页（各页面未登录门禁）
   ========================================================================== */
[class*="login-box"], [class*="login-card"], [class*="auth-box"] {
  border-radius: var(--vi-r-lg);
  padding: var(--vi-sp-6);
}
[class*="login-title"], [class*="auth-title"] {
  font-size: var(--vi-fs-lg);
  font-weight: var(--vi-fw-semibold);
  line-height: var(--vi-lh-snug);
}
[class*="login-btn"], [class*="auth-btn"] {
  font-size: var(--vi-fs-md);
  font-weight: var(--vi-fw-semibold);
  min-height: var(--vi-h-lg);
  border-radius: var(--vi-r-sm);
}

/* ==========================================================================
   §13  响应式 —— 小屏不再降字号（保持可读下限），改为调整布局密度
   ========================================================================== */
@media (max-width: 768px) {
  body { font-size: var(--vi-fs-md); }

  .topbar-row1 {
    padding: var(--vi-sp-2) var(--vi-sp-3);
    min-height: 46px;
    gap: var(--vi-sp-2);
  }
  .topbar-row2 {
    padding: 0 var(--vi-sp-3) var(--vi-sp-2) var(--vi-sp-3);
    gap: var(--vi-sp-2);
  }

  /* 触控目标不小于 44px */
  button, .btn, [class*="-btn"] {
    min-height: 36px;
  }

  /* 小屏收敛：仍保持字号不降，靠间距让位 */
  [class*="-item-main"] {
    padding: var(--vi-sp-2);
    gap: var(--vi-sp-2);
  }
  [class*="-qtag"], [class*="-sort-btn"] {
    min-height: 30px;
  }
}

@media (max-width: 480px) {
  .topbar-row1 { gap: var(--vi-sp-1); }
  [class*="-item-price-col"] { min-width: 66px; }
}

/* ==========================================================================
   §14  打印
   ========================================================================== */
@media print {
  body { font-size: 12pt; }
  [class*="-item"], [class*="-card"] { break-inside: avoid; }
}

/* ==========================================================================
   §15  手机可读性 / 可点性兜底（2026-09-13 实测，390×844）
   --------------------------------------------------------------------------
   本层文件头写的目标就是「任何界面文字不小于 12px」，但各页仍有硬编码
   9–11.5px 残留，另有若干触控目标低于 32px（Apple HIG 44 / 常用下限 32）。
   这里按**实测 offender 逐个兜底**，不靠感觉。

   ★ 为什么整块必须带 !important（第 1 版没带，index 上几乎全线失效）
     ① 加载顺序没有保证 —— vi.css 并不总是最后一张：
          · index.html   ：stockpage.css(第14行) 在 vi.css(第12行) **之后**
          · index/bull/ding：holder-drill.css 更靠后
          · 其余页（bull/ding/trading/admin/watchlist）vi.css 确实在最后
        所以同权重时页面样式表反压本层。实证：撤掉 stockpage.css，
        .sh-tag 立刻从 11px 回到 12px。
     ② 特异性倒挂 —— 连 vi.css 自己内部都有：
        `.period-btn, .period-group button, ... { min-height: var(--vi-h-sm) }`
        里命中的是 `.period-group button`(0,1,1)，比本层的 `.period-btn`
        (0,1,0) 高一档，于是 min-height:32px 输了 var(--vi-h-sm)=28px。
        实证：撤掉 vi.css，min-height 变 auto、height 变 26px。
     带 !important 后与权重、顺序都无关，这个「全站手机地板」才真正落地。
     只在本断点内生效，桌面不受影响。

   ★ 为什么不改 --vi-fs-2xs 等令牌：
     实测超标的是硬编码字面量（不走令牌）+ 一批内联 style，改令牌打不到点上，
     却会波及全部断点与 6 个页面。
   ========================================================================== */
@media (max-width: 768px) {

  /* ---- §15.1  字号地板 12px ---------------------------------------------- */

  /* (A) 内联写死的 10–11.5px。
         app.js / bull.js / ding.js 的 kpi()、typeTag()、user-btn 等用
         style="font-size:11px" 直接生成（见 app.js:1940），
         内联声明只输给 !important，所以这里必须带，且只能用属性选择器命中。 */
  [style*="font-size:11px"],
  [style*="font-size: 11px"],
  [style*="font-size:10px"],
  [style*="font-size: 10px"],
  [style*="font-size:11.5px"],
  [style*="font-size: 11.5px"],

  /* (B) 跨页通用的小标签 / 版本徽标 / 竖向箭头 */
  .hot-rank,
  .bull-index-label,
  .ds-bt-label,
  .ding-version-tag,
  .bull-phase-tag,
  .t-version-tag,
  .topbar-version,
  .dim-layer-tag,
  .period-signal-tag,
  .bp-col-desc,
  .sh-tag,
  .data-label,
  .hd-dd-entry-s,
  .sb-section-arrow,

  /* (C) index / 个股页：开高低昨收、缠论结构明细表头、图例、涨跌标记 */
  .sh-ohlc-cell i,
  .bottom-panel th,
  .bottom-panel td,
  .empty-tag,
  .chart-legend .lg,
  .tag,

  /* (D) 小牛人 / 庖丁解牛 的分析面板（实测 24 个类，最小 10px） */
  .sa-label,
  .sa-base-tag,
  .pos-item-label,
  .pos-level-tag,
  .ds-risk-label,
  .ds-risk-val,
  .ds-ring-label,
  .ds-win-label,
  .ds-win-count,
  .ds-conflict-tag,
  .bull-timing-layer-detail,
  .bp-factor,
  .rr-pct,
  .rr-gauge-label,
  .lc-step-strength,
  .lc-evidence-tag,
  .lc-conclusion-label,
  .bull-report-meta,
  .bull-report-rating,
  .pp-step-tag,
  .oh-badge,
  .oh-factor,
  .plan-warn-icon,
  .bull-tech-ind-name span,

  /* (E) 模拟交易 / 自选股 */
  .t-acct-label,
  .t-lb-assets,
  .wl-nav-row a,
  .wl-nav-row button {
    font-size: 12px !important;
  }

  /* ---- §15.2  触控目标地板 32px ------------------------------------------ */

  /* 只提「高度」；宽度交给图标按钮那一组单独处理。
     390px 窄栏里横向再撑就会左右溢出。 */
  .logout-link,
  .topbar-nav-item,
  .appbar-navitem,
  .ding-nav-item,
  .bull-nav-item,
  .t-nav-item,
  .wl-nav-row a,
  .wl-nav-row button,
  .user-btn,
  .login-btn,
  .wl-login-btn,
  .bull-user-btn,
  .bull-logout-link,
  .ding-user-btn,
  .ding-logout-link,
  .appbar-brand,
  .pool-tab,
  .period-btn,
  .hot-item,
  .bull-empty-tag,
  .ding-empty-tag {
    min-height: 32px !important;
  }

  /* 宽度也要兜的两类：
     ① 图标按钮：只有一个字形的（× / ▾），宽度由字号撑出来，天然偏窄；
     ② 纯文字小链接：「退出」这种两个汉字的，高度补齐后宽度仍只有 26px。
     实测（第 2 批回归）就漏在这一类上：.bull-logout-link / .ding-logout-link
     是 26x32 —— 高度达标、宽度不达标。 */
  .close-btn,
  .bottom-toggle-btn,
  .user-btn,
  .bull-user-btn,
  .t-qty-btns button,
  .logout-link,
  .bull-logout-link,
  .ding-logout-link,
  .login-btn,
  .wl-login-btn {
    min-width: 32px;
  }

  /* a / span 默认 inline，min-height 对它们无效，须显式给 inline-flex */
  .logout-link,
  .topbar-nav-item,
  .appbar-navitem,
  .ding-nav-item,
  .bull-nav-item,
  .t-nav-item,
  .wl-nav-row a,
  .wl-nav-row button,
  .bull-logout-link,
  .ding-logout-link,
  .appbar-brand {
    display: inline-flex;
    align-items: center;
  }

  /* 12px 字号下原内边距会贴边，补一点 */
  .bull-empty-tag,
  .ding-empty-tag {
    padding: 5px 12px;
  }

  /* 热搜名次徽标：16×16 装 12px 数字太挤，放大到 18×18 */
  .hot-rank {
    width: 18px;
    height: 18px;
    border-radius: 4px;
  }

  /* 导航组纵向居中，避免 32px 目标把行高顶歪 */
  .topbar-nav-group,
  .bull-nav-group,
  .ding-nav-group,
  .t-nav-group {
    align-items: center;
  }
}


/* ---- §15.2 手机 KPI 卡放宽（2026-09-13 第二批） ----------------------
   kpi()（app.js / bull.js / ding.js 三份副本）把卡写死为
   flex:1 1 108px; min-width:108px + 内联 font-size:16px。
   390px 浮层/面板一行塞 3 张时，「2026-06-30」与
   「CR5 46.89% · CR10 63.44%」都折成两行（实测行数=2）。
   放宽到 46% 一行两张，值与副行各得整行。属性选择器只匹配
   这三处内联样式（全站 108px 已 grep 确认无其他使用点）。 */
@media (max-width: 768px) {
  [style*="flex:1 1 108px"] { flex: 1 1 46% !important; min-width: 140px !important; }
}
