/* ═══════════════════════════════════════════════════════════════
   观澜 Dashboard — 霓虹赛博主题
   纯 CSS 实现，零依赖。毛玻璃 + 霓虹发光 + 微动效。
   ═══════════════════════════════════════════════════════════════ */

/* ── CSS 变量（设计令牌）── */
:root {
  /* 字体 */
  --font-ui:    'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-data:  'Inter', -apple-system, BlinkMacSystemFont, monospace;

  /* 背景层级 */
  --bg-base:       #06080d;
  --bg-elevated:   #0a0f1a;
  --bg-glass:      rgba(10, 15, 26, 0.55);
  --bg-glass-strong: rgba(10, 15, 26, 0.78);
  --bg-hover:      rgba(255, 255, 255, 0.04);
  --bg-active:     rgba(0, 210, 255, 0.08);

  /* Accent — 冰蓝 */
  --accent:         #00d2ff;
  --accent-dim:     rgba(0, 210, 255, 0.2);
  --accent-glow:    rgba(0, 210, 255, 0.3);
  --accent-strong:  rgba(0, 210, 255, 0.45);
  --purple:         #a29bfe;
  --purple-dim:     rgba(162, 155, 254, 0.25);
  --pink:           #ff6b9d;
  --green:          #00ff88;

  /* 边框 */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-glow:   var(--accent-dim);
  --border-active: var(--accent-strong);

  /* 文字 — 提升对比度，副文字不再发灰 */
  --text-primary:  #e4ecf7;
  --text-secondary:#b8c5da;
  --text-muted:    #8895ac;

  /* 语义色（涨红跌绿，国内习惯） */
  --up:            #ff4757;
  --up-glow:       rgba(255, 71, 87, 0.3);
  --up-bright:     #ff8095;   /* --up 亮化派生色(深底上文字对比度更好) */
  --down:          #00ff88;
  --down-glow:     rgba(0, 255, 136, 0.25);
  --gold:          #f0c060;
  --gold-dim:      rgba(240, 192, 96, 0.25);

  /* 圆角 */
  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     16px;
  --radius-xl:     20px;

  /* 阴影 */
  --shadow-card:   0 2px 16px rgba(0, 0, 0, 0.4);
  --shadow-glow-sm: 0 0 12px var(--accent-dim);
  --shadow-glow-md: 0 0 24px var(--accent-dim);
  --shadow-glow-lg: 0 0 40px var(--accent-glow);

  /* 过渡 */
  --ease-out:      cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:   cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast:      150ms;
  --dur-normal:    300ms;
  --dur-slow:      600ms;

  /* 毛玻璃（降噪：blur 16→8px saturate 180%→120%） */
  --glass-blur:    8px;
  --glass-saturate: 120%;

  /* Chat 页专属（A2 方案：深青实底用户气泡，低刺激） */
  --chat-user-bubble: #123a52;
  --chat-user-text:   #e8f4fb;

  /* 顶部安全区（刘海避让）。iPad PWA 状态栏虽不透明，但 standalone 全屏下内容仍延伸至其下，
     必须用 env(safe-area-inset-top) 避让，否则顶栏与系统状态栏重合 */
  --safe-top: env(safe-area-inset-top, 0px);
  /* 底部安全区（2026-09-13）：viewport-fit=cover 下 iPhone PWA 的 home indicator
     会盖住贴底内容——每页条数自适应（fitPageSize）用它扣减可用高度 */
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ── 基础重置 ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ⚠️ dvh 注意（2026-09-15 深夜）：iOS 27 PWA 用不透明状态栏（black/default）时
   `100vh` 会算成物理屏高（比实际视口大一个状态栏 ~59px）→ body 被撑长、整页多出
   一小截滚动。`100dvh` = 实际视口高度，才是正确口径。规则：本文件内新增任何
   `100vh` 一律同时写 `100dvh` 覆盖（老浏览器自动忽略后者）。 */
body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 15px; line-height: 1.55;
  min-height: 100vh; min-height: 100dvh; overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'tnum' 1, 'cv01' 1;  /* tabular numbers + open digits */
}

/* ── 滚动稳定（2026-09-12）：消除"稍微一拖动就会晃" ──
   ① 禁纵向橡皮筋：iOS 轻拖时整页弹性位移（overscroll-behavior Safari 16+）
   ② 横向溢出由 body 的 overflow-x:hidden（下方"基础重置"区）传播到 viewport 兜底；
      html 自身不再设 overflow-x（2026-09-13 移除）：html 上设 hidden 会让它成为
      滚动容器，个别内核（夸克实测）滚轮滚动链随之失效——内容区滚轮不滚、
      点住滚动条滚却有效。body 的声明传播后效果等价（横向仍不可滚）。
   ③ 内嵌滚动容器防滚动链：滚到边界继续拖不带动整页弹动 */
html { overscroll-behavior-y: none; }
body { overscroll-behavior-y: none; }
.dash-main [style*="overflow"] { overscroll-behavior: contain; }

/* 星空背景（CSS 径向渐变模拟） */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1px 1px at 10% 15%, rgba(255,255,255,0.25), transparent),
    radial-gradient(1px 1px at 25% 35%, rgba(255,255,255,0.2), transparent),
    radial-gradient(1.5px 1.5px at 40% 8%, rgba(0,210,255,0.3), transparent),
    radial-gradient(1px 1px at 55% 25%, rgba(255,255,255,0.2), transparent),
    radial-gradient(1.5px 1.5px at 65% 60%, rgba(162,155,254,0.25), transparent),
    radial-gradient(1px 1px at 75% 12%, rgba(255,255,255,0.2), transparent),
    radial-gradient(1px 1px at 85% 45%, rgba(0,210,255,0.2), transparent),
    radial-gradient(1.5px 1.5px at 15% 70%, rgba(255,255,255,0.2), transparent),
    radial-gradient(1px 1px at 35% 80%, rgba(162,155,254,0.2), transparent),
    radial-gradient(1px 1px at 50% 50%, rgba(255,255,255,0.15), transparent),
    radial-gradient(1.5px 1.5px at 70% 85%, rgba(0,210,255,0.2), transparent),
    radial-gradient(1px 1px at 90% 75%, rgba(255,255,255,0.15), transparent),
    /* 大面积柔光 */
    radial-gradient(ellipse 80% 60% at 30% 20%, rgba(0,210,255,0.03) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 70% 70%, rgba(162,155,254,0.03) 0%, transparent 60%);
  background-size: 100% 100%;
}

/* ── 动画关键帧 ── */

/* 入场：从下往上淡入 */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 入场：缩放淡入 */
@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

/* 霓虹脉冲 */
@keyframes neonPulse {
  0%, 100% { box-shadow: 0 0 8px var(--accent-dim), 0 0 20px var(--accent-dim); }
  50%      { box-shadow: 0 0 8px var(--accent-dim), 0 0 20px var(--accent-dim), 0 0 40px var(--accent-glow); }
}

/* 呼吸灯 */
@keyframes breathe {
  0%, 100% { opacity: 1;   box-shadow: 0 0 6px var(--green); }
  50%      { opacity: 0.4; box-shadow: 0 0 12px var(--green); }
}

/* 边框发光扫描 */
@keyframes borderGlow {
  0%, 100% { border-color: var(--border-glow); }
  50%      { border-color: rgba(0, 210, 255, 0.4); }
}

/* 文字渐变流动 */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* shimmer 骨架屏 */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* 数字计数弹跳 */
@keyframes countBounce {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* ── 星空闪烁 Canvas（随机大小/位置/相位的星星，starfield.js 绘制） ── */
#starfield {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
}

/* ── 页面容器 ── */
main.dash-main {
  position: relative; z-index: 1;
  padding: 16px 24px;
  max-width: 1440px;
  margin: 0 auto;
}

/* ── 排版层级 ── */
h1, h2, h3 { font-family: var(--font-ui); letter-spacing: -0.01em; }
h1 { font-size: 1.6em; font-weight: 800; }
h2 { font-size: 1.25em; font-weight: 700; }
h3 { font-size: 1.05em; font-weight: 600; }

/* ── 顶栏导航 ── */
.top-nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 4px;
  padding: calc(var(--safe-top) + 8px) 20px;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 1px 20px rgba(0, 0, 0, 0.3);
}

/* 品牌名：渐变文字 + 发光点 */
.top-nav .brand {
  font-weight: 900; font-size: 1.35em; text-decoration: none; letter-spacing: 0.04em;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-right: 14px;
  position: relative;
  display: flex; align-items: center; gap: 7px;
}

.brand-icon {
  width: 26px; height: 26px; border-radius: 8px;
  border: 1px solid rgba(0,210,255,0.35);
  box-shadow: 0 0 10px rgba(0,210,255,0.25);
  object-fit: cover;
}
.top-nav .brand::after {
  content: '';
  position: absolute; right: -8px; top: 50%; transform: translateY(-50%);
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent), 0 0 16px var(--accent);
  animation: breathe 2.5s ease-in-out infinite;
}

/* 导航链接 */
.nav-link {
  font-family: var(--font-ui); font-weight: 500;
  color: var(--text-secondary); text-decoration: none;
  font-size: 0.9em; padding: 7px 16px; border-radius: var(--radius-sm);
  transition: all var(--dur-fast) var(--ease-out);
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute; bottom: -1px; left: 50%; transform: translateX(-50%);
  width: 0; height: 2px; border-radius: 1px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  transition: width var(--dur-normal) var(--ease-out);
}
.nav-link:hover { color: var(--text-primary); background: var(--bg-hover); }
.nav-link:hover::after { width: 60%; }
.nav-link.active {
  color: var(--accent);
  background: var(--bg-active);
}
.nav-link.active::after { width: 60%; }

/* 状态指示器 */
.nav-status {
  margin-left: auto; font-size: 0.78em; color: var(--text-secondary);
  display: flex; align-items: center; gap: 6px;
}
.nav-status::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: breathe 3s ease-in-out infinite;
}

/* ── 用户下拉菜单 ── */
.user-menu { position: relative; margin-left: 8px; }
.user-menu-check { display: none; }
.user-menu-btn {
  display: flex; align-items: center; gap: 4px; cursor: pointer;
  padding: 3px 8px; border-radius: 4px;
  transition: background 0.2s;
  animation: btn-glow 2.5s ease-in-out infinite;
}
@keyframes btn-glow {
  0%, 100% { box-shadow: 0 0 4px rgba(0,229,255,0.15); }
  50% { box-shadow: 0 0 12px rgba(0,229,255,0.35); }
}
.user-menu-btn:hover { background: rgba(88,166,255,0.08); }
.nav-user-name {
  font-size: 0.8em; color: var(--accent); font-weight: 600;
  max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: inline-block;
  color: #00e5ff;
}
.user-menu-arrow {
  font-size: 0.65em; color: var(--text-secondary);
  transition: transform 0.2s;
}
.user-menu-check:checked ~ .user-menu-btn .user-menu-arrow {
  transform: rotate(180deg);
}
.user-menu-drop {
  display: none; position: absolute; right: 0; top: 100%; z-index: 100;
  min-width: 140px; background: var(--bg-glass-strong);
  border: 1px solid var(--border-glow); border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  padding: 4px 0; margin-top: 4px;
  backdrop-filter: blur(12px);
}
.user-menu-check:checked ~ .user-menu-drop { display: block; }

.nav-desk-only { display: inline; }
/* 手机端更多下拉（桌面隐藏）*/
.nav-more-mob { display: none; position: relative; }
.user-menu-drop a {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px; font-size: 0.82em;
  color: var(--text-primary); text-decoration: none;
  transition: background 0.15s;
}
.user-menu-drop a svg { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.85; }
.user-menu-drop a:hover { background: rgba(88,166,255,0.08); color: var(--accent); }
.user-menu-drop a:hover svg { opacity: 1; }

/* ── KPI 卡片网格 ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}

/* KPI 卡片（2026-09-12 精修）：毛玻璃 + 顶部 1px edge highlight。
   色彩克制——label 中性灰、数值语义色只表达状态（牛熊/阶段/涨跌），不再给每张卡
   配彩色圆点（原彩虹糖配色显得花）。hover 仅边框微光 + 位移，不缩放数值（装饰性动效）。 */
.kpi-card {
  position: relative; overflow: hidden;
  background: var(--bg-glass);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 13px 12px;
  text-align: center;
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.045);
  transition: border-color var(--dur-normal) var(--ease-out),
              box-shadow var(--dur-normal) var(--ease-out),
              transform var(--dur-normal) var(--ease-out);
  animation: fadeInUp var(--dur-slow) var(--ease-out) both;
}
.kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 210, 255, 0.22);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.06),
              0 8px 24px rgba(0, 0, 0, 0.32);
}

.kpi-card .label {
  font-size: 0.75em; font-weight: 500; color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 7px;
}
.kpi-card .value {
  font-family: var(--font-data);
  font-size: 1.7em; font-weight: 750; line-height: 1.12;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  letter-spacing: -0.01em;
}
/* 文字型数值（熊市/分歧/冰点等）：字号降档 + 字距放松，与数字型值区分 */
.kpi-card .value.value-text {
  font-size: 1.45em; font-weight: 700; letter-spacing: 0.02em;
}
.kpi-card .detail {
  font-size: 0.8em; font-weight: 400; color: var(--text-secondary); margin-top: 6px;
}

/* ── 图表容器（毛玻璃 + edge highlight）── */
.chart-box {
  position: relative; overflow: hidden;
  background: var(--bg-glass);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
  transition: border-color var(--dur-normal) var(--ease-out), box-shadow var(--dur-normal) var(--ease-out);
  animation: fadeInScale var(--dur-slow) var(--ease-out) both;
}
.chart-box:hover {
  border-color: rgba(0, 210, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 24px rgba(0, 210, 255, 0.05);
}

.chart-box .chart-title {
  font-size: 0.84em; color: var(--text-secondary); font-weight: 600;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
/* 标题左侧细竖线（2px，柔和） */
.chart-box .chart-title::before {
  content: '';
  display: inline-block; width: 2px; height: 13px; border-radius: 1px;
  background: var(--accent);
  opacity: 0.75;
}

/* 趋势大图高度随视口自适应（2026-09-12 紧凑化）：
   小屏少占垂直空间（首屏能看到图主体），大屏展开更多历史。
   两个 id 分别为首页/数据看板的大图；内联 height 已移除，交给此规则。 */
#trend-chart, #sentiment-trend-chart { height: clamp(340px, calc(100vh - 620px), 440px); }
@supports (height: 100dvh) {
  #trend-chart, #sentiment-trend-chart { height: clamp(340px, calc(100dvh - 620px), 440px); }
}
/* 趋势卡 flex 列（2026-09-12 全局化）：图 flex:1 填充卡片，底部不留空
   （原仅在 PC 断点内，手机端图没吃满卡底） */
.charts-block-trend { display: flex; flex-direction: column; }

/* ── 两栏布局 ── */
.two-col {
  display: flex; gap: 14px;
}
.two-col > * { flex: 1; min-width: 0; }
.two-col .side { flex: 0.8; display: flex; flex-direction: column; gap: 14px; }

/* ── 表格（2026-09-13 精修：去单元格竖线 / 精致表头 / 柔和行线，PC+iPad 统一）── */
.data-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: 0.88em; font-variant-numeric: tabular-nums;
  border: 1px solid var(--border-subtle);
  border-radius: 10px; overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,0.012), rgba(255,255,255,0.004));
}
.data-table thead th {
  text-align: left; padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.09);
  color: var(--text-muted);
  font-size: 0.72em; font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer; user-select: none;
  background: rgba(255,255,255,0.022);
  transition: color var(--dur-fast), background var(--dur-fast);
  white-space: nowrap;
}
.data-table thead th:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.data-table tbody td {
  padding: 9px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.032);
  transition: background var(--dur-fast);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr {
  transition: background var(--dur-fast) var(--ease-out);
}
/* hover: 微光背景 + 左侧 neon 指示线 */
.data-table tbody tr:hover td {
  background: rgba(0, 210, 255, 0.05);
}
.data-table tbody tr:hover td:first-child {
  box-shadow: inset 2px 0 0 var(--accent);
}

/* 全市场分页稳定列宽（2026-09-18 v2）：翻页只替换 tbody，列宽不得随当前页内容变化。
   ⚠️ 仅宽屏（>950，iPad 横屏/PC）生效——手机端 .m-table 是 display:block 折段布局，
   固定宽会撑到内容总宽、行内永不换行右侧裁切（2026-09-18 回归修复）。
   ⚠️ 必须用确定宽度（--mkt-table-w=各列指定宽之和，服务端下发）：width:max-content
   会让 Chromium 按当前页内容做内在尺寸计算，列宽跨页漂移（实测 87→79px）；
   确定宽度下 table-layout:fixed 严格按表头 width 分配，翻页方真正稳定。 */
@media (min-width: 951px) {
  .data-table.market-table {
    width: var(--mkt-table-w, max-content);
    min-width: 100%;
    table-layout: fixed;
  }
}
.data-table.market-table .mkt-turnover { white-space: nowrap; }

/* 涨停行 */
.data-table tbody tr.row-zt td {
  background: rgba(255, 71, 87, 0.04);
}

/* ── 按钮 ── */
.btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 7px 16px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 0.8em; font-weight: 500;
  transition: all var(--dur-fast) var(--ease-out);
  text-decoration: none;
  white-space: nowrap;
}
/* iOS 触摸优化（2026-09-12）：禁止双击缩放判定等待——快速连续 tap
   （如翻页后紧接着点级别按钮）不再被 iOS 吞掉（"点几下才有反应"）。
   pinch 双指缩放不受影响；hover 粘滞见下方 hover:hover 包装。 */
button, a, [onclick] { touch-action: manipulation; }

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.3; cursor: not-allowed; pointer-events: none; }

/* 激活态按钮 */
.btn.active {
  background: var(--bg-active);
  border-color: var(--border-active);
  color: var(--accent);
  box-shadow: var(--shadow-glow-sm);
}

/* 主 CTA 按钮 */
.btn-primary {
  background: rgba(0, 210, 255, 0.1);
  border-color: rgba(0, 210, 255, 0.3);
  color: var(--accent);
  font-weight: 600;
}
.btn-primary:hover {
  background: rgba(0, 210, 255, 0.18);
  box-shadow: var(--shadow-glow-md);
}

/* ── 输入框 ── */
.input {
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: 0.85em; width: 100%;
  transition: all var(--dur-fast) var(--ease-out);
  outline: none;
}
/* iOS 聚焦自动放大修复（2026-08-26）：触屏设备字号 ≥16px（iOS 对聚焦元素 <16px 强制 zoom），PC 保持紧凑 */
@media (pointer: coarse) {
  .input { font-size: 1em; }
}
.input::placeholder { color: var(--text-muted); }
.input:focus {
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px rgba(0, 210, 255, 0.08), var(--shadow-glow-sm);
  background: rgba(0, 0, 0, 0.5);
}
select.input { width: auto; cursor: pointer; color-scheme: dark; }

/* ── 日期选择器 ── */
input[type="date"].input {
  color-scheme: dark;
  cursor: pointer;
}

/* ── 日期 segmented 控件（2026-09-12 首页精修沉淀为全局）──
   ◀ 日期 ▶ 合并为一个圆角整体；color-scheme:dark 让原生日历图标适配暗色 */
.date-seg {
  display: inline-flex; align-items: center;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border-subtle);
  border-radius: 10px; overflow: hidden;
}
.date-seg .date-seg-btn {
  padding: 6px 12px; color: var(--text-secondary); text-decoration: none;
  font-size: 12px; line-height: 1; transition: background .15s, color .15s;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; min-height: 34px; background: transparent; border: none;
  cursor: pointer;
}
.date-seg .date-seg-btn:hover { background: rgba(255, 255, 255, 0.05); color: var(--text-primary); }
.date-seg .date-seg-btn.disabled { opacity: .28; pointer-events: none; }
.date-seg input[type="date"] {
  background: transparent; border: none; color: var(--text-primary);
  font-family: var(--font-data); font-size: 13px; padding: 6px 6px;
  border-left: 1px solid var(--border-subtle); border-right: 1px solid var(--border-subtle);
  outline: none; color-scheme: dark; min-height: 34px; width: auto;
}
.date-seg input[type="date"]::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }
.date-seg input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: .9; }

/* ── Tab 栏 ── */
.tab-bar {
  display: flex; gap: 4px; margin-bottom: 14px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab {
  padding: 8px 20px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 0.85em; font-weight: 500;
  background: transparent; color: var(--text-muted); border: none;
  transition: all var(--dur-fast) var(--ease-out);
  white-space: nowrap;
  flex-shrink: 0;
}
.tab:hover { color: var(--text-secondary); background: var(--bg-hover); }
.tab.active {
  background: var(--bg-active);
  color: var(--accent);
  box-shadow: var(--shadow-glow-sm);
}

/* ── 缠论级别按钮组 ── */
.freq-bar { display: flex; gap: 4px; }
.freq-btn {
  background: rgba(0, 0, 0, 0.3); color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  padding: 5px 14px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 0.78em; font-weight: 500;
  transition: all var(--dur-fast) var(--ease-out);
}
/* hover 只给支持真悬停的设备（2026-09-12）：触摸设备上 :hover 会"粘滞"，
   且 iOS 对带 hover 样式的元素有"首击只激活 hover"的历史行为 */
@media (hover: hover) {
  .btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow-sm);
  }
  .freq-btn:hover { color: var(--text-secondary); border-color: var(--border-glow); }
  .bk-level-btn:hover { border-color: rgba(240, 192, 96, 0.3); }
}
.freq-btn.active {
  background: var(--bg-active); border-color: var(--border-active);
  color: var(--accent);
  box-shadow: var(--shadow-glow-sm);
}

/* ── 搜索建议下拉 ── */
.search-item {
  padding: 8px 12px; cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.82em;
  transition: all var(--dur-fast);
  display: flex; align-items: center; gap: 8px;
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--bg-hover); }
.search-empty {
  padding: 12px; color: var(--text-secondary); font-size: 0.85em; text-align: center;
}

/* ── 信息面板 ── */
.info-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: var(--shadow-card);
}
.info-panel .panel-label {
  /* 小标题提亮（2026-08-16）：渐变竖条 + 青色发光 + 加粗 */
  position: relative;
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding-left: 12px;
  font-size: 0.78em; font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.info-panel .panel-label::before {
  content: '';
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 15px; border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--purple));
  box-shadow: 0 0 8px rgba(0,210,255,0.55);
}
.info-panel .panel-value { font-size: 0.9em; color: var(--text-primary); }
.info-panel .panel-detail {
  font-size: 0.7em; color: var(--text-muted); margin-top: 2px;
}

/* ── 证据卡片 ── */
.evidence-card {
  background: var(--bg-glass);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 0.86em;
  transition: all var(--dur-fast) var(--ease-out);
}
.evidence-card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow-sm);
}

/* ── 工具类：颜色 ── */
.text-up    { color: var(--up); }
.text-down  { color: var(--down); }
.text-gold  { color: var(--gold); }
.text-cyan  { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-purple{ color: var(--purple); }

/* ── 表格单元格微进度条 ── */
.mini-bar {
  display: inline-block; width: 36px; height: 4px;
  background: rgba(255,255,255,0.06); border-radius: 2px;
  vertical-align: middle; margin-right: 6px;
  overflow: hidden;
}
.mini-bar-fill {
  display: block; height: 100%; border-radius: 2px;
  transition: width var(--dur-slow) var(--ease-out);
}
.mini-bar-fill.high  { background: var(--up); box-shadow: 0 0 6px var(--up-glow); }
.mini-bar-fill.mid   { background: var(--gold); }
.mini-bar-fill.low   { background: var(--text-muted); }

/* ── 阶段徽章 ── */
.stage-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 20px;
  font-weight: 600; font-size: 0.82em;
}
.stage-badge.fire    { color: #ff6b6b; background: rgba(255,107,107,0.1); }
.stage-badge.repair  { color: #ff9f43; background: rgba(255,159,67,0.1); }
.stage-badge.diverge { color: var(--gold); background: rgba(240,192,96,0.1); }
.stage-badge.ebb     { color: var(--accent); background: var(--bg-active); }
.stage-badge.ice     { color: #545dff; background: rgba(84,93,255,0.1); }

/* ── 分数渐变色 ── */
.score-high  { color: #ff6b6b; font-weight: 700; }
.score-mid   { color: var(--gold); font-weight: 600; }
.score-low   { color: var(--text-primary); }
.score-dim   { color: var(--text-muted); }

/* ── 连板徽章 ── */
.lianban-4plus { color: var(--up); font-weight: 700; text-shadow: 0 0 8px var(--up-glow); }
.lianban-3     { color: var(--up); font-weight: 700; }
.lianban-2     { color: var(--gold); }

/* ── 涨停标记 ── */
.zt-badge {
  display: inline-flex; align-items: center; gap: 2px;
  color: var(--up); font-weight: 700;
}

/* ── 进场动画 stagger ── */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }

/* ── 骨架屏 ── */
.skeleton {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.03) 0%,
    rgba(255,255,255,0.06) 40%,
    rgba(255,255,255,0.03) 80%
  );
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

/* ── Loading spinner ── */
.loading-spinner {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 320px; gap: 16px;
}
.loading-spinner .ring {
  width: 40px; height: 40px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  box-shadow: 0 0 12px var(--accent-dim);
}
.loading-spinner .text { color: var(--text-secondary); font-size: 0.9em; font-weight: 500; }
.loading-spinner .sub  { color: var(--text-muted); font-size: 0.8em; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── 空状态占位 ── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 60px 20px; color: var(--text-muted);
  text-align: center; gap: 12px;
}
.empty-state .icon { font-size: 2.8em; opacity: 0.5; }
.empty-state .title { font-size: 1.15em; color: var(--text-secondary); font-weight: 600; }
.empty-state .desc { font-size: 0.88em; max-width: 360px; line-height: 1.55; }

/* ── 分页控件 ── */
.pager-container {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px; flex-wrap: wrap; gap: 8px;
}
.pager-info { font-size: 0.78em; color: var(--text-muted); }
.pager-btns  { display: flex; align-items: center; gap: 3px; }
.pager-btn {
  background: rgba(255,255,255,0.03); color: var(--text-secondary);
  border: 1px solid var(--border-subtle); padding: 3px 8px;
  border-radius: var(--radius-sm); cursor: pointer;
  font-size: 0.72em; font-weight: 500;
  transition: all var(--dur-fast);
}
.pager-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.pager-btn.active {
  background: var(--bg-active); border-color: var(--border-active);
  color: var(--accent); font-weight: 700;
}

/* ── HTMX 加载指示 ── */
.htmx-indicator { opacity: 0; transition: opacity 200ms ease-in; }
.htmx-request .htmx-indicator { opacity: 1; }
.htmx-request.htmx-indicator { opacity: 1; }

/* ── 滚动条美化 ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08); border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }
::-webkit-scrollbar-corner { background: transparent; }

/* ── 选择文字颜色 ── */
::selection {
  background: rgba(0, 210, 255, 0.2);
  color: var(--text-primary);
}

/* ── 键盘焦点环（2026-09-12）：从调色板出，键盘导航可见、鼠标点击不打扰 ── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ═══════════════════ 手机端适配 ═══════════════════ */
@media (max-width: 768px) {
  main.dash-main { padding: calc(var(--safe-top) + 48px) 10px 10px 10px; overflow-x: hidden; }
  img, svg, canvas { max-width: 100%; }

  /* 顶栏 */
  .top-nav { flex-wrap: wrap; gap: 4px; padding: calc(var(--safe-top) + 6px) 36px 6px 10px; position: fixed; top:0; left:0; right:0; z-index:100; }
  .top-nav .brand { font-size: 0.95em; margin-right: 4px; }
  .nav-link { font-size: 0.7em; padding: 4px 8px; }
  .nav-status { display: none; }
  .user-menu { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); margin-left: 0; }
  .nav-user-name { max-width: 60px; font-size: 0.75em; }
  .user-menu-drop { min-width: 120px; right: -4px; }
  .user-menu-drop a { padding: 10px 14px; font-size: 0.85em; }
  .nav-desk-only { display: none; }
  .nav-more-mob { display: inline-flex; }
  .nav-more-btn { font-size: 1.1em !important; padding: 6px 4px 6px 0 !important; margin-left: -2px; }

  /* KPI 卡片：2列 */
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .kpi-card { padding: 10px 8px; }
  .kpi-card .value { font-size: 1.1em; }
  .kpi-card .label { font-size: 0.6em; }
  .kpi-card .detail { font-size: 0.6em; }

  /* 两栏 → 上下堆叠 */
  .two-col { flex-direction: column; gap: 10px; }
  .two-col > * { width: 100%; }  /* 2026-09-12：去 flex:none!important——手机 stack 固定高时卡片需 flex 填充 */

	  /* 手机端图表排序（2026-09-12 重设计）：六维+连板在前（状态拆解承接 KPI），
	     趋势图压后；配合去抽屉化，页面一路下滑即完整阅读 */
	  .charts-block-radar  { order: 1; }
	  .charts-block-trend { order: 2; }

  /* Tab 栏与响应式数据表样式移至下方 950 断点块（覆盖手机横屏/iPad 竖屏） */

  /* 筛选栏 */
  .dash-main > div[style*="display:flex"] {
    flex-wrap: wrap !important; gap: 8px !important;
  }

  /* 输入框 */
  .input { font-size: 0.8em; max-width: 100%; }
  select.input { max-width: 100%; }
  input[type="date"].input { max-width: 100%; }

  /* 图表容器 */
  .chart-box { padding: 10px; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* 表格 */
  .data-table { font-size: 0.7em; }
  .data-table th, .data-table td { padding: 5px 8px; white-space: nowrap; }
  .data-table th { font-size: 0.7em; }
  /* 响应式数据表规则移至下方 950 断点块 */

  /* 图表高度 */
	#promotion-chart { height: 220px !important; }
	/* #trend-chart 高度由 flex 填充 + JS 视口自适应（2026-09-12），勿再写死 */

  /* K线分析搜索栏 */
  #stock-search { font-size: 0.85em; }
  #search-results { width: 100% !important; left: 0 !important; }

  /* 按钮 */
  .btn { font-size: 0.74em; padding: 5px 10px; }
  .freq-bar { flex-wrap: wrap; }
  .freq-btn { font-size: 0.7em; padding: 4px 8px; }

  /* 搜索建议 */
  .search-item { font-size: 0.78em; padding: 6px 10px; }

  /* 分页 */
  .pager-container { flex-direction: column; align-items: stretch; }
}

/* ═══════════════════════════════════════════════════════════════
   响应式数据表 + Tab 栏（2026-09-12 v2）：≤950（手机竖/横屏 + iPad 竖屏）
   ——数据表转分段行零横滚，7-tab 换行不横拖
   ═══════════════════════════════════════════════════════════════ */
/* 宽屏（>950）：换行标记为空 td，隐藏（否则占一个空单元格） */
.data-table.m-table td.m-brk { display:none; }

/* 分页行（2026-09-12 v3）：每页选择 + 页码一行两端——统计文字已删，
   手机（6 个/页短页码）一行放得下；flex-wrap 仅极端长度兜底 */
.pager-row { display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; gap:6px; flex-wrap:wrap; }

/* 全市场工具栏（2026-09-13）：搜索 + 每页 + 分页两端一行——
   行内样式沉淀为 class（≤950 才能用媒体查询压缩，行内样式无法被覆盖）；
   2026-09-13 v2：通用表格分页（板块衔接/情绪历史）统一复用本组样式 */
.mkt-toolbar-left { display:flex; align-items:center; gap:6px; font-size:0.8em; color:var(--subtext); }
.mkt-toolbar-left > span { white-space:nowrap; }  /* 「每页」禁折字（挤窄时曾竖排撑高整行） */
.mkt-search { width:130px; padding:3px 8px; font-size:0.78em; }
select.input.mkt-page-size { width:55px; padding:2px 4px; font-size:0.8em; }
.mkt-pager { display:flex; align-items:center; gap:3px; }
.mkt-pg-btn { padding:2px 6px; font-size:0.7em; }
.mkt-pg-info { font-size:0.75em; color:var(--subtext); padding:0 6px; }

@media (max-width: 950px) {
  /* Tab 栏（2026-09-12 v3）：单行横滑不占高度（隐滚动条），
     切换时由 JS scrollIntoView 把当前 tab 滚入视野 */
  .tab-bar { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; white-space: nowrap;
    -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tab-bar::-webkit-scrollbar { display: none; }
  .tab { flex: 0 0 auto; padding: 7px 14px; font-size: 0.78em; }

  /* ── 响应式数据表：手机分段行、零横滚 ——
     规则：table 加 .m-table；主行 td 加 .m-p1（名称再加 .m-name），
     主行后插 <td class="m-brk"></td>（必须用 td——tr 里放 <i> 会被 HTML
     解析器按 foster parenting 移出表格）；指标 td 加 data-l="列名"（自动前缀标签）；
     序号等隐藏列加 .m-hide */
  .data-table.m-table { display:block; border:none; min-width:0; }
  .data-table.m-table thead { display:none; }
  .data-table.m-table tbody { display:block; }
  .data-table.m-table tr { display:flex; flex-wrap:wrap; align-items:baseline;
    gap:3px 10px; padding:9px 10px; border-bottom:1px solid rgba(255,255,255,0.05); }
  .data-table.m-table tr:hover { background:var(--bg-hover); }
  .data-table.m-table td { display:inline-flex; align-items:baseline; border:none !important;
    padding:0 !important; background:none !important; white-space:nowrap;
    max-width:none !important; overflow:visible !important; text-overflow:clip !important; }
  .data-table.m-table td[data-l]::before { content:attr(data-l);
    font-size:10px; color:var(--text-muted); margin-right:3px; font-weight:400; }
  .data-table.m-table td.m-hide { display:none; }
  .data-table.m-table td.m-brk { display:block; flex:0 0 100%; height:0; margin:0; }
  .data-table.m-table td.m-p1 { order:-10; }
  .data-table.m-table td[data-l] { order:1; }  /* 指标行统一排主行/换行标记之后 */
  .data-table.m-table td.m-name { font-size:13px; font-weight:600; }
  .data-table.m-table td .mini-bar { display:none; }  /* 手机去 mini bar 省宽度 */
  .data-table.m-table td[colspan] { flex:1 1 100%; justify-content:center; }

  /* 全市场工具栏（2026-09-13）：搜索框小宽度固定（内容不长，不用撑满），
     每页/分页控件紧凑——三者同行不换行，排布自然 */
  .mkt-toolbar { flex-wrap:nowrap; }
  .mkt-toolbar-left { flex:1 1 auto; min-width:0; gap:4px; }
  .mkt-search { flex:0 1 auto; width:100px; min-width:64px; padding:3px 6px; }
  select.input.mkt-page-size { width:45px; padding:2px 2px; }
  .mkt-pager { flex:0 0 auto; }
  .mkt-pg-btn { padding:2px 4px; font-size:0.66em; }
  .mkt-pg-info { padding:0 3px; font-size:0.7em; }
}

/* ═══════════════════════════════════════════════════════════════
   导航重构（2026-08-14）：图标导航 + 窄屏汉堡抽屉
   ═══════════════════════════════════════════════════════════════ */
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 9px; font-size: 11.5px; color: var(--text-muted);
  text-decoration: none; border-bottom: 2px solid transparent;
  position: relative;
  transition: color .15s, border-color .15s, background .15s;
  white-space: nowrap;
}
/* 下划线重设计（2026-08-16）：实线但收短至内容宽度的 65%，不再横贯整个按钮 */
.nav-item::after {
  content: ''; position: absolute; left: 50%; bottom: -2px;
  width: 0; height: 2px; transform: translateX(-50%);
  background: var(--accent);
  border-radius: 1px;
  transition: width .25s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
}
.nav-item svg { width: 13px; height: 13px; flex-shrink: 0; }
.nav-item:hover { color: var(--text-secondary); }
.nav-item:hover::after { width: 40%; }
.nav-item.active {
  color: var(--accent);
  font-weight: 600;
  box-shadow: inset 0 -8px 14px -10px rgba(0,210,255,0.4);
}
.nav-item.active::after { width: 88%; }
.nav-flex { flex: 1; }

/* 用户圆形头像 */
.nav-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, #00b8e6, #4f8fc9);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: #fff; font-weight: 700; flex-shrink: 0;
}

/* 汉堡按钮（默认隐藏，窄屏显示） */
.nav-hamburger { display: none; }

/* 手机/窄屏导航抽屉 + 遮罩：四分之一椭圆扇形（2026-09-13 重设计）。
   圆心=屏幕左下角（形状为圆的右上四分之一，弧朝右上）；核心导航 6 项沿
   外弧、用户菜单 4-5 项沿内弧排布——位置由 HTML 内联 %（left/top）写入，
   等比自适应面板尺寸。
   视觉：极简"渐隐暗雾"——从圆心向外渐透明、边缘一圈极淡弧光（无纹理、
   无硬边、无发光堆叠；借鉴 Path 弧形菜单"按钮漂浮于压暗内容上"的语言，
   装饰纹理=噪音，形状感由渐变的弧线消隐表达）。
   展开动画=clip-path 从圆心径向扫开 + 按钮依次点亮。
   ⚠️ 不用 backdrop-filter：clip-path 展开下 Safari 对 backdrop 裁剪有
   风险，且遮罩已压暗背景，模糊收益极小。 */
.nav-drawer-backdrop {
  display: none; position: fixed; inset: 0; z-index: 120;
  background: rgba(2,6,14,0.7); opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.nav-drawer {
  position: fixed; left: 0; bottom: 0; top: auto;
  width: min(360px, 94vw); height: min(560px, 76vh);
  z-index: 121;
  border-radius: 0 100% 0 0 / 0 100% 0 0;   /* 四分之一椭圆盘（圆心左下） */
  overflow: hidden;
  background: radial-gradient(100% 100% at 0% 100%,
    rgba(9,14,26,0.97) 0%,
    rgba(9,14,26,0.90) 46%,
    rgba(9,14,26,0.55) 74%,
    rgba(9,14,26,0.32) 88%,
    rgba(9,14,26,0.12) 100%);
  clip-path: circle(0% at 0% 100%);
  opacity: 0; pointer-events: none;
  transition: clip-path .42s cubic-bezier(.4,0,.2,1), opacity .22s ease;
  display: none;
}
.nav-drawer.show { clip-path: circle(150% at 0% 100%); opacity: 1; pointer-events: auto; }
.nav-drawer-backdrop.show { opacity: 1; pointer-events: auto; }

/* 弧上按钮（位置=HTML 内联 left/top，绝对定位以按钮中心对齐弧点） */
.nav-arc {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  text-decoration: none; cursor: pointer;
  opacity: 0; transition: opacity .25s ease;
}
.nav-arc .ico {
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transform: scale(.55);
  transition: transform .28s cubic-bezier(.34,1.4,.64,1), color .15s ease, background .15s ease, border-color .15s ease;
}
.nav-arc .lbl { white-space: nowrap; transition: color .15s ease; }
/* 核心导航（外弧）：中性深圆 + 两态配色（与顶部导航同一语言：未选
   muted / 选中 accent——不再"青渐变底+青描边+青图标"三重青叠加） */
.nav-arc-core .ico {
  width: 44px; height: 44px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
.nav-arc:active .ico { filter: brightness(1.3); }
.nav-arc-core .ico svg { width: 18px; height: 18px; }
.nav-arc-core .lbl { font-size: 11px; color: var(--text-muted); }
.nav-arc-core:hover .ico, .nav-arc-core:hover .lbl { color: var(--text-secondary); }
.nav-arc-core.active .ico {
  background: rgba(0, 210, 255, 0.10);
  border-color: rgba(0, 210, 255, 0.38);
  color: var(--accent);
}
.nav-arc-core.active .lbl { color: var(--accent); font-weight: 600; }
/* 用户菜单（内弧）：小图标 + 小字（扩到 6 项后的紧凑尺寸——弧上不挤） */
.nav-arc-sub { gap: 4px; }
.nav-arc-sub .ico { width: 28px; height: 28px; color: var(--text-muted); }
.nav-arc-sub .ico svg { width: 13px; height: 13px; }
.nav-arc-sub .lbl { font-size: 9.5px; color: var(--text-muted); }
.nav-arc-sub:hover .ico, .nav-arc-sub:hover .lbl { color: var(--text-secondary); }
/* 展开时依次点亮（--i 为弧上序数；关闭不设延迟，立即收） */
.nav-drawer.show .nav-arc { opacity: 1; }
.nav-drawer.show .nav-arc .ico { transform: scale(1); }
.nav-drawer.show .nav-arc-core, .nav-drawer.show .nav-arc-core .ico {
  transition-delay: calc(70ms + var(--i) * 45ms);
}
.nav-drawer.show .nav-arc-sub, .nav-drawer.show .nav-arc-sub .ico {
  transition-delay: calc(300ms + var(--i) * 40ms);
}

/* 品牌：扇形轴心（圆心底=屏幕左下角）——关闭走遮罩点击 */
.nav-drawer-head {
  position: absolute; left: 16px;
  bottom: max(14px, env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 12px;
}
.nav-drawer-head .brand {
  font-weight: 900; font-size: 1.1em; letter-spacing: 0.04em;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex; align-items: center; gap: 6px;
}
.nav-drawer-head .brand .brand-icon { width: 22px; height: 22px; border-radius: 6px; }

/* ── 扇形导航手势跟手态（2026-09-13 晚，替代导航球）──
   左下区起手向右上 45° 斜滑唤出（JS 见 base.html）：拖动中禁过渡
   （clip-path/opacity 由 JS 直写），按钮直显（被展开的扇面揭示——stagger
   是点击/阈值完成后的路径，跟手期不重播）。 */
.nav-drawer.dragging, .nav-drawer-backdrop.dragging { transition: none !important; }
.nav-drawer.dragging .nav-arc { opacity: 1; transition: none !important; }
.nav-drawer.dragging .nav-arc .ico { transform: scale(1); transition: none !important; }

/* 窄屏（<=1100px）：核心页直排 + 其余进汉堡抽屉 */
.nav-core-mob { display: none; }
.nav-core-mob .nav-guide-item { display: none; }
/* 简称/全称切换：默认显示全称（平板空间够），手机（<=768px）切成 2 字简称 */
.nav-core-mob .nav-short { display: none; }
@media (max-width: 1100px) {
  .top-nav { padding: calc(var(--safe-top) + 6px) 12px; }
  .top-nav .brand { margin-right: 6px; font-size: 1.2em; }
  .nav-links { display: none; }
  .user-menu { display: none; }  /* 头像与账号菜单收进 ☰ 抽屉 */
  .nav-core-mob { display: flex; align-items: center; gap: 0; flex: 1; min-width: 0; }  /* 撑满中间，把 ☰ 顶到最右 */
  .nav-core-mob .nav-item { padding: 2px 2px; font-size: 12px; gap: 2px; border-bottom-width: 1.5px; white-space: nowrap; }
  .nav-core-mob .nav-item::after { bottom: -1.5px; height: 1.5px; }
  .nav-core-mob .nav-item svg { width: 11px; height: 11px; }
  .top-nav { flex-wrap: nowrap; }
  .nav-hamburger {
    display: flex; align-items: center; justify-content: center;
    background: none; border: none; cursor: pointer; flex-shrink: 0;
    width: 32px; height: 32px; padding: 0;
  }
  .nav-hamburger .nav-avatar { width: 26px; height: 26px; font-size: 12px; }
  .nav-drawer { display: block; }
  .nav-drawer-backdrop { display: block; }
  .nav-flex { display: none; }
}

/* iPad 平板顶栏空间足够，直接显示教程入口；手机放在头像抽屉内。 */
@media (min-width: 769px) and (max-width: 1100px) {
  .nav-core-mob .nav-guide-item {
    display: flex;
    flex-shrink: 1;
    min-width: 0;
  }
}

/* 手机顶部保留核心入口（2 字简称），系统教程固定放在头像抽屉内。
   2026-09-01：加入资讯广场核心入口，全文改 2 字简称腾出空间；
   5 项均分横向剩余（flex:1），字号放大 13px，把横向空间利用满 */
@media (max-width: 768px) {
  .nav-core-mob .nav-guide-item { display: none; }
  .nav-core-mob .nav-item .nav-full { display: none; }
  .nav-core-mob .nav-item .nav-short { display: inline; }
  .nav-core-mob .nav-item {
    flex: 1 1 0; min-width: 0;
    justify-content: center;
    font-size: 13px; gap: 3px;
    padding: 5px 0;
  }
  .nav-core-mob .nav-item svg { width: 12px; height: 12px; }
}

/* iOS PWA 顶栏最终收敛：安全区只负责避开系统控制栏，导航自身不再额外留大块顶部空白。
   直接按 .pwa-ios 判断，避免依赖 iPadOS 对 hover/pointer 的不稳定报告。 */
.pwa-ios .top-nav {
  /* 安全区只让出系统控制栏，导航自身不再额外留上下空白 */
  padding-top: var(--safe-top);
  padding-bottom: 0;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
}
.pwa-ios .top-nav .brand-icon {
  width: 20px;
  height: 20px;
  border-radius: 6px;
}
.pwa-ios .top-nav .brand {
  font-size: 1.1em;
}
.pwa-ios .top-nav .nav-item {
  padding-top: 2px;
  padding-bottom: 2px;
}
/* iPad 触屏平板（横屏 >1100 也走 PC 布局）：压掉 dash-main 顶部留白 + 日期控件与 KPI 的间隙 */
.pwa-ios main.dash-main {
  padding-top: 0;
}
.pwa-ios .sentiment-date-nav {
  margin-top: 0 !important;
  margin-bottom: 4px !important;
}
.pwa-ios #kpi-row {
  margin-top: 0 !important;
  margin-bottom: 8px;
}

/* 宽屏图表区左右分栏（2026-09-12 推广至 PC + iPad 横屏通用）：
   charts-stack 改 grid 5:7——左列（六维得分 + 连板）纵向堆叠，右列
   情绪得分主图全高。空间利用率远高于"三层纵向堆叠"，全部入首屏。
   窄屏（≤1100，含 iPad 竖屏）走原有堆叠/抽屉布局，不受影响 */
@media (min-width: 1101px) {
  .charts-stack {
    display: grid !important;
    grid-template-columns: minmax(360px, 5fr) 7fr;
    gap: 10px !important;
  }
  .charts-block-radar {
    flex-direction: column;
    gap: 10px;
  }
  /* 左列高度比：连板图略高于六维条（0.88 : 1.15），连板绘图区不被压 */
  .charts-block-radar > .chart-box:first-child { flex: 0.88; }
  .charts-block-radar > .chart-box:last-child { flex: 1.15; }
  .charts-block-trend { align-self: stretch; display: flex; flex-direction: column; }
  /* 连板图撑满卡片（不固定高、不留白） */
  #board-chart { height: auto !important; flex: 1 1 auto; min-height: 180px; }
  /* 首页趋势图（分栏右列）：flex 填充卡片——卡片高度由 JS 按视口自适应
     （保证 KPI + 图表一屏放得下，不引入整页滚动；2026-09-12） */
  #trend-chart { flex: 1 1 auto; height: auto; min-height: 340px; }
}

/* iPad 横屏专属微调（触屏，.pwa-ios 由 maxTouchPoints 检测注入；PC 不命中） */
@media (min-width: 1101px) {
  .pwa-ios main.dash-main { padding: 10px 20px 16px; }
  .pwa-ios #kpi-row .kpi-card { padding: 10px 12px; }
  .pwa-ios .charts-block-radar .chart-box { padding: 10px; }
  .pwa-ios #sentiment-trend-chart { height: clamp(340px, 55vh, 460px); }
  .pwa-ios .dim-bars { min-height: 118px; }
}

/* ═══════════════════ 平板端适配（769px–1100px） ═══════════════════
   平板有足够宽度保留横向内容，但输入方式仍以触控为主，不沿用 PC 的密度。 */
@media (min-width: 769px) and (max-width: 1100px) {
  main.dash-main {
    padding: 8px 16px 16px;
    max-width: none;
  }

  .top-nav {
    min-height: 48px;
    padding: calc(var(--safe-top) + 4px) 20px 4px;
    gap: 8px;
  }
  .top-nav .brand {
    margin-right: 12px;
    font-size: 1.2em;
  }
  .top-nav .brand-icon {
    width: 24px;
    height: 24px;
  }
  .nav-core-mob {
    gap: 4px;
  }
  .nav-core-mob .nav-item {
    min-height: 36px;
    padding: 7px 8px;
    gap: 5px;
    font-size: 12px;
  }
  .nav-core-mob .nav-item svg {
    width: 14px;
    height: 14px;
  }
  .nav-hamburger {
    width: 40px;
    height: 40px;
  }
  .nav-hamburger .nav-avatar {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }

  /* KPI 卡与图表框再紧一档（2026-09-12 iPad 竖向紧凑化） */
  .kpi-card { padding: 11px 12px; }
  .chart-box { padding: 12px; }
  /* 表格行高：iPad 段保持舒适（2026-09-13 与 PC 版精致表格统一，不再过度压缩） */
  .data-table th, .data-table td { padding: 8px 12px; }
  .tab { padding: 7px 14px; }
  .input, .btn { min-height: 36px; }
}

/* 窄平板（iPad 竖屏 769–950）：6 卡一行时每卡 <130px 太挤，改 3×2 布局 */
@media (min-width: 769px) and (max-width: 950px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
}

/* iPad PWA 顶栏已由系统安全区提供顶部避让，不再额外叠加平板留白。 */
@media (min-width: 769px) and (max-width: 1100px) {
  /* 平板不依赖 PWA/UA 标记：Safari、主屏幕 PWA 和横竖屏都必须命中同一套节奏。 */
  .top-nav {
    min-height: 0;
    padding-top: var(--safe-top);
    padding-bottom: 0;
  }
  .nav-core-mob .nav-item {
    min-height: 0;
    padding-top: 2px;
    padding-bottom: 2px;
  }
  .nav-hamburger {
    width: 26px;
    height: 26px;
  }
  .nav-hamburger .nav-avatar {
    width: 22px;
    height: 22px;
    font-size: 11px;
  }
  main.dash-main {
    padding-top: 0;
  }
  .sentiment-date-nav {
    margin-top: 0 !important;
    margin-bottom: 4px !important;
    min-height: 0 !important;
  }
  #kpi-row {
    margin-top: 0 !important;
    margin-bottom: 8px;
  }

  .pwa-ios .top-nav {
    padding-top: var(--safe-top);
    padding-bottom: 0;
  }
  .pwa-ios .nav-core-mob .nav-item {
    padding-top: 2px;
    padding-bottom: 2px;
  }
}

/* iPad 直接屏 PWA 顶部文字发糊修复（2026-09-18 终版，像素级实测，三次迭代）：
   根因：iOS 27 iPad standalone 全屏下，屏幕顶部有一条「系统玻璃模糊带」——逐行
   梯度对比 iOS 26 旧截图：y=40 处文字锐度仅剩 4%、y=52 剩 21%、y=60 剩 ~25%、
   y≈70 才恢复 100%（渐进模糊，不是齐边）。iPhone 因 safe-area 59px 把导航文字
   顶到带外，故只有 iPad 中招（safe-top 仅 ~24px）。
   修复：① 导航内容让到 60px 以下（栅格化/模糊随位置变化，避让是唯一解）；
        ② 导航去 backdrop-filter（系统玻璃下不再叠自绘毛玻璃）；
        ③ 顶部 60px 改用页面底色（--bg-base），导航条视觉上从 60px 线才开始——
           否则整条 87px 实心深色栏会显得状态栏与导航之间空一大截。
   ⚠️ 三个值耦合：--pwa-top-pad 同时决定 padding 与渐变分界线，改一处即可。
   仅 .pwa-standalone（主屏全屏）生效——Safari/PC 布局与毛玻璃不动。 */
.pwa-ios.pwa-standalone .top-nav {
  --pwa-top-pad: max(var(--safe-top), 60px);
  padding-top: var(--pwa-top-pad);
  background: linear-gradient(to bottom,
    var(--bg-base) 0,
    var(--bg-base) var(--pwa-top-pad),
    var(--bg-elevated) var(--pwa-top-pad));
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
/* viewport-fit=auto 实验：若 iPad WebView 已避开系统玻璃带，恢复紧凑导航间距。 */
.pwa-ios.pwa-standalone.pwa-viewport-auto .top-nav {
  /* viewport-fit=auto 已由 WebView 把内容放到系统状态栏下方，不能再重复加 safe-top。 */
  --pwa-top-pad: 0px;
}

/* ── 表头内嵌筛选（全市场/板块信号，2026-09-01）：筛选框做进列头，与列宽对齐 ── */
.data-table thead th.th-filter-cell {
  vertical-align: top;
  padding: 6px 8px 8px;
  cursor: default;
  position: sticky; top: 0; z-index: 3;
  background: #0e1726;  /* 不透明深底：纵向滚动时表头固定，数据不从下方透出 */
}
.th-sort {
  cursor: pointer; white-space: nowrap; line-height: 1.4;
}
.th-sort:hover { color: #fff; }
.th-filter {
  display: block; width: 100%; box-sizing: border-box;
  margin-top: 5px; padding: 4px 7px; font-size: 0.72em;
  background: rgba(0, 0, 0, 0.38); border: 1px solid var(--border-subtle);
  border-radius: 5px; color: var(--text-primary); outline: none;
  cursor: text;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.th-filter::placeholder { color: var(--text-muted); opacity: .55; }
.th-filter:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 210, 255, 0.12);
  background: rgba(0, 0, 0, 0.5);
}
/* 有筛选值时高亮边框，一眼看出哪些列正在筛选中 */
.th-filter:not(:placeholder-shown) {
  border-color: rgba(0, 210, 255, 0.45);
  background: rgba(0, 210, 255, 0.06);
}

/* 板块信号级别按钮：active 金色（与上方 Top1 金色卡片呼应，区别于 K 线页青色 freq-btn） */
.bk-level-btn.active {
  background: rgba(240, 192, 96, 0.1);
  border-color: rgba(240, 192, 96, 0.45);
  color: var(--gold);
  box-shadow: 0 0 12px rgba(240, 192, 96, 0.2);
}

/* ── 统一搜索框组件（2026-08-16）：玻璃态 + focus 辉光 + ✕ 清除 ── */
.gl-search-wrap { position:relative; }
.gl-search {
  width:100%; box-sizing:border-box;
  background:var(--bg-base);
  border:1px solid var(--border-subtle);
  border-radius:8px;
  padding:7px 26px 7px 10px;
  color:var(--text-primary); font-size:13px;
  outline:none;
  transition:border-color .2s, box-shadow .2s;
}
@media (pointer: coarse) {
  .gl-search { font-size: 16px; padding: 5px 26px 5px 10px; }
  /* K线搜索框 #stock-search 的 ID 特异性高于 .input，窄屏 0.85em 会覆盖 .input 的
     pointer:coarse 1em，导致 iOS 聚焦 <16px 强制 zoom。单独给 16px（源顺序靠后覆盖）。 */
  #stock-search { font-size: 16px; }
  /* 板块信号/全市场搜索框 & 表头筛选（2026-09-12）：同类 iOS 聚焦防放大，
     内联 0.78em 优先级高，用 !important 压制；
     2026-09-18 补：成分股明细搜索框 + 每页条数选择框（select 聚焦同样触发 zoom）；
     2026-09-26 补 .mkt-search：通用分页 JS 动态创建的搜索框（选股/衔接/涨停质量/
     板块放量等版面共用，此前只覆盖 id 版 #mkt-search，动态框无 id 漏掉） */
  #bk-search, #mkt-search, .th-filter, .mkt-search,
  #bk-detail-search, #bk-page-size, select.input.mkt-page-size { font-size: 16px !important; }
}
.gl-search::placeholder { color:var(--text-muted); }
.gl-search:focus {
  border-color:var(--border-active);
  box-shadow:0 0 0 3px rgba(0, 210, 255, 0.08), var(--shadow-glow-sm);
  background:rgba(0, 0, 0, 0.5);
}
.gl-search-icon {
  position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none; line-height: 0;
}
.gl-search-clear {
  position:absolute; right:8px; top:50%; transform:translateY(-50%);
  cursor:pointer; color:var(--text-muted); font-size:14px; line-height:1;
  display:none;
}
.gl-search-wrap input:not(:placeholder-shown) + .gl-search-icon {
  position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none; line-height: 0;
}
.gl-search-clear { display:block; }
.gl-search-clear:hover { color:var(--text-primary); }

/* ═══════════════════════════════════════════════════════════════
   Auth 页面共享组件（2026-08-16 风格统一：CRT 终端风 → 首页风）
   ═══════════════════════════════════════════════════════════════ */

/* ── 页面头：标题 + 副标题 + 右侧动作 ── */
.auth-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; margin-bottom: 14px;
}
.auth-head h1 {
  display: inline-block;  /* 渐变贴合文字宽度 */
  background: linear-gradient(135deg, var(--accent), var(--purple));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 12px rgba(0, 210, 255, 0.25));
}
.auth-head .auth-sub {
  display: block; font-size: 0.78em; color: var(--text-muted);
  margin-top: 2px; font-weight: 400;
}
/* 表单页专用：标题块居中 */
.auth-head-center { justify-content: center; text-align: center; }

/* ── 卡片内标题（单薄表单页：标题直接做在卡片上） ── */
.auth-card-head { position: relative; text-align: center; }
.auth-card-title {
  /* inline-block:让渐变贴合文字宽度(block级h1渐变铺满整行,文字落在中间看不出渐变) */
  display: inline-block;
  text-align: center; margin-bottom: 2px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 12px rgba(0, 210, 255, 0.25));
}
/* 卡片右上角返回按钮（标题行右侧，不占表单主体空间） */
.auth-card-back {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  padding: 4px 12px; font-size: 0.72em;
}
.auth-card-sub {
  text-align: center; color: var(--text-muted);
  font-size: 0.78em; margin-bottom: 18px;
}

/* ── 表单卡垂直居中容器（只包卡片，不含标题；
      flex 子项宽度会收缩为 fit-content，必须 width:100% + shrink:0，
      实际宽度由子项自身的 max-width(480px) 封顶） ── */
.auth-card-vcenter {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - 230px);
  min-height: calc(100dvh - 230px);  /* iOS 27 不透明状态栏下 vh 偏大（见 body 处 dvh 说明） */
}
.auth-card-vcenter > * { flex-shrink: 0; width: 100%; }
@media (max-width: 640px) {
  .auth-card-vcenter {
    min-height: calc(100vh - 300px);
    min-height: calc(100dvh - 300px);  /* iOS 27 同上 */
  }
}

/* ── 胶囊徽章 ── */
.auth-badge {
  display: inline-block; padding: 2px 10px;
  font-size: 0.72em; font-weight: 500;
  border-radius: 999px; border: 1px solid; white-space: nowrap;
}
.auth-badge-cyan   { background: rgba(0, 210, 255, 0.08);  color: var(--accent);      border-color: rgba(0, 210, 255, 0.35); }
.auth-badge-purple { background: rgba(162, 155, 254, 0.1); color: var(--purple);      border-color: rgba(162, 155, 254, 0.4); }
.auth-badge-gold   { background: rgba(240, 192, 96, 0.1);  color: var(--gold);        border-color: rgba(240, 192, 96, 0.4); }
.auth-badge-gray   { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); border-color: rgba(255, 255, 255, 0.15); }

/* ── 提示条（错误红 / 成功绿） ── */
.auth-msg {
  padding: 9px 14px; border-radius: var(--radius-sm);
  font-size: 0.82em; margin-bottom: 14px;
  border: 1px solid; animation: fadeInUp var(--dur-fast) var(--ease-out) both;
}
.auth-msg-error { background: rgba(255, 71, 87, 0.08); border-color: rgba(255, 71, 87, 0.35); color: var(--up-bright); }
.auth-msg-ok    { background: rgba(0, 255, 136, 0.06); border-color: rgba(0, 255, 136, 0.3);  color: var(--down); }

/* ── 表单组 ── */
.auth-form-group { margin-bottom: 14px; }
.auth-form-group label {
  display: block; font-size: 0.78em; color: var(--text-secondary);
  margin-bottom: 5px;
}
/* auth 表单输入框：比全局 .input 更宽更高（padding 加大） */
.auth-form-group .input, .auth-form-group input.input,
.auth-form-group select.input {
  padding: 11px 14px; font-size: 0.9em;
}
.auth-form-group select.input { width: 100%; }
.auth-form-row { display: flex; gap: 10px; }
.auth-form-row .auth-form-group { flex: 1; min-width: 0; }
.auth-form-hint { font-size: 0.72em; color: var(--text-muted); margin-left: 6px; }

/* ── 动作行 ── */
.auth-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

/* ── 窄卡片容器（表单页水平居中） ── */
.auth-card-narrow { max-width: 480px; margin: 0 auto; }

/* ── 表单主提交按钮（全宽大按钮） ── */
.auth-submit {
  width: 100%; justify-content: center;
  padding: 12px 16px; font-size: 0.92em; font-weight: 600;
}

/* ── 套餐卡高亮 ── */
.auth-plan-hot { border-color: var(--border-active) !important; box-shadow: var(--shadow-glow-md) !important; }

/* ── Modal（用户管理弹窗） ── */
.auth-modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  align-items: center; justify-content: center;
}
.auth-modal-overlay.active { display: flex; }
.auth-modal {
  width: 100%; max-width: 420px; padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--bg-glass-strong);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glow);
  box-shadow: var(--shadow-card), var(--shadow-glow-md);
  animation: fadeInScale var(--dur-fast) var(--ease-out);
}
.auth-modal h2 { margin-bottom: 16px; }

/* ── Toast ── */
.auth-toast {
  position: fixed; top: 70px; right: 20px; z-index: 300;
  padding: 10px 18px; font-size: 0.8em;
  border-radius: var(--radius-sm); border: 1px solid;
  transition: opacity var(--dur-normal);
  animation: fadeInUp var(--dur-fast) var(--ease-out);
}
.auth-toast-ok  { background: rgba(0, 255, 136, 0.08); border-color: rgba(0, 255, 136, 0.35); color: var(--down); }
.auth-toast-err { background: rgba(255, 71, 87, 0.08); border-color: rgba(255, 71, 87, 0.35); color: var(--up-bright); }

/* ── 403 居中卡 ── */
.auth-403-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 55vh;
}
.auth-403-card { text-align: center; max-width: 440px; padding: 44px 36px; }
.auth-403-card .auth-403-icon { font-size: 2.4em; margin-bottom: 10px; }
.auth-403-card p { color: var(--text-muted); margin: 10px 0 22px; line-height: 1.7; }

/* ── 移动端 ── */
@media (max-width: 640px) {
  .auth-form-row { flex-direction: column; gap: 0; }
  .auth-toast { left: 12px; right: 12px; top: 62px; }
  .auth-modal { max-width: 94vw; padding: 18px 16px; }
}

/* ── iPhone PWA 顶栏收敛（2026-08-25）：同 iPad——安全区只让出系统控制栏，
      不叠加 calc(safe-top + 6px) 的多余留白，避免顶栏纵向过高（iPhone 有刘海/灵动岛，
      不命中 .pwa-ios 的宽度判断，需单独收敛）── */
@media (max-width: 768px) {
  .top-nav {
    /* max() 兜底：非 PWA Safari safe-top=0 时保留 6px 顶部呼吸，PWA 里取安全区值 */
    padding-top: max(6px, var(--safe-top));
    padding-bottom: 0;
  }
}

/* iPhone PWA：main 顶部让位同步收敛——顶栏 fixed 脱离文档流，main 需让出
   顶栏高度 + 呼吸间距。2026-09-18：原 calc(safe-top + 36px) 在无安全区时
   比导航实际高度（39px）还小 3px——内容顶被压进导航（首页日期控件/K线工具栏
   "挨得太近"）。改用 --nav-h（base.html JS 写入的实际导航高）+ 12px 呼吸，
   安全区、字体、换行任意变化都严丝合缝；fallback 按手机导航实测 39px。 */
@media (max-width: 768px) {
  main.dash-main {
    padding-top: calc(var(--nav-h, calc(var(--safe-top) + 39px)) + 12px);
  }
}

/* ── 板块衔接成分股 chips（2026-09-13）──
   数据看板「板块衔接」tab 点击行展开的涨停成分股；
   视觉与首页板块衔接展开区同款。.coh-members 必须显式 [hidden]{display:none}
   （压过 display:flex，UA 的 hidden 规则权重不足）。 */
.coh-members { display:flex; flex-wrap:wrap; gap:6px; padding:7px 10px 9px 18px;
  background:rgba(255,255,255,0.015); }
.coh-members[hidden] { display:none; }
.coh-chip { display:inline-flex; align-items:baseline; gap:5px; padding:3px 8px; border-radius:6px;
  background:rgba(0,210,255,0.05); border:1px solid rgba(0,210,255,0.14); text-decoration:none; font-size:11px; }
.coh-chip:hover { border-color:rgba(0,210,255,0.4); background:rgba(0,210,255,0.09); }
.cc-name { color:var(--text-primary); font-weight:600; }
.cc-time { color:var(--text-muted); font-family:var(--font-data); font-size:10px; }
.coh-chip em { font-style:normal; font-size:10px; font-weight:600; padding:0 4px; border-radius:3px;
  color:var(--text-muted); background:rgba(255,255,255,0.05); }
.coh-chip em.lb2 { color:#f0c060; background:rgba(240,192,96,0.13); }
.coh-chip em.lb3 { color:#ff9f43; background:rgba(255,159,67,0.15); }
.coh-chip em.lb4 { color:#ff4757; background:rgba(255,71,87,0.16); }
@media (max-width: 950px) {
  .coh-members { padding:6px 9px 9px 12px; }
  .coh-members-row td { width:100%; }  /* 手机 flex 行：展开行撑满 */
}

/* ⚠️ 手机端（≤950）数据看板 .m-table tr 被设为 display:flex，会覆盖 UA 的
   [hidden]{display:none}——展开行会全部视觉漏出（2026-09-13 实测踩坑：
   PC 正常、手机 44 行成分股全展示）。必须高优先级压回。 */
tr.coh-members-row[hidden] { display: none !important; }
