
/* ---------- v3.2 优化：状态、图例、判定结论 ---------- */
.src-badge { font-size: 11px; white-space: nowrap; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line); }
.src-badge.ok { color: #2b8a3e; background: #ebfbee; border-color: #b2f2bb; }
.src-badge.bad { color: #c92a2a; background: #fff5f5; border-color: #ffc9c9; }
.offline-bar button { margin-left: 10px; padding: 3px 10px; border: 1px solid #a15c00; background: #fff; color: #a15c00; border-radius: 6px; font-size: 12px; cursor: pointer; }
.stage-row { justify-content: flex-start; margin-top: 4px; }
.stage-title { color: var(--muted); font-size: 11px; margin-right: 4px; }
.ctrl-verdict { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-left: 4px solid; border-radius: 8px; padding: 9px 14px; margin: 4px 0 12px; font-size: 13px; }
.ctrl-verdict b { font-size: 19px; }
.cv-label { color: var(--muted); font-size: 11.5px; }
.cv-why { color: var(--muted); font-size: 12px; }
.ctrl-verdict.vd-warn { border-color: #e03131; background: #fff5f5; color: #c92a2a; }
.ctrl-verdict.vd-mid  { border-color: #f59f00; background: #fff9db; color: #a15c00; }
.ctrl-verdict.vd-ok   { border-color: #2f9e44; background: #ebfbee; color: #2b8a3e; }
.ctrl-bars { display: flex; flex-direction: column; gap: 3px; }
.ctrl-bars > .badge { align-self: flex-start; margin-bottom: 3px; }
.cb-item { display: flex; align-items: center; gap: 7px; font-size: 11.5px; }
.cb-name { width: 58px; color: var(--muted); flex: none; }
.cb-track { flex: 1; height: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; min-width: 40px; }
.cb-track i { display: block; height: 100%; }
.cb-item b { width: 20px; text-align: right; color: var(--text); font-size: 11.5px; }
.offline-bar { position: sticky; top: 0; z-index: 90; background: #fff4e6; color: #a15c00; border-bottom: 1px solid #ffd8a8; padding: 10px 16px; font-size: 13px; line-height: 1.5; }
:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --line: #e6e8ec;
  --text: #1f2329;
  --muted: #8a919f;
  --up: #e03131;      /* 涨-红 */
  --down: #2f9e44;    /* 跌-绿 */
  --flat: #8a919f;
  --accent: #2563eb;
  --up-bg: #fdecec;
  --down-bg: #eaf6ec;
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  padding-bottom: 0;
}

/* ===== 顶栏 ===== */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.brand { font-size: 17px; font-weight: 700; white-space: nowrap; }
.search-wrap { position: relative; flex: 1; max-width: 420px; }
#searchInput {
  width: 100%; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; outline: none; background: var(--bg);
}
#searchInput:focus { border-color: var(--accent); background: #fff; }
.search-drop {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  max-height: 260px; overflow-y: auto; z-index: 60;
}
.search-drop .sd-item {
  padding: 9px 12px; cursor: pointer; display: flex; gap: 10px; align-items: baseline;
}
.search-drop .sd-item:hover, .search-drop .sd-item.hl { background: var(--bg); }
.sd-item .sd-name { font-weight: 600; }
.sd-item .sd-code { color: var(--muted); font-size: 12px; }
.sd-item .sd-kw { margin-left: auto; color: var(--muted); font-size: 11px; }
.data-time { color: var(--muted); font-size: 12px; white-space: nowrap; margin-left: auto; }

/* ===== 布局 ===== */
main { max-width: 1200px; margin: 0 auto; padding: 16px 20px 40px; }
.panel { display: flex; flex-direction: column; gap: 14px; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
}
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.card-head h2 { font-size: 15px; }
.hint { color: var(--muted); font-size: 12px; margin-left: auto; }

/* ===== 指数卡片 ===== */
.index-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.idx-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
}
.idx-name { color: var(--muted); font-size: 12px; }
.idx-price { font-size: 26px; font-weight: 700; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.idx-sub { font-size: 13px; font-variant-numeric: tabular-nums; }
.c-up { color: var(--up); }
.c-down { color: var(--down); }
.c-flat { color: var(--flat); }
.idx-amount { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* ===== 表格 ===== */
.table-scroll { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tbl th {
  text-align: left; color: var(--muted); font-weight: 500; font-size: 12px;
  padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl td { padding: 8px; border-bottom: 1px solid #f0f1f4; white-space: nowrap; }
.tbl th.num, .tbl td.num { text-align: right; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover { background: var(--bg); }
.tbl tbody tr.sel { background: #eef4ff; }
.row-del {
  color: var(--muted); border: none; background: none; cursor: pointer;
  font-size: 15px; padding: 2px 6px; border-radius: 6px;
}
.row-del:hover { color: var(--up); background: var(--up-bg); }
.tag-buy { color: var(--up); font-weight: 600; }
.tag-sell { color: var(--down); font-weight: 600; }

/* ===== 分段按钮 ===== */
.seg { display: inline-flex; background: var(--bg); border-radius: 8px; padding: 2px; }
.seg button {
  border: none; background: none; padding: 5px 14px; border-radius: 6px;
  cursor: pointer; font-size: 13px; color: var(--muted);
}
.seg button.on { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* ===== K线 ===== */
.kline-wrap { position: relative; width: 100%; height: 420px; }
/* canvas 位图按 W*dpr 放大，必须锁回容器尺寸，否则手机 dpr=2/3 时会撑破页面 */
.kline-wrap canvas { display: block; width: 100%; height: 100%; }
#klineCanvas { width: 100%; height: 100%; display: block; }
.kline-empty {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 14px; pointer-events: none;
}
.kline-legend {
  display: flex; flex-wrap: wrap; gap: 14px; margin-top: 6px;
  font-size: 12px; color: var(--text);
}
.kline-legend .lg-dim { color: var(--muted); }
.lg-tri { display: inline-block; width: 0; height: 0; margin-right: 4px; vertical-align: middle; }
.lg-top { border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 8px solid #d9480f; }
.lg-bot { border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 8px solid #1c7ed6; }
.lg-line { display: inline-block; width: 18px; height: 0; border-top: 2px dashed #c2255c; margin-right: 4px; vertical-align: middle; }
.lg-ma5 { border-top: 2px solid #f59f00; }
.lg-ma10 { border-top: 2px solid #1c7ed6; }
.lg-ma20 { border-top: 2px solid #7048e8; }
.lg-ma60 { border-top: 2px solid #868e96; }
.lg-fib { border-top: 2px dashed #c2255c; }

/* ===== 策略信号 ===== */
.signal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.sig-card {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg);
}
.sig-title { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.sig-main { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.sig-detail { font-size: 12px; color: var(--muted); line-height: 1.7; }
.sig-detail b { color: var(--text); font-variant-numeric: tabular-nums; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.badge-up { background: var(--up-bg); color: var(--up); }
.badge-down { background: var(--down-bg); color: var(--down); }
.badge-flat { background: #eef0f3; color: var(--muted); }

/* ===== 财务 ===== */
.fin-wrap { display: flex; flex-direction: column; gap: 10px; }
.fin-val { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.fin-val .ps-label { color: var(--muted); font-size: 12px; }
.fin-val .ps-value { font-size: 17px; }
.fin-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 13px; }
.fin-table th, .fin-table td { padding: 6px 8px; border-bottom: 1px solid #f0f1f4; text-align: right; white-space: nowrap; }
.fin-table th:first-child, .fin-table td:first-child { text-align: left; }
.fin-table th { color: var(--muted); font-weight: 500; font-size: 12px; }
.kline-note { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.6; }
.kline-note b { color: var(--text); font-variant-numeric: tabular-nums; }

/* ===== 持仓汇总 ===== */
.port-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.ps-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 16px;
}
.ps-label { color: var(--muted); font-size: 12px; }
.ps-value { font-size: 20px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ===== 记账表单 ===== */
.trade-form { display: flex; flex-direction: column; gap: 12px; }
.tf-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px;
}
.tf-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.tf-grid input {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; outline: none; background: #fff;
}
.tf-grid input:focus { border-color: var(--accent); }
.tf-grid input.err { border-color: var(--up); background: var(--up-bg); }
.tf-amount output {
  display: block; padding: 8px 10px; font-size: 15px; font-weight: 700;
  font-variant-numeric: tabular-nums; color: var(--text);
}
.code-wrap { position: relative; }
.code-wrap .search-drop { z-index: 55; }
.tf-foot { display: flex; align-items: center; gap: 12px; }
.tf-err { color: var(--up); font-size: 12px; flex: 1; }
.btn-primary {
  background: var(--accent); color: #fff; border: none; border-radius: 8px;
  padding: 9px 24px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn-primary:hover { background: #1d4fd8; }

.realized { color: var(--muted); font-size: 12px; padding: 8px 4px 0; }
.realized b { font-variant-numeric: tabular-nums; }

/* ===== 移动端底部标签栏 ===== */
.tabbar { display: none; }

/* ===== 响应式 ===== */
.ver-badge { font-size: 11px; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; white-space: nowrap; }

/* ---------- 主力行为判别 ---------- */
.ctrl-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.stage-legend { display: inline-flex; align-items: center; gap: 3px; flex-wrap: wrap; color: var(--muted); }
.stage-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-left: 5px; }
.ctrl-head { display: grid; grid-template-columns: 110px 1fr 200px; gap: 14px; align-items: center; margin: 6px 0 14px; }
.ctrl-score { font-size: 15px; color: var(--muted); line-height: 1; }
.ctrl-score b { font-size: 40px; font-weight: 700; letter-spacing: -1px; }
.ctrl-sub { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.ctrl-stage { border: 1px solid var(--line); border-left-width: 4px; border-radius: 8px; padding: 8px 12px; }
.cs-label { font-size: 11.5px; color: var(--muted); }
.cs-main { font-size: 19px; font-weight: 700; margin: 2px 0; }
.cs-main span { font-size: 12px; font-weight: 400; color: var(--muted); }
.cs-sub { font-size: 11px; color: var(--muted); }
.ctrl-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ctrl-col h4 { margin: 0 0 8px; font-size: 13px; color: var(--text); }
.ctrl-list, .ctrl-why { margin: 0; padding-left: 18px; font-size: 12px; line-height: 1.65; }
.ctrl-list li { margin-bottom: 7px; }
.ce-name { font-weight: 600; color: var(--text); }
.ce-score { float: right; font-weight: 700; color: var(--muted); }
.ce-detail { color: var(--muted); clear: both; }
.ctrl-why li { margin-bottom: 5px; color: var(--muted); }
.ctrl-warn { margin-top: 12px; padding: 8px 12px; border-radius: 8px; background: #fff4e6; color: #a15c00; font-size: 12px; }
.ctrl-disclaimer { border-top: 1px solid var(--line); padding-top: 10px; color: var(--muted); }

/* ---------- 添加自选按钮 ---------- */
.btn-add {
  border: 1px solid var(--accent); color: var(--accent); background: none;
  border-radius: 8px; padding: 4px 12px; font-size: 13px; cursor: pointer; font-weight: 600;
}
.btn-add:hover { background: var(--accent); color: #fff; }

/* ---------- 选股条件 ---------- */
.scan-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 16px; margin: 10px 0 14px;
}
.scan-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
.scan-grid .rng { display: flex; gap: 6px; }
.scan-grid input[type="number"], .scan-grid select {
  width: 100%; box-sizing: border-box; padding: 7px 9px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 14px; background: var(--bg); color: var(--text); min-width: 0;
}
.scan-check { flex-direction: row !important; align-items: center; gap: 6px !important; font-size: 14px !important; color: var(--text) !important; }
.scan-check input { width: 16px; height: 16px; }
#scanTable .row-add {
  border: 1px solid var(--accent); color: var(--accent); background: none; border-radius: 6px;
  width: 26px; height: 26px; cursor: pointer; font-size: 15px; line-height: 1;
}
#scanTable .row-add.done { border-color: var(--muted); color: var(--muted); cursor: default; }

@media (max-width: 767px) {
  body { padding-bottom: 64px; }
  .topbar { padding: 10px 12px; gap: 6px; flex-wrap: wrap; align-items: center; }
  .brand { font-size: 15px; order: 1; }
  .src-badge { order: 2; flex: 0 0 auto; margin-left: auto; font-size: 10px; padding: 2px 6px; }
  .search-wrap { order: 3; flex: 1 1 100%; max-width: none; min-width: 0; }
  .search-wrap input { font-size: 14px; }
  .data-time { order: 4; width: auto; margin-left: 0; text-align: left; font-size: 11px; }
  .ver-badge { order: 5; margin-left: auto; font-size: 10px; padding: 2px 6px; }
  /* 周期/均线/阶段开关：整组换行，按钮文字不竖排 */
  .card-head { flex-wrap: wrap; gap: 6px; }
  .card-head h2 { flex: 1 1 100%; font-size: 15px; }
  .seg { flex: none; }
  .seg button { white-space: nowrap; padding: 6px 10px; min-height: 34px; font-size: 12px; }
  #stageSeg { flex: 1 1 100%; justify-content: center; }
  .kline-note, .ctrl-disclaimer, .sig-detail, .ce-detail, .ctrl-why li { overflow-wrap: anywhere; word-break: normal; white-space: normal; }
  main { padding: 10px 12px 24px; }
  .card { padding: 12px; }
  .index-cards { gap: 8px; }
  .idx-price { font-size: 20px; }
  .idx-amount { display: none; }
  .col-x { display: none; }   /* 手机砍次要列 */
  .kline-wrap { height: 320px; }
  .signal-grid { grid-template-columns: 1fr; }
  .fin-val { grid-template-columns: repeat(2, 1fr); }
  .port-summary { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .ps-value { font-size: 16px; }
  .tf-grid { grid-template-columns: repeat(2, 1fr); }
  .tf-grid .tf-amount { grid-column: span 2; }
  .scan-grid { grid-template-columns: 1fr; gap: 8px; }
  .ctrl-head { grid-template-columns: 80px 1fr; gap: 10px; }
  .ctrl-verdict b { font-size: 16px; }
  .cb-name { width: 52px; }
  .stage-row { flex-direction: column; align-items: flex-start; gap: 3px; }
  .ctrl-score b { font-size: 32px; }
  .ctrl-stage { grid-column: span 2; }
  .ctrl-cols { grid-template-columns: 1fr; gap: 12px; }
  .btn-add { padding: 6px 12px; }
  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--card); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom); z-index: 80;
  }
  .tabbar button {
    flex: 1; border: none; background: none; padding: 12px 0;
    font-size: 14px; color: var(--muted);
  }
  .tabbar button.on { color: var(--accent); font-weight: 700; }
  /* 手机上一次只显示一个面板 */
  #main .panel { display: none; }
  #main .panel.on { display: flex; }
}

/* ==========================================================================
   独立模块「形态策略」专属样式 —— 全部 fl- 前缀，勿与其他模块混用
   模块自带 strategy.js（IIFE），此处只负责外观
   ========================================================================== */
#flRoot { display: flex; flex-direction: column; gap: 14px; width: 100%; }
.fl-jump {
  border: 1px solid var(--accent); color: var(--accent); background: #fff;
  border-radius: 8px; padding: 5px 12px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.fl-jump:hover { background: var(--accent); color: #fff; }
.fl-head { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 14px 16px; }
.fl-title { font-size: 17px; font-weight: 700; }
.fl-sub { color: var(--muted); font-size: 12px; margin-top: 4px; line-height: 1.6; }
.fl-p { font-size: 13.5px; line-height: 1.8; margin: 8px 0; }
.fl-p b, .kline-note b { color: var(--text); }
.fl-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 12px 0; }
.fl-kpis div { background: var(--bg); border-radius: 8px; padding: 12px 8px; text-align: center; }
.fl-kpis b { display: block; font-size: 23px; color: var(--up); font-variant-numeric: tabular-nums; }
.fl-kpis span { font-size: 11.5px; color: var(--muted); }
.fl-warn { background: #fff5f5; border: 1px solid #ffc9c9; color: #c92a2a; border-radius: 8px; padding: 10px 14px; font-size: 13px; line-height: 1.7; margin: 10px 0; }
.fl-analogy { background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 10px; padding: 12px 16px; font-size: 13.5px; margin: 10px 0; }
.fl-steps { margin: 12px 0; }
.fl-step { display: flex; gap: 10px; align-items: flex-start; margin: 9px 0; font-size: 13px; line-height: 1.7; }
.fl-step i { flex: 0 0 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 12px; }
.fl-gloss { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px; }
.fl-gloss div { background: var(--bg); border-radius: 8px; padding: 10px 12px; font-size: 12.5px; line-height: 1.7; }
.fl-gloss b { color: var(--accent); }
.fl-h3 { font-size: 14px; margin: 18px 0 8px; color: var(--text); }
.fl-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; align-items: center; margin-bottom: 6px; }
.fl-lg { display: inline-block; width: 16px; height: 0; border-top: 2px solid; margin-right: 4px; vertical-align: middle; }
.fl-lg-dim { color: var(--muted); }
.fl-chart-wrap { position: relative; width: 100%; height: 380px; }
/* canvas 位图按 W*dpr 放大，必须锁回容器尺寸，否则手机 dpr=2/3 会撑破页面 */
.fl-chart-wrap canvas { display: block; width: 100%; height: 100%; }
.fl-tbl th, .fl-tbl td { white-space: normal; line-height: 1.6; vertical-align: top; }
.fl-tbl th.num, .fl-tbl td.num { white-space: nowrap; }
.fl-formula { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--muted); }
.fl-real { color: var(--accent); font-weight: 700; }
.fl-th { color: var(--up); font-weight: 600; }
.fl-diag-bar { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0 6px; }
.fl-input-wrap { position: relative; flex: 1; min-width: 0; }
.fl-input-wrap input {
  width: 100%; box-sizing: border-box; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 14px; outline: none; background: var(--bg); color: var(--text);
}
.fl-input-wrap input:focus { border-color: var(--accent); background: #fff; }
.fl-drop {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 60;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 260px; overflow-y: auto;
}
.fl-drop[hidden] { display: none; }
.fl-drop-item { padding: 9px 12px; cursor: pointer; display: flex; gap: 10px; align-items: baseline; font-size: 13px; }
.fl-drop-item:hover { background: var(--bg); }
.fl-drop-item span { color: var(--muted); font-size: 12px; }
.fl-btn {
  border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 8px;
  padding: 9px 14px; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.fl-btn:hover { border-color: var(--accent); color: var(--accent); }
.fl-placeholder { color: var(--muted); font-size: 13px; padding: 14px 4px; }
.fl-diag-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 14px 0 8px; }
.fl-diag-head > div:first-child { flex: 1; min-width: 200px; }
.fl-diag-title { font-size: 15px; font-weight: 700; }
.fl-diag-score { text-align: center; background: var(--bg); border-radius: 10px; padding: 8px 16px; }
.fl-diag-score b { display: block; font-size: 24px; color: var(--accent); font-variant-numeric: tabular-nums; }
.fl-diag-score span { font-size: 11px; color: var(--muted); }
.fl-verdict { background: #eef4ff; border-left: 4px solid var(--accent); border-radius: 8px; padding: 10px 14px; font-size: 13.5px; font-weight: 600; margin: 8px 0 12px; }
.fl-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 8px 0; }
.fl-box { background: var(--bg); border-radius: 8px; padding: 14px; font-size: 13px; line-height: 1.75; }
.fl-box h3 { font-size: 14px; margin: 0 0 8px; }
.fl-box p { margin: 6px 0; }
.fl-details { margin-top: 14px; }
.fl-details summary { cursor: pointer; font-size: 13px; color: var(--accent); padding: 6px 0; }
.fl-pre { background: #1f2329; color: #e6edf3; padding: 14px; border-radius: 8px; overflow-x: auto; font-size: 12px; line-height: 1.6; margin: 8px 0; }
.fl-disc { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 14px; font-size: 13px; color: #78350f; line-height: 1.7; }

@media (max-width: 767px) {
  .fl-jump { display: none; }   /* 手机走底部标签栏，顶栏不再重复放入口 */
  .fl-head { padding: 12px; }
  .fl-title { font-size: 16px; }
  .fl-kpis { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .fl-kpis b { font-size: 20px; }
  .fl-gloss, .fl-two { grid-template-columns: 1fr; }
  .fl-chart-wrap { height: 300px; }
  .fl-tbl th, .fl-tbl td { padding: 7px 6px; font-size: 12px; }
  .fl-formula { font-size: 11px; overflow-wrap: anywhere; }
  .fl-diag-bar { flex-wrap: wrap; }
  .fl-diag-bar .btn-primary, .fl-diag-bar .fl-btn { min-height: 34px; }
  .fl-p, .fl-warn, .fl-analogy, .fl-box, .fl-disc, .fl-legend { overflow-wrap: anywhere; }
  /* 5 个底部标签：缩字号 + 不换行，保证 375px 下不挤裂 */
  .tabbar button { font-size: 13px; padding: 12px 2px; white-space: nowrap; }
}
@media (max-width: 400px) {
  .tabbar button { font-size: 12px; }
}

/* ==========================================================================
   独立模块「量化模型池」专属样式 —— mp- 前缀
   ========================================================================== */
#mpRoot { display: flex; flex-direction: column; gap: 14px; width: 100%; }
.mp-head { background: var(--card); border: 1px solid var(--line); border-left: 4px solid #7048e8; border-radius: var(--radius); padding: 14px 16px; }
.mp-title { font-size: 17px; font-weight: 700; }
.mp-sub { color: var(--muted); font-size: 12px; margin-top: 4px; line-height: 1.6; }
.mp-status { color: var(--muted); font-size: 11.5px; margin-top: 8px; line-height: 1.6; }
.mp-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.mp-kpis > div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 8px; text-align: center; }
.mp-kpis b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.mp-kpis span { font-size: 11.5px; color: var(--muted); }
.mp-card .mp-model { border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: var(--bg); }
.mp-model-head { margin-bottom: 10px; }
.mp-model-title { font-size: 15px; font-weight: 700; }
.mp-ver { font-size: 11px; color: #7048e8; background: #f3f0ff; border-radius: 5px; padding: 2px 6px; margin: 0 4px; }
.mp-n { color: var(--muted); font-size: 11px; font-weight: 400; }
.mp-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 10px 0; }
.mp-stats > div { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 9px 6px; text-align: center; }
.mp-stats b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.mp-stats span { font-size: 11px; color: var(--muted); }
.mp-expect { background: #eef4ff; border-left: 4px solid var(--accent); border-radius: 8px; padding: 10px 12px; font-size: 12.5px; line-height: 1.75; margin: 10px 0; }
.mp-expect .mp-n { display: block; margin-top: 5px; }
.mp-entry { background: #f3f0ff; border-left: 4px solid #7048e8; border-radius: 8px; padding: 10px 12px; font-size: 12.5px; line-height: 1.75; margin: 10px 0; }
.mp-entry .mp-n { display: block; margin-top: 5px; }
.mp-check { flex-direction: row !important; align-items: center; gap: 6px !important; font-size: 13px !important; color: var(--text) !important; }
.mp-check input { width: 16px; height: 16px; flex: none; }
.mp-diag { background: var(--card); border: 1px solid var(--line); border-left: 4px solid #7048e8; border-radius: 8px; padding: 12px; margin-bottom: 12px; font-size: 12.5px; line-height: 1.75; }
.mp-diag-title { font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.mp-diag-sum { background: var(--bg); border-radius: 6px; padding: 8px 10px; margin-bottom: 8px; }
.mp-diag-line { margin: 5px 0; overflow-wrap: anywhere; }
.mp-near-item { padding: 3px 0 3px 12px; border-left: 2px solid var(--line); margin: 3px 0; }
.mp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.mp-actions .btn-primary, .mp-actions .fl-btn { min-height: 34px; }
.mp-btn:disabled { opacity: .5; cursor: default; }
.mp-ok { background: #ebfbee; border: 1px solid #b2f2bb; color: #2b8a3e; border-radius: 8px; padding: 9px 12px; font-size: 13px; }
.mp-edit { background: var(--card); border: 1px dashed var(--accent); border-radius: 8px; padding: 12px; margin: 10px 0; }
.mp-edit[hidden] { display: none; }
.mp-edit-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mp-edit-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.mp-edit-grid input { width: 100%; box-sizing: border-box; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; background: #fff; color: var(--text); }
.mp-edit-grid input:focus { border-color: var(--accent); }
.mp-details { margin: 10px 0; }
.mp-details summary { cursor: pointer; font-size: 13px; color: var(--accent); padding: 6px 0; }
.mp-h3 { font-size: 14px; margin: 16px 0 8px; }
.mp-tbl th, .mp-tbl td { white-space: normal; line-height: 1.6; vertical-align: top; }
.mp-tbl th.num, .mp-tbl td.num { white-space: nowrap; }
.mp-tbl td.num b { font-variant-numeric: tabular-nums; }
.mp-th { color: var(--up); font-weight: 600; }
.mp-suggest { color: var(--accent); font-weight: 700; }
.mp-reason { min-width: 150px; max-width: 280px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.mp-del { border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: 6px; padding: 4px 8px; font-size: 12px; cursor: pointer; min-height: 30px; }
.mp-del:hover { border-color: var(--up); color: var(--up); }
.mp-fix-head { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font-size: 12.5px; margin-bottom: 8px; }
.mp-fix-empty { background: var(--card); border: 1px dashed var(--line); border-radius: 8px; padding: 12px; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.mp-fix-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.mp-fix-foot .hint { margin-left: 0; }
.mp-locked, .mp-canlock, .mp-lockneed { border-radius: 8px; padding: 10px 12px; font-size: 12.5px; margin-top: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mp-locked { background: #f3f0ff; color: #5f3dc4; }
.mp-canlock { background: #ebfbee; color: #2b8a3e; }
.mp-lockneed { background: var(--bg); color: var(--muted); }
.mp-hist-item { border-bottom: 1px solid var(--line); padding: 8px 0; font-size: 12.5px; }
.mp-hist-item .mp-n { display: block; margin-top: 3px; }

@media (max-width: 767px) {
  .mp-kpis { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .mp-kpis > div:last-child { grid-column: span 2; }
  .mp-kpis b { font-size: 20px; }
  .mp-stats { grid-template-columns: repeat(3, 1fr); }
  .mp-edit-grid { grid-template-columns: repeat(2, 1fr); }
  .mp-card .mp-model { padding: 12px; }
  .mp-tbl th, .mp-tbl td { padding: 7px 6px; font-size: 12px; }
  .mp-reason { min-width: 110px; max-width: 160px; }
  .mp-expect, .mp-fix-head, .mp-fix-empty, .fl-p { overflow-wrap: anywhere; }
  /* 6 个底部标签：缩字号不缩热区，保证 375px 下不挤裂 */
  .tabbar button { font-size: 11.5px; padding: 12px 1px; white-space: nowrap; }
}
@media (max-width: 400px) {
  .tabbar button { font-size: 11px; }
}
