/* ============================================================
   顶底雷达 · 样式
   移动优先，浅色专业风格；涨红跌绿（A股习惯）
   ============================================================ */

/* 时钟字体：DSEG7 Classic Bold（七段数码管，SIL OFL 开源），本地内嵌无网络依赖。
   字体文件改动时同步递增 index.html 里 style.css 的 ?v= */
@font-face {
  font-family: "DSEG7 Classic";
  src: url("fonts/DSEG7Classic-Bold.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: block;
}

:root {
  --bg: #f3f4f6;
  --card: #ffffff;
  --card-2: #f7f8fa;      /* 次级底：表头 / hover / 信息块 */
  --btn-bg: #ffffff;      /* 按钮 / 胶囊底 */
  --bar-bg: rgba(255, 255, 255, 0.94); /* 悬浮条底（导航 / 吸顶栏） */
  --track: #eef0f3;       /* 进度条 / 柱条轨道 */
  --star-bg: #fffaf2;     /* 自选高亮底 */
  --text: #16191d;
  --text-2: #5b6570;
  --sub: #9aa3ad;
  --line: #edeff2;
  --line-2: #e3e6ea;

  /* 图表（canvas）专用：网格 / 坐标轴 / 文字，深色主题由 themes.js 覆盖 */
  --ch-grid: #eef0f3;
  --ch-axis: #e3e6ea;
  --ch-sub: #8b939c;
  --ch-text: #1a1d21;

  --up: #e54545;
  --down: #12a06a;

  --bottom: #ef7d00;
  --bottom-bg: #fff6ec;
  --top: #5b5bd6;
  --top-bg: #f0f0fd;
  --pb: #0d9488;
  --pb-bg: #e7f6f4;
  --bn: #e54545;
  --bn-bg: #fdecec;
  --watch: #7c8894;
  --watch-bg: #f2f4f6;

  /* 品牌选中色：深红底 + 白字（板块地图「概念/风格/行业」选中页签、
     MA5/MA20 排序按钮、板块详情排序按钮共用）。
     此前 .bmap-tab.active 引用 var(--brand) 但从未定义过——
     浅色皮肤里选中页签背景透明、白字完全看不见（用户 2026-11-03 截图反馈）。
     深红在浅色/深色皮肤上都能衬住白字，无需按主题覆盖 */
  --brand: #b93434;

  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 14px rgba(16, 24, 40, 0.05);

  /* 行情表列宽（13 列，信号页/自选页统一）：
     名称列用 fit-content(上限)：列宽贴合内容（名称+代码+徽标），不再留 210px 死宽——
     窗口缩小时名称列的富余自动让给后面的列（用户 2026-11-02 要求），
     上限仍是 210px，超长内容照旧截断。
     拆成「名称列 + 其余列」两段，在使用处（.stk-head/.stk-row）才拼成完整模板——
     若整条模板在 :root 拼死，JS 钉名称列宽度时子元素覆盖不生效（表头数据会错位） */
  --stk-name-w: fit-content(210px);
  --stk-cols-rest:
    minmax(58px, 0.62fr)    /* 走势：5 个趋势箭头（短期/中期/长期/板块短/板块中） */
    minmax(46px, 0.62fr)    /* 现价 */
    minmax(54px, 0.66fr)    /* 涨跌幅 */
    minmax(54px, 0.66fr)    /* 总市值 */
    minmax(52px, 0.64fr)    /* 20日涨幅 */
    minmax(54px, 0.6fr)     /* 安全比率（财务折价率） */
    minmax(150px, 1.6fr)    /* 行业/概念（2026-12-04：概念格加涨跌幅+三日排名，列加宽） */
    minmax(54px, 0.62fr)    /* 成交额 */
    minmax(40px, 0.4fr)     /* 换手 */
    minmax(40px, 0.4fr)     /* 量比 */
    minmax(42px, 0.4fr)     /* 量倍（当日量/昨日量） */
    minmax(106px, 1.1fr)    /* 主力净流（数值+分时资金走势图） */
    minmax(80px, 0.8fr);    /* 操作 */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100%;
  position: relative;
  background: var(--bg);
}

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 14px) 18px 12px;
  background: rgba(243, 244, 246, 0.86);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
}

/* 左侧品牌区：按基线对齐，让右侧时钟的底部与「股票期货」几个字的底部齐平
   （用户 2026-10-23 要求；数字与汉字都坐在基线上，基线齐 = 底边齐）。
   logo 不参与基线对齐，单独居中。 */
.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

/* 左上角 logo = APP 图标（build/icon.icns 导出的 app-icon.png，用户 2026-10-22 要求） */
.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: none;
  align-self: center;
}

.brand-mark img {
  width: 26px;
  height: 26px;
  display: block;
  object-fit: contain;
  -webkit-user-drag: none;
}

.brand-mark svg {
  width: 16px;
  height: 16px;
}

.brand-text {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.2px;
  display: flex;
  flex-direction: column;
  line-height: 1.12;
}

/* 品牌名下方的版本号（只做标识，不抢视觉） */
.brand-ver {
  font-size: 9.5px;
  font-weight: 500;
  font-style: normal;
  letter-spacing: 0.3px;
  color: var(--sub);
  opacity: 0.9;
  margin-top: 1px;
}

/* 左上角北京时间（用户 2026-10-22 要求）
   字体 DSEG7 Classic Bold：七段数码管时钟字体（用户 2026-11-02 要求改「时钟字体」），
   数码管字形本身等宽，每秒刷新不会左右抖动；
   字号 17px（用户 2026-11-03 要求「缩小一点，跟股票期货那几个字一样高」）：
   与 .brand-text 同字号，DSEG7 数字视觉高度正好与品牌文字齐平，
   顶栏第一行中间随之腾出空间给基本面筛选胶囊。 */
.brand-clock {
  font-family: "DSEG7 Classic", "DINPro", "DIN Alternate", "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  font-weight: normal;
  /* DSEG7 自带段间空隙，外挂字距归零；微调 1px 让日期与时间读起来更成组 */
  letter-spacing: 1px;
  color: #e8386f;
  font-variant-numeric: tabular-nums;
  /* LED 数码管的微光晕：贴主题的红色淡一圈，不刺眼 */
  text-shadow: 0 0 7px rgba(232, 56, 111, 0.35);
  white-space: nowrap;
  margin-left: 4px;
  line-height: 1;
  /* 日期 / 时间拆成两段，靠 gap 控制空隙：原单空格 4.8px（20px 字号），
     用户要求加大一倍 → 0.48em，窄窗字号缩小时按比例跟随 */
  display: inline-flex;
  align-items: baseline;
  gap: 0.48em;
  /* 基线对齐后肉眼看着还差一点点：汉字（PingFang）字形底部比基线低 ~1.7px，
     数字正好坐在基线上，所以整体下压 1.7px 才是真正的「底对齐」（3x 截图像素量得） */
  position: relative;
  top: 1.7px;
}

/* 窄窗口时钟不再单独缩小：全局已降到 17px（2026-11-03），各宽度视觉一致 */

.topbar-mid {
  /* 顶栏第一行中间：基本面筛选胶囊 + 收盘状态（用户 2026-11-03 要求「还是放到上面中间」）。
     flex:1 吃掉品牌/搜索与右侧导航区之间的空档；内容靠左排（justify-content:flex-start）：
     右上导航是 fixed 悬浮层，绝对居中会随窗口变宽而压到导航上，靠左则永远安全；
     min-width:0 防止胶囊把搜索框挤变形 */
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-width: 0;
}

/* 子项不许收缩：空间不足时整体溢出（右缘仍避开导航），绝不能把状态灯压成竖排两行 */
.topbar-mid .fund-pills,
.topbar-mid .status-pill {
  flex: none;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-2);
  background: var(--card);
  padding: 5px 10px;
  border-radius: 100px;
  box-shadow: var(--shadow);
}

/* 顶栏右侧：基本面筛选胶囊 + 收盘状态 */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

/* 基本面筛选胶囊：安全边际 / 财务为正 */
.fund-pills {
  display: flex;
  align-items: center;
  gap: 6px;
}

.fund-pill {
  appearance: none;
  border: 1px solid var(--line-2);
  background: var(--card);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 100px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
  white-space: nowrap;
}

.fund-pill:hover {
  border-color: var(--bottom);
  color: var(--bottom);
}

.fund-pill.on {
  background: var(--bottom-bg);
  border-color: var(--bottom);
  color: var(--bottom);
  font-weight: 620;
}

.fund-pill.busy {
  opacity: 0.72;
  cursor: progress;
}

@media (max-width: 900px) {
  .fund-pill {
    padding: 4px 9px;
    font-size: 11px;
  }
}

@media (max-width: 759px) {
  .fund-pills {
    display: none; /* 手机窄屏放不下，基本面筛选在桌面使用 */
  }
}

.status-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sub);
}

.status-pill.live .dot {
  background: var(--down);
  box-shadow: 0 0 0 0 rgba(18, 160, 106, 0.55);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(18, 160, 106, 0.5); }
  70% { box-shadow: 0 0 0 6px rgba(18, 160, 106, 0); }
  100% { box-shadow: 0 0 0 0 rgba(18, 160, 106, 0); }
}

/* ---------------- 页面 ---------------- */
.page {
  display: none;
  padding: 4px 16px calc(96px + env(safe-area-inset-bottom));
  animation: fade 0.22s ease;
}

.page.active {
  display: block;
}

@keyframes fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.section {
  margin-top: 18px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 0 2px;
}

.section-head h2 {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.2px;
  /* 2026-11-13：副标题变长（期货页加了 HLS 统计）后，窄窗里标题会被挤成一字一行
     （「期」「货」竖排），这里禁止换行、不参与收缩 */
  white-space: nowrap;
  flex: none;
}

.section-sub {
  font-size: 11.5px;
  color: var(--sub);
}

/* 碗底榜标题右侧：副标题 + 刷新按钮（section-head 是 space-between，需要自己包一层） */
.wd-head-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.wd-head-right .section-sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------- 概念板块列（2026-11-01：替代原行业/ETF 展示） ---------------- */
/* 概念名小链接：点开看板块日K；没有概念的格子整格隐藏，原行业名仍在 title 里 */
.gn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 130px;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--text-2);
  white-space: nowrap;
  cursor: pointer;
}
.gn-item .gn-nm {
  display: block; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-style: normal;
}

.gn-item:hover .gn-nm {
  color: var(--bottom, #d3540a);
  text-decoration: underline;
}

.sr-ind .gn-item + .gn-item {
  margin-top: 1px;
}

/* 2026-12-04：概念格第二行＝该概念板块当日涨跌幅 + 近三日涨幅排名（今·昨·前日）。
   涨红跌绿；排名连续靠前红、靠后绿（同板块地图）。列窄，字号压小、允许省略。 */
.gn-item .gn-meta {
  display: flex; align-items: center; justify-content: center;
  gap: 3px; min-width: 0; max-width: 100%;
  font-size: 8.5px; line-height: 1.15; white-space: nowrap;
  font-style: normal; font-variant-numeric: tabular-nums;
  letter-spacing: -0.4px;
}
.gn-meta .gn-pct { font-weight: 700; }
.gn-meta .gn-pct.up { color: var(--up); }
.gn-meta .gn-pct.down { color: var(--down); }
.gn-meta .gn-rk { color: var(--sub); letter-spacing: -0.3px; }
.gn-meta .gn-rk.rk-up { color: #d81e06; }
.gn-meta .gn-rk.rk-dn { color: #0a8f4d; }
/* <1500px：概念半列只有 58~80px，一行放不下「涨跌幅 + 三日排名」；
   拆成上下两行，涨幅与排名都完整显示（行高仍有富余，不挤压股票名）。 */
@media (max-width: 1499px) {
  .gn-item .gn-meta { flex-direction: column; gap: 0; }
}

/* ---------------- 概念板块日K弹层 ---------------- */
/* 桌面端 .sheet 是嵌入式面板（min-width:1080px 的 media 改了定位），所以概念板块
   弹层用独立的遮罩式弹窗，桌面 / 窄窗行为一致 */
.concept-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 18, 22, 0.38);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.concept-overlay.open {
  opacity: 1;
  visibility: visible;
}

.concept-card {
  width: min(1040px, 96vw);
  max-height: 92vh;
  overflow-y: auto;
  background: var(--bg);
  border-radius: 14px;
  padding: 18px 18px 14px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  transform: translateY(14px);
  transition: transform 0.2s ease;
}

.concept-overlay.open .concept-card {
  transform: none;
}

.cs-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.cs-head .cs-title {
  font-size: 15px;
  font-weight: 650;
}

.cs-head .cs-sub {
  flex: 1;
  min-width: 0;
  font-size: 11.5px;
  color: var(--sub);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cs-body {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 8px 4px;
}

#conceptChart {
  width: 100%;
  height: 470px;
  display: block;
}

.cs-note {
  margin-top: 8px;
  font-size: 10.5px;
  color: var(--sub);
  text-align: center;
}

/* 板块弹层（2026-11-02 改版）：左边成分股列表（全部、可滚动）、右边走势图 */
.cs-main {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}
.cs-stocks {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 6px 4px;
  display: flex;
  flex-direction: column;
  max-height: 560px;
}
.cs-chartcol { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cs-chartcol .cs-note { margin-top: 0; }
.cs-stocks-head { display: flex; align-items: baseline; gap: 10px; padding: 0 10px 6px; }
.cs-stocks-head b { font-size: 13px; }
.cs-stocks-head span { flex: 1; min-width: 0; font-size: 11.5px; color: var(--sub); text-align: right; }
.cs-stocks-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.cs-stocks-list .bc-row { padding: 7px 12px; }
.cs-stocks-list .bc-nm { flex: 1 1 auto; min-width: 0; margin-left: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-stocks-list .bc-pct { flex: 0 0 auto; margin-left: 8px; }
.bc-i { flex: 0 0 22px; color: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; text-align: center; }

.link-btn {
  background: none;
  border: none;
  font-size: 12.5px;
  color: var(--text-2);
  font-family: inherit;
  cursor: pointer;
  padding: 0;
}

/* ---------------- 大盘卡片 ---------------- */
.index-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.idx-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px 13px 10px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.idx-card:active {
  transform: scale(0.975);
}

.idx-top {
  display: flex;
  align-items: center;
  gap: 6px;
}

.idx-name {
  flex: 0 1 auto;
  font-size: 12.5px;
  color: var(--text-2);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 趋势标签紧跟指数名称，右端涨幅靠右 */
.idx-top .tag {
  flex: none;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}

.idx-pct {
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* 价格 + 当天主力资金净流入（右对齐） */
.idx-price-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.idx-price {
  font-size: 20px;
  font-weight: 660;
  letter-spacing: -0.6px;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.idx-flow {
  font-size: 12px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

.idx-spark {
  width: 100%;
  height: 66px; /* 底部标签行取消，高度全部给曲线 */
  display: block;
  margin: 6px 0 0;
}

.tag-up { background: #fdeeee; color: var(--up); }
.tag-down { background: #eaf7f1; color: var(--down); }
.tag-flat { background: var(--watch-bg); color: var(--watch); }

.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--text-2); }

/* ---------------- 概览 ---------------- */
.overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.ov-card {
  border-radius: 14px;
  padding: 13px 10px 11px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.ov-card:active { transform: scale(0.97); }

.ov-bottom { background: var(--bottom-bg); }
.ov-top { background: var(--top-bg); }
.ov-pullback { background: var(--pb-bg); }
.ov-bign { background: var(--bn-bg); }
.ov-wandi { background: rgba(124, 58, 237, 0.14); }
.ov-watch { background: var(--card); box-shadow: var(--shadow); }

.ov-num {
  font-size: 24px;
  font-weight: 680;
  letter-spacing: -0.8px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.ov-bottom .ov-num { color: var(--bottom); }
.ov-top .ov-num { color: var(--top); }
.ov-pullback .ov-num { color: var(--pb); }
.ov-bign .ov-num { color: var(--bn); }
.ov-watch .ov-num { color: var(--watch); }

.ov-label {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 3px;
}


/* ---------------- 列表 / 信号卡 ---------------- */
.list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.sig-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 13px 14px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.15s ease;
  position: relative;
  overflow: hidden;
}

.sig-card:active { transform: scale(0.985); }

.sig-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
}

.sig-card.s-bottom::before { background: var(--bottom); }
.sig-card.s-top::before { background: var(--top); }
.sig-card.s-watch::before { background: var(--line-2); }

.sig-main {
  flex: 1;
  min-width: 0;
}

.sig-line1 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
}

.sig-name {
  font-size: 15px;
  font-weight: 640;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sig-code {
  font-size: 11px;
  color: var(--sub);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.sig-line2 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.sig-price {
  font-size: 15px;
  font-weight: 640;
  font-variant-numeric: tabular-nums;
}

.sig-chg {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.chip {
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--card-2);
  color: var(--text-2);
  white-space: nowrap;
}

.chip.hot {
  background: var(--bottom-bg);
  color: var(--bottom);
  font-weight: 600;
}

.chip.cold {
  background: var(--top-bg);
  color: var(--top);
  font-weight: 600;
}

.sig-side {
  text-align: center;
  flex-shrink: 0;
  width: 54px;
}

.sig-spark {
  width: 54px;
  height: 30px;
  display: block;
}

.sig-score {
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

.score-a { color: var(--bottom); }
.score-b { color: #d98416; }
.score-c { color: var(--sub); }

/* 理由标签 */
.reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-top: 7px;
}

.reason {
  font-size: 10.5px;
  color: var(--text-2);
  background: var(--card-2);
  border-radius: 5px;
  padding: 2.5px 6px;
  line-height: 1.3;
}

.reason.hl {
  background: var(--bottom-bg);
  color: var(--bottom);
}

.reason.warn {
  background: #fdf0f0;
  color: #b83232;
}

.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 0 2px;
}

.result-count {
  font-size: 11.5px;
  color: var(--sub);
}

.ghost-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: var(--card);
  color: var(--text-2);
  font-family: inherit;
  font-size: 11.5px;
  padding: 5px 9px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.ghost-btn svg {
  width: 12px;
  height: 12px;
}

.ghost-btn.spinning svg {
  animation: spin 1s linear infinite;
}

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

/* ---------------- 自选 / 搜索 ---------------- */
.search-box {
  position: relative;
  margin: 8px 0 14px;
  display: flex;
  align-items: center;
}

/* 顶栏全局搜索框（任何页面都可用）：绝对居中于顶栏 */
.topbar-search {
  margin: 0 20px;
}

@media (min-width: 760px) {
  /* 中等宽度也走流内布局。原来是 absolute + left:44% 居中，搜索框收窄后
     仍会压住左侧的北京时间（2026-10-22 实测 900px 下遮住时钟尾部）。 */
  .topbar {
    justify-content: flex-start;
  }

  .topbar-search {
    /* 只放「搜索股票」四个字，宽度收到 180px（用户 2026-10-22 要求收窄） */
    flex: 0 0 180px;
    width: 180px;
    max-width: 180px;
    margin: 0 18px;
  }

  /* 中等宽度顶栏元素少，收盘状态随中间容器靠左排（topbar-right 已并入 topbar-mid） */
}

@media (max-width: 759px) {
  .topbar {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .topbar-search {
    order: 10;
    flex-basis: 100%;
    max-width: none;
    margin: 0;
  }
}

/* 桌面宽屏（≥1000）：搜索框改流内布局，右侧给悬浮导航(tabbar fixed)留位，
   基本面筛选胶囊 + 收盘状态排在搜索框右侧，互不重叠 */
@media (min-width: 1000px) {
  /* 搜索框宽度固定后不再吸收剩余空间，顶栏改为左对齐：
     brand → 搜索框 → 安全边际/财务为正 → 收盘状态 →（右侧空白留给悬浮导航） */
  .topbar {
    justify-content: flex-start;
  }

  .topbar-search {
    /* 必须是 positioned：栏内的放大镜 .search-icon 是 absolute，靠这个容器定位。
       若写成 static，它就不再是定位祖先，放大镜会一路找到 .topbar（sticky 算定位元素），
       按 left:13px / top:50% 落到左上角、正好压在 logo 上（2026-10-22 用户报障）。
       relative 不脱离文档流，flex 布局与原来一致。 */
    position: relative;
    /* 必须把 left/top 重置掉：760~999 段是 absolute + left:44% / top:50%，
       这里改成 relative 后，那两个值不会失效，而是变成"相对原位置的偏移量"，
       于是搜索框被右推 355px、下推 16px，看着像跑到了「财务为正」右边（2026-10-22 排查） */
    left: auto;
    top: auto;
    transform: none;
    /* 固定 180px（原来 flex:1 1 220px 会被拉到 270px 左右），
       框里只放「搜索股票」+ 图标 + 识股按钮（用户 2026-10-22 要求收窄）。
       宽度固定后不再靠 flex 拉伸占位，所以顶栏要改成左对齐（见下面的 .topbar），
       否则 space-between 会把搜索框甩到中间去。 */
    flex: 0 0 160px;
    min-width: 0;
    width: 160px;
    max-width: 160px;
    margin: 0 18px;
  }
}

/* ⚠️ 不要把「安全边际 / 财务为正」整段 display:none：
   以前 760~1299 直接隐藏，用户在这个窗口宽度下根本看不到、也点不到筛选，
   反馈「上面的安全边际跟财务为正选项筛选也没用」（2026-11-03）。
   1080~1299 的顶栏一行确实放不下（右上角悬浮导航收窄后仍占 ~560px），
   改到文件末尾的换行补丁：中间容器（胶囊+收盘状态）换到顶栏第二行，绝不隐藏。 */

/* 1000~1199：一行布局下收盘状态先让位（第二行补丁里会恢复） */
@media (min-width: 1000px) and (max-width: 1199px) {
  .status-pill {
    display: none;
  }
}

.search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--sub);
}

#searchInput {
  flex: 1;
  min-width: 0;
  border: none;
  background: var(--card);
  border-radius: 12px;
  padding: 12px 14px 12px 38px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  box-shadow: var(--shadow);
  outline: none;
}

#searchInput::placeholder {
  color: var(--sub);
}

.suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(16, 24, 40, 0.14);
  overflow: hidden;
  z-index: 20;
  display: none;
}

.suggest.show {
  display: block;
}

.suggest-item {
  padding: 11px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
}

.suggest-item:last-child {
  border-bottom: none;
}

.suggest-item:active {
  background: var(--card-2);
}

.si-name {
  font-size: 14px;
  font-weight: 550;
}

.si-code {
  font-size: 11px;
  color: var(--sub);
  margin-left: 6px;
}

.si-tag {
  display: inline-block;
  font-size: 10px;
  line-height: 1.4;
  padding: 0 4px;
  margin-right: 5px;
  border-radius: 3px;
  color: #b45309;
  background: rgba(245, 158, 11, .14);
  vertical-align: 1px;
  font-weight: 500;
}

.si-right {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--sub);
  font-size: 13px;
  line-height: 1.7;
}

.empty-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  color: #ccd2d9;
}

/* ---------------- 底部导航 ---------------- */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  background: var(--bar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  z-index: 40;
}

.tab {
  flex: 1;
  border: none;
  background: none;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 0;
  color: var(--sub);
  cursor: pointer;
  position: relative;
  transition: color 0.15s;
}

.tab svg {
  width: 21px;
  height: 21px;
}

.tab span {
  font-size: 10px;
  font-weight: 500;
}

.tab.active {
  color: var(--text);
}

.tab.active svg {
  stroke-width: 2.2;
}

.tab-badge {
  position: absolute;
  top: 0;
  right: 5px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--bn);
  color: #fff;
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* 2026-12-04：没有数字时不要显示空红圈/残留旧数字（hidden 会被 display:flex 覆盖） */
.tab-badge:empty,
.tab-badge[hidden] { display: none; }


/* ---------------- 详情页 ---------------- */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--bg);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  visibility: hidden;
}

.sheet.open {
  transform: none;
  visibility: visible;
}

.sheet-inner {
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: calc(30px + env(safe-area-inset-bottom));
}

.detail-head {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: rgba(243, 244, 246, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  gap: 10px;
}

.back-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  flex-shrink: 0;
}

.back-btn svg {
  width: 17px;
  height: 17px;
}

.detail-title {
  flex: 1;
  min-width: 0;
}

.detail-title h1 {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-title p {
  font-size: 11px;
  color: var(--sub);
  font-variant-numeric: tabular-nums;
}

/* 上一只 / 下一只切换 */
.nav-switch {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.nav-btn {
  border: none;
  background: var(--card);
  color: #3d76e8;
  font-size: 11.5px;
  font-weight: 550;
  padding: 7px 10px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
}

.nav-btn:active {
  transform: scale(0.95);
}

.nav-btn:disabled {
  color: #b6bcc5;
  cursor: default;
  box-shadow: none;
  background: rgba(0, 0, 0, 0.045);
}

.nav-btn:disabled:active {
  transform: none;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  flex-shrink: 0;
  color: var(--sub);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

.icon-btn.on {
  color: #f0a020;
}

.icon-btn.on svg {
  fill: #f0a020;
  stroke: #f0a020;
}

.price-block {
  padding: 4px 18px 14px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.price-big {
  font-size: 32px;
  font-weight: 680;
  letter-spacing: -1.2px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.price-chg {
  font-size: 14px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
}

.price-meta {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--sub);
  text-align: right;
  line-height: 1.5;
}

.chart-card {
  background: var(--card);
  border-radius: var(--radius);
  margin: 0 16px 12px;
  padding: 10px 10px 6px;
  box-shadow: var(--shadow);
}

.chart-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 8px;
  padding: 0 2px;
}

.chart-tab {
  border: none;
  background: none;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--sub);
  padding: 4px 10px;
  border-radius: 7px;
  cursor: pointer;
}

.chart-tab.active {
  background: #f2f3f5;
  color: var(--text);
  font-weight: 640;
}

#mainChart {
  width: 100%;
  height: 306px;
  display: block;
  touch-action: pan-y;
}

.ma-legend {
  display: flex;
  gap: 10px;
  padding: 4px 4px 2px;
  font-size: 9.5px;
  color: var(--sub);
  font-variant-numeric: tabular-nums;
}

.ma-legend i {
  font-style: normal;
}

.ma-legend .flow-src {
  font-style: normal;
  font-size: 8.5px;
  color: #b0b6bf;
  margin-left: 2px;
}

.signal-panel {
  background: var(--card);
  border-radius: var(--radius);
  margin: 0 16px 12px;
  padding: 14px;
  box-shadow: var(--shadow);
}

/* ---------------- 资金流向面板 ---------------- */
.flow-note {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--sub);
  background: #f3f4f6;
  padding: 2px 7px;
  border-radius: 6px;
}

.flow-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.flow-cell {
  background: var(--card-2);
  border-radius: 10px;
  padding: 8px 6px;
  text-align: center;
}

.flow-k {
  font-size: 10.5px;
  color: var(--sub);
  margin-bottom: 3px;
}

.flow-v {
  font-size: 13px;
  font-weight: 640;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.2px;
}

/* 20 日迷你流向柱：以中线为零轴，向上为流入、向下为流出 */
.flow-mini {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 2px;
  height: 58px;
}

.flow-mini::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px solid #e8ebee;
  pointer-events: none;
}

.fm-slot {
  position: relative;
  flex: 1;
  min-width: 2px;
}

.fm-slot i {
  position: absolute;
  left: 0;
  right: 0;
  border-radius: 2px;
  display: block;
}

.fm-slot i.fi {
  bottom: 50%;
  background: rgba(229, 69, 69, 0.72);
}

.fm-slot i.fo {
  top: 50%;
  background: rgba(18, 160, 106, 0.72);
}

.flow-axis {
  display: flex;
  justify-content: space-between;
  font-size: 9.5px;
  color: #b3bbc4;
  border-top: 1px dashed var(--line-2);
  margin-top: 2px;
  padding-top: 5px;
}

.flow-tip {
  font-size: 10.5px;
  line-height: 1.55;
  color: var(--sub);
  margin-top: 8px;
  background: var(--card-2);
  border-radius: 8px;
  padding: 8px 10px;
}

.panel-title {
  font-size: 13px;
  font-weight: 620;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
}

.badge.b-bottom { background: var(--bottom-bg); color: var(--bottom); }
.badge.b-top { background: var(--top-bg); color: var(--top); }
/* 大底 / 大顶：分型 + 背驰，实心强调 */
.badge.b-major { background: var(--bottom); color: #fff; }
.badge.b-major-top { background: var(--top); color: #fff; }
.badge.b-watch { background: var(--watch-bg); color: var(--watch); }
.badge.b-none { background: var(--watch-bg); color: var(--sub); }

/* 当日 V 针：虚线描边，与实心的「长底」一眼区分（V 只是当日预警，未确认） */
.badge.b-v,
.badge-sig.b-v {
  background: transparent;
  color: var(--bottom);
  border: 1px dashed var(--bottom);
}

.score-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.score-ring {
  width: 52px;
  height: 52px;
  position: relative;
  flex-shrink: 0;
}

.score-ring svg {
  transform: rotate(-90deg);
}

.score-ring .val {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.score-desc {
  flex: 1;
  font-size: 11.5px;
  color: var(--text-2);
  line-height: 1.55;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 10px;
}

.metric {
  background: var(--card);
  padding: 9px 4px;
  text-align: center;
}

.metric .k {
  font-size: 9.5px;
  color: var(--sub);
  margin-bottom: 2px;
}

.metric .v {
  font-size: 12.5px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
}

.week-note {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-2);
  background: var(--card-2);
  padding: 8px 10px;
  border-radius: 8px;
  line-height: 1.5;
}

.week-note b {
  font-weight: 650;
  color: var(--text);
}

/* 顶/底信号已确认（详情页顶部提示条） */
.sig-banner {
  border: 1px solid;
  border-radius: 9px;
  padding: 8px 11px;
  margin-bottom: 10px;
  line-height: 1.5;
}
.sig-banner .sb-title {
  font-size: 12.5px;
  font-weight: 700;
}
.sig-banner .sb-sub {
  font-size: 11px;
  opacity: 0.85;
  margin-top: 2px;
}
.sig-banner.pending {
  border-style: dashed;
  border-color: var(--line, rgba(150, 160, 175, 0.45));
  background: var(--card-2);
  color: var(--text-2);
}

/* 当日 V 针提示（比候选强、比已确认弱） */
.sig-banner.v-bar {
  border: 1px dashed var(--bottom);
  background: var(--bottom-bg);
  color: var(--bottom);
}

/* ---------------- Toast ---------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translate(-50%, 10px);
  background: rgba(22, 25, 29, 0.9);
  color: #fff;
  font-size: 12.5px;
  padding: 9px 16px;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s ease;
  z-index: 100;
  backdrop-filter: blur(8px);
  max-width: 80%;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------------- 扫描进度 ---------------- */
.scan-progress {
  background: var(--card);
  border-radius: var(--radius);
  padding: 15px 16px;
  box-shadow: var(--shadow);
}

.sp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
}

.sp-text {
  font-size: 12.5px;
  color: var(--text);
  font-weight: 550;
}

.sp-pct {
  font-size: 12px;
  color: var(--sub);
  font-variant-numeric: tabular-nums;
}

.sp-bar {
  height: 4px;
  background: #eef0f3;
  border-radius: 2px;
  overflow: hidden;
}

.sp-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #f5a623, var(--bottom));
  border-radius: 2px;
  transition: width 0.4s ease;
}

.sp-hint {
  margin-top: 8px;
  font-size: 10.5px;
  color: var(--sub);
  line-height: 1.5;
}

/* 旧数据提示条 */
.stale-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff9ef;
  border: 1px solid #ffe8c7;
  color: #9a6a15;
  font-size: 11px;
  padding: 7px 11px;
  border-radius: 9px;
  margin-bottom: 10px;
}

/* ---------------- 骨架屏 ---------------- */
.skeleton {
  background: linear-gradient(90deg, #eef0f3 25%, #f6f7f9 50%, #eef0f3 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius);
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.idx-skeleton {
  height: 116px;
}

.sig-skeleton {
  height: 76px;
}

.disclaimer {
  margin-top: 22px;
  padding: 0 4px;
  font-size: 10.5px;
  color: var(--sub);
  line-height: 1.6;
  text-align: center;
}

@media (min-width: 481px) {
  .app {
    box-shadow: 0 0 60px rgba(16, 24, 40, 0.08);
    min-height: 100vh;
  }
  body {
    background: #e8eaee;
  }
}

/* ============================================================
   平板：内容双列，信息密度提升
   ============================================================ */
@media (min-width: 760px) {
  .app {
    max-width: 760px;
  }

  /* 大盘 4 列排开 */
  .index-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* 信号 / 自选列表两列 */
  .list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: start;
  }

  .ov-num {
    font-size: 28px;
  }

  .sheet-inner {
    max-width: 760px;
  }
}

/* ============================================================
   笔记本 / 宽屏：底部导航上移到顶部，页面变宽，详情居中弹层
   ============================================================ */
@media (min-width: 1080px) {
  body {
    background: var(--bg);
  }

  .app {
    max-width: none; /* 内容铺满 APP 窗口宽度 */
    padding: 0 24px;
    box-shadow: none;
    /* 顶栏实际高度（3x 量得 80.4px）：此前从未定义，全靠 fallback 66px，
       页面高度因此全部多算 14.4px，板块详情页的卡片会探出窗口底部 */
    --topbar-h: 80.4px;
  }

  /* ---------- 顶栏 ---------- */
  .topbar {
    padding: 24px 4px 20px;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding-right: 550px; /* 给右上角悬浮导航留位（收窄后实测 538px + 缝隙） */
    justify-content: flex-start;
    gap: 10px;
  }

  .brand-text {
    font-size: 19px;
  }

  /* 宽屏时钟与品牌文字视觉等高（用户 2026-11-03 要求「跟股票期货那几个字一样高」） */
  .brand-clock {
    font-size: 18px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }

  .brand-mark svg {
    width: 17px;
    height: 17px;
  }

  /* ---------- 底部导航 → 顶部胶囊 ---------- */
  .tabbar {
    position: fixed;
    top: 18px;
    bottom: auto;
    left: auto;
    right: 24px;
    transform: none;
    width: auto;
    max-width: none;
    padding: 5px;
    gap: 2px;
    border-top: none;
    border-radius: 100px;
    background: var(--btn-bg);
    box-shadow: var(--shadow);
  }

  .tab {
    flex: none;
    flex-direction: row;
    gap: 5px;
    padding: 8px 10px; /* 16→10：导航 7 项实测 645px，胶囊回第一行后中间放不下，收窄给顶栏中部让位（2026-11-03） */
    border-radius: 100px;
  }

  .tab svg {
    width: 15px;
    height: 15px;
  }

  .tab span {
    font-size: 12px;
  }

  .tab.active {
    background: var(--card-2);
  }

  .tab-badge {
    top: -2px;
    right: 8px;
    margin-right: 0;
  }

  /* ---------- 页面 ---------- */
  .page {
    padding: 0 0 64px;
  }

  .index-grid {
    gap: 14px;
  }

  .idx-card {
    padding: 16px 16px 12px;
  }

  .idx-price {
    font-size: 22px;
  }

  .overview {
    gap: 14px;
  }

  .ov-card {
    padding: 18px 14px;
    border-radius: 16px;
  }

  .ov-num {
    font-size: 32px;
  }

  .list {
    gap: 14px;
  }

  .sig-card {
    padding: 16px 16px;
  }

  /* 信号页内容更宽，可容纳三列 */
  #signalList {
    grid-template-columns: repeat(3, 1fr);
  }

  /* ---------- 详情：页内直接打开（非弹窗） ---------- */
  /* 打开详情时隐藏列表页，详情自带左侧股票列表（dside），铺满 APP 内容宽度 */
  body.detail-open .page {
    display: none !important;
  }

  body.detail-open .disclaimer {
    display: none;
  }

  .sheet {
    position: static;
    display: none;
    transform: none;
    visibility: visible;
    background: transparent;
    overflow: visible;
    transition: none;
  }

  .sheet.open {
    display: block;
    transform: none;
  }

  .sheet-inner {
    max-width: none;
    margin: 0;
    max-height: none;
    overflow: visible;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
  }

  /* 左侧股票列表宽度定义在文件后面 .dbody 基础规则处（源码顺序靠后者生效） */

  .dside-list {
    max-height: calc(100vh - 240px);
  }

  #mainChart {
    height: 372px;
  }

  .flow-mini {
    height: 68px;
  }

  .flow-v {
    font-size: 14px;
  }
}

/* 超宽屏：无需再限制（内容已铺满窗口） */
@media (min-width: 1600px) {
  .topbar {
    padding-right: 480px;
  }
}


/* ============================================================
   v2 · 行情表格（信号 / 自选 / 首页精选）
   ============================================================ */
#signalList,
#watchList,
#wandiList,
#cjhList,
#allupList,
#prepareList,
#futList,
#sgzList,
#homePicks {
  display: block;
}

/* 行情表格页在窄窗下横向滚动（2026-11-03）：14 列挤不下时不再被裁掉，
   用 overflow-x:auto 的独立滚动条；此时禁用表头吸顶（sticky 会被滚动容器捕获） */
@media (max-width: 1079px) {
  #watchList,
  #wandiList,
  #cjhList,
  #allupList,
  #prepareList,
  #futList,
  #sgzList {
    overflow-x: auto;
    /* 不能写 hidden：overflow-x:auto 的容器会把纵向滚轮事件吞掉，
       窄窗下页面整体就滚不动了（2026-11-03 用户反馈「里面滚动滚轮也不能用」） */
    overflow-y: auto;
    padding-bottom: 2px;
  }
  #watchList .stk-head,
  #wandiList .stk-head,
  #cjhList .stk-head,
  #allupList .stk-head,
  #prepareList .stk-head,
  #futList .stk-head,
  #sgzList .stk-head {
    position: static;
  }
  #watchList .stk-table,
  #wandiList .stk-table,
  #cjhList .stk-table,
  #allupList .stk-table,
  #prepareList .stk-table,
  #futList .stk-table,
  #sgzList .stk-table {
    min-width: 900px;
  }
}

.stk-table {
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  /* 不能用 overflow:hidden：会吞掉 .stk-head 的 sticky 吸顶（列表页固定视口滚动） */
  margin-bottom: 12px;
}

.stk-table .stk-head {
  border-radius: 14px 14px 0 0;
}

.stk-table .stk-row:last-child {
  border-radius: 0 0 14px 14px;
}

.stk-head,
.stk-row {
  display: grid;
  /* 列宽按内容比重自适应：名称列弹性，其余列随 APP 宽度均匀伸缩。
     名称列在使用处拼接，JS 钉扎（pinStkNameCol）覆盖 --stk-name-w 才能同时作用表头和数据行 */
  grid-template-columns: var(--stk-name-w) var(--stk-cols-rest);
  gap: 8px;
  align-items: center;
  padding: 8px 14px;
}

.stk-head {
  font-size: 10.5px;
  color: var(--sub);
  background: var(--card-2);
  border-bottom: 1px solid var(--line);
  padding: 7px 14px;
  position: sticky;
  top: 0;
  z-index: 2;
}

.stk-head span {
  white-space: nowrap;
  min-width: 0;
}

/* 表头与数据列对齐：数字列全部靠右对齐（Excel 式，用户 2026-11-02 晚要求，
   每列的表头文字和下面每一行数据都贴同一条右对齐线；
   排序箭头 ↕ 已挪到表头文字左侧，不占用右边缘位置） */
.stk-head .c-tr,
.stk-head .c-price,
.stk-head .c-pct,
.stk-head .c-cap,
.stk-head .c-20,
.stk-head .c-disc,
.stk-head .c-amt,
.stk-head .c-turn,
.stk-head .c-lb,
.stk-head .c-vm,
.stk-head .c-flow {
  text-align: right;
}

/* 「走势」列：5 个趋势箭头（短期/中期/长期/板块短/板块中），口径同详情页摘要条（2026-11-02）。
   主列表与板块详情成分股列表共用同一套箭头样式；用户明确要求这里不加粗（与板块地图的粗箭头区分） */
.sr-tr,
.r-tr {
  display: flex;
  align-items: center;
  justify-content: flex-end; /* 走势列整体右对齐，与其它数字列贴同一条右线（用户 2026-11-02） */
  gap: 1px;
  min-width: 0;
  overflow: hidden;
}

.tr-a {
  font-style: normal;
  font-size: 11px;
  line-height: 1;
  width: 11px;
  flex: none;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.tr-a.up { color: var(--up); }
.tr-a.down { color: var(--down); }
.tr-a.flat { color: var(--sub); }

/* 未加载/无数据的灰点占位 */
.tr-a.na {
  color: var(--sub);
  opacity: 0.45;
  width: auto;
  letter-spacing: 1px;
}
.c-up { color: var(--up); }

/* 安全比率算不出（亏损/无预期）：灰色小字标注「亏损」，区别于数据缺失的 -- */
.disc-na {
  color: var(--sub);
  font-size: 11px;
}

/* 量倍 → 主力净流之间留少量间距；主力净流 → 操作列之间留大间距（用户 2026-10-22 要求），
   走势图与「查看」按钮不再贴在一起 */
.stk-head .c-flow,
.stk-row .c-flow {
  padding-left: 10px;
  padding-right: 28px;
}

/* 窗口窄时防溢出：grid 单元格允许收缩，主力净流柱条自适应列宽、不压到操作列 */
.stk-head span,
.stk-row > div {
  min-width: 0;
}
.stk-row .c-flow {
  overflow: hidden;
}

/* 行业列表头拆成「行业」「概念」两半，与数据格左右两半对齐 */
.stk-head .c-ind {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.stk-head .c-ind .ind-hd {
  flex: 0 0 31%;
  min-width: 0;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 2026-12-04：概念半列要容纳「概念名 + 涨跌幅 + 三日排名」，比行业半列更宽 */
.stk-head .c-ind .ind-hd + .ind-hd {
  flex: 1 1 69%;
}

.stk-head .c-act {
  text-align: right;
}

.stk-row {
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.12s ease;
}

.stk-row:last-child {
  border-bottom: none;
}

.stk-row:hover {
  background: var(--card-2);
}

/* ---------- 自选股排序：拖拽换位 + 右键菜单 ---------- */
.stk-row.dragging {
  opacity: 0.4;
}

.stk-row.drop-above {
  box-shadow: inset 0 2px 0 var(--bottom);
}

.stk-row.drop-below {
  box-shadow: inset 0 -2px 0 var(--bottom);
}

.ctx-menu {
  position: fixed;
  z-index: 1200;
  min-width: 104px;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 4px;
  display: flex;
  flex-direction: column;
}

.ctx-menu button {
  border: none;
  background: none;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text);
  text-align: left;
  padding: 7px 12px;
  border-radius: 7px;
  cursor: pointer;
}

.ctx-menu button:hover {
  background: var(--card-2);
}

.ctx-menu button.danger {
  color: var(--down);
}

.sr-name {
  min-width: 0;
}

.sr-nm {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
}

.sr-nm .nm {
  font-size: 13px;
  font-weight: 620;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 股票名颜色（用户 2026-11-02 重新定义）：
   红 = 同时出现在「碗底」+「操家伙」两榜；蓝 = 自选股（自选页本身不着色） */
.sr-nm .nm.hot {
  color: var(--up);
}

.sr-nm .nm.blue {
  color: #2563eb;
}

/* ---------- 名称颜色标示（右键股票/期货名称 → 7 色任选，2026-11-26） ----------
   高对比文字 + 淡色药丸底，深浅主题各一套；不占用涨跌红绿语义以外的地方 */
:root {
  --nm1: #cf2e2e; --nm1-bg: #fdeaea;
  --nm2: #c25a00; --nm2-bg: #fdf0e2;
  --nm3: #967000; --nm3-bg: #faf3d8;
  --nm4: #0a7d52; --nm4-bg: #e3f6ee;
  --nm5: #0a6f68; --nm5-bg: #dff3f1;
  --nm6: #1d4fbd; --nm6-bg: #e7edfd;
  --nm7: #6d33cf; --nm7-bg: #f0e9fb;
}
html[data-theme-dark="1"] {
  --nm1: #ff7b7b; --nm1-bg: rgba(229, 69, 69, 0.18);
  --nm2: #ff9f4a; --nm2-bg: rgba(239, 125, 0, 0.18);
  --nm3: #f2cc55; --nm3-bg: rgba(211, 164, 0, 0.18);
  --nm4: #46d69c; --nm4-bg: rgba(18, 160, 106, 0.18);
  --nm5: #4bdbd0; --nm5-bg: rgba(13, 148, 136, 0.18);
  --nm6: #7ea6ff; --nm6-bg: rgba(37, 99, 235, 0.2);
  --nm7: #b48cf5; --nm7-bg: rgba(139, 92, 246, 0.2);
}
/* 只改颜色/底色，不动 padding、字重、display——保证 scrollWidth 不变，长股票名不会被省略号截断 */
.sr-nm .nm.nm-mark, .bc-nm.nm-mark {
  border-radius: 4px;
  box-shadow: 0 0 0 2px transparent;
}
.sr-nm .nm.nm-mark-1, .bc-nm.nm-mark-1 { color: var(--nm1); background: var(--nm1-bg); }
.sr-nm .nm.nm-mark-2, .bc-nm.nm-mark-2 { color: var(--nm2); background: var(--nm2-bg); }
.sr-nm .nm.nm-mark-3, .bc-nm.nm-mark-3 { color: var(--nm3); background: var(--nm3-bg); }
.sr-nm .nm.nm-mark-4, .bc-nm.nm-mark-4 { color: var(--nm4); background: var(--nm4-bg); }
.sr-nm .nm.nm-mark-5, .bc-nm.nm-mark-5 { color: var(--nm5); background: var(--nm5-bg); }
.sr-nm .nm.nm-mark-6, .bc-nm.nm-mark-6 { color: var(--nm6); background: var(--nm6-bg); }
.sr-nm .nm.nm-mark-7, .bc-nm.nm-mark-7 { color: var(--nm7); background: var(--nm7-bg); }
.ds-nm.nm-mark-1 { color: var(--nm1); background: var(--nm1-bg); }
.ds-nm.nm-mark-2 { color: var(--nm2); background: var(--nm2-bg); }
.ds-nm.nm-mark-3 { color: var(--nm3); background: var(--nm3-bg); }
.ds-nm.nm-mark-4 { color: var(--nm4); background: var(--nm4-bg); }
.ds-nm.nm-mark-5 { color: var(--nm5); background: var(--nm5-bg); }
.ds-nm.nm-mark-6 { color: var(--nm6); background: var(--nm6-bg); }
.ds-nm.nm-mark-7 { color: var(--nm7); background: var(--nm7-bg); }

/* 右键名称的颜色选择菜单 */
.ctx-menu.nm-menu { min-width: 172px; padding: 6px; }
.nm-menu-title { font-size: 11.5px; color: var(--sub); padding: 3px 7px 6px; white-space: nowrap; max-width: 210px; overflow: hidden; text-overflow: ellipsis; }
.nm-menu-title b { color: var(--text); font-weight: 650; }
.nm-menu-swatches { display: flex; gap: 6px; padding: 2px 5px 7px; }
.nm-menu-swatches .nm-sw {
  width: 20px; height: 20px; border-radius: 50%; padding: 0;
  background: none; border: 2px solid transparent; display: grid; place-items: center;
}
.nm-menu-swatches .nm-sw i { display: block; width: 13px; height: 13px; border-radius: 50%; background: var(--sw); }
.nm-menu-swatches .nm-sw.on { border-color: var(--sw); }
.nm-menu-swatches .nm-sw:hover { background: var(--card-2); }
.ctx-menu.nm-menu .nm-menu-clear { border-top: 1px solid var(--line); border-radius: 0 0 7px 7px; padding-top: 8px; margin-top: 1px; }

.sr-nm .cd {
  font-size: 10.5px;
  color: var(--sub);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* 信号徽标（含评分）与名称同行 */
.sr-nm .badge-sig {
  flex-shrink: 0;
  transform: translateY(-0.5px);
}


.badge-sig {
  display: inline-block;
  font-size: 10px;
  line-height: 1.5;
  padding: 0 4px;
  border-radius: 4px;
  font-weight: 600;
}

/* 级别后缀：底部/底量/大N 等信号在「信号名 + 分数」后面带上 A/B/C/D 级，
   与详情页诊断条的「底部信号·A级」同一口径（用户 2026-10-23 要求）。
   加粗比正文重一点，扫一眼就能看出级别；前导的「·」用 ::before 画，省一个字符的空隙。 */
.badge-sig .sig-lv {
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.badge-sig .sig-lv::before {
  content: "·";
  margin: 0 1px;
  font-weight: 600;
  opacity: 0.75;
}

.badge-sig .sig-lv .lv-suf {
  font-style: normal;
  font-weight: 600;
  opacity: 0.85;
  margin-left: 0.5px;
}

/* 底量/大N 形态分的分母（/56、/100）：缩一号、淡一点，读起来像分数而不是「53 分」 */
.badge-sig .sc-den {
  font-size: 9px;
  font-weight: 500;
  opacity: 0.8;
  margin-left: 0.5px;
}

/* 「形态分 · 综合分」之间的分隔点：把两把尺隔开，避免读成「53/56·97」一坨 */
.badge-sig .sc-sep {
  margin: 0 1.5px;
  opacity: 0.5;
  font-weight: 600;
}

.badge-sig.b-bot {
  background: var(--bottom-bg);
  color: var(--bottom);
}

/* 大底 / 大顶：分型 + MACD 背驰 */
.badge-sig.b-major {
  background: var(--bottom);
  color: #fff;
}

.badge-sig.b-major-top {
  background: var(--top);
  color: #fff;
}

/* 底放量：2.5 倍量低位放量见底 */
.badge-sig.b-vb {
  background: rgba(239, 125, 0, 0.22);
  color: var(--bottom);
  border: 1px solid rgba(239, 125, 0, 0.55);
}

.badge-sig.b-top {
  background: var(--top-bg);
  color: var(--top);
}

.badge-sig.b-pb {
  background: var(--pb-bg);
  color: var(--pb);
}

.badge-sig.b-bn {
  background: var(--bn-bg);
  color: var(--bn);
}

/* 三阳：连续三日小阳，徽标带「今日 / MM/DD」区分哪天走完 */
.badge-sig.b-sy {
  background: rgba(229, 69, 69, 0.16);
  color: #e54545;
  border: 1px solid rgba(229, 69, 69, 0.45);
}

/* 碗底回踩：MA60 放量突破 → 缩量回踩不破 → 放量再攻（2026-10-30 新增） */
.badge-sig.b-wd {
  background: rgba(124, 58, 237, 0.16);
  color: #7c3aed;
  border: 1px solid rgba(124, 58, 237, 0.45);
}

/* 操家伙：日/周/月 MA20 三线向上 + 回踩 MA20（2026-11-02 新增） */
.badge-sig.b-cjh {
  background: rgba(217, 119, 6, 0.16);
  color: #b45309;
  border: 1px solid rgba(217, 119, 6, 0.45);
}

.badge-sig.weak {
  opacity: 0.78;
}

.sr-price,
.sr-pct,
.sr-cap,
.sr-20,
.sr-amt,
.sr-turn,
.sr-lb,
.sr-disc,
.sr-vm,
.sr-flow .fv {
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  text-align: right;
  white-space: nowrap;
}

.sr-price {
  font-weight: 650;
}

.sr-cap,
.sr-20,
.sr-amt,
.sr-turn,
.sr-lb,
.sr-vm {
  color: var(--text-2);
}

/* 行业列拆两半（用户 2026-11-02 要求）：左=行业名、右=概念板块，单行各超长省略。
   表头（.stk-head .c-ind）与数据格（.sr-ind）用同款 flex 布局，两个小标签
   严格对齐到自己数据的上方 */
.sr-ind {
  font-size: 11px;
  color: var(--text-2);
  text-align: center;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1.3;
  min-width: 0;
  overflow: hidden;
}

/* 行业窄 / 概念宽（2026-12-04）：概念半列要放「概念名 + 涨跌幅 + 三日排名」两行 */
.sr-ind .ind-hd {
  flex: 0 0 31%;
  min-width: 0;
  max-width: none;
  line-height: inherit;
  text-align: center;
}
.sr-ind .gn-item {
  flex: 1 1 69%;
  min-width: 0;
  max-width: none;
  line-height: inherit;
  text-align: center;
}

/* 行业名（左半）：静态文本，超长省略，悬停 title 看全称 */
.sr-ind .ind-hd {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sr-ind .gn-item + .gn-item {
  margin-top: 0;
  margin-left: 0;
}

.sr-ind .ind-nm {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10.5px;
}

.sr-ind .ind-etf {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  max-width: 100%;
  min-width: 0;
  color: var(--sub);
  white-space: nowrap;
}

.sr-ind .ind-etf[hidden] {
  display: none;
}

/* 有 ETF：行业名让位，只留 ETF 名（与行业名同字号，更直观） */
.sr-ind.has-etf .ind-nm {
  display: none;
}

.sr-ind .ie-nm {
  font-style: normal;
  font-size: 10.5px;
  color: var(--text-2);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 第二行：该股占 ETF 净值的比例 + 走势线 */
.sr-ind .ie-sub {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  max-width: 100%;
  min-width: 0;
}

/* 权重（该股占这只 ETF 的净值比例）：灰色小字，涨跌方向看右边曲线的颜色 */
.sr-ind .ie-w {
  flex: none;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

/* 可点：进 ETF 详情页 */
.sr-ind .ind-etf.link {
  cursor: pointer;
}

.sr-ind .ind-etf.link:hover .ie-nm {
  color: var(--acc, #e8a33d);
  text-decoration: underline;
}

/* 走势线：viewBox 40x12，随列宽略缩，不至于把 ETF 名挤掉 */
.sr-ind .ie-spark {
  width: 26px;
  height: 11px;
  flex: 0 0 26px;
}

.sr-ind .ie-spark path {
  fill: none;
  stroke-width: 1.2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

/* 主力净流单元格：数字贴右对齐线（row-reverse 把 DOM 里第一个的数值排到右端）、
   分时资金走势图填满左侧，单行排列不重叠（用户 2026-11-02 Excel 式右对齐） */
.sr-flow {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.sr-flow .fv {
  font-size: 11.5px;
  font-weight: 600;
  flex: none;
}

.sr-flow .fbar {
  flex: 1;
  min-width: 0;
}

.sr-act {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

.mini-btn {
  border: 1px solid var(--line-2);
  background: var(--btn-bg);
  color: var(--text-2);
  font-family: inherit;
  font-size: 11px;
  line-height: 1.4;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.mini-btn:hover {
  border-color: #c6cdd6;
  color: var(--text);
}

.mini-btn.primary {
  background: #1a1d21;
  border-color: #1a1d21;
  color: #fff;
}

.mini-btn.star b {
  font-weight: 400;
  font-size: 12px;
  line-height: 1;
}

.mini-btn.star.on {
  color: #d98a12;
  border-color: #f0d3a8;
  background: var(--star-bg);
}

/* 主力净流柱条 */
.fbar {
  display: block;
  height: 5px;
  border-radius: 3px;
  background: var(--track);
  overflow: hidden;
}

.fbar em {
  display: block;
  height: 100%;
  border-radius: 3px;
}

.fbar em.in {
  background: var(--up);
}

.fbar em.out {
  background: var(--down);
}

/* 主力净流分时资金走势图（列表 sparkline）：0 轴虚线，线上方=进钱（红）/下方=出钱（绿） */
.sr-flow .fspark {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 20px;
  display: block;
}

.fspark .fs-zero {
  stroke: var(--line-2);
  stroke-width: 1;
  stroke-dasharray: 2 2;
}

.fspark .fs-line {
  fill: none;
  stroke: var(--up);
  stroke-width: 1.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

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

/* ============================================================
   v2 · 详情页
   ============================================================ */
.detail-loading {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--sub);
  font-size: 13px;
}

.spinner-lg {
  width: 26px;
  height: 26px;
  border: 2.5px solid #e3e6ea;
  border-top-color: #ef7d00;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

/* 详情头 = 列表行同款（.dhead.stk-row）：网格/列宽/对齐/字号全部继承 .stk-row，
   打开详情时头部每个数字与列表完全同一位置，不再跳动 */
/* .dhead-wrap 把「指标名表头 + 数据行」包在一起吸顶，滚动时指标名始终可见 */
.dhead-wrap {
  position: sticky;
  top: 0;
  z-index: 6;
  background: var(--bar-bg);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
}

.dhead-wrap .stk-head {
  position: static;
  background: transparent;
  z-index: auto;
}

.dhead {
  position: relative;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid var(--line);
  cursor: pointer; /* 点任意位置收起回列表 */
}

.dhead.stk-row:hover {
  background: var(--bar-bg);
}

/* 返回按钮浮在左上角，不占网格列（≥760px 隐藏，用周期胶囊右侧的「收起」） */
.dhead .back-btn {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 26px;
  height: 26px;
}

@media (min-width: 760px) {
  .dhead .back-btn {
    display: none;
  }
}

.dtitle {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.dtitle h1 {
  font-size: 18px;
  font-weight: 680;
  white-space: nowrap;
}

.dcode {
  font-size: 11px;
  color: var(--sub);
  font-variant-numeric: tabular-nums;
}

.dprice {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.dprice span {
  font-size: 12px;
  font-weight: 600;
  margin-left: 5px;
}

.dstats {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
}

.dstats span {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.25;
}

.dstats i {
  font-style: normal;
  font-size: 9.5px;
  color: var(--sub);
}

.dstats b {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.dflow {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
}

.dflow i {
  font-style: normal;
  color: var(--sub);
}

.dflow b {
  font-size: 12.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.dflow .fbar {
  width: 62px;
}

.dact {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.dbody {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 14px;
  padding: 14px 18px calc(28px + env(safe-area-inset-bottom));
  align-items: start;
}

/* 桌面端左侧股票列表加宽（2026-11-05：240→300，给「走势」箭头列留空间，
   名称不再截断）。必须放在基础 .dbody 之后才生效（源码顺序靠后者赢） */
@media (min-width: 1080px) {
  .dbody {
    grid-template-columns: 300px minmax(0, 1fr);
  }
}

.dside {
  position: sticky;
  top: 70px;
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* 宽屏详情固定视口布局：
   详情页整体高度 = 视口 - 顶栏，不产生页面滚动；
   头部横幅 / 周期胶囊 / 左侧列表全部固定，只有右侧内容区（.dmain-scroll）滚动；
   左侧列表撑到 APP 下边界，内部可上下滚动 */
@media (min-width: 1080px) {
  .sheet {
    height: calc(100vh - var(--topbar-h, 66px));
    overflow: hidden;
  }

  .sheet-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
  }

  .dhead-wrap {
    position: static;
    flex: none;
  }

  .dbody {
    flex: 1;
    min-height: 0;
    align-items: stretch;
    grid-template-rows: minmax(0, 1fr);
    padding-bottom: 14px;
  }

  .dside {
    position: static;
    height: 100%;
    display: flex;
    flex-direction: column;
  }

  .dside-list {
    flex: 1;
    max-height: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .dmain {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .ptabs-h {
    position: static;
    flex: none;
  }

  .dmain-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* 注意：max-height 限制只用于 <1080 的窄屏；桌面端由上方固定视口布局接管，
   若把 max-height 写在这条基础规则里会因源码顺序靠后覆盖桌面端的 max-height:none */
@media (max-width: 1079px) {
  .dside-list {
    max-height: 44vh;
  }
}

.dside-list {
  overflow-y: auto;
}

.dside-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 7px 8px 7px 9px;
  cursor: pointer;
  border-left: 3px solid transparent;
  border-bottom: 1px solid var(--line);
}

.dside-item:hover {
  background: var(--card-2);
}

.dside-item.active {
  background: var(--bottom-bg);
  border-left-color: var(--bottom);
}

/* 左：名称 + 代码 竖排（宽度自适应，不主动撑满——剩余空间由 space-between 均分，
   使「名称→现价」与「现价→涨跌幅」两个间距自动相等，用户 2026-10-22 要求） */
.ds-l {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 0 1 auto;
}

.ds-nm {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 详情左侧列表：红=碗底+操家伙双榜，蓝=自选股 */
.ds-nm.hot {
  color: var(--up);
}

.ds-nm.blue {
  color: #2563eb;
}

.ds-cd {
  font-size: 9.5px;
  color: var(--sub);
  font-variant-numeric: tabular-nums;
}

/* 侧栏右两列：现价、涨跌幅各自成列、右对齐、不折行 */
.ds-price {
  flex: 0 0 auto;
  min-width: 40px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.ds-pct {
  flex: 0 0 auto;
  min-width: 42px;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

/* 详情左侧列表「走势」列（涨跌幅右边，5 箭头，2026-11-05）：
   侧栏只有 250px，箭头用 9px 小号 + 右对齐，名称列自动收缩（ellipsis 兜底） */
.ds-tr {
  flex: 0 0 auto;
  display: flex;
  gap: 1px;
  justify-content: flex-end;
  min-width: 45px;
}

.ds-tr .tr-a {
  font-size: 9px;
  width: 9px;
}

.ptabs-v {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}

.ptabs-v .ptab {
  border: none;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--btn-bg);
  padding: 8px 0;
  font-family: inherit;
  font-size: 11.5px;
  color: var(--text-2);
  cursor: pointer;
}

.ptabs-v .ptab.on {
  background: var(--bottom-bg);
  color: var(--bottom);
  font-weight: 700;
}

/* 周期切换（分时/日K/周K/月K/财务）：位于图表标题上方 */
.ptabs-h {
  display: flex;
  gap: 2px;
  background: var(--card);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 4px;
  margin-bottom: 10px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ptabs-h .ptab {
  border: none;
  background: transparent;
  padding: 7px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
}

.ptabs-h .ptab.on {
  background: var(--bottom-bg);
  color: #d97a00;
  font-weight: 700;
}

/* 收起按钮：贴在周期胶囊右侧 */
.ptabs-h .mini-btn {
  flex: 0 0 auto;
  margin-left: 8px;
  align-self: center;
}

.dmain {
  min-width: 0;
}

.dmain .chart-card {
  margin: 0 0 12px;
  padding: 10px 10px 6px;
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 4px 6px;
  font-size: 12.5px;
}

/* 标题 + 信号诊断摘要条（同一行左侧） */
.ch-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.chart-head b {
  font-weight: 650;
  flex-shrink: 0;
}

.chart-head > span {
  font-size: 10.5px;
  color: var(--sub);
  flex-shrink: 0;
}

/* 图表右上角：画线 / 清除线 + 行情时间 */
.ch-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.ch-right #chartDate {
  font-size: 10.5px;
  color: var(--sub);
}
/* 日K右上角日期左侧：股票代码 + 名称（用户 2026-11-23 要求）。
   名称深色加粗、代码灰色小字放后面，与右侧日期用竖线分隔，不抢主图。 */
.ch-right #chartSymbol {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding-right: 8px;
  border-right: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--text);
  white-space: nowrap;
}
.ch-right #chartSymbol b { font-weight: 700; }
.ch-right #chartSymbol i {
  font-style: normal;
  font-size: 10px;
  color: var(--sub);
  font-variant-numeric: tabular-nums;
}
.draw-btn {
  font-size: 11px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--sub);
  cursor: pointer;
  transition: all 0.12s;
}
.draw-btn:hover {
  border-color: #f0781e;
  color: #d4610e;
}
/* 画线模式开启：按钮变橙，提示当前正在画 */
.draw-btn.on {
  background: #f0781e;
  border-color: #f0781e;
  color: #fff;
  box-shadow: 0 0 0 2px rgba(240, 120, 30, 0.18);
}
/* 画线模式：十字光标换成细十字，避免误以为在选点 */
.chart-card.drawing #mainChart {
  cursor: crosshair;
}

/* 主图指标开关（均线 / 布林，用户 2026-11-01 要求）：与画线按钮同款，开启时紫色高亮 */
.ind-btn {
  font-size: 11px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--sub);
  cursor: pointer;
  transition: all 0.12s;
}
.ind-btn:hover {
  border-color: #a855f7;
  color: #7c3aed;
}
.ind-btn.on {
  background: #7c3aed;
  border-color: #7c3aed;
  color: #fff;
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.16);
}

/* K线缩放按钮组（＋/−，用户 2026-11-02 要求）：紧凑方块，贴在指标开关左侧 */
.zoom-group {
  display: inline-flex;
  gap: 3px;
}
.zoom-group .zbtn {
  width: 24px;
  padding: 4px 0;
  text-align: center;
  font-weight: 700;
  font-size: 12px;
}

/* ---------------- 信号诊断摘要条（单行，跟在图表标题后） ---------------- */
.sig-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 10.5px;
  line-height: 16px;
  font-weight: 500;
}

.sig-strip .ss-score {
  flex-shrink: 0;
  font-weight: 700;
  border: 1px solid;
  border-radius: 5px;
  padding: 0 6px;
  letter-spacing: -0.1px;
}

.sig-strip .ss-trend {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-2);
}

.sig-strip .ss-kv {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.sig-strip .ss-kv i {
  font-style: normal;
  color: var(--sub);
  font-weight: 500;
}

.sig-strip .ss-kv.up { color: var(--up); }
.sig-strip .ss-kv.down { color: var(--down); }
/* 底量当日强度（满分 56）：用底量徽标同款青绿，和综合分的橙色区分开，一眼看出是另一把尺 */
.sig-strip .ss-kv.dil { color: #0d9488; font-weight: 600; }

/* 短/中/长期走势 chips（用户 2026-11-02 要求）：日K+MA20→短期、周K→中期、月K→长期 */
.sig-strip .ss-t {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  border-radius: 20px;
  font-weight: 600;
  line-height: 16px;
}
.sig-strip .ss-t i {
  font-style: normal;
  font-weight: 500;
  color: var(--sub);
}
.sig-strip .ss-t.up { color: var(--up); background: rgba(211, 47, 47, 0.08); }
.sig-strip .ss-t.down { color: var(--down); background: rgba(15, 138, 92, 0.09); }
.sig-strip .ss-t.flat { color: var(--text-2); background: rgba(0, 0, 0, 0.05); }
/* 「板块短/板块中」胶囊：有概念板块时可点击打开板块日K（2026-11-02） */
.sig-strip .ss-t.bt-link { cursor: pointer; border-bottom: 1px dashed currentColor; }
.sig-strip .ss-t.bt-link:hover { filter: brightness(0.92); }
.sig-strip .ss-t.bt-link:active { transform: translateY(1px); }

.sig-strip .ss-none {
  color: var(--sub);
}

.dmain #mainChart {
  width: 100%;
  /* 用户 2026-11-03 要求：K线价格区加高（canvas 从 300 → 400，配合 chart.js
     成交量占比 0.22 → 0.14，蜡烛区净增 ~110px），成交量条随之下移，
     MACD 及以下各卡整体往下移 */
  height: 400px;
  display: block;
  touch-action: pan-y;
  cursor: crosshair;
}

.sub-card {
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 8px 10px 6px;
  margin-bottom: 12px;
}

.sub-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 10.5px;
  color: var(--text-2);
  padding: 0 2px 4px;
}

.sub-head span {
  color: var(--sub);
  font-variant-numeric: tabular-nums;
}

/* MACD 副图标题（文本随周期切换：分时 MACDFS(9,15,9) / 日K MACD(9,26,9)）。
   .sub-head span 的浅色是给右侧图例数值用的，标题要保持与卡片标题同色 */
#macdLabel {
  color: var(--text-2);
}

.sub-head i {
  font-style: normal;
  margin-left: 9px;
}

.sub-head b {
  font-weight: 650;
}

/* MACD 单独加高（用户 2026-10-22 要求）：原来和 KDJ 一样 108px，
   柱状体被压得很扁，看不出多空能量的比例；加高到 168px 后柱子高低一目了然。
   drawMacd 是按 canvas 实际尺寸算的，改高度不需要动 JS。 */
#macdChart {
  width: 100%;
  height: 168px;
  display: block;
}

#kdjChart {
  width: 100%;
  height: 108px;
  display: block;
}

/* 价格 · 库存 副图（期货详情，2026-11-16）：库存柱 + 价格线，比 KDJ 高一点，
   双轴刻度（左库存、右价格）需要更多纵向空间才看得清 */
#fundChart {
  width: 100%;
  height: 156px;
  display: block;
}

.fund-legend i {
  font-style: normal;
  margin-left: 10px;
  font-size: 10px;
  color: var(--sub);
}

.fund-legend .fl-price::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 2px;
  margin-right: 4px;
  vertical-align: middle;
  background: #5b7cfa;
  border-radius: 1px;
}

.fund-legend .fl-stock::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 4px;
  vertical-align: -1px;
  background: rgba(46, 138, 132, 0.35);
  border: 1px solid rgba(46, 138, 132, 0.8);
  border-radius: 2px;
}

/* 四块数字：最新库存 / 5 日环比 / 一年分位 / 与价格相关 */
.fund-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 8px 2px 4px;
}

.fs-item {
  background: var(--bg-2, #f6f7f9);
  border-radius: 8px;
  padding: 6px 9px;
  min-width: 0;
}

.fs-item em {
  display: block;
  font-style: normal;
  font-size: 10px;
  color: var(--sub);
  margin-bottom: 2px;
  white-space: nowrap;
}

.fs-item b {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

/* 库存增→绿（对价格偏空）、库存减→红（偏多），与全站涨红跌绿一致 */
.fs-item b.fs-neg { color: var(--down); }
.fs-item b.fs-pos { color: var(--up); }

.fs-item span {
  font-size: 10px;
  color: var(--sub);
  margin-left: 4px;
}

@media (max-width: 980px) {
  .fund-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

#flowChart {
  width: 100%;
  height: 56px;
  display: block;
}
/* 24节气副图图例：五行传统色（非涨跌色） */
.wx-legend { display: inline-flex; gap: 6px; align-items: center; font-weight: 400; }
.wx-legend em {
  font-style: normal; font-size: 10px; line-height: 1; padding: 2px 4px; border-radius: 3px;
  background: var(--card-2);
}
.wx-legend .wx-mu   { color: #2ea36d; }
.wx-legend .wx-huo  { color: #e00000; }
.wx-legend .wx-tu   { color: #8b4513; }
.wx-legend .wx-jin  { color: #c9a300; }
.wx-legend .wx-shui { color: #3a7fc8; }

/* 分时页：今日资金累计（x 轴铺满 09:30~15:00 全天，曲线随时间往右长） */
#minFlowChart {
  width: 100%;
  height: 108px;
  display: block;
}

.fund-card {
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 12px;
  margin-bottom: 12px;
}

.fund-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}

.fund-head b {
  font-size: 13px;
  font-weight: 650;
}

.fund-head small {
  font-size: 10px;
  color: var(--sub);
}

.fund-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.fb-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-2);
  margin-bottom: 9px;
}

.fb-title span {
  font-size: 9.5px;
  color: var(--sub);
}

.fb-title b {
  font-size: 15px;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
}

.fb-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 66px;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 11px;
}

.fb-k {
  color: var(--text-2);
}

.fb-track {
  height: 9px;
  background: #f2f4f6;
  border-radius: 2px;
  overflow: hidden;
}

.fb-track em {
  display: block;
  height: 100%;
  border-radius: 2px;
}

.fb-track em.in {
  background: linear-gradient(90deg, #f08a8a, var(--up));
}

.fb-track em.out {
  background: linear-gradient(90deg, #63cba2, var(--down));
}

.fb-row b {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

#cumChart {
  width: 100%;
  height: 118px;
  display: block;
}

.fb-note {
  font-size: 9.5px;
  color: var(--sub);
  margin-top: 2px;
}

.fund-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed var(--line);
}

.flow-chip {
  display: flex;
  align-items: baseline;
  gap: 4px;
  background: var(--card-2);
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.flow-chip i {
  font-style: normal;
  color: var(--sub);
}

.flow-chip b {
  font-weight: 600;
}

.finance-card {
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 12px;
  margin-bottom: 12px;
}

.fin-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.fin-cell {
  background: var(--card-2);
  border-radius: 8px;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.fin-cell span {
  font-size: 10px;
  color: var(--sub);
}

.fin-cell b {
  font-size: 13px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 财务页：安全边际估值 + 财务透视 + 优劣势 ---------- */
.fin-sec {
  margin-bottom: 14px;
}

.fs-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.fs-head b {
  font-size: 13.5px;
  font-weight: 700;
}

.fs-head span {
  font-size: 11px;
  color: var(--sub);
}

.margin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.margin-card {
  background: var(--card-2);
  border-radius: 10px;
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left: 3px solid #f0a020;
  min-width: 0;
}

.mc-year {
  font-size: 11px;
  color: var(--sub);
  font-weight: 600;
}

.mc-line {
  font-size: 12px;
  color: var(--sub);
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex-wrap: wrap;
}

.mc-line b {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.mc-line.up b {
  color: var(--up);
}

.mc-line.down b {
  color: var(--down);
}

.mc-none {
  color: #b9c0c8;
}

.mc-note {
  font-size: 10px;
  color: var(--sub);
  opacity: 0.85;
}

.fs-formula {
  margin-top: 8px;
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--sub);
  background: var(--card-2);
  border-radius: 8px;
  padding: 8px 10px;
}

.fin-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.fin-chart {
  background: var(--card-2);
  border-radius: 10px;
  padding: 10px 10px 6px;
  min-width: 0;
}

.fc-title {
  font-size: 11px;
  color: var(--sub);
  font-weight: 600;
  margin-bottom: 4px;
}

.fin-chart canvas {
  width: 100%;
  height: 150px;
  display: block;
}

.fin-swot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.swot-col {
  background: var(--card-2);
  border-radius: 10px;
  padding: 10px 12px;
}

.swot-col.good {
  border-left: 3px solid var(--up);
}

.swot-col.bad {
  border-left: 3px solid var(--down);
}

.swot-t {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 5px;
}

.swot-i {
  font-size: 11px;
  line-height: 1.7;
  color: var(--sub);
  position: relative;
  padding-left: 10px;
}

.swot-i::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}

@media (max-width: 720px) {
  .margin-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .margin-card {
    padding: 9px 8px;
  }

  .mc-line b {
    font-size: 13px;
  }

  .fin-charts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .fin-swot {
    grid-template-columns: 1fr;
  }
}

/* 详情面板在宽屏下的宽度（页内打开，随 APP 内容宽度自适应） */
@media (min-width: 1080px) {
  .sheet-inner {
    max-width: 100%;
  }

  .dmain #mainChart {
    height: 470px;
  }
}

@media (min-width: 760px) and (max-width: 1079px) {
  /* 中等窗口（APP 最小 900px 时列表卡片只有 ~728px）：
     行业列带上 ETF 后 13 列塞不下，这里整列收起「量倍」「换手」两个次要列，
     主力净流只留数字、操作只留星标，其余列按真实字号给足宽度——
     宁可少两列，也不能让数值互相压字（用户 2026-10-23 截图里 132.86亿+5.52% 叠在一起）。 */
  :root {
    --stk-name-w: fit-content(168px);
    --stk-cols-rest:
      minmax(50px, 0.55fr)    /* 走势：5 个趋势箭头 */
      minmax(48px, 0.5fr)     /* 现价（1339.14 这类四位数要 48px） */
      minmax(48px, 0.52fr)    /* 涨跌幅 */
      minmax(56px, 0.54fr)    /* 总市值 */
      minmax(50px, 0.52fr)    /* 20日涨幅 */
      minmax(50px, 0.5fr)     /* 安全比率 */
      minmax(84px, 0.9fr)     /* 行业 / 概念（缩掉右侧富余，让给走势列） */
      minmax(50px, 0.52fr)    /* 成交额 */
      minmax(28px, 0.3fr)     /* 量比 */
      minmax(50px, 0.72fr)    /* 主力净流 */
      minmax(30px, 0.36fr);   /* 操作（只留星标） */
  }

  /* 这两列在这一档隐藏（表头与行必须一起隐藏，否则网格错位） */
  .stk-head .c-vm,
  .stk-row .c-vm,
  .stk-head .c-turn,
  .stk-row .c-turn {
    display: none;
  }

  .stk-head,
  .stk-row {
    gap: 3px;
    padding-left: 8px;
    padding-right: 8px;
  }

  /* 数值列字号收一档：12px 的「132.86亿」需要 ~60px，11px 才塞得进 56px 且不压到下一列 */
  .stk-row .sr-price,
  .stk-row .sr-pct,
  .stk-row .sr-cap,
  .stk-row .sr-20,
  .stk-row .sr-disc,
  .stk-row .sr-amt,
  .stk-row .sr-lb,
  .stk-row .sr-flow .fv {
    font-size: 11px;
  }

  /* 主力净流：走势图让位，只显示金额（不然 54px 的列放不下 86px 的 sparkline） */
  .sr-flow .fspark {
    display: none;
  }

  /* 操作列：只留星标，去掉「查看」（点整行就能进详情） */
  .mini-btn.view {
    display: none;
  }

  .mini-btn.star {
    padding: 2px 4px;
    border: none;
    background: transparent;
    font-size: 15px;
  }

  .mini-btn.star span {
    display: none;
  }

  /* 行业列：有 ETF 时只显示 ETF 名 —— 窄窗优先保住名字，走势线让位 */
  .sr-ind .ie-spark {
    display: none;
  }

  /* 名称列这一档只有 168px：徽标带上「形态分 + 综合分 + 级别」会把股票名挤成省略号。
     做法是整块收起形态分（.sc-ms，含 /56 分母和分隔点），只留「底量 35 C」「底 45 C」——
     一个分数配它自己的级别，不会出现「底量 56 · 35C」两个裸数字分不清谁是谁。 */
  .badge-sig .lv-suf,
  .badge-sig .sc-ms {
    display: none;
  }

  .sr-nm {
    gap: 3px;
  }

  .badge-sig {
    font-size: 9px;
    padding: 0 3px;
  }

  .sr-ind .ie-nm {
    max-width: 100%;
  }

  .sheet-inner {
    max-width: 760px;
  }

  .dbody {
    grid-template-columns: 220px minmax(0, 1fr);
  }
}

/* ---------- 手机 ---------- */
@media (max-width: 759px) {
  .stk-head {
    display: none;
  }

  .stk-row {
    grid-template-columns: minmax(104px, 1fr) 52px 58px 76px 26px;
    gap: 6px;
    padding: 9px 10px;
  }

  .c-cap,
  .c-20,
  .c-tr,
  .c-ind,
  .c-amt,
  .c-turn,
  .c-lb {
    display: none;
  }

  .sr-nm .nm {
    font-size: 12.5px;
  }

  .sr-price,
  .sr-pct {
    font-size: 12px;
  }

  .mini-btn.view {
    display: none;
  }

  .mini-btn.star span {
    display: none;
  }

  .mini-btn.star {
    padding: 2px 4px;
    border: none;
    background: transparent;
    font-size: 15px;
  }

  .mini-btn.star b {
    font-size: 15px;
  }

  .dhead.stk-row {
    padding: calc(env(safe-area-inset-top) + 8px) 12px 8px 46px;
  }

  .dtitle h1 {
    font-size: 16px;
  }

  .dprice {
    font-size: 19px;
  }

  .dstats {
    order: 4;
    width: 100%;
    overflow-x: auto;
    gap: 14px;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .dstats span {
    flex: 0 0 auto;
  }

  .dflow {
    order: 5;
    width: 100%;
  }

  .dflow .fbar {
    flex: 1;
    width: auto;
  }

  .dact {
    margin-left: auto;
  }

  .dbody {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 10px 12px calc(26px + env(safe-area-inset-bottom));
  }

  .dside {
    display: none;
  }

  .ptabs-h {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    margin-bottom: 10px;
    -webkit-overflow-scrolling: touch;
  }

  .ptabs-h .ptab {
    flex: 0 0 auto;
    border: 1px solid var(--line-2);
    background: var(--btn-bg);
    border-radius: 999px;
    padding: 5px 14px;
    font-family: inherit;
    font-size: 12px;
    color: var(--text-2);
    cursor: pointer;
  }

  .ptabs-h .ptab.on {
    background: var(--bottom-bg);
    border-color: var(--bottom);
    color: #d97a00;
    font-weight: 700;
  }

  .dmain #mainChart {
    height: 240px;
  }

  .fund-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .fin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fund-head small {
    display: none;
  }
}

/* 搜索提示 */
.search-hint {
  margin: -8px 2px 12px;
  font-size: 10.5px;
  color: var(--sub);
  line-height: 1.5;
}

/* 搜索结果两行结构 */
.si-left {
  min-width: 0;
}

.si-sub {
  font-size: 10px;
  color: var(--sub);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   主题配色面板（点击左上角 logo 打开）
   ============================================================ */
#themePanel {
  position: fixed;
  top: calc(var(--topbar-h, 66px) + 6px);
  left: 14px;
  z-index: 90;
  width: min(420px, calc(100vw - 28px));
  max-height: min(560px, calc(100vh - var(--topbar-h, 66px) - 20px));
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  padding: 12px;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

#themePanel.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.tp-head {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.tp-sub {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--sub);
}

.tp-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

@media (max-width: 640px) {
  .tp-grid { grid-template-columns: repeat(3, 1fr); }
}

.tp-item {
  border: 1.5px solid var(--line-2);
  background: var(--card);
  border-radius: 10px;
  padding: 4px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.12s ease, transform 0.12s ease;
}

.tp-item:hover {
  transform: translateY(-1px);
  border-color: var(--sub);
}

.tp-item.on {
  border-color: var(--bottom);
  box-shadow: 0 0 0 1px var(--bottom);
}

.tp-prev {
  display: block;
  height: 46px;
  border-radius: 7px;
  padding: 5px;
  overflow: hidden;
}

.tp-card {
  display: block;
  height: 100%;
  border: 1px solid;
  border-radius: 5px;
  padding: 4px 5px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tp-card i {
  display: block;
  width: 55%;
  height: 4px;
  border-radius: 2px;
}

.tp-card b {
  display: inline-block;
  width: 14px;
  height: 4px;
  border-radius: 2px;
  margin-right: 3px;
}

.tp-up { background: #e54545; }
.tp-dn { background: #12a06a; }
.tp-ac { background: #ef7d00; }

.tp-name {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  color: var(--text-2);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   宽屏固定视口：列表页超出时只滚动列表，顶部排版（tab / 筛选条）固定
   ============================================================ */
@media (min-width: 1080px) {
  html, body {
    height: 100%;
    overflow: hidden;
  }

  .page.active {
    height: calc(100vh - var(--topbar-h, 66px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 4px 0 12px;
  }

  /* 首页：上方板块固定高度，双板块撑满剩余视口（内部各自滚动），底部声明常驻可见 */
  #page-home.active {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #page-home .section {
    flex: none;
  }

  /* 板块地图：板块多（概念 294 个）一屏放不下，整页可滚——滚轮往下翻看隐藏板块
     （用户 2026-11-02 要求；宽屏 .page.active 默认 overflow:hidden，这里单独放开） */
  #page-bmap.active {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 模拟盘页：成交记录多时翻不动（2026-11-20 用户反馈）。
     宽屏 .page.active 默认 overflow:hidden，会把超出视口的成交/持仓记录裁掉且滚轮失效；
     同板块地图页放开整页纵向滚动，section 设 flex:none 防止被 flex 压缩再次截断。 */
  #page-paper.active {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #page-paper.active > .section {
    flex: none;
  }

  /* 市场动态/交易分析这一排：与上方「影响力要闻/优劣势」一排等高（用户要求）
     两排 brief-card 统一固定高度，卡片内列表各自独立滚动 */
  #page-home .section:last-of-type {
    flex: none;
    display: flex;
    flex-direction: column;
  }

  #page-home .macro-grid > .brief-card,
  #page-home .duo-grid > .brief-card {
    height: 380px;                    /* 两排卡片等高 */
  }

  #page-home .duo-grid {
    flex: none;
    min-height: 0;
    align-items: stretch;             /* 两卡等高 */
    grid-template-rows: minmax(0, 1fr); /* 行高锁定为容器高度，防止内容撑破 */
  }

  #page-home .brief-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  #page-home .brief-head {
    flex: none;
  }

  /* 卡内内容区：填满卡片剩余高度并独立滚动 */
  #page-home .news-list,
  #page-home .hot-scroll,
  #page-home .macro-list,
  #page-home .edge-body {
    flex: 1;
    min-height: 0;
    max-height: none;
  }
  /* 影响力要闻/市场动态只显示最新 10 条，卡片内不滚动（2026-11-22 用户要求） */
  #page-home .news-list,
  #page-home .macro-list {
    overflow: hidden;
  }
  /* 优劣势卡片：两组+各行按高度均分，刚好填满卡片 */
  #page-home .edge-body { display: flex; }
  #page-home .edge-grid { flex: 1 1 0; min-height: 0; }

  #page-home .disclaimer {
    flex: none;
  }

  /* 信号页：筛选条固定，只有列表滚动 */
  #filterBar {
    flex: none;
  }

  #signalList,
  #watchList,
  #wandiList,
  #cjhList,
  #allupList,
  #prepareList,
  #futList,
  #sgzList {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  /* 碗底 / 操家伙 / 5箭向上 / 期货 / 四共震页：外层 section 撑满剩余高度，标题行固定，列表内部滚动
     （2026-11-03：新增 5箭向上页漏登记，宽屏下 .page.active overflow:hidden 把 63 行全裁掉且滚轮失效）
     （2026-11-11：期货 / 四共震页同批登记，页面滚动行为与操家伙保持一致） */
  #page-wandi > .section,
  #page-cjh > .section,
  #page-allup > .section,
  #page-prepare > .section,
  #page-futures > .section,
  #page-sgz > .section {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin-top: 6px;
  }

  #page-wandi > .section > .section-head,
  #page-cjh > .section > .section-head,
  #page-allup > .section > .section-head,
  #page-prepare > .section > .section-head,
  #page-futures > .section > .section-head,
  #page-sgz > .section > .section-head,
  #page-wandi > .section > div[id$='Progress'],
  #page-cjh > .section > div[id$='Progress'],
  #page-allup > .section > div[id$='Progress'],
  #page-prepare > .section > div[id$='Progress'],
  #page-futures > .section > div[id$='Progress'],
  #page-sgz > .section > div[id$='Progress'],
  /* 四共震条件设置条固定高度，不参与列表挤压（2026-11-11） */
  #page-futures > .section > .sgz-cfg,
  #page-sgz > .section > .sgz-cfg {
    flex: none;
  }

  /* 列表滚动时表头吸顶 */
  #signalList .stk-head,
  #watchList .stk-head,
  #wandiList .stk-head,
  #cjhList .stk-head,
  #allupList .stk-head,
  #prepareList .stk-head,
  #futList .stk-head,
  #sgzList .stk-head {
    position: sticky;
    top: 0;
    z-index: 2;
  }
}

/* ============================================================
   首页双板块：市场动态（左） / 交易分析（右）
   ============================================================ */
.duo-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}

@media (min-width: 1080px) {
  .duo-grid {
    grid-template-columns: 1.05fr 1fr;
  }
}

.brief-card {
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 12px 14px 14px;
  min-width: 0;
}

.brief-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}

.brief-head h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

/* ---------- 新闻列表 ---------- */
.news-list {
  max-height: 520px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.news-item {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 5px 4px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  cursor: pointer;
}

.news-item:last-child { border-bottom: none; }
.news-item:hover { background: var(--card-2); }

.nv-dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-top: 6px;
  background: var(--sub);
}

.news-item.lv-high .nv-dot { background: var(--up); box-shadow: 0 0 0 2px rgba(229, 69, 69, 0.15); }
.news-item.lv-mid .nv-dot { background: var(--bottom); }

.nv-time {
  flex: none;
  font-size: 10.5px;
  color: var(--sub);
  font-variant-numeric: tabular-nums;
  margin-top: 1px;
}

.nv-ttl {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.news-item:hover .nv-ttl { color: var(--bottom); }

.nv-live {
  flex: none;
  font-style: normal;
  font-size: 9px;
  font-weight: 700;
  color: var(--up);
  border: 1px solid currentColor;
  border-radius: 4px;
  padding: 0.5px 3px;
  margin-top: 1px;
}

.nv-tag {
  flex: none;
  font-style: normal;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--pb);
  background: var(--pb-bg);
  border-radius: 4px;
  padding: 1px 5px;
  margin-top: 1px;
}

/* ---------- 交易分析 ---------- */
.hot-scroll {
  max-height: 560px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.hot-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  margin: 2px 0 6px;
}

.hot-title small {
  font-size: 10px;
  font-weight: 500;
  color: var(--sub);
  margin-left: 4px;
}

.hot-views {
  list-style: none;
  margin-bottom: 12px;
}

.hot-views li {
  position: relative;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-2);
  padding: 3px 0 3px 14px;
}

.hot-views li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 10px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--bottom);
}

.hb-group {
  font-size: 11px;
  font-weight: 700;
  margin: 8px 0 4px;
}

.hb-group.g-adv { color: var(--up); }
.hb-group.g-fade { color: var(--down); }

.hb-row {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 6px 10px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.hb-row.adv { border-left: 3px solid var(--up); }
.hb-row.fade { border-left: 3px solid var(--down); }

.hb-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  flex: none;
}

.hb-pct {
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  flex: none;
}

.hb-net {
  margin-left: auto;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  flex: none;
}

.hb-days {
  font-style: normal;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--up);
  background: var(--bn-bg);
  border-radius: 4px;
  padding: 0.5px 5px;
  flex: none;
}

.hb-days.new { color: var(--bottom); background: var(--bottom-bg); }
.hb-days.cool { color: var(--down); background: var(--card-2); }

/* 中段信息：宽度不足时优先收缩省略 */
.hb-breadth {
  font-size: 10px;
  color: var(--sub);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
}

.hb-leader {
  font-size: 10.5px;
  color: var(--text-2);
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 2;
}

/* 领涨股可点击（按钮重置 + 链接态） */
button.hb-leader.link {
  border: none;
  background: none;
  font-family: inherit;
  padding: 0;
  cursor: pointer;
  color: var(--text-2);
  text-align: left;
}

button.hb-leader.link:hover {
  color: var(--bottom);
  text-decoration: underline;
}

/* ============================================================
   滚动条主题化（深浅色跟随变量）
   ============================================================ */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--card-2);
}

::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 6px;
  border: 2px solid var(--card-2);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--sub);
}

::-webkit-scrollbar-corner {
  background: var(--card-2);
}

/* 桌面宽屏：流内搜索框压到与品牌同高（顶栏不加高，首页声明不被顶出视口） */
@media (min-width: 1000px) {
  #searchInput {
    padding: 7px 14px 7px 36px;
    font-size: 13.5px;
  }

  .topbar .search-icon {
    width: 15px;
  }

  /* 品牌名不换行：1080 宽下 flex 空间紧张时防止「顶底雷达」折行把顶栏撑高 */
  .topbar .brand {
    flex: none;
  }

  .brand-text {
    white-space: nowrap;
  }
}

/* 临界宽度（1000~1129）：胶囊紧凑档，确保 搜索框→胶囊→状态→导航 全都不重叠 */
@media (min-width: 1000px) and (max-width: 1129px) {
  .fund-pill {
    padding: 4px 8px;
    font-size: 11px;
  }

  .status-pill {
    padding: 4px 8px;
    font-size: 11px;
  }

  .topbar {
    gap: 12px;
  }
}

/* ============ 新闻热度火苗 + 热点风险提示 ============ */
.nv-flames {
  display: inline-flex; align-items: center; gap: 1px;
  flex: none; margin-left: 8px;
}
.nv-flames .flame path { fill: #3a3f4a; }
.nv-flames .flame.lit path { fill: #ff8a3d; }
.nv-flames.f5 .flame.lit path { fill: #ff5a3d; }
.nv-flames.f4 .flame.lit path { fill: #ff7a35; }

/* 新闻利好/利空标记（A股口径：利好红、利空绿） */
.nv-tone {
  flex: none;
  font-style: normal;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.3;
  padding: 1px 4px;
  margin-top: 1px;
  border: 1px solid transparent;
  border-radius: 4px;
  white-space: nowrap;
}
.nv-tone.bull { color: var(--up); background: rgba(229, 69, 69, .1); border-color: rgba(229, 69, 69, .3); }
.nv-tone.bear { color: var(--down); background: rgba(18, 160, 106, .1); border-color: rgba(18, 160, 106, .3); }
.nv-tone.flat { color: var(--sub); background: rgba(140, 150, 160, .1); border-color: var(--line-2); }
.mi-meta .nv-tone { margin-top: 0; font-size: 10px; }

/* 信号列表表头排序箭头 */
.stk-head .th-sort { cursor: pointer; user-select: none; }
.stk-head .th-sort:hover { color: var(--text); }
.stk-head .th-sort .sa {
  font-style: normal; font-size: 9px; margin-left: 2px;
  opacity: 0.4; vertical-align: 1px;
}
.stk-head .th-sort.on { color: var(--acc, #e8a33d); }
.stk-head .th-sort.on .sa { opacity: 1; }

/* ---------------- 图片识股 ---------------- */
.ocr-btn {
  width: 30px;
  height: 30px;
  margin-right: 4px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--sub);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  transition: background 0.15s, color 0.15s;
}

.ocr-btn:hover {
  background: var(--card-2);
  color: var(--text);
}

.ocr-btn svg {
  width: 19px;
  height: 19px;
}

.ocr-sheet {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(10, 12, 16, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s;
}

.ocr-sheet.open {
  opacity: 1;
  visibility: visible;
}

.ocr-inner {
  width: min(640px, calc(100vw - 48px));
  max-height: min(80vh, 740px);
  overflow-y: auto;
  background: var(--card, #fff);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  transform: translateY(14px) scale(0.98);
  transition: transform 0.22s ease;
}

.ocr-sheet.open .ocr-inner {
  transform: none;
}

.ocr-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}

.ocr-head b {
  font-size: 16.5px;
}

.ocr-sub {
  font-size: 11.5px;
  color: var(--sub);
  flex: 1;
}

.ocr-close {
  width: 30px;
  height: 30px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex: none;
}

.ocr-close svg {
  width: 15px;
  height: 15px;
}

.ocr-drop {
  border: 1.5px dashed var(--line, #c9ced6);
  border-radius: 14px;
  padding: 34px 20px 26px;
  text-align: center;
  color: var(--text-2);
  transition: border-color 0.15s, background 0.15s;
}

.ocr-drop.drag {
  border-color: var(--acc, #e8a33d);
  background: rgba(232, 163, 61, 0.06);
}

.ocr-drop svg {
  width: 46px;
  height: 46px;
  color: var(--sub);
  margin-bottom: 10px;
}

.ocr-drop p {
  font-size: 13.5px;
  margin-bottom: 14px;
}

.ocr-drop small {
  display: block;
  margin-top: 14px;
  font-size: 11px;
  color: var(--sub);
}

.ocr-progress {
  margin-top: 16px;
}

.ocr-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--line, #e5e7eb);
  overflow: hidden;
}

.ocr-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 4px;
  background: var(--acc, #e8a33d);
  transition: width 0.2s;
}

.ocr-progress span {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--sub);
  text-align: center;
}

.ocr-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2px 0 10px;
  font-size: 13px;
  color: var(--text-2);
}

.ocr-list {
  max-height: 46vh;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.ocr-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  cursor: pointer;
}

.ocr-row:hover {
  background: var(--card-2);
}

.ocr-row + .ocr-row {
  border-top: 1px solid var(--line);
}

/* 识别原文：先出文字、再对名称，方便核对 */
.ocr-raw {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-2);
  padding: 8px 12px;
}

.ocr-raw summary {
  cursor: pointer;
  font-size: 12.5px;
  color: var(--sub);
  list-style: none;
}

.ocr-raw summary::-webkit-details-marker {
  display: none;
}

.ocr-raw summary::before {
  content: '▸ ';
}

.ocr-raw[open] summary::before {
  content: '▾ ';
}

.ocr-raw pre {
  margin: 8px 0 2px;
  max-height: 22vh;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-2);
}

/* ============ 模拟盘（虚拟交易） ============ */
/* 纯本地虚拟资金，不接券商。用于验证信号策略效果 */

.paper-warn {
  background: rgba(255, 168, 38, 0.12);
  border: 1px solid rgba(255, 168, 38, 0.32);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-2);
  margin-bottom: 12px;
}

.paper-warn b {
  color: #b26a00;
}

.paper-summary {
  margin-bottom: 12px;
}

.psum-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.psum-item {
  background: var(--card);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.psum-item span {
  font-size: 10.5px;
  color: var(--sub);
}

.psum-item b {
  font-size: 15px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.paper-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.paper-tab {
  appearance: none;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 500;
  padding: 5px 15px;
  border-radius: 100px;
  cursor: pointer;
}

.paper-tab.active {
  background: var(--text);
  border-color: var(--text);
  color: var(--card);
}

/* 三个子页各自的容器布局：持仓单列、成交两列、设置单列窄板 */
/* 注意：全局 .list 在宽屏带 align-items:start，这里必须显式改回 stretch，
   否则 flex 子项按内容宽度收缩（2026-10-23 踩过：持仓卡只有一半宽） */
#paperBody.pos-list {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
}

#paperBody.trade-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: stretch;
}

#paperBody.set-list {
  display: block;
}

@media (max-width: 1079px) {
  #paperBody.trade-grid {
    grid-template-columns: 1fr;
  }
}

/* 持仓行：名称 | 四列数据 | 弹性空白 | 盈亏 | 按钮 */
.prow {
  display: grid;
  grid-template-columns: minmax(120px, 180px) max-content 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  background: var(--card);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.prow-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.prow-main b {
  font-size: 13.5px;
  font-weight: 600;
}

/* 模拟盘持仓/成交行：名称区可点进详情（2026-11-04） */
.prow-main.link,
.trow-main.link {
  cursor: pointer;
  border-radius: 6px;
  align-self: stretch;
}
.prow-main.link:hover b,
.trow-main.link:hover b {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.prow-code,
.prow-dim,
.trow-dim {
  font-size: 10.5px;
  color: var(--sub);
}

.prow-src {
  display: inline-block;
  margin-top: 2px;
  font-size: 10px;
  color: var(--text-2);
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  padding: 1px 5px;
  align-self: flex-start;
}

.prow-mid {
  display: grid;
  /* 6 列：股数 / 成本 / 现价 / 市值 / 持有天数 / 移动止损（2026-11-17 新增止损列） */
  grid-template-columns: repeat(6, minmax(70px, 104px));
  justify-content: start;
  gap: 4px 18px;
  font-size: 11.5px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.prow-mid > span {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* T+1 锁定（2026-11-19）：股数在上、当日锁定提示在下；列窄，同样要避开 ellipsis 裁切 */
.prow-qty {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: visible;
  font-variant-numeric: tabular-nums;
}
.prow-qty .prow-lock {
  font-style: normal;
  font-weight: 600;
  font-size: 10px;
  color: #b8790f;
}
.prow-btn.t1-lock {
  color: var(--sub);
  border-style: dashed;
}
.prow-btn.t1-lock:hover {
  border-color: #b8790f;
  color: #b8790f;
}

/* 移动止损（2026-11-17）：止损价在上、距现价余量在下（列窄，一行放不下会被省略号截断） */
.prow-stop {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.3;
  color: #c0392b;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: visible;
}
.prow-stop em {
  font-style: normal;
  font-weight: 500;
  font-size: 10px;
  color: var(--sub);
}

.prow-pnl {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 84px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.prow-pnl b {
  font-size: 14px;
  font-weight: 650;
}

.prow-pnl span {
  font-size: 11px;
}

.prow-btn {
  appearance: none;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 100px;
  cursor: pointer;
  flex: none;
}

.prow-btn:hover {
  border-color: var(--up);
  color: var(--up);
}

/* 成交行 */
.trow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--card);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.trow-main {
  display: flex;
  flex-direction: column;
  min-width: 96px;
}

.trow-main b {
  font-size: 13px;
  font-weight: 600;
}

.trow-mid {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  font-size: 11.5px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.trow-side {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 4px;
}

.trow-side.buy {
  color: var(--up);
  background: rgba(229, 69, 69, 0.1);
}

.trow-side.sell {
  color: var(--down);
  background: rgba(18, 160, 106, 0.1);
}

.trow-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-variant-numeric: tabular-nums;
}

.trow-right b {
  font-size: 13.5px;
  font-weight: 650;
}

.trow-right span {
  font-size: 11.5px;
  color: var(--text-2);
}

/* 成交页：一只股票一张表格（2026-11-24）。左侧买卖明细，右侧最终收益整列跨行 */
#paperBody.trade-card-list {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.tcard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 168px;
  background: var(--card);
  border-radius: 11px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tcard-main { min-width: 0; }

.tcard-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
}

.tcard-name {
  display: flex;
  align-items: baseline;
  gap: 8px;
  cursor: pointer;
}
.tcard-name b {
  font-size: 13.5px;
  font-weight: 650;
}
.tcard-name:hover b {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* 多轮交易的轮次标记：清仓后又建仓就分一张表（2026-11-24） */
.tcard-round {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--brand);
  background: rgba(185, 52, 52, 0.09);
  padding: 1px 7px;
  border-radius: 4px;
}

.tcard-state {
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 4px;
}
.tcard-state.holding {
  color: var(--up);
  background: rgba(229, 69, 69, 0.1);
}
.tcard-state.closed {
  color: var(--text-2);
  background: rgba(140, 150, 160, 0.12);
}

.tcard-meta {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--sub);
}

/* 表头与数据行共用同一套列模板，保证逐列对齐 */
.tt-head, .tt-row {
  display: grid;
  grid-template-columns: 88px 52px 76px 76px 104px 104px minmax(90px, 1fr);
  gap: 8px;
  align-items: center;
  padding: 6px 14px;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.tt-head {
  font-size: 10.5px;
  color: var(--sub);
  background: rgba(140, 150, 160, 0.06);
}
.tt-row + .tt-row { border-top: 1px dashed var(--line); }
.tt-row .trow-side { display: inline-block; font-style: normal; }
.tt-pnl { display: flex; flex-direction: column; line-height: 1.25; }
.tt-pnl em { font-size: 9.5px; font-style: normal; opacity: 0.8; }
.tt-when { color: var(--text-2); }
.tt-reason {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tcard-final {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border-left: 1px solid var(--line);
  background: rgba(140, 150, 160, 0.05);
  text-align: center;
}
.tf-label { font-size: 10.5px; color: var(--sub); }
.tf-val {
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.tf-pct {
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-top: -3px;
}
.tf-sub {
  font-size: 10.5px;
  color: var(--sub);
  font-variant-numeric: tabular-nums;
}
.tf-sub i { font-style: normal; font-weight: 650; }

@media (max-width: 1079px) {
  /* 窄屏：最终收益挪到卡片顶部整行，表格独占一行横向自适应 */
  .tcard { grid-template-columns: 1fr; }
  .tcard-final {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px 14px;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 8px 14px;
  }
  .tf-val { font-size: 15px; }
  .tt-head, .tt-row { grid-template-columns: 78px 48px 68px 68px 90px 88px minmax(70px, 1fr); gap: 6px; padding: 6px 10px; }
}

/* 设置 */
.pset {
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 12px 16px;
  max-width: 720px;
}

.pset-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-2);
}

.pset-row:last-of-type {
  border-bottom: none;
}

/* 复选框行（移动止损开关，2026-11-17）：label 里再套一个 label 时保持横排 */
.pset-chk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  width: auto !important;
  min-width: 0;
  flex: 1 1 auto;
  text-align: left !important;
}
.pset-chk input[type='checkbox'] {
  width: 14px;
  height: 14px;
  accent-color: var(--brand);
  cursor: pointer;
}

.pset-row label {
  font-size: 12.5px;
  color: var(--text-2);
  min-width: 96px;
  flex: none;
}

.pset-row select,
.pset-row input[type='number'],
.pset-row input[type='text'] {
  appearance: none;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  padding: 5px 9px;
  border-radius: 7px;
  min-width: 120px;
}
/* 飞书 Webhook 输入框（2026-12-04）：长地址要能撑满整行 */
.pset-row input[type='text']#psFsWebhook,
.pset-row input[type='text']#psFsSecret { flex: 1; min-width: 0; width: 100%; }

.pset-srcs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pset-chk {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: var(--text);
  border: 1px solid var(--line-2);
  border-radius: 100px;
  padding: 4px 11px 4px 8px;
  cursor: pointer;
}

.pset-chk input {
  margin: 0;
}

.pset-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.pset-btn {
  appearance: none;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 500;
  padding: 7px 15px;
  border-radius: 100px;
  cursor: pointer;
}

.pset-btn.primary {
  background: var(--text);
  border-color: var(--text);
  color: var(--card);
}

.pset-btn.danger {
  border-color: var(--up);
  color: var(--up);
}

.pset-note {
  margin-top: 9px;
  font-size: 11px;
  color: var(--sub);
  line-height: 1.6;
}

/* 模拟盘窄屏适配（放在基础规则之后，否则同优先级会被覆盖） */
@media (max-width: 1180px) {
  .prow {
    grid-template-columns: minmax(96px, 140px) minmax(0, 1fr) auto auto;
    gap: 12px;
  }
  .prow-mid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px 10px;
  }
}

@media (max-width: 900px) {
  .prow-mid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .prow-mid > span:nth-child(4) {
    display: none; /* 窄屏藏掉「市值」一列，避免挤压名称 */
  }
}

@media (max-width: 760px) {
  .psum-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============ 详情页一键交易（模拟盘） ============ */
.dmain-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  /* 2026-11-17：工具栏搬上来后一行可能放不下（股票页还有一键买卖），
     让它整组换行，绝不压缩周期胶囊（压缩会把「收起」挤没） */
  flex-wrap: wrap;
  row-gap: 8px;
  margin-bottom: 10px;
}

.dmain-top .ptabs-h {
  margin-bottom: 0;
  flex: 0 0 auto;
  min-width: 0;
}

/* 顶部行右侧组：一键买卖 + 主图工具栏（2026-11-17）
   整组贴右；放不下时组内先换行（一键买卖在上、工具栏在下），
   绝不压缩左侧周期胶囊（压缩会把「收起」挤没） */
.dright {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px 10px;
  flex: 1 1 auto;
  min-width: 0;
}

/* 主图工具栏（＋ − 均线 布林 海龟 画线 清除线）
   用户 2026-11-17：原来贴在 .chart-head 右侧，内容区一滚就看不见了；
   现在挂在顶部周期胶囊同一行右端（.dmain-top 固定在滚动容器外，不随内容滚走） */
.dtools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 0 0 auto;
}

.dquick {
  display: flex;
  gap: 6px;
  flex: none;
}

.dquick .mini-btn {
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 13px;
  border-radius: 8px;
}

.dquick .qbuy {
  color: var(--up);
  border-color: rgba(229, 69, 69, 0.45);
  background: rgba(229, 69, 69, 0.08);
}

.dquick .qbuy:hover {
  background: var(--up);
  border-color: var(--up);
  color: #fff;
}

.dquick .qsell {
  color: var(--down);
  border-color: rgba(18, 160, 106, 0.45);
  background: rgba(18, 160, 106, 0.08);
}

.dquick .qsell:hover {
  background: var(--down);
  border-color: var(--down);
  color: #fff;
}

@media (max-width: 820px) {
  .dquick .mini-btn {
    padding: 4px 9px;
    font-size: 11px;
  }
}

/* 设置页：一键交易参数分组 */
.pset-sep {
  margin: 14px 0 2px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-2);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.2px;
}

.pset-hint {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.65;
  color: var(--sub);
}

.pset-row input[type='number']:disabled {
  opacity: 0.45;
}

/* 窄屏：周期胶囊 + 一键交易换行，否则「收起」会被挤掉 */
@media (max-width: 1024px) {
  .dmain-top {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .dmain-top .ptabs-h {
    flex: 1 1 100%;
  }
  /* 右侧组（一键买卖 + 工具栏）独占一行，仍在右端 */
  .dright {
    flex: 1 1 100%;
    margin-left: 0;
  }
  .dquick {
    justify-content: flex-end;
  }
}

/* ============ 板块K线页（2026-11-01 新增） ============ */
/* 三个标签（概念/风格/指数）用胶囊，和模拟盘子页签同一视觉语言 */
.bk-kinds { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.bk-kind {
  appearance: none; border: 1px solid var(--line-2); background: transparent;
  color: var(--text-2); font-size: 12.5px; font-weight: 500;
  padding: 6px 16px; border-radius: 100px; cursor: pointer;
}
.bk-kind.on { background: var(--text); border-color: var(--text); color: var(--card); }

/* 搜索 + 周期切换 */
.bk-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.bk-search {
  flex: 1 1 auto; min-width: 0; height: 32px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--card); color: var(--text); font-size: 13px; outline: none;
}
.bk-search:focus { border-color: var(--text-2); }
.bk-periods { display: flex; gap: 4px; flex: 0 0 auto; }
.bk-p {
  appearance: none; border: 1px solid var(--line-2); background: transparent;
  color: var(--text-2); font-size: 12.5px; padding: 5px 12px; border-radius: 8px; cursor: pointer;
}
.bk-p.on { background: var(--card-2); border-color: var(--text-2); color: var(--text); font-weight: 600; }

/* 左列表 + 右图 */
.bk-wrap { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 12px; align-items: start; }
.bk-list { display: flex; flex-direction: column; gap: 3px; max-height: 560px; overflow-y: auto; padding-right: 4px; }
/* flex:0 0 auto 关键——否则 375 行被 flex-shrink 压进 560px 容器，
   每行剩 16px 导致文字削顶、滚动失效（2026-11-01 修复） */
.bk-item {
  flex: 0 0 auto;
  appearance: none; text-align: left; border: 1px solid transparent; background: transparent;
  color: var(--text-2); font-size: 13px; line-height: 20px; padding: 7px 10px; border-radius: 9px; cursor: pointer;
  display: flex; align-items: center; gap: 8px; width: 100%;
}
.bk-item .bk-name { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 当日涨跌，右对齐；涨红跌绿沿用全局 .up/.down */
.bk-item .bk-pct { flex: 0 0 auto; margin-left: auto; font-size: 12px; font-variant-numeric: tabular-nums; min-width: 46px; text-align: right; }
.bk-item:hover { background: var(--card-2); }
.bk-item.on { background: var(--card-2); border-color: var(--line-2); color: var(--text); font-weight: 600; }

.bk-chartbox {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px 8px;
}
/* 右列：K线 + 成分股纵排 */
.bk-right { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.bk-chart-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.bk-chart-head b { font-size: 15px; color: var(--text); }
.bk-chart-head span { font-size: 12px; color: var(--sub); }
/* 图表右上角工具区：均线/BOLL 开关 + K线缩放（2026-11-01 用户要求） */
.bk-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.bk-tog {
  appearance: none; border: 1px solid var(--line-2); background: transparent;
  color: var(--text-2); font-size: 12px; padding: 3px 10px; border-radius: 100px; cursor: pointer;
}
.bk-tog.on { background: var(--text); border-color: var(--text); color: var(--card); font-weight: 600; }
.bk-zoom { display: flex; gap: 2px; margin-left: 2px; }
.bk-zoom button {
  appearance: none; border: 1px solid var(--line-2); background: transparent;
  color: var(--text-2); font-size: 13px; line-height: 1; width: 24px; height: 24px;
  border-radius: 7px; cursor: pointer; padding: 0;
}
.bk-zoom button:first-child { border-radius: 7px 0 0 7px; }
.bk-zoom button:last-child { border-radius: 0 7px 7px 0; border-left: none; }
.bk-zoom button:hover { background: var(--card-2); color: var(--text); }
/* 涨跌幅排序按钮（搜索条右侧） */
.bk-sort {
  appearance: none; border: 1px solid var(--line-2); background: transparent;
  color: var(--text-2); font-size: 12.5px; padding: 5px 12px; border-radius: 8px; cursor: pointer;
  flex: 0 0 auto;
}
.bk-sort.on { background: var(--card-2); border-color: var(--text-2); color: var(--text); font-weight: 600; }
#boardChart { display: block; width: 100%; height: 380px; }

/* 成分股列表（K线下方） */
.bk-cons {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px;
}
.bk-cons-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; font-size: 13px; }
.bk-cons-head b { font-size: 13.5px; color: var(--text); }
.bk-cons-head .up, .bk-cons-head .down { font-size: 12px; }
.bk-cons-note { font-size: 11.5px; color: var(--sub); }
.bk-cons-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px; }
.bc-item {
  appearance: none; border: 1px solid transparent; background: transparent;
  display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 8px;
  cursor: pointer; text-align: left;
}
.bc-item:hover { background: var(--card-2); border-color: var(--line); }
.bc-item .bc-nm {
  flex: 1 1 auto; min-width: 0; font-size: 12.5px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bc-item .bc-pct { flex: 0 0 auto; font-size: 12px; font-variant-numeric: tabular-nums; }

@media (max-width: 720px) {
  .bk-wrap { grid-template-columns: 1fr; }
  .bk-list { flex-direction: row; flex-wrap: wrap; max-height: 128px; }
  #boardChart { height: 280px; }
}

/* ============ 板块地图（2026-11-02，对标通达信板块地图） ============ */
.bmap-tabs {
  display: flex; gap: 8px; margin: 6px 0 10px; align-items: center; flex-wrap: wrap;
}
.bmap-tab {
  padding: 5px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg-1); color: var(--text-2); font-size: 13px; cursor: pointer;
}
.bmap-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

/* MA5 / MA20 走势排序（标签行右侧，用户 2026-11-02） */
.bmap-sort { margin-left: auto; display: flex; align-items: center; gap: 3px; }
/* 板块排序控件里的 MA5/MA20 小字标签（与已删除的 B/S 做T徽标无关） */
.bs-tag { font-size: 11px; color: var(--text-3); margin: 0 1px 0 8px; }
.bs-btn {
  appearance: none; border: 1px solid var(--line-2); background: transparent;
  color: var(--text-2); font-size: 12px; line-height: 1; min-width: 22px; height: 22px;
  border-radius: 6px; cursor: pointer; padding: 0 4px;
}
.bs-btn:hover { color: var(--text); border-color: var(--text-2); }
.bs-btn.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }

/* 格子内 MA5（左）/ MA20（右）方向箭头：颜色随格子底色，形状表方向，悬停看口径 */
/* MA 方向箭头（SVG）：笔画粗、圆头，明显比原来的文字箭头醒目（用户 2026-11-02 要求粗 3 倍以上） */
.bmap-cell .maa {
  font-style: normal;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  opacity: 0.95;
  flex: 0 0 auto;
}
.bmap-cell .maa svg { width: 100%; height: 100%; display: block; overflow: visible; }
.bmap-cell .maa svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.1;      /* 默认细箭头（≈1.3px，与原来文字符号粗细一致） */
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* 只有「强势向上 ↑」加粗（用户 2026-11-02 明确：只要向上的箭头粗） */
.bmap-cell .maa.up2 svg path { stroke-width: 3.2; }
.bmap-cell .maa.na { visibility: hidden; }
.bmap-cell .pct { padding: 0 1px; }
/* 日K箭头组与周K箭头组之间的细分隔线（用户 2026-11-02：左两个日K、右两个周K） */
.bmap-cell .msep {
  width: 1px;
  height: 10px;
  border-radius: 1px;
  background: currentColor;
  opacity: 0.35;
  margin: 0 3px;
  flex: 0 0 auto;
}

.bmap-legend {
  display: flex; align-items: center; gap: 3px; margin: 0 0 10px;
  font-size: 11px; color: var(--text-3); flex-wrap: wrap;
}
.bmap-legend .lg { width: 22px; height: 12px; border-radius: 2px; display: inline-block; }
.bmap-legend em { font-style: normal; margin-left: 10px; }

.bmap-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 4px; align-content: start;
}
.bmap-cell {
  border: none; border-radius: 4px; padding: 6px 6px 5px; cursor: pointer;
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  font-size: 12px; line-height: 1.25; min-height: 46px; justify-content: center;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.bmap-cell:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,0.14); z-index: 1; }
.bmap-cell b { font-weight: 600; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 名称行里的名字：与排名紧贴，过长时右端渐变淡出（用户 2026-11-06：被排名盖住的部分做渐变隐藏） */
.bmap-cell .nm b { flex: 0 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: clip; }
.bmap-cell .nm b.fade {
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 13px), transparent 100%);
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 13px), transparent 100%);
}
.bmap-cell i { font-style: normal; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 2px; }

/* 名称行：名字靠左、排名右缘与第二行最右箭头对齐（宽度由 JS 设成箭头行宽度，用户 2026-11-06） */
.bmap-cell .nm {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 3px; width: 100%; min-width: 0;
}
/* 近三日排名（今·昨·前日）：连续靠前=红、连续靠后=绿 */
.bmap-cell .rk {
  font-size: 10px; font-weight: 700; flex: 0 0 auto;
  font-variant-numeric: tabular-nums; letter-spacing: -0.3px; line-height: 1.1;
}
.bmap-cell .rk.rk-up { color: #d81e06; }
.bmap-cell .rk.rk-dn { color: #0a8f4d; }

/* 涨跌 11 档热力（中国习惯红涨绿跌） */
.bmap-cell.r1 { background: #fdeceb; } .bmap-cell.r2 { background: #f9d4d1; }
.bmap-cell.r3 { background: #f2a8a3; } .bmap-cell.r4 { background: #e9756e; }
.bmap-cell.r5 { background: #d94a42; }
.bmap-cell.g1 { background: #e7f5ee; } .bmap-cell.g2 { background: #c9e9da; }
.bmap-cell.g3 { background: #9dd7bf; } .bmap-cell.g4 { background: #62bd95; }
.bmap-cell.g5 { background: #2e9969; }
.bmap-cell.g0 { background: #f0f1f3; }
.bmap-cell { color: #47181a; }
.bmap-cell i { opacity: 0.92; }
.bmap-cell.r1 { color: #8f2019; } .bmap-cell.r2 { color: #8f2019; } .bmap-cell.r3 { color: #6d1410; }
.bmap-cell.r4, .bmap-cell.r5 { color: #fff; }
.bmap-cell.g1 { color: #0d5c3c; } .bmap-cell.g2 { color: #0d5c3c; } .bmap-cell.g3 { color: #084229; }
.bmap-cell.g4, .bmap-cell.g5 { color: #fff; }
.bmap-cell.g0 { color: var(--text-2); }

/* 深色主题跟随：底色降饱和、文字亮色 */
@media (prefers-color-scheme: dark) {
  .bmap-cell.r1 { background: #4a201e; color: #ffb4ae; }
  .bmap-cell.r2 { background: #6b2723; color: #ffc9c5; }
  .bmap-cell.r3 { background: #93342e; color: #ffe0de; }
  .bmap-cell.r4 { background: #c04a41; color: #fff; }
  .bmap-cell.r5 { background: #e05a4f; color: #fff; }
  .bmap-cell.g1 { background: #1c4034; color: #9fdcc2; }
  .bmap-cell.g2 { background: #205a45; color: #b8e8d2; }
  .bmap-cell.g3 { background: #1f7a56; color: #d8f5e8; }
  .bmap-cell.g4 { background: #219967; color: #fff; }
  .bmap-cell.g5 { background: #17b573; color: #fff; }
  .bmap-cell.g0 { background: #2a2d33; color: var(--text-2); }
}

/* 图例色块 */
.lg.r1{background:#fdeceb}.lg.r2{background:#f9d4d1}.lg.r3{background:#f2a8a3}.lg.r4{background:#e9756e}.lg.r5{background:#d94a42}
.lg.g1{background:#e7f5ee}.lg.g2{background:#c9e9da}.lg.g3{background:#9dd7bf}.lg.g4{background:#62bd95}.lg.g5{background:#2e9969}
.lg.g0{background:#f0f1f3}

/* 板块成分股弹层 */
.bmap-comp {
  background: var(--bg-1); border-radius: 12px; width: min(560px, 92vw);
  max-height: 78vh; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 12px 48px rgba(0,0,0,0.25);
}
.bmap-comp-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.bmap-comp-head b { font-size: 15px; }
.bmap-comp-head span { flex: 1; font-size: 12px; color: var(--text-3); }
.bmap-comp-list { overflow-y: auto; padding: 6px 0; }
.bc-row {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 8px 16px; border: none; background: none;
  cursor: pointer; font-size: 13px; color: var(--text-1); text-align: left;
}
.bc-row:hover { background: var(--bg-2); }
.bc-nm { font-weight: 500; }
.bc-nm .bc-cd { font-style: normal; color: var(--text-3); font-size: 11px; margin-left: 6px; }
.bc-pct { font-variant-numeric: tabular-nums; font-weight: 700; }
.bc-pct.up { color: var(--up); }
.bc-pct.down { color: var(--down); }

/* ============ 板块详情页（2026-11-02，点板块地图跳转；左成分股行情表 / 右板块走势） ============ */
.bd-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0 10px;
  flex-wrap: wrap;
}
.bd-head .bd-back { padding: 5px 12px; font-size: 12.5px; }
.bd-name { font-size: 17px; font-weight: 700; }
.bd-pct { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bd-pct.up { color: var(--up); }
.bd-pct.down { color: var(--down); }
.bd-trends { display: flex; gap: 10px; font-size: 12px; }
.bd-tr {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  background: var(--bg-1); border: 1px solid var(--line);
  color: var(--text-2); font-variant-numeric: tabular-nums;
}
.bd-tr i { font-style: normal; font-size: 10.5px; color: var(--sub); }
.bd-meta { margin-left: auto; font-size: 12px; color: var(--sub); }

.bd-main {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.bd-left {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 8px 6px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 232px);
  min-height: 420px;
}
.bd-left-head { display: flex; align-items: center; gap: 10px; padding: 0 8px 8px; }
.bd-left-head b { font-size: 13px; }
.bd-count { font-size: 11.5px; color: var(--sub); font-variant-numeric: tabular-nums; }
.bd-sort { margin-left: auto; display: flex; gap: 4px; }
.bd-sort button {
  border: 1px solid var(--line);
  background: var(--bg-1);
  color: var(--text-2);
  font-size: 11.5px;
  font-family: inherit;
  padding: 3px 9px;
  border-radius: 999px;
  cursor: pointer;
}
.bd-sort button.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

.bd-thead,
.bd-row {
  display: grid;
  /* 名称/代码同行后名称列收窄；走势列给足 5 个箭头（5×11px + 4px 间隔 ≈ 60px），
     以前只有 56px 会把最后一个箭头裁掉（用户 2026-11-02 要求走势全部显示）；
     第 8 列换成「安全比率」（折价率，如 12.3%）比量比宽，给 0.72fr */
  grid-template-columns: minmax(104px, 1.35fr) 62px 0.78fr 0.85fr 0.95fr 0.95fr 0.62fr 0.72fr 1fr;
  align-items: center;
  gap: 4px;
}
.bd-thead {
  font-size: 11px;
  color: var(--sub);
  padding: 0 10px 6px;
  border-bottom: 1px solid var(--line);
}
.bd-thead span:not(:first-child) { text-align: right; }
.bd-rows { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.bd-row {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--line);
  background: none;
  font-family: inherit;
  font-size: 12px;
  color: var(--text);
  padding: 4px 10px; /* 名称/代码同行后行高减半，一屏多看好几只（用户 2026-11-02） */
  cursor: pointer;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.bd-row:hover { background: rgba(127, 127, 127, 0.08); }
/* 名称 + 代码同一行：名称在前、代码紧随（灰色小字），超长只截名称 */
.bd-row .r-nm {
  text-align: left;
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
}
.bd-row .r-nm b {
  font-weight: 600;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.bd-row .r-nm i { font-style: normal; font-size: 10.5px; color: var(--sub); flex: none; }
.bd-row .up { color: var(--up); }
.bd-row .down { color: var(--down); }

.bd-right {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bd-chart-head { display: flex; align-items: baseline; gap: 10px; padding: 0 8px; }
.bd-chart-head b { font-size: 13px; }
.bd-chart-head span { margin-left: auto; font-size: 11.5px; color: var(--sub); font-variant-numeric: tabular-nums; }
/* 板块K线高度 2026-12-04：用户要求缩小 1/3（原 calc(100vh-320px)/min 360px → 0.667 倍/min 240px） */
#bdChart { width: 100%; height: calc((100vh - 320px) * 0.667); min-height: 240px; display: block; }
.bd-note { font-size: 10.5px; color: var(--sub); text-align: center; }

@media (max-width: 1000px) {
  .bd-main { grid-template-columns: minmax(0, 1fr); }
  .bd-left { height: 440px; min-height: 0; }
  #bdChart { height: 200px; min-height: 0; }
  .bd-meta { display: none; }
}

/* 宽屏：板块详情内容边框与 APP 边缘统一留 20px，左右两卡底部对齐撑满（用户 2026-11-02 要求：
   原来左卡 100vh-232px / 右图 100vh-320px 两套魔数，底部差一截且互相不齐，下面空一大块） */
@media (min-width: 1080px) {
  #page-bdetail.active {
    /* .app 宽屏自带 24px 内边距，负 margin 抵掉 4px → 内容距窗口边缘正好 20px */
    margin: 0 -4px;
    padding: 2px 0 20px;
  }
  #page-bdetail .bd-section {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin-top: 0;
  }
  #page-bdetail .bd-main {
    flex: 1 1 auto;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr); /* 行高直接吃满容器，两卡同高同底 */
    align-items: stretch;
  }
  #page-bdetail .bd-left { height: auto; min-height: 0; }
  #page-bdetail .bd-right { min-height: 0; }
  /* 宽屏下原为 flex 撑满（实测 295px），用户要求缩 1/3 → 固定 197px，不再吃满剩余高度 */
  #page-bdetail #bdChart { height: 197px; flex: 0 0 197px; min-height: 0; }
}

/* ============================================================
   ≥1080：顶栏单行（2026-11-03 第二版）
   1.34.0 曾让 topbar-right 换行到第二行放胶囊；用户后来要求
   「时钟缩小、胶囊还是放到上面中间」：时钟降到与品牌文字等高后，
   第一行中间腾出空间，胶囊移入 .topbar-mid 居中，顶栏恢复单行，
   第二行取消。顶栏实际高度仍由 app.js 的 syncTopbarHeight()
   动态写入 --topbar-h，行数变化不会裁掉底部。
   ============================================================ */
@media (min-width: 1080px) {
  .topbar-search { margin: 0 10px; }

  .fund-pills { display: flex; }
}

/* 收盘状态在 ≥1200 才回第一行：1080~1199 让位给胶囊（沿用旧隐藏规则），
   否则一行放不下又把顶栏挤成两行 */
@media (min-width: 1200px) {
  .status-pill { display: flex; }
}

/* 1080~1399：第一行放不下 品牌+搜索+胶囊+状态（导航收窄后仍占 538px，
   实测 1400 宽时中间只剩 ~233px 刚好装下胶囊+状态，再窄必撞导航），
   中间容器整体换到第二行靠左（等同 1.34.0 的两行方案），≥1400 才真正单行 */
@media (min-width: 1080px) and (max-width: 1399px) {
  .topbar {
    flex-wrap: wrap;
    row-gap: 8px;
    padding-bottom: 10px;
  }

  .topbar-mid {
    order: 10;
    flex-basis: 100%;
  }
}

/* 1080~1199 紧凑档：时钟/搜索框收窄，保证 品牌+搜索+胶囊+状态 一行放得下
   （右上导航占 460px，1080 宽只剩 ~600px 给左侧四件） */
@media (min-width: 1080px) and (max-width: 1199px) {
  .brand-clock { font-size: 15px; }
  .topbar-search {
    flex-basis: 150px;
    width: 150px;
    max-width: 150px;
    margin: 0 6px;
  }
  .topbar { column-gap: 6px; }
}

/* ============================================================
   商业化：试用徽标 / 付费墙 / 升级弹层（2026-11-05）
   ============================================================ */
.lic-pill {
  color: var(--bottom);
  border-color: var(--bottom);
}
.lic-pill.on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.lic-pill.warn {
  color: #9a6700;
  border-color: #d4a72c;
  background: #fff7e0;
}
.upd-pill {
  border-color: var(--up, var(--bottom));
  color: var(--up, var(--bottom));
  animation: upd-pulse 1.6s ease-in-out infinite;
}
.upd-pill b { font-weight: 700; }
@keyframes upd-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.primary-btn {
  appearance: none;
  border: none;
  background: var(--brand);
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 20px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.12s ease;
}
.primary-btn:hover { filter: brightness(1.08); }
.primary-btn:disabled { opacity: 0.6; cursor: progress; }

.paywall {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.paywall[hidden] { display: none; }

.paywall-card {
  position: relative;
  width: min(460px, 92vw);
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 30px 28px 24px;
  text-align: center;
  color: var(--text);
}
.paywall-close {
  position: absolute;
  top: 12px;
  right: 14px;
  appearance: none;
  border: none;
  background: transparent;
  color: var(--sub);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
}
.paywall-close:hover { color: var(--text); background: var(--card-2); }
.paywall-close[hidden] { display: none; }
.paywall-icon { font-size: 44px; line-height: 1; margin-bottom: 10px; }
.paywall-card h2 { margin: 0 0 8px; font-size: 20px; }
.paywall-sub { margin: 0 0 18px; color: var(--sub); font-size: 13px; line-height: 1.7; }
.paywall-term {
  margin: -8px 0 16px; padding: 8px 12px; border-radius: 10px;
  background: var(--card-2); color: var(--text-2); font-size: 12.5px; line-height: 1.6;
}
.paywall-term[hidden] { display: none; }
.paywall-steps {
  text-align: left;
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pw-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-2);
}
.pw-step b {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.paywall-actions { display: flex; flex-direction: column; gap: 12px; }
.paywall-actions .primary-btn { width: 100%; padding: 11px 0; }
.pw-act { display: flex; flex-direction: column; gap: 8px; }
.pw-act .primary-btn { width: 100%; padding: 11px 0; }
.pw-act input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line-2);
  background: var(--bottom-bg, var(--card-2));
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  letter-spacing: 1px;
  text-align: center;
  padding: 12px 14px;
  border-radius: 10px;
  outline: none;
}
.pw-act input:focus { border-color: var(--brand); }
.paywall-mid { margin: 16px 0 0; font-size: 11.5px; color: var(--sub); }
.paywall-mid code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text-2);
  background: var(--card-2);
  padding: 2px 6px;
  border-radius: 6px;
}
.paywall-err { margin: 12px 0 0; font-size: 12.5px; color: var(--down); }

/* 升级弹层 */
.upd-modal {
  position: fixed;
  inset: 0;
  z-index: 1001;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.upd-modal[hidden] { display: none; }
.upd-card {
  width: min(420px, 92vw);
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 26px 24px 20px;
  color: var(--text);
}
.upd-card h2 { margin: 0 0 12px; font-size: 18px; }
.upd-card h2 b { color: var(--brand); }
.upd-notes {
  margin: 0 0 16px;
  padding: 12px;
  border-radius: 10px;
  background: var(--card-2);
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: inherit;
  max-height: 180px;
  overflow-y: auto;
}
.upd-progress { margin: 0 0 14px; }
.upd-bar {
  height: 8px;
  border-radius: 100px;
  background: var(--card-2);
  overflow: hidden;
}
.upd-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--brand);
  transition: width 0.3s ease;
}
.upd-progress span { display: block; margin-top: 6px; font-size: 12px; color: var(--sub); }
.upd-actions { display: flex; gap: 10px; justify-content: flex-end; }
.upd-actions .ghost-btn { font-size: 13px; padding: 9px 14px; }
.upd-err { margin: 12px 0 0; font-size: 12.5px; color: var(--down); }

/* ============================================================
   期货 + 四共震（2026-11-11 新增，样式独立前缀，不碰既有规则）
   涨红跌绿；箱体用琥珀色 --sf-box（浅深主题都衬得住）
   ============================================================ */
:root {
  --sf-box: #ba7517;
  --sf-box-bg: rgba(250, 206, 117, 0.16);
  --sf-fut: #185fa5;
  --sf-fut-bg: #e6f1fb;
}

/* 段选器（期货页 全部/上涨/下跌） */
.seg { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 2px; }
.seg-btn { padding: 4px 12px; border-radius: 7px; font-size: 12.5px; color: var(--text-2); background: none; border: none; cursor: pointer; }
.seg-btn.active { background: var(--brand); color: #fff; }

/* ---------------- 期货行情表 ---------------- */
.fut-group { margin-bottom: 18px; }
.fut-group-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--text-2);
  margin-bottom: 8px;
}
.fut-group-title .cnt {
  font-weight: 400; color: var(--sub); font-size: 12px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 1px 9px;
}
.fut-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.fut-table th {
  font-size: 12px; font-weight: 500; color: var(--sub);
  background: var(--card-2); text-align: right;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.fut-table th:first-child, .fut-table td:first-child { text-align: left; padding-left: 18px; }
.fut-table td {
  padding: 10px 12px; text-align: right;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums; font-size: 13px;
  white-space: nowrap;
}
.fut-table tr:last-child td { border-bottom: none; }
.fut-table tbody tr { cursor: pointer; transition: background 0.12s; }
.fut-table tbody tr:hover { background: var(--card-2); }
.fut-table .num-up { color: var(--up); font-weight: 600; }
.fut-table .num-down { color: var(--down); font-weight: 600; }
.fut-table .num-flat { color: var(--text-2); }
.fut-name { display: flex; align-items: center; gap: 8px; }
.fut-name .fut-sym { font-size: 11px; color: var(--sub); font-family: ui-monospace, Menlo, monospace; }
.fut-name b { font-weight: 600; }

/* ---------------- 四共震：参数面板 / 进度 / 图例 ---------------- */
.params-panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 20px; margin-bottom: 14px;
}
.param-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; flex-wrap: wrap; }
.param-row label { width: 92px; font-size: 13px; color: var(--text-2); text-align: right; }
.param-row input {
  width: 78px; padding: 5px 8px; border: 1px solid var(--line-2);
  border-radius: 8px; font-size: 13px; text-align: center;
  background: var(--card-2); color: var(--text);
}
.param-row input:focus { outline: none; border-color: var(--brand); }
.param-hint { font-size: 12px; color: var(--sub); }
.param-actions { display: flex; gap: 10px; margin-top: 12px; padding-left: 102px; }

#sgzProgress { margin-bottom: 14px; }
.progress-track { height: 6px; background: var(--track); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, #d96565, var(--brand)); border-radius: 999px; transition: width 0.4s ease; }
.progress-text { font-size: 12px; color: var(--text-2); margin-top: 6px; }

.sf-legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; font-size: 12px; color: var(--sub); }
.sf-legend .legend-item { display: flex; align-items: center; gap: 5px; }
.lg-box { width: 18px; height: 10px; border-radius: 2px; background: var(--sf-box-bg); border: 1px dashed var(--sf-box); display: inline-block; }
.lg-break { width: 3px; height: 13px; border-radius: 1px; background: var(--up); display: inline-block; }

/* ---------------- 四共震结果卡片 ---------------- */
.sgz-list { display: flex; flex-direction: column; gap: 10px; }
.sgz-card {
  display: grid;
  grid-template-columns: 172px minmax(150px, 1.1fr) repeat(6, minmax(64px, 0.6fr)) 40px;
  gap: 12px; align-items: center;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow);
  padding: 12px 16px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}
.sgz-card:hover { border-color: #d8b19b; transform: translateY(-1px); }
.sgz-card.futures-row { border-left: 3px solid var(--sf-fut); }
.sgz-card.stock-row { border-left: 3px solid var(--up); }

.sg-chart { display: block; }
.sg-chart .sg-box { fill: var(--sf-box-bg); stroke: var(--sf-box); stroke-width: 0.8; stroke-dasharray: 3 2; }
.sg-chart .sg-wick { stroke: #b8bec6; stroke-width: 1; }
.sg-chart .sg-break-wick { stroke: var(--up); stroke-width: 1.3; }
.sg-chart .sg-break-body { fill: var(--up); }

.sg-main { min-width: 0; }
.sg-title { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.sg-title b { font-size: 15px; font-weight: 600; }
.sg-code { font-size: 11.5px; color: var(--sub); font-family: ui-monospace, Menlo, monospace; }
.badge-stock { background: #fdecec; color: var(--up); }
.badge-fut { background: var(--sf-fut-bg); color: var(--sf-fut); }

.sg-facts { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.sg-fact { font-size: 12px; color: var(--text-2); display: flex; gap: 6px; align-items: center; }
.sg-fact em { font-style: normal; color: var(--sub); }

.sg-metric { text-align: right; }
.sg-metric .v { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sg-metric .k { font-size: 11px; color: var(--sub); }
.v-up { color: var(--up); }
.v-down { color: var(--down); }
.v-box { color: var(--sf-box); }

/* 自选星标按钮（sf 前缀，避免与自选页既有按钮混淆） */
.sf-star {
  font-size: 19px; line-height: 1; color: var(--sub);
  padding: 4px 6px; border-radius: 8px; background: none; border: none; cursor: pointer;
  transition: color 0.12s, background 0.12s;
}
.sf-star:hover { background: var(--card-2); color: var(--sf-box); }
.sf-star.on { color: var(--sf-box); }

.sgz-counts {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  font-size: 12.5px; color: var(--text-2); margin-bottom: 10px;
}
.sgz-counts .chip b { font-weight: 600; }
.sgz-counts .chip.sgz-stk b { color: var(--up); }
.sgz-counts .chip.sgz-fut b { color: var(--sf-fut); }

/* ---------------- 窄屏适配 ---------------- */
@media (max-width: 1120px) {
  .sgz-card { grid-template-columns: 150px minmax(130px, 1fr) repeat(3, minmax(60px, 0.6fr)); }
  .sg-metric.optional { display: none; }
}
@media (max-width: 760px) {
  .sgz-card { grid-template-columns: 140px minmax(110px, 1fr) repeat(2, minmax(56px, 0.6fr)); }
  .fut-table th:nth-child(5), .fut-table td:nth-child(5),
  .fut-table th:nth-child(6), .fut-table td:nth-child(6),
  .fut-table th:nth-child(7), .fut-table td:nth-child(7) { display: none; }
}

/* ============================================================
   期货 / 四共震（2026-11-11 二次改版）
   两页与操家伙共用 .list / .stk-table / .stk-head / .stk-row，
   这里只补「期货表栅格」和「触发日」等少量新元素，不新增另一套表格外观
   ============================================================ */
:root {
  --sf-box: #ba7517;
}

/* 期货表：11 列（品种/交易所/最新价/涨跌幅/昨结算/今开/最高/最低/持仓量/四共震/操作） */
.fut-head,
.fut-row {
  grid-template-columns:
    minmax(150px, 1.5fr)   /* 品种 / 代码 */
    minmax(58px, 0.7fr)    /* 交易所 */
    minmax(66px, 0.8fr)    /* 最新价 */
    minmax(66px, 0.8fr)    /* 涨跌幅 */
    minmax(66px, 0.8fr)    /* 昨结算 */
    minmax(66px, 0.8fr)    /* 今开 */
    minmax(66px, 0.8fr)    /* 最高 */
    minmax(66px, 0.8fr)    /* 最低 */
    minmax(72px, 0.8fr)    /* 持仓量 */
    minmax(96px, 0.9fr)    /* 箱体区间（最近一次形态的箱体上下沿） */
    minmax(112px, 1.1fr)    /* 四共震（×次数 + 日期 + 震荡天数） */
    minmax(76px, 0.8fr);   /* 操作 */
}
.fut-row .fr-r { text-align: right; font-variant-numeric: tabular-nums; }
.fut-head .fr-r { text-align: right; }
/* 中间数值列字号与股票页保持一致（股票数值列 .sr-price/.sr-cap 等为 12.5px） */
.fut-row .fr-sub { color: var(--text-2); font-size: 12.5px; }
.fut-row .fr-ex { font-size: 12px; color: var(--sub); }
.fut-row .fr-sig { font-size: 12px; }
.fr-none { color: var(--sub); }
.fr-sig-hit {
  display: inline-flex; align-items: baseline; gap: 4px;
  color: var(--sf-box); font-weight: 600;
}
.fr-sig-hit em {
  font-style: normal; font-weight: 400; font-size: 11px; color: var(--sub);
}
/* 表头「四共震 50 ↓」：点一下有信号的排最前（2026-11-11） */
.fr-sig-sort {
  appearance: none;
  justify-self: start;
  padding: 0 5px 0 0;
  margin: 0;
  background: none;
  border: 0;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  border-radius: 4px;
}
.fr-sig-sort b {
  font-weight: 700;
  color: var(--sf-box);
  font-variant-numeric: tabular-nums;
}
.fr-sig-sort:hover { color: var(--text); }
.fr-sig-sort.on { color: var(--sf-box); }
.fr-sig-sort.on b { color: var(--sf-box); }
/* 近一年零命中：表头数字压暗，别让人以为漏了数据 */
.fr-sig-sort.dim b { color: var(--sub); }
.fr-sig-sort.dim:hover { color: var(--text-2); }
/* 期货信号列里「震荡 N 日」小标（2026-11-11 用户要求显示数字，与列表小标同族） */
.fr-sig-hit .fsg-days {
  font-style: normal; font-size: 10.5px; line-height: 15px; padding: 0 4px;
  color: #8a5a12; background: rgba(250, 206, 117, 0.18);
  border: 1px solid rgba(186, 117, 23, 0.34); border-radius: 5px;
  white-space: nowrap;
}
html[data-theme-dark="1"] .fr-sig-hit .fsg-days { color: #e8b96a; }

/* 四共震行：名称后的「触发日」小标记（与代码同排，不额外占列） */
.sig-date {
  font-size: 10.5px; line-height: 15px; padding: 0 4px;
  color: #8a5a12; background: rgba(250, 206, 117, 0.24);
  border: 1px solid rgba(186, 117, 23, 0.34); border-radius: 5px;
  white-space: nowrap;
}
/* 四共震行「震荡 N 日」小标：与触发日同族，但空心区分（2026-11-11） */
.sgz-box-len {
  background: transparent;
  border-color: rgba(186, 117, 23, 0.5);
}
/* 四共震行「共 N 次」小标（2026-11-13 列表按股票去重后，标出窗口内共出现几次） */
.sgz-times {
  font-size: 10.5px; line-height: 15px; padding: 0 4px;
  color: #5b6b86; background: rgba(120, 144, 190, 0.14);
  border: 1px solid rgba(120, 144, 190, 0.34); border-radius: 5px;
  white-space: nowrap;
}
body.dark .sgz-times { color: #9fb2d4; background: rgba(120, 144, 190, 0.18); border-color: rgba(120, 144, 190, 0.4); }

/* 期货日K弹层画布 */

/* ============ 期货整页详情（2026-11-11 二次改版：弹层版下线） ============ */
/* 详情头 9 列：品种/最新价/涨跌幅/昨结算/今开/最高/最低/持仓量/成交量。
   覆盖 .stk-row / .stk-head 的通用列宽（更高优先级），表头与数据行共用同一条 */
.fut-dhead-cols,
.dhead.stk-row.fut-dhead {
  grid-template-columns: minmax(180px, 1.5fr) repeat(8, minmax(66px, 1fr));
}
.dhead.stk-row.fut-dhead .sr-nm .fr-ex {
  font-size: 10.5px; line-height: 15px; padding: 0 4px;
  color: var(--sub); border: 1px solid var(--line); border-radius: 5px;
  white-space: nowrap;
}
/* 右侧「近一年四共震形态」卡片 */
.fut-sgz-card .fut-sgz-list {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px 12px;
}
.fut-sgz-item {
  display: inline-flex; align-items: baseline; gap: 7px;
  font-size: 12px; line-height: 16px; padding: 6px 10px;
  background: var(--card, #f5f6f8); border: 1px solid var(--line);
  border-radius: 8px; color: var(--txt); cursor: pointer;
}
.fut-sgz-item:hover { border-color: rgba(186, 117, 23, 0.55); }
.fut-sgz-item.on {
  border-color: var(--sf-box); background: rgba(232, 163, 61, 0.14);
  box-shadow: inset 0 0 0 1px rgba(186, 117, 23, 0.25);
}
.fut-sgz-item b { font-weight: 600; }
.fut-sgz-item .fsg-box { color: var(--sub); font-size: 11px; }
.fut-sgz-item .fsg-amp { color: var(--sub); font-size: 11px; }

/* 期货详情头：9 列在任何宽度都完整显示——通用的窄屏「隐藏列」规则会砍掉
   持仓量(c-turn)/成交量(c-lb)，这里按更高优先级顶回来（列宽本身是自适应的） */
.dhead.stk-row.fut-dhead > .c-turn,
.dhead.stk-row.fut-dhead > .c-lb,
.stk-head.fut-dhead-cols > .c-turn,
.stk-head.fut-dhead-cols > .c-lb {
  display: block;
}
@media (max-width: 900px) {
  .fut-dhead-cols,
  .dhead.stk-row.fut-dhead {
    grid-template-columns: minmax(132px, 1.3fr) repeat(8, minmax(54px, 1fr));
    gap: 4px;
  }
  .dhead.stk-row.fut-dhead { font-size: 11.5px; }
}

/* ============ 四共震条件设置条（2026-11-11） ============
   用户要求：把四共震的几个条件选项全部搬到标题下面那条空白带里，期货页和四共震页都放。
   「震荡区间」和「时长」是最关键的两个，排最前并用琥珀底高亮（与列表里的「震荡 N 日」小标同族）。
   一条 = 一组 条件名 + 数字输入 + 单位；改完 1.2 秒防抖自动保存并重扫。 */
.sgz-cfg {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 2px 8px;
  padding: 7px 9px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.sgz-cfg:empty { display: none; }   /* JS 未挂载时不留空盒子 */

.scfg-badge {
  flex: none;
  font-size: 11px;
  color: var(--sub);
  letter-spacing: 0.4px;
  padding-left: 1px;
}

.scfg-item {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px 3px 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 11.5px;
  line-height: 16px;
  color: var(--text-2);
  white-space: nowrap;
  cursor: text;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.scfg-item:hover { border-color: var(--line-2); }
.scfg-k { color: var(--text-2); }
.scfg-v { display: inline-flex; align-items: baseline; gap: 2px; color: var(--sub); }
.scfg-v i { font-style: normal; font-size: 11px; }

/* 数字输入：去掉原生上下微调箭头，居中加粗，聚焦时橙边 */
.scfg-n {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: textfield;
  width: 32px;
  padding: 1px 2px 2px;
  border: 1px solid var(--line-2);
  border-radius: 5px;
  background: var(--btn-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 650;
  line-height: 15px;
  text-align: center;
  outline: none;
}
.scfg-n::-webkit-outer-spin-button,
.scfg-n::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.scfg-n:focus {
  border-color: var(--bottom);
  box-shadow: 0 0 0 2px rgba(239, 125, 0, 0.14);
}

/* 关键两项：震荡区间 / 时长 */
.scfg-item.scfg-key {
  background: rgba(250, 206, 117, 0.16);
  border-color: rgba(186, 117, 23, 0.34);
}
.scfg-item.scfg-key .scfg-k { color: #8a5a12; font-weight: 620; }
.scfg-item.scfg-key .scfg-n { font-weight: 700; }
html[data-theme-dark="1"] .scfg-item.scfg-key {
  background: rgba(250, 206, 117, 0.13);
  border-color: rgba(232, 185, 106, 0.42);
}
html[data-theme-dark="1"] .scfg-item.scfg-key .scfg-k { color: #e8b96a; }

/* 固定条件（MA5>MA60）：不可调，虚框弱化 */
.scfg-item.scfg-fixed {
  cursor: default;
  background: transparent;
  border-style: dashed;
  color: var(--sub);
}

.scfg-reset {
  appearance: none;
  flex: none;
  margin-left: auto;
  padding: 3px 10px;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 100px;
  color: var(--text-2);
  font-family: inherit;
  font-size: 11.5px;
  line-height: 16px;
  cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease;
}
.scfg-reset:hover { color: var(--bottom); border-color: var(--bottom); }

/* 右下角状态：条件已改 / 保存中 / 按新条件重扫中 */
.scfg-status { flex: none; font-size: 11px; color: var(--bottom); }
.scfg-status:empty { display: none; }

@media (max-width: 760px) {
  .sgz-cfg { gap: 5px; padding: 6px 7px; }
  .scfg-item { font-size: 11px; padding: 2px 6px; }
  .scfg-n { width: 28px; font-size: 11px; }
}
/* 四共震条件设置条（2026-11-11 二次改版：股票 / 期货两套条件分开，
   每条设置条只放本页那一组，不再有「弱化的另一市门槛」） */

/* ============ 箱体上下沿（2026-11-11 用户要求：期货和股票都要把区间标出来） ============
   股票列表：箱体区间放在「触发价」下方一行小字（799.32–1015.30）；
   期货列表：独占「箱体区间」一列。两处都用 .box-rng，等宽数字对齐。 */
.box-rng {
  display: block;
  font-style: normal;
  font-size: 9.5px;
  line-height: 12px;
  font-weight: 500;
  color: var(--sub);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  letter-spacing: 0;
}

/* 四共震列表：价格列改成两行（价 + 区间），并给区间留出宽度。
   ⚠️ 只能作用在 .stk-row 上——表头格也带 c-price，一起改会把「触发价」表头挤成两行 */
.stk-table.sgz-table .stk-row .c-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}
.stk-table.sgz-table .stk-row .c-price .box-rng { max-width: 100%; }
/* 四共震表格自己的列宽：多加了一行小字，价格列从 46 放到 64，
   行业/概念 112→96、主力净流 106→100 让位，总宽不变（1180 也不溢出） */
.stk-table.sgz-table {
  --stk-cols-rest:
    minmax(58px, 0.62fr)    /* 走势 */
    minmax(64px, 0.66fr)    /* 触发价 + 箱体区间 */
    minmax(54px, 0.64fr)    /* 触发日涨幅 */
    minmax(54px, 0.64fr)    /* 总市值 */
    minmax(52px, 0.62fr)    /* 触发后至今 */
    minmax(54px, 0.58fr)    /* ATR% */
    minmax(96px, 1.02fr)    /* 行业/概念 */
    minmax(50px, 0.58fr)    /* 成交额 */
    minmax(40px, 0.4fr)     /* 换手 */
    minmax(40px, 0.4fr)     /* 突破量比 */
    minmax(42px, 0.4fr)     /* 量倍 */
    minmax(100px, 1.04fr)   /* 主力净流 */
    minmax(76px, 0.76fr);   /* 操作 */
}

/* 期货列表：箱体区间列（等宽数字，弱于价格、强于涨跌停辅助列） */
.fut-head .fr-box,
.fut-row .fr-box {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.fut-row .fr-box .box-rng { font-size: 11px; color: var(--text-2); line-height: 16px; }

/* 四共震表头「触发价」：列宽 64px 装不下「触发价 ↕」，箭头挪到文字上方会挤成两行，
   这里把排序箭头缩到 8px 并允许表头轻微缩字，保证一行显示（2026-11-11） */
.stk-table.sgz-table .stk-head .th-sort {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  white-space: nowrap;
}
.stk-table.sgz-table .stk-head .th-sort .sa { font-size: 8px; margin-left: 0; }

/* 表头文字跟下面的数据贴同一条右对齐线（用户 2026-11-12 截图指出）：
   .th-sort 是 inline-flex（「↕」+ 文字装一个盒子里），作为 grid 项会被块化成 flex，
   默认 justify-content:flex-start ⇒ 父级 text-align:right 完全失效，
   于是「涨跌幅 / 总市值 / 换手…」全贴在列左沿，跟右对齐的数字错位。
   名称列仍然靠左，其余列（含行业 / 概念）一律贴右。 */
.stk-table.sgz-table .stk-head .th-sort { justify-content: flex-end; }
.stk-table.sgz-table .stk-head .th-sort[data-sort="name"] { justify-content: flex-start; }

/* ============================================================
   全A股（2026-11-12 三次改版：原「四共震」页改名）
   条件条最前面是「四共震」勾选，HLS 顶/底 放在条件之后；
   列表两种模式（形态点 / 全市场）只换列宽，不换外观。
   ============================================================ */

/* 四共震勾选：和条件项同族的胶囊开关 */
.scfg-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px 3px 7px;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  font-family: inherit;
  font-size: 11.5px;
  line-height: 16px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.scfg-toggle:hover { border-color: var(--sub); }
.scfg-toggle .tg-dot {
  position: relative;
  width: 11px;
  height: 11px;
  border-radius: 3px;
  border: 1.5px solid var(--sub);
  background: transparent;
}
.scfg-toggle.on {
  color: #8a5a12;
  background: rgba(250, 206, 117, 0.22);
  border-color: rgba(186, 117, 23, 0.45);
}
.scfg-toggle.on .tg-dot { background: #ba7517; border-color: #ba7517; }
.scfg-toggle.on .tg-dot::after {
  content: '✓';
  position: absolute;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  font-size: 9px;
  line-height: 1;
  font-weight: 700;
  color: #fff;
}

/* HLS 顶 / 底 筛选按钮组 */
.scfg-hls {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 5px 3px 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 11.5px;
  line-height: 16px;
  white-space: nowrap;
}
.scfg-hls b { font-weight: 700; color: var(--text-2); letter-spacing: 0.5px; margin-right: 2px; }
.hls-btn {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line-2);
  background: var(--card-2);
  color: var(--text-2);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 15px;
  padding: 2px 9px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.hls-btn:hover { border-color: var(--sub); color: var(--text); }
.hls-btn.on { background: #2b2f36; border-color: #2b2f36; color: #fff; }
.hls-btn.on[data-hls="bottom"] { background: var(--down); border-color: var(--down); color: #fff; }
/* 大顶 / 大底（背离档）：选中态红色，与图上红字一致 */
.hls-btn.on[data-hls="topX"],
.hls-btn.on[data-hls="bottomX"] { background: var(--up); border-color: var(--up); color: #fff; }

/* 老虎模式 🐅 筛选按钮（2026-11-13）：与 HLS 那组并排，选中态橙金底 */
.scfg-tiger {
  flex: none;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line-2);
  background: var(--card-2);
  color: var(--text-2);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 15px;
  padding: 3px 9px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.scfg-tiger:hover { border-color: #d99a2b; color: var(--text); }
.scfg-tiger.on { background: #e08a1e; border-color: #e08a1e; color: #fff; }

/* 年限（回放窗口）：页头「年限 1年 2年 3年」分段按钮，与 HLS 那组同一套观感 */
.yr-seg {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 5px 3px 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 11.5px;
  line-height: 16px;
  white-space: nowrap;
}
.yr-seg .yr-k { font-weight: 700; color: var(--text-2); letter-spacing: 0.5px; margin-right: 2px; }
.yr-seg button {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line-2);
  background: var(--card-2);
  color: var(--text-2);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 15px;
  padding: 2px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.yr-seg button:hover { border-color: var(--sub); color: var(--text); }
.yr-seg button.on { background: #2b2f36; border-color: #2b2f36; color: #fff; }
html[data-theme-dark="1"] .yr-seg button.on { background: #e8eaed; border-color: #e8eaed; color: #1a1d21; }

/* 四共震关掉时：六个条件不生效，整组压暗 + 输入框禁用 */
.sgz-cfg.sgz-off .scfg-item { opacity: 0.42; }
.sgz-cfg.sgz-off .scfg-n { cursor: not-allowed; }
/* 老虎 🐅 参数不走四共震开关（全A股模式下也要能调，2026-11-13 用户反馈「不能设置」）：
   保持全亮 + 正常光标，只是标签左侧加一条橙色小竖条提示它独立于四共震 */
.sgz-cfg.sgz-off .scfg-item.scfg-tig { opacity: 1; }
.sgz-cfg.sgz-off .scfg-n[data-tig] { cursor: text; }
.sgz-cfg.sgz-off .scfg-item.scfg-tig .scfg-k::before {
  content: '';
  display: inline-block;
  width: 3px; height: 9px;
  margin-right: 3px;
  border-radius: 1.5px;
  background: #e08a1e;
  vertical-align: -1px;
}

/* 列表里的 HLS 徽标（名称后面）：顶 黑系、底 绿系、大底 红底 */
.hls-badge {
  flex: none;
  display: inline-block;
  font-size: 10px;
  line-height: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 0 4px;
  border-radius: 5px;
  border: 1px solid transparent;
  white-space: nowrap;
}
/* 近 10 个交易日内出现过大底/大顶（金叉/死叉确认后标在历史最低/最高点那天）：淡一点，与当日档位区分 */
.hls-badge.h-ago { opacity: .72; }

.hls-badge.h-top { color: #fff; background: #2b2f36; border-color: #2b2f36; }
.hls-badge.h-bot { color: #0f7a52; background: rgba(18, 160, 106, 0.12); border-color: rgba(18, 160, 106, 0.42); }
.hls-badge.h-red { color: #fff; background: var(--up); border-color: var(--up); }
/* 大底 = 绿色实底（2026-11-13 用户要求：列表里大顶红、大底绿；与「底」的浅绿底区分开） */
.hls-badge.h-grn { color: #fff; background: var(--down); border-color: var(--down); }
html[data-theme-dark="1"] .hls-badge.h-top { color: #15181d; background: #e9ebef; border-color: #e9ebef; }
html[data-theme-dark="1"] .hls-badge.h-bot { color: #35c48d; background: rgba(18, 160, 106, 0.2); border-color: rgba(18, 160, 106, 0.5); }

/* 老虎徽标（2026-11-13 双向）：向下虎 🐅 橙金底；向上虎 🐯 蓝底，列表里一眼分方向 */
.tiger-badge {
  flex: none;
  display: inline-block;
  font-size: 10px;
  line-height: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 0 4px;
  border-radius: 5px;
  border: 1px solid #e08a1e;
  color: #fff;
  background: #e08a1e;
  white-space: nowrap;
}
.tiger-badge.up {
  border-color: #2f7fd1;
  background: #2f7fd1;
}

/* 全A股模式列宽（13 列 + 名称列）：2026-11-13 起补回「安全比率」（ATR 仍在它右边） */
.stk-table.sgz-table.all-mode {
  --stk-cols-rest:
    minmax(56px, 0.6fr)     /* 走势 */
    minmax(46px, 0.58fr)    /* 现价 */
    minmax(52px, 0.62fr)    /* 涨跌幅 */
    minmax(52px, 0.62fr)    /* 总市值 */
    minmax(54px, 0.58fr)    /* 安全比率 */
    minmax(50px, 0.54fr)    /* ATR% */
    minmax(92px, 0.96fr)    /* 行业/概念 */
    minmax(48px, 0.54fr)    /* 成交额 */
    minmax(38px, 0.38fr)    /* 换手 */
    minmax(38px, 0.38fr)    /* 量比 */
    minmax(40px, 0.38fr)    /* 量倍 */
    minmax(92px, 0.96fr)    /* 主力净流 */
    minmax(72px, 0.72fr);   /* 操作 */
}

/* 深色主题：勾选框 / HLS 按钮的选中态要反过来（深底上再压深色就看不见了） */
html[data-theme-dark="1"] .scfg-toggle.on {
  color: #e8b96a;
  background: rgba(250, 206, 117, 0.16);
  border-color: rgba(232, 185, 106, 0.45);
}
html[data-theme-dark="1"] .scfg-toggle.on .tg-dot { background: #e8b96a; border-color: #e8b96a; }
html[data-theme-dark="1"] .scfg-toggle.on .tg-dot::after { color: #17181c; }
html[data-theme-dark="1"] .hls-btn.on { background: #e9ebef; border-color: #e9ebef; color: #15181d; }
html[data-theme-dark="1"] .hls-btn.on[data-hls="bottom"] { background: var(--down); border-color: var(--down); color: #fff; }
html[data-theme-dark="1"] .hls-btn.on[data-hls="topX"],
html[data-theme-dark="1"] .hls-btn.on[data-hls="bottomX"] { background: var(--up); border-color: var(--up); color: #fff; }

/* ============================================================
   外围行情条 + 宏观情报 + A股/期货优劣势（2026-11-21 用户要求）
   浅色/深色统一走 CSS 变量；涨红跌绿（A股习惯）
   ============================================================ */
.global-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
@media (min-width: 720px) {
  .global-strip { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
.gs-item {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.gs-skeleton { height: 102px; }
/* 名称 / 价格 / 涨幅 / 周期 同一行，省下的高度全部给 60 日曲线 */
.gs-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
}
.gs-name-text {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
}
.gs-price {
  flex: none;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.gs-pct {
  flex: none;
  font-size: 11.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.gs-range {
  flex: none;
  margin-left: auto;
  font-style: normal;
  font-size: 9px;
  line-height: 1.2;
  color: var(--sub);
  border: 1px solid var(--line-2);
  border-radius: 3px;
  padding: 0 3px;
}
/* 窄屏六列时名称优先，周期徽标让位（周期仍见曲线 title） */
@media (max-width: 1200px) {
  .gs-range { display: none; }
  .gs-head { gap: 3px; }
  .gs-name-text { font-size: 10.5px; }
  .gs-price { font-size: 12.5px; }
  .gs-pct { font-size: 10px; }
}
.gs-spark {
  width: 100%;
  height: 60px;
  display: block;
  margin-top: 3px;
}
.gs-spark.none {
  font-size: 10px;
  color: var(--sub);
  line-height: 60px;
  white-space: nowrap;
}
.gs-up { color: var(--up); }
.gs-down { color: var(--down); }

/* 领涨/领跌 期货前三：左右各三张卡，卡片沿用外围行情同款 */
.fut-movers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
@media (max-width: 1300px) {
  .fut-movers { grid-template-columns: 1fr; } /* 两组上下排，每组三卡才有足够宽度显示名称+3日排名 */
}
.fm-group { min-width: 0; }
.fm-group-h {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 0 2px 5px;
  font-size: 11px;
  color: var(--sub);
}
.fm-group-h b { font-size: 12.5px; font-weight: 700; }
.fm-up { color: var(--up); }
.fm-down { color: var(--down); }
.fm-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.fm-item { padding: 7px 8px; cursor: pointer; transition: border-color .15s, background .15s; }
.fm-item:hover, .fm-item:focus-visible {
  border-color: var(--brand, var(--up));
  background: var(--card-3, var(--card-2));
  outline: none;
}
.fm-item .gs-head { gap: 4px; }
.fm-item .gs-name-text { font-size: 10.5px; }
.fm-item .gs-price { font-size: 12.5px; }
.fm-item .gs-pct { font-size: 10.5px; }
.fm-item .gs-spark { height: 54px; }
.fm-item .gs-spark.none { line-height: 54px; }
.fm-rank {
  border: none;
  letter-spacing: 0;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  padding: 0;
}
.fm-rank-up { color: var(--up); }
.fm-rank-down { color: var(--down); }
@media (max-width: 1200px) {
  .fm-item .gs-name-text { font-size: 10px; }
  .fm-item .gs-price { font-size: 12px; }
  .fm-item .gs-pct { font-size: 10px; }
  .fm-rank { display: inline-flex; align-items: center; } /* 3日排名徽标窄屏也要保留 */
}

.macro-filter { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.mf-btn {
  border: 1px solid var(--line-2);
  background: var(--btn-bg);
  color: var(--text-2);
  font-size: 11.5px;
  line-height: 1;
  padding: 5px 9px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.mf-btn:hover { border-color: var(--pb); color: var(--pb); }
.mf-btn.active {
  background: var(--pb);
  border-color: var(--pb);
  color: #fff;
  font-weight: 600;
}
.macro-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 1080px) {
  .macro-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
}

.macro-list {
  max-height: 320px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.macro-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}
.macro-item:last-child { border-bottom: none; }
.macro-item:hover { background: var(--card-2); }
.mi-firewrap {
  flex: none;
  display: flex;
  align-items: center;
}
.mi-firewrap .nv-flames { margin-left: 0; }
.mi-firewrap .flame { width: 10px; height: 12px; }

.mi-impact {
  position: relative;
  flex: none;
  width: 32px;
  height: 22px;
  border-radius: 4px;
  background: var(--track);
  overflow: hidden;
}
.mi-impact i {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(232, 160, 70, 0.45), rgba(229, 69, 69, 0.5));
}
.mi-impact b {
  position: relative;
  z-index: 1;
  display: block;
  text-align: center;
  line-height: 22px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text);
}
/* 标题 + 标签 + 时间 同一行，标题省略、标签时间靠右，节约行高 */
.mi-body { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; }
.mi-title {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text);
}
.macro-item:hover .mi-title { color: var(--pb); }
.macro-item.mi-off .mi-title { font-weight: 650; }
.mi-tail { flex: none; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.mi-tail .nv-tone { margin-top: 0; font-size: 10px; }
.mi-cat, .mi-auth, .mi-focus {
  font-style: normal;
  font-size: 10px;
  line-height: 1.2;
  padding: 2px 5px;
  border-radius: 3px;
  white-space: nowrap;
}
.mi-cat { background: rgba(59, 130, 246, 0.12); color: #3a6ea8; }
.mi-auth { background: rgba(229, 69, 69, 0.12); color: var(--up); }
.mi-focus { background: rgba(232, 160, 70, 0.16); color: #a9670b; }
html[data-theme-dark="1"] .mi-cat { color: #8db8f5; }
html[data-theme-dark="1"] .mi-focus { color: #e8b96a; }
.mi-time { font-size: 10.5px; color: var(--sub); margin-left: 2px; }
/* 窄屏次要标签收起，保标题 + 利好利空 + 时间 */
@media (max-width: 1200px) {
  .mi-cat, .mi-auth, .mi-focus { display: none; }
  .mi-title { font-size: 11.5px; }
}

.edge-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; height: 100%; }
.edge-side {
  display: flex; flex-direction: column; min-height: 0;
  background: var(--card-2); border-radius: 10px; padding: 9px 10px;
}
.edge-side-h { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; flex: none; }
.edge-side-h b { font-size: 13px; color: var(--text); }
.edge-level { font-size: 12px; font-weight: 700; }
.edge-a .edge-level { color: var(--up); }
.edge-f .edge-level { color: var(--bottom); }
/* 两组（可做多/注意风险）均分剩余高度，组内各行再均分 → 文字行高随卡片高度撑满 */
.edge-group { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; margin-top: 7px; }
.edge-group-h { font-size: 11px; font-weight: 700; line-height: 1.4; flex: none; }
.edge-group.long .edge-group-h { color: var(--up); }
.edge-group.risk .edge-group-h { color: var(--down); }
.edge-group .edge-pt {
  display: flex; align-items: center; flex: 1 1 0; min-height: 0;
  font-size: 11px; line-height: 1.45; margin-top: 0;
}
.edge-pt.muted { color: var(--sub); }
/* 优劣势文案里的股票/期货名称：可点开详情 */
.edge-link {
  display: inline; padding: 0; margin: 0; border: 0; background: none;
  font: inherit; line-height: inherit; cursor: pointer;
  color: var(--acc, #e8a33d); text-decoration: none;
}
.edge-link:hover { text-decoration: underline; }
.edge-note { font-size: 10.5px; line-height: 1.55; color: var(--sub); margin-top: 9px; }

/* ===== 外围行情详情弹层（点击黄金/白银/原油/美元/美债/纳指卡片） ===== */
.gs-item[data-key] { cursor: pointer; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.gs-item[data-key]:hover { border-color: var(--acc, #e8a33d); box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08); }
.gd-card {
  width: min(860px, 96vw); max-height: 92vh; overflow-y: auto;
  background: var(--bg); border-radius: 14px; padding: 18px 18px 14px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  transform: translateY(14px); transition: transform 0.2s ease;
}
.gd-overlay.open .gd-card { transform: none; }
.gd-quote { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.gd-price { font-size: 24px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.gd-pct { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.gd-pct.gs-up { color: var(--up); }
.gd-pct.gs-down { color: var(--down); }
.gd-meta { margin-left: auto; font-size: 11.5px; color: var(--sub); }
.gd-chartbox { position: relative; min-height: 420px; }
#gdChart { width: 100%; height: 440px; display: block; }
.gd-loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--sub); background: var(--card); border-radius: var(--radius);
}
.gd-note {
  margin-top: 10px; padding: 9px 11px; font-size: 11.5px; line-height: 1.65; color: var(--text-2);
  background: var(--card-2); border: 1px solid var(--line); border-radius: 8px;
}
.gd-note b { color: var(--acc, #e8a33d); }

/* ===== 外围详情浮窗：涨跌对市场的影响 / 利好利空板块与个股 ===== */
.gd-impact { margin-top: 12px; }
.gd-imp-head {
  display: flex; align-items: baseline; gap: 8px; margin-bottom: 7px;
  font-size: 12.5px; color: var(--text);
}
.gd-imp-head b { font-size: 13px; }
.gd-imp-dir { font-weight: 700; }
.gd-imp-dir.gd-up { color: var(--up); }
.gd-imp-dir.gd-down { color: var(--down); }
.gd-imp-sum {
  font-size: 11.5px; line-height: 1.7; color: var(--text-2);
  padding: 9px 11px; background: var(--card-2); border: 1px solid var(--line); border-radius: 8px;
}
.gd-imp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 9px; }
.gd-imp-col { padding: 9px 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--card-2); }
.gd-imp-col-h { font-size: 12px; font-weight: 700; margin-bottom: 5px; }
.gd-imp-col.good .gd-imp-col-h { color: var(--up); }
.gd-imp-col.bad .gd-imp-col-h { color: var(--down); }
.gd-imp-row { font-size: 11.5px; line-height: 1.7; color: var(--text-2); }
.gd-imp-row + .gd-imp-row { margin-top: 3px; }
@media (max-width: 720px) { .gd-imp-grid { grid-template-columns: 1fr; } }

/* ============================================================
   期货详情三栏布局（2026-11-24）：品种列表 + 合约列表 + K线/MACD
   仅对 .dbody.is-fut 生效，股票详情两栏完全不受影响。
   ============================================================ */
/* 2026-11-24 修正：品种栏与合约栏等宽；两栏合计仍 356px，K线宽度不变。
   合约栏由 166px 加宽到 178px，品种栏由 190px 收窄到 178px。 */
.dbody.is-fut { grid-template-columns: 178px 178px minmax(0, 1fr); gap: 10px; }

/* 期货详情顶部空白区：代码简称由来 + 保证金率 + 杠杆倍数（2026-11-24） */
.fut-code-note {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 520px;
  padding: 5px 10px;
  border-radius: 9px;
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 11.5px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fut-code-note b { color: var(--text); font-weight: 700; }
.fut-code-note em { color: var(--bottom); font-style: normal; font-weight: 700; }

/* 品种列表（第一栏）缩窄：名称/代码 + 价格 + 涨幅，紧凑不拥挤 */
.dbody.is-fut .dside-item { padding: 6px 3px 6px 7px; gap: 1px; }
.dbody.is-fut .ds-nm { font-size: 11.5px; }
.dbody.is-fut .ds-price { min-width: 38px; font-size: 11px; }
.dbody.is-fut .ds-pct { font-size: 10.5px; min-width: 40px; }

/* 合约列表（第二栏） */
.fut-contracts {
  background: var(--card); border-radius: 12px; box-shadow: var(--shadow);
  overflow: hidden; display: flex; flex-direction: column; min-height: 0;
}
.fc-head {
  display: grid; grid-template-columns: 1fr 1.25fr 0.75fr; gap: 4px;
  padding: 8px 8px 7px; font-size: 9.5px; color: var(--sub);
  border-bottom: 1px solid var(--line); background: var(--card-2);
  position: sticky; top: 0; z-index: 2;
}
.fc-head span:nth-child(2), .fc-head span:nth-child(3) { text-align: right; }
.fc-head span:nth-child(2) { white-space: nowrap; }
.fc-list { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.fc-row {
  display: grid; grid-template-columns: 1fr 1.15fr 0.85fr; gap: 4px;
  align-items: center; padding: 7px 8px; cursor: pointer;
  border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums;
}
.fc-row:hover { background: var(--card-2); }
.fc-row.active { background: var(--bottom-bg); box-shadow: inset 3px 0 0 var(--bottom); }
.fc-code {
  font-size: 11.5px; font-weight: 600; color: var(--text);
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.fc-main-tag {
  display: inline-block; font-size: 9px; font-weight: 700; font-style: normal;
  color: #fff; background: var(--up); border-radius: 3px; padding: 0 4px; line-height: 14px;
  width: fit-content;
}
.fc-row:not(.fc-cont) .fc-main-tag { background: #e0563b; }
.fc-cont .fc-main-tag { background: #7c8796; }
.fc-px { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; min-width: 0; }
.fc-px b { font-size: 11.5px; font-weight: 600; }
.fc-px i { font-size: 10px; font-style: normal; }
.fc-oi { font-size: 10.5px; color: var(--text-2); text-align: right; }
.fc-empty { padding: 18px 8px; text-align: center; font-size: 11.5px; color: var(--sub); }

@media (min-width: 1080px) {
  .dbody.is-fut { grid-template-rows: minmax(0, 1fr); }
  .dbody.is-fut .fut-contracts { height: 100%; }
}

/* 窄屏（<900）：合约栏折到品种栏下方，避免把K线挤没 */
@media (max-width: 899px) {
  .dbody.is-fut { grid-template-columns: 178px minmax(0, 1fr); }
  .dbody.is-fut .fut-contracts { grid-column: 1 / -1; max-height: 220px; }
}

/* ===== 板块上涨逻辑解读卡片（2026-12-04）=====
   位置：板块详情页右栏 K 线图下方。用真实行情 + 真实新闻交给模型组织，
   分「宏观情绪 / 基本面 / 产业链 / 因果链」四层，新闻标题可点开核对。 */
.bd-story {
  margin: 4px 6px 2px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-2);
  padding: 9px 11px 10px;
  flex: 0 0 auto;
}
.bd-story-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.bd-story-head b { font-size: 13.5px; color: var(--text); }
.bd-story-head span { margin-left: auto; font-size: 11px; color: var(--sub); }
.bd-story-body { font-size: 12.5px; line-height: 1.7; color: var(--text-2); }
.bd-story-hint { color: var(--sub); font-size: 12px; padding: 6px 0; }
.bd-story-sec { display: flex; gap: 7px; margin: 5px 0; }
.bd-story-sec .k {
  flex: 0 0 74px; font-size: 11.5px; font-weight: 600; color: var(--card);
  background: var(--brand); border-radius: 5px; padding: 1px 5px; height: fit-content;
  text-align: center; line-height: 1.5;
}
.bd-story-sec .v { flex: 1; min-width: 0; }
.bd-story-sec.chain .k { background: #8a6d3b; }
.bd-story-sec.cause .k { background: #2f7d6e; }
.bd-story-causal {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 7px; padding: 5px 8px; margin: 6px 0 4px;
  color: var(--text); font-size: 12.5px; font-weight: 600; line-height: 1.6;
}
.bd-story-caveat { color: var(--sub); font-size: 11.5px; margin: 4px 0 6px; }
.bd-story-evidence { border-top: 1px dashed var(--line-2); padding-top: 6px; margin-top: 6px; }
.bd-story-evidence .t {
  font-size: 11.5px; color: var(--sub); margin-bottom: 3px;
  display: flex; align-items: center; gap: 6px;
}
.bd-story-evidence .t b { color: var(--text-2); font-weight: 600; }
.bd-story-evidence ol { margin: 0; padding-left: 16px; }
.bd-story-evidence li { font-size: 11.5px; line-height: 1.6; margin: 2px 0; }
.bd-story-evidence a { color: var(--up); text-decoration: none; }
.bd-story-evidence a:hover { text-decoration: underline; }
.bd-story-src { color: var(--sub); font-size: 11px; margin-left: 5px; }
.bd-story-retry {
  border: 1px solid var(--line-2); background: var(--card); color: var(--text-2);
  border-radius: 5px; font-size: 11.5px; padding: 2px 7px; cursor: pointer;
}
/* 2026-12-04：通俗例子置顶——用生活化类比讲产业链因果 */
.bd-story-example {
  margin: 0 0 8px; padding: 7px 9px 8px;
  background: var(--card-2); border: 1px solid var(--line-2);
  border-left: 3px solid var(--brand); border-radius: 7px;
}
/* 2026-12-04：用户要求举例字号加大 1/3（正文 12→16px，标题 12.5→16.5px） */
.bd-story-example .t { font-size: 16.5px; font-weight: 700; color: var(--brand); margin-bottom: 4px; }
.bd-story-example .c { font-size: 16px; line-height: 1.65; color: var(--text); }
/* 2026-12-04：例子下方 3 个相关板块（直接取自板块地图，涨红跌绿） */
.bd-story-rel { margin-top: 8px; padding-top: 7px; border-top: 1px dashed var(--line-2); }
.bd-story-rel .chips { display: flex; flex-wrap: nowrap; gap: 5px; min-width: 0; }
.bd-story-rel-item { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.bd-story-rel-item .stage { font-size: 11px; font-weight: 700; color: var(--sub); line-height: 1.2; }
.bd-story-rel .bmap-cell { width: 100%; min-width: 0; padding: 4px 5px; font-size: 11.5px; }
.bd-story-rel .bmap-cell i { font-size: 11.5px; }
.bd-story-rel-chip {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
  border: 1px solid var(--line-2); background: var(--card); color: var(--text-2);
  border-radius: 5px; padding: 2px 7px; font-size: 12.5px; line-height: 18px;
  cursor: pointer; white-space: nowrap;
}
.bd-story-rel-chip:hover { border-color: var(--brand); color: var(--text); }
.bd-story-rel-chip i { font-style: normal; font-size: 11.5px; font-weight: 600; }
.bd-story-rel-chip.up i { color: var(--up); }
.bd-story-rel-chip.down i { color: var(--down); }
