:root {
  --bg: #f6f8fb; --card: #ffffff; --ink: #0f172a; --muted: #64748b;
  --line: #e6ebf1; --brand: #2563eb; --brand-d: #1d4ed8;
  --red: #e5484d; --orange: #f76b15; --amber: #f5a623; --teal: #12a594;
  --green: #30a46c; --blue: #3b82f6;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 8px; outline: none; background: #fff; }
input:focus, textarea:focus { border-color: var(--brand); }

/* 认证 */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg,#eef2ff,#f6f8fb); }
.auth-card { width: 360px; background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 28px; box-shadow: 0 10px 40px rgba(15,23,42,.08); }
.brand { font-size: 17px; font-weight: 700; margin-bottom: 18px; text-align: center; }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab { flex: 1; padding: 9px; border: 1px solid var(--line); background: #fff; border-radius: 9px; color: var(--muted); }
.tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }
#auth-form { display: flex; flex-direction: column; gap: 11px; }
#auth-submit { background: var(--brand); color: #fff; border: 0; padding: 11px; border-radius: 9px; font-weight: 600; }
#auth-submit:hover { background: var(--brand-d); }
.msg { font-size: 13px; min-height: 16px; }
.msg.err { color: var(--red); }
.msg.ok { color: var(--green); }

/* 整体页面宽度：视口的 90% 居中（顶栏与内容区一起收窄），两侧留边 */
#app.app { max-width: 90vw; margin: 0 auto; }
/* 布局 */
/* 顶栏拆两层：品牌条（品牌 + 版本 + 当前页）+ 导航条。
   两层整体 sticky，品牌条高度小，滚动时当前页始终可见；
   导航条横向可滚动，窄屏下菜单不会被换行挤出屏幕。 */
.top-sticky { position: sticky; top: 0; z-index: 5; background: #fff;
  border-bottom: 1px solid var(--line); }
.brandbar { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 16px 4px; }
.logo { font-weight: 700; white-space: nowrap; }
.now-page { font-size: 12px; color: var(--muted); white-space: nowrap; }
.now-page b { color: var(--brand); }
.ver-chip { font-size: 11px; font-weight: 500; color: var(--muted); background: #f1f5f9;
  border-radius: 20px; padding: 1px 8px; margin-left: 4px; }
.nav { display: flex; gap: 4px; padding: 0 10px 8px; overflow-x: auto; overflow-y: hidden;
  scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.nav::-webkit-scrollbar { height: 4px; }
.nav::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.nav-btn { border: 0; background: transparent; padding: 7px 10px; border-radius: 8px; color: var(--muted);
  font-size: 13px; white-space: nowrap; flex: 0 0 auto; }
.nav-btn.active { background: #eef2ff; color: var(--brand); font-weight: 600; }
.user { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.ghost { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 11px; }
.ghost.danger { color: #e5484d; border-color: #f3c1c0; }
.ghost.danger:hover { background: #fff5f5; }
.scan-select { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 7px 9px; }

main { padding: 18px 16px 40px; max-width: 100%; margin: 0; }
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.page-head h2 { margin: 0; font-size: 19px; }
.btn { background: var(--brand); color: #fff; border: 0; padding: 9px 14px; border-radius: 9px; font-weight: 600; }
.btn:hover { background: var(--brand-d); }
.btn.sec { background: #eef2ff; color: var(--brand); }

/* 卡片 / 网格 */
.grid { display: grid; gap: 14px; }
.cards { grid-template-columns: repeat(auto-fill, minmax(264px, 1fr)); }
/* 按股票代码分组的表格：代码列第一列并 rowspan 合并，组内为该类代码的明细 */
.grp-table { margin-bottom: 16px; }
/* 分组表里的多行合并单元格：内容顶部对齐，避免长文本居中后错位 */
.grp-table td[colspan], .grp-table td.grp-code { vertical-align: top; }
.grp-table td.wrap { white-space: normal; overflow-wrap: anywhere; }
.grp-table td.nowrap { white-space: nowrap; }
/* 提醒日志：级别栏固定 9 个字宽（列宽固定，超长标签在列内换行不挤压其它列）；说明栏固定 45% 并自动换行 */
.grp-table th.lvl, .grp-table td.lvl { width: 9em; min-width: 9em; max-width: 9em; }
.grp-table td.lvl { vertical-align: top; }
.grp-table td.lvl .pill { white-space: normal; overflow-wrap: anywhere; line-height: 1.35; padding: 2px 6px; }
.grp-table th.note, .grp-table td.note { width: 45%; white-space: normal; overflow-wrap: anywhere; line-height: 1.55; }
/* 可点击排序的表头（发件箱「标识」栏） */
.grp-table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.grp-table th.sortable:hover { color: var(--brand); }
.sort-ind { font-size: 11px; margin-left: 2px; color: var(--brand); }
/* 发件箱勾选列（窄） */
.grp-table th.sel, .grp-table td.sel { width: 34px; min-width: 34px; text-align: center; padding: 10px 4px; }
.grp-table td.sel input { cursor: pointer; width: 15px; height: 15px; }
.grp-code { vertical-align: top; width: 132px; background: #f8fafc; white-space: nowrap; }
.grp-code b { font-size: 14px; font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; }
.grp-code .gn { color: #334155; font-weight: 600; margin-top: 2px; }
.grp-code .gm { color: var(--muted); font-size: 12px; margin-top: 4px; white-space: normal; }
/* 表格在大屏下横向铺满：自动布局 + 内容列尽量占满剩余宽度 */
table { table-layout: auto; }
th:last-child, td:last-child { white-space: nowrap; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; min-width: 110px; }
.stat .v { font-size: 24px; font-weight: 700; }
.stat .k { color: var(--muted); font-size: 12px; }

/* 关注项卡 */
.pos { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 15px; position: relative; }
.pos .code { font-weight: 700; font-size: 15px; }
.pos .name { color: var(--muted); margin-left: 6px; }
/* 评分统一保留一位小数（如 54.0），4 字符在 54px 圆内需略缩字号并收紧字距 */
.score-badge { position: absolute; top: 14px; right: 14px; width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 15px; letter-spacing: -0.3px; color: #fff; }
/* 体检页可点评分：跳到首页对应评分格子 */
.score-badge.score-jump { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.score-badge.score-jump:hover { transform: scale(1.1); box-shadow: 0 0 0 3px rgba(37, 99, 235, .3); }
/* 跳转定位后的短暂高亮（让视线一眼找到目标格子） */
.pos.flash { border-color: #2563eb; animation: posFlash 2.4s ease-out 1; }
@keyframes posFlash {
  0% { box-shadow: 0 0 0 4px rgba(37, 99, 235, .45); }
  60% { box-shadow: 0 0 0 4px rgba(37, 99, 235, .25); }
  100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}
.tags { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 5px; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 20px; background: #f1f5f9; color: #475569; }
.tag.risk { background: #fee2e2; color: #b91c1c; }
.tag.opp { background: #dcfce7; color: #15803d; }
.sub { color: var(--muted); font-size: 12px; margin-top: 6px; display: flex; gap: 12px; flex-wrap: wrap; }
.profit.pos { color: var(--red); } /* 市场红涨 */
.profit.neg { color: var(--green); }

/* 表格 */
table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
th { background: #f8fafc; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
.pill { padding: 2px 9px; border-radius: 20px; font-size: 12px; color: #fff; display: inline-block; }

/* 持仓体检：相关性热力图（紧凑、居中、等宽单元格） */
.corr-table { border-radius: 10px; }
.corr-table th, .corr-table td { padding: 6px 4px; text-align: center; font-size: 11px;
  white-space: nowrap; font-variant-numeric: tabular-nums; }
.corr-table th { background: #f8fafc; font-weight: 600; }
.corr-table tbody th { background: #fff; color: var(--muted); font-weight: 600; text-align: left; padding-left: 8px; }

/* 持仓体检：图表容器固定高度，避免 Chart.js 在无高度容器内无限增高撑坏下方区块 */
.chart-box { position: relative; width: 100%; }

/* 持仓体检「综合建议」：重点两条（优先处理=红 / 底仓=绿）加左侧色条突出 */
.advice-sec h3 { margin-bottom: 10px; }
.advice-list { margin: 0; padding-left: 22px; }
.adv-item { font-size: 13px; line-height: 1.75; color: #334155; margin-bottom: 10px; padding-left: 10px; }
.adv-item > b { color: #0f172a; }
.adv-item.adv-priority { border-left: 3px solid #e5484d; background: #fef3f2; border-radius: 0 8px 8px 0; padding: 9px 12px; }
.adv-item.adv-core { border-left: 3px solid #30a46c; background: #f0fdf6; border-radius: 0 8px 8px 0; padding: 9px 12px; }

/* 发件箱「标识」颜色图例：小圆点 + 文案，横向自动换行 */
.legend { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.legend .lg { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.legend .lg i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* 「立即扫描」按钮旁的扫描类型预览（盘中/盘后由时段决定，颜色区分） */
.scan-hint { font-size: 13px; white-space: nowrap; }
.scan-hint b { font-weight: 700; }

/* 大盘 / 板块热度面板（仪表盘）：热度是叠加到综合分的 ±4 附加分，此处让调整有据可查 */
.heat-panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; margin: 12px 0 0; }

/* —— 大盘环境 & 仓位建议面板（仪表盘顶部） —— */
.mkt-panel { background: linear-gradient(180deg, #f8fbff 0%, var(--card) 60%);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 12px 0 0; }
.mkt-panel.mkt-empty { background: var(--card); }
.mkt-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mkt-title { font-weight: 800; font-size: 14px; color: var(--ink); }
.mkt-upd { font-size: 11px; margin-left: auto; }
.mkt-assess { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 8px 0 6px; }
.mkt-cond { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mkt-badge { color: #fff; border-radius: 20px; padding: 2px 11px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.mkt-pos { display: flex; align-items: baseline; gap: 7px; white-space: nowrap; }
.mkt-pos b { font-size: 26px; font-weight: 800; line-height: 1; }
.mkt-label { font-size: 13px; font-weight: 700; }
.mkt-bar { position: relative; height: 12px; border-radius: 8px; overflow: hidden;
  background: #eef2f7; margin-top: 4px; }
.mkt-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 8px;
  transition: width .3s ease; min-width: 3px; }
.mkt-scale { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin-top: 2px; }
.mkt-note { font-size: 12px; color: var(--muted); margin-top: 7px; line-height: 1.55; }
@media (max-width: 640px) {
  .mkt-assess { flex-direction: column; align-items: flex-start; gap: 6px; }
  .mkt-pos b { font-size: 22px; }
}
.heat-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.heat-title { font-weight: 700; font-size: 13px; }
.heat-scale { font-size: 12px; color: var(--muted); }
.heat-scale b { color: var(--brand); }
.heat-upd { font-size: 11px; margin-left: auto; }
.heat-broad { display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding-bottom: 8px; border-bottom: 1px dashed var(--line); margin-bottom: 8px; font-size: 13px; }
.heat-broad .ix { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.heat-broad .ix b { font-weight: 600; color: var(--ink); }
.heat-secs { display: flex; flex-direction: column; gap: 5px; }
.heat-row { display: grid; grid-template-columns: 132px 1fr 66px 46px; align-items: center; gap: 9px; font-size: 12px; }
.heat-row .hr-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.heat-row .hr-track { position: relative; height: 8px; background: #f1f5f9; border-radius: 6px; overflow: hidden; }
/* 以中线为 0：涨在右半、跌在左半，宽度按 ±3% 满格映射 */
.heat-row .hr-track i { position: absolute; top: 0; bottom: 0; border-radius: 6px; }
.heat-row .hr-val { text-align: right; font-weight: 600; }
.heat-row .hr-lvl { text-align: center; color: #fff; border-radius: 20px; padding: 1px 0; font-size: 11px; }
@media (max-width: 720px) {
  .heat-row { grid-template-columns: 96px 1fr 60px 42px; }
}

/* 我的持仓：股票名/代码点击跳转新浪（新窗口） */
.stock-link { color: var(--brand); text-decoration: none; font-weight: 600; }
.stock-link:hover { text-decoration: underline; }
/* 仪表盘持仓卡：股票名称点击跳新浪（新窗口），与卡片自身的「因子诊断」点击互不干扰 */
.pos .name-link { margin-left: 6px; color: var(--brand); font-weight: 600; text-decoration: none; }
.pos .name-link:hover { text-decoration: underline; }
/* 公司名称列：加宽约一字宽度、表头与名称单行显示不换行 */
th.c-name, td.c-name { white-space: nowrap; min-width: 9em; }

/* 录入弹窗：拼音/中文/代码自动补齐下拉 */
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 28px rgba(15,23,42,.12);
  max-height: 240px; overflow-y: auto; }
.sg-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; border-bottom: 1px solid #f1f5f9; }
.sg-item:last-child { border-bottom: 0; }
.sg-item:hover { background: #f1f5ff; }
.sg-item b { font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; color: #0f172a; }
.sg-mkt { font-size: 11px; font-weight: 700; color: #475569; background: #eef2ff; border: 1px solid #c7d2fe;
  padding: 1px 7px; border-radius: 10px; }

/* 表单/弹层
   高度策略：遮罩层负责滚动（内容超过视口时底部可滚到，且不裁切）。
   modal 自身 max-height + overflow-y 兜底，避免遮罩滚动失效时内容被截断。 */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 20;
  display: flex; align-items: flex-start; justify-content: center;
  overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  padding: 24px 12px; }
.modal { width: 460px; max-width: 92vw; background: #fff; border-radius: 16px; padding: 22px;
  max-height: calc(100dvh - 48px); overflow-y: auto; -webkit-overflow-scrolling: touch;
  margin: auto; }  /* margin:auto 让内容矮时垂直居中、高时从顶部排布且底部可达 */
.modal h3 { margin: 0 0 14px; }
/* 窄屏/移动端：弹层贴满宽度，减少内边距换取内容区高度 */
@media (max-width: 640px) {
  .modal-mask { padding: 12px 8px; }
  .modal { width: auto; max-width: 100%; padding: 16px 14px; max-height: calc(100dvh - 24px); }
}
.form-grid { display: grid; gap: 11px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
/* 带标签栏位：输入框无论是否聚焦/有值，标签始终可见 */
.fld { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.fld label { font-size: 12px; font-weight: 600; color: var(--muted); }
.fld input { width: 100%; }
.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
/* 因子诊断弹层：比通用弹层宽 10%（560 → 616px），窄屏仍自适应 */
.modal.modal-detail { width: 616px; max-width: 96vw; }
/* 关闭按钮吸底：内容再长也一直可见，不用滚到底部才能关闭 */
.modal .actions-sticky { position: sticky; bottom: -22px; margin: 16px -22px -22px; padding: 12px 22px;
  background: rgba(255,255,255,.96); border-top: 1px solid var(--line); backdrop-filter: blur(4px); }
@media (max-width: 640px) {
  .modal .actions-sticky { bottom: -16px; margin: 16px -14px -16px; padding: 10px 14px; }
}

/* 配置 */
.cfg-sec { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-bottom: 14px; }
.cfg-sec h3 { margin: 0 0 14px; font-size: 16px; }
.cfg-note { font-size: 12px; line-height: 1.6; background: #f1f5f9; border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 11px; margin-bottom: 12px; }
.cfg-note b { color: var(--brand); }
.weight-row { display: grid; grid-template-columns: 100px 1fr 54px; gap: 12px; align-items: center; margin-bottom: 9px; }
.weight-row input[type=range] { width: 100%; }
.lvl-table td input { width: 90px; }
.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 40px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #0f172a; color: #fff;
  padding: 10px 18px; border-radius: 10px; z-index: 30; opacity: 0; transition: opacity .2s; }
.toast.show { opacity: 1; }

/* 数据源徽标 / 成本异常提示 */
.src-badge { margin-left: 10px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.src-badge.real { background: #e7f7ef; color: #0f7b52; }
.src-badge.mock { background: #fff3e0; color: #b45309; }
.src-badge.na { background: #fdecec; color: #b3261e; }
.na-pill { padding: 2px 8px; border-radius: 10px; background: #fdecec; color: #b3261e; font-size: 12px; font-weight: 600; }
/* 顶栏软件版本 chip（commit · 更新时间） */
.ver-chip { margin-left: 8px; padding: 2px 8px; border-radius: 10px; background: #eef2f7; color: #64748b;
  font-size: 11px; font-weight: 500; vertical-align: middle; cursor: help; white-space: nowrap; }
.warn-dot { display: inline-block; margin-left: 6px; width: 16px; height: 16px; line-height: 16px;
  text-align: center; border-radius: 50%; background: #e5484d; color: #fff; font-size: 11px;
  font-weight: 700; cursor: help; vertical-align: middle; }
.cost-warn { margin-top: 10px; padding: 7px 10px; border-radius: 8px; font-size: 12px;
  background: #fdecec; color: #b3261e; line-height: 1.5; }

/* 评级 / 四维明细 / 信号 */
.verdict-line { margin-top: 6px; font-size: 13px; }
.verdict-card { margin: 10px 0; padding: 12px 14px; border-radius: 12px; background: #f8fafc; border: 1px solid var(--line); }
.verdict-card .vc-head { font-size: 14px; font-weight: 700; color: #0f172a; }
.verdict-card .vc-pct { font-size: 20px; font-weight: 800; margin: 4px 0; color: #1d4ed8; }
.verdict-card .vc-advice { font-size: 13px; color: #475569; line-height: 1.55; }
.dim-block { margin-bottom: 12px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.dim-title { display: flex; justify-content: space-between; align-items: center; padding: 7px 12px;
  background: #f1f5f9; font-size: 13px; font-weight: 600; }
.dim-title b { font-size: 15px; }
.dim-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.dim-table td { padding: 5px 10px; border-top: 1px solid #eef2f7; vertical-align: top; }
.dim-table .dl { color: #475569; white-space: nowrap; width: 96px; }
.dim-table .dv { color: #0f172a; font-weight: 600; white-space: nowrap; width: 130px; }
.dim-table .ds { color: #1d4ed8; font-weight: 700; text-align: center; width: 42px; }
.dim-table .dc { color: #64748b; }
.flags { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.flag { font-size: 12px; padding: 3px 9px; border-radius: 16px; }
.flag.risk { background: #fdecec; color: #b3261e; }
.flag.opp { background: #e7f7ef; color: #0f7b52; }

/* 资金行为研判卡片 */
.cap-card { margin: 10px 0; padding: 12px 14px; border-radius: 12px; background: #fff8f1; border: 1px solid #f4d9b8; }
.cap-head { display: flex; justify-content: space-between; align-items: center; }
.cap-behavior { font-size: 15px; font-weight: 800; }
.cap-conf { font-size: 12px; font-weight: 700; color: #fff; padding: 2px 9px; border-radius: 14px; }
.cap-summary { font-size: 13px; color: #475569; line-height: 1.55; margin: 6px 0; }
.cap-ev { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 4px; }
.cap-ev td { padding: 4px 8px; border-top: 1px solid #f3e4cf; vertical-align: top; }
.cap-ev .ce-l { color: #475569; white-space: nowrap; width: 76px; }
.cap-ev .ce-v { color: #0f172a; font-weight: 600; white-space: nowrap; width: 92px; text-align: right; }
.cap-ev .ce-n { color: #64748b; }
.cap-reject { font-size: 12px; color: #92650f; margin-top: 6px; background: #fdf3e3; padding: 6px 8px; border-radius: 8px; }
.cap-badge { font-size: 12px; color: #92650f; margin-top: 4px; }
.cap-conf-sm { font-weight: 700; color: #b45309; }

/* 观察/候选池标识（基准价/数量留空） */
.watch-tag { font-size: 11px; font-weight: 700; color: #6d28d9; background: #f3e8ff; padding: 1px 7px; border-radius: 10px; margin-left: 4px; vertical-align: middle; }

/* 健康分布仪表盘（顶部 · 紧凑 · 可点击筛选） */
.filter-bar { margin: 2px 0 8px; font-size: 14px; color: #475569; display: flex; align-items: center; }
.filter-bar b { margin: 0 4px; }
.ghost.sm { padding: 3px 11px; font-size: 12px; margin-left: 8px; }
.hd-compact { background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 14px; margin-bottom: 14px; }
.hd-title { font-size: 13px; font-weight: 600; color: #334155; margin-bottom: 8px; }
.hd-bar { height: 10px; border-radius: 6px; overflow: hidden; background: #eef2f7; margin-bottom: 10px; }
.hd-seg { display: flex; height: 100%; width: 100%; }
.hd-seg > span { height: 100%; display: block; transition: width .2s; }
.hd-legend { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hc-chip { display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1.5px solid var(--c, #cbd5e1); background: #fff; color: #334155;
  border-radius: 999px; padding: 4px 12px; font-size: 13px; transition: all .15s; }
.hc-chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, #cbd5e1); }
.hc-chip b { margin-left: 2px; color: #0f172a; }
.hc-chip:hover { background: #f8fafc; }
.hc-chip.active { background: var(--c, #2563eb); color: #fff; border-color: var(--c, #2563eb); }
.hc-chip.active .dot { background: #fff; }
.hc-chip.active b { color: #fff; }

/* 模型校准监控页 */
.disclaimer { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412;
  border-radius: 10px; padding: 10px 14px; font-size: 13px; line-height: 1.6; margin-bottom: 14px; }
.opp-card { margin: 10px 0; padding: 12px 14px; border-radius: 12px; background: #f0fdf4; border: 1px solid #bbf7d0; }
.opp-card .oc-head { font-size: 14px; font-weight: 700; color: #14532d; }
.opp-card .oc-prob { font-size: 20px; font-weight: 800; color: #15803d; margin: 0 4px; }
.opp-card .oc-baseline { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.neut-badge { font-size: 12px; padding: 2px 9px; border-radius: 12px; background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.opp-card .oc-notes { font-size: 12px; line-height: 1.6; }
.opp-card .oc-notes .ok { color: #15803d; }
.opp-card .oc-notes .muted { color: #64748b; }

/* 诊断弹窗：大盘/板块热度调整块（说明综合分 = 维度分 + 热度附加分） */
.heat-card { margin: 10px 0; padding: 10px 13px; border-radius: 12px; background: #eff6ff; border: 1px solid #bfdbfe; }
.heat-card .hc-head { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 700; color: #1e3a8a; flex-wrap: wrap; }
.heat-card .hc-adj { font-size: 13px; font-weight: 800; color: #fff; border-radius: 20px; padding: 1px 10px; }
.heat-card .hc-lvl { font-size: 12px; font-weight: 600; }
.heat-card .hc-reason { font-size: 12px; color: #1e40af; margin-top: 5px; line-height: 1.55; }
.heat-card .hc-split { font-size: 12px; margin-top: 5px; line-height: 1.55; }
.heat-card .hc-split b { color: #1e3a8a; }
.heat-card .hc-parts { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
.heat-card .hc-part { font-size: 13px; font-weight: 700; }
.heat-card .hc-split b { color: #1e3a8a; }

/* —— 我的持仓 / 历史持仓：操作按钮竖向堆叠（两行），便于移动端点按 —— */
.act-stack { display: flex; flex-direction: column; gap: 6px; }
.act-stack .ghost { width: 100%; }

/* —— 移动端（≤720px）：宽表转卡片式，每列带标签竖向排列，避免横向滚动挤占「建议」列 —— */
@media (max-width: 720px) {
  .resp { border: 0; background: transparent; }
  .resp thead { display: none; }
  .resp tbody, .resp tr, .resp td { display: block; width: 100%; }
  .resp tr { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px;
    background: #fff; padding: 2px 0; }
  .resp td { border: 0; border-bottom: 1px solid #f1f5f9; white-space: normal;
    display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 9px 12px; }
  .resp td::before { content: attr(data-label); flex: 0 0 auto; font-weight: 600;
    color: var(--muted); font-size: 12px; }
  .resp td.col-actions { display: block; }
  .resp td.col-actions .act-stack { margin-top: 6px; }
  .resp td[colspan] { justify-content: center; }
  .resp td[colspan]::before { content: none; }
}
