/* BtWin 前端样式
   颜色规范：红涨绿跌、平盘灰。详见项目根目录 STYLE_GUIDE.md */
:root {
  --bt-bg: #f2f4f8;
  --bt-surface: #ffffff;
  --bt-border: #e4e8f0;
  --bt-text: #1f2430;
  --bt-muted: #78818f;
  --bt-primary: #2f6fed;
  --bt-primary-dark: #2358c3;
  /* 涨跌颜色：红 = 盈利/上涨；绿 = 亏损/下跌；灰 = 平盘 */
  --bt-up: #d9382c;
  --bt-down: #12995a;
  --bt-flat: #8a94a6;
  /* 严重度色（影响等级/紧急度/风控提示）：**刻意不用涨跌色** ——
     否则「利好 + 影响高」会同框出现红绿，读起来像利好被标红。见下方 .badge-sev-* */
  --bt-sev-high: #d97706;
  --bt-header-bg: #fafbfd;
  --bt-thead-bg: #f6f8fc;
  --bt-hover-bg: #f2f6ff;
  --bt-nav-bg: #22304e;
  --bt-sidebar-hover: #eef3fc;
  --bt-link: #2358c3;
  --bt-primary-soft: #eaf1ff;
  --bt-bonus-soft: #fff4e0;
  --bt-bonus-text: #a25c00;
  --bt-highlight: #fff7e6;
  --bt-scroll: #cfd6e4;
  --bt-navbar-h: 46px;
  /* 菜单宽度 */
  --bt-sidebar-w: 130px;
  --bt-radius: 8px;
  --bt-shadow: 0 1px 2px rgba(24, 34, 58, .05);
}

/* 暗色主题（data-bs-theme 由顶栏按钮切换并写入 localStorage）
   为避免闪烁，index 的 <head> 内联脚本在首屏前应用 data-bs-theme */
[data-bs-theme="dark"] {
  --bt-bg: #12161f;
  --bt-surface: #1a2029;
  --bt-border: #2a323d;
  --bt-text: #e6e9ef;
  --bt-muted: #9aa4b2;
  --bt-primary: #4c8bf5;
  --bt-primary-dark: #7aa7ff;
  --bt-flat: #9aa4b2;
  --bt-header-bg: #1f2630;
  --bt-thead-bg: #1d242e;
  --bt-hover-bg: #232c38;
  --bt-nav-bg: #151b26;
  --bt-sidebar-hover: #232c38;
  --bt-link: #7aa7ff;
  --bt-primary-soft: #1e2a44;
  --bt-bonus-soft: #3a2f18;
  --bt-bonus-text: #f0b46b;
  --bt-highlight: #3a3218;
  --bt-scroll: #39424f;
  --bt-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
[data-bs-theme="dark"] body { background: var(--bt-bg); color: var(--bt-text); }
[data-bs-theme="dark"] .table { --bs-table-color: var(--bt-text); }
[data-bs-theme="dark"] .table-light > :not(caption) > * > * {
  background-color: var(--bt-thead-bg); color: var(--bt-muted);
}
[data-bs-theme="dark"] .bg-body-tertiary { background-color: var(--bt-header-bg) !important; }
[data-bs-theme="dark"] .list-group-item { background: var(--bt-surface); color: var(--bt-text); border-color: var(--bt-border); }
[data-bs-theme="dark"] .form-control, [data-bs-theme="dark"] .form-select {
  background-color: #141a23; color: var(--bt-text); border-color: var(--bt-border);
}
[data-bs-theme="dark"] .text-bg-light { background: #232c38 !important; color: var(--bt-text) !important; }

html, body { height: 100%; }
body {
  font-size: 13px;
  overflow: hidden;
  background: var(--bt-bg);
  color: var(--bt-text);
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, -apple-system, Arial, sans-serif;
}

/* ---------------- 顶部栏 ---------------- */
.app-navbar {
  height: var(--bt-navbar-h);
  padding: .2rem .75rem;
  z-index: 1030;
  background: var(--bt-nav-bg);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.app-navbar .navbar-brand { font-size: .95rem; font-weight: 600; letter-spacing: .2px; }
.app-navbar .navbar-text { font-size: .8rem; }
.nav-badge {
  background: rgba(255, 255, 255, .12);
  border-radius: 999px;
  padding: .1rem .5rem;
  font-size: .7rem;
}
.nav-icon-btn { padding: .12rem .45rem; border-color: rgba(255, 255, 255, .32); color: #fff; font-size: .8rem; }
.nav-icon-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }

/* ---------------- 布局 ---------------- */
.app-layout { display: flex; height: calc(100vh - var(--bt-navbar-h)); margin-top: var(--bt-navbar-h); }
.app-sidebar {
  flex: 0 0 var(--bt-sidebar-w);
  width: var(--bt-sidebar-w);
  background: var(--bt-surface);
  border-right: 1px solid var(--bt-border);
  overflow-y: auto;
  overflow-x: hidden;
  transition: flex-basis .15s ease, width .15s ease, transform .15s ease;
}
.app-sidebar.collapsed { flex-basis: 0; width: 0; overflow: hidden; }
.app-main { flex: 1 1 auto; overflow-y: auto; padding: .7rem .85rem 1.5rem; }

/* ---------------- 侧边菜单 ---------------- */
.side-group-title {
  font-size: .68rem;
  letter-spacing: .06em;
  color: var(--bt-muted);
  padding: .55rem .65rem .15rem;
  white-space: nowrap;
}
.app-sidebar .nav-link {
  display: flex; align-items: center; gap: .5rem;
  color: var(--bt-text); border-radius: 6px;
  padding: .34rem .55rem; margin: 0 .35rem;
  white-space: nowrap; font-size: .82rem;
}
.app-sidebar .nav-link:hover { background: var(--bt-sidebar-hover); color: var(--bt-primary-dark); }
.app-sidebar .nav-link.active { background: var(--bt-primary); color: #fff; }
.app-sidebar .nav-link i { font-size: .95rem; width: 1rem; text-align: center; }
/* 收窄后长菜单名以省略号截断，避免半字被裁切 */
.app-sidebar .nav-link span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sidebar-overlay { display: none; }

/* ---------------- 页头（紧凑） ---------------- */
.page-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .5rem; margin-bottom: .6rem;
}
.page-head h6 { margin: 0; font-weight: 650; font-size: .98rem; }
.page-head .hint { color: var(--bt-muted); font-size: .75rem; }

/* ---------------- 卡片 ---------------- */
.card { border: 1px solid var(--bt-border); border-radius: var(--bt-radius); box-shadow: var(--bt-shadow); background: var(--bt-surface); }
.card-header {
  background: var(--bt-header-bg); border-bottom: 1px solid var(--bt-border);
  font-weight: 600; font-size: .82rem; padding: .4rem .65rem;
  border-radius: var(--bt-radius) var(--bt-radius) 0 0 !important;
}
.card-body { padding: .6rem .65rem; }
.card-body.p-0 { padding: 0 !important; }

/* 卡片标题颜色区分（柔和，不刺眼） */
.card-header.hdr-blue   { color: #1d4ed8; background: #eef3ff; border-bottom-color: #dbe6ff; }
.card-header.hdr-green  { color: #0f7a45; background: #e9f7ef; border-bottom-color: #d5efe0; }
.card-header.hdr-orange { color: #a25c00; background: #fff4e0; border-bottom-color: #fbe6c2; }
.card-header.hdr-purple { color: #6d28d9; background: #f2edff; border-bottom-color: #e4daff; }
.card-header.hdr-teal   { color: #0f766e; background: #e6f7f5; border-bottom-color: #cdeeea; }
.card-header.hdr-red    { color: #b42318; background: #fdeceb; border-bottom-color: #f8d7d4; }
.card-header.hdr-gray   { color: #475569; background: #f1f5f9; border-bottom-color: #e2e8f0; }
[data-bs-theme="dark"] .card-header.hdr-blue   { color: #9cc0ff; background: #1b2740; border-bottom-color: #24344f; }
[data-bs-theme="dark"] .card-header.hdr-green  { color: #7fdcae; background: #14291f; border-bottom-color: #1d3a2c; }
[data-bs-theme="dark"] .card-header.hdr-orange { color: #f0b46b; background: #2e2413; border-bottom-color: #3d311b; }
[data-bs-theme="dark"] .card-header.hdr-purple { color: #c4b0ff; background: #241d3b; border-bottom-color: #322a4d; }
[data-bs-theme="dark"] .card-header.hdr-teal   { color: #7fd8cf; background: #122b29; border-bottom-color: #1b3c39; }
[data-bs-theme="dark"] .card-header.hdr-red    { color: #f09a92; background: #2f1a18; border-bottom-color: #402523; }
[data-bs-theme="dark"] .card-header.hdr-gray   { color: #b6c0cd; background: #1f2630; border-bottom-color: #2a323d; }

/* 指标卡片：适配 1 千万级（7 位以上数字）不换行 */
/* 顶部指标卡：限宽 180px，同排卡片间距 10px，避免宽屏下被拉伸过宽 */
.card-metric { min-height: 74px; max-width: 180px; }
.metric-row { display: flex; flex-wrap: wrap; gap: 10px; }
.metric-row > .card-metric { flex: 0 1 180px; max-width: 180px; }
.card-metric .metric-label { color: var(--bt-muted); font-size: .72rem; }
.card-metric .metric-value {
  font-size: 1.05rem; font-weight: 650; font-variant-numeric: tabular-nums;
  white-space: nowrap; letter-spacing: -.2px; line-height: 1.35;
}
.card-metric .metric-sub { font-size: .72rem; color: var(--bt-muted); white-space: nowrap; }

/* 大盘 / 最强板块卡片：内容比指标卡宽，允许伸展（最多 420px） */
.metric-row > .card-index { flex: 1 1 240px; max-width: 420px; min-width: 200px; }

/* 移动端：顶部指标卡宽度收窄为桌面端的一半（180px → 90px） */
@media (max-width: 767.98px) {
  .metric-row { gap: 6px; }
  .card-metric { min-height: 62px; max-width: 80px; }
  .metric-row > .card-metric { flex: 0 1 80px; max-width: 80px; }
  .card-metric .card-body { padding: .35rem .4rem; }
  .card-metric .metric-label { font-size: .64rem; }
  .card-metric .metric-value { font-size: .78rem; letter-spacing: -.3px; white-space: normal; word-break: break-all; }
  .card-metric .metric-sub { font-size: .62rem; white-space: normal; }
  /* 大盘 / 板块卡片在窄屏独占一行，不跟着缩到 80px */
  .metric-row > .card-index { flex: 1 1 100%; max-width: 100%; min-width: 0; }
  .card-index .metric-label { font-size: .7rem; }
}

/* ---------------- 表格（紧凑） ---------------- */
.table { margin-bottom: 0; font-size: .8rem; }
.table > thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--bt-thead-bg); color: var(--bt-muted);
  font-weight: 600; font-size: .74rem;
  border-bottom: 1px solid var(--bt-border) !important;
  white-space: nowrap; padding: .34rem .45rem;
}
.table td, .table th { padding: .3rem .45rem; }
.table-hover > tbody > tr:hover > * { background: var(--bt-hover-bg); }
.mono { font-family: Consolas, "Courier New", monospace; }
/* 移动端：名称 / 赛道合并到代码列显示（收起独立的名称列、赛道列，表头同步收起以保持对齐） */
.m-name, .m-track { display: none; }
@media (max-width: 767.98px) {
  .col-name, .col-track { display: none; }
  td.col-code { white-space: nowrap; }
  .m-name, .m-track {
    display: block; margin-top: 1px; font-size: .72rem; font-weight: 400;
    font-family: var(--bs-body-font-family); white-space: normal;
  }
  .m-track { color: var(--bt-muted); font-size: .68rem; }
}
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* 持仓等列表限高：约 10 行高度，超出滚动 */
.positions-scroll { max-height: 332px; overflow-y: auto; }
.date-list-scroll { max-height: calc(100vh - 190px); overflow-y: auto; }

/* ---------------- 首页仪表盘 ---------------- */
/* 顶部指标卡固定在滚动容器顶部，下方内容滚动 */
.dashboard-metrics {
  position: sticky; top: 0; z-index: 5;
  background: var(--bt-bg);
  padding-bottom: .35rem;
}
/* 左右两栏：高度等高，末张卡片底部对齐 */
.dash-col { display: flex; flex-direction: column; gap: .5rem; }
.dash-fill { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.dash-fill > .card-body { flex: 1 1 auto; overflow-y: auto; min-height: 96px; }
@media (max-width: 1199.98px) {
  .dash-col { height: auto; }
  .dash-fill { flex: 0 0 auto; }
}

/* 关键信息强调 + 涨跌色 */
.kv-strong { font-weight: 650; color: var(--bt-primary-dark); }
.text-up { color: var(--bt-up) !important; font-weight: 600; }     /* 红：盈利/上涨 */
.text-down { color: var(--bt-down) !important; font-weight: 600; } /* 绿：亏损/下跌 */
.text-flat { color: var(--bt-flat) !important; }                   /* 灰：平盘 */
.badge { border-radius: 999px; font-weight: 500; padding: .28em .55em; font-size: .72rem; }
.badge-score { background: var(--bt-primary-soft); color: var(--bt-link); }
.badge-bonus { background: var(--bt-bonus-soft); color: var(--bt-bonus-text); }

/* ---------------------------------------------------------------------------
   方向色 / 严重度色（2026-10-09 新增，补 STYLE_GUIDE 的规则漏洞）
   ---------------------------------------------------------------------------
   为什么必须单独定义这组类（原来各页面直接写 Bootstrap 的 text-bg-success /
   text-bg-danger，结果全站漂移成两套相反约定）：

   1) **方向色**（利好/利空、上涨/下跌、买入/卖出）走 `--bt-up` / `--bt-down`，
      与 §一 的「红涨绿跌」同源。照着 Bootstrap 的语义类写是错的 ——
      Bootstrap 的 `danger`=红=告警、`success`=绿=成功，与股市颜色**正好相反**，
      这正是 STYLE_GUIDE §一 禁止用它们表达涨跌的原因（当时只覆盖了数字列，
      badge 层漏了，于是「利好」一会儿红一会儿绿）。
   2) **严重度色**（影响高/紧急/风控）**不得**复用方向色：否则「利好 + 影响高」
      会在同一行同时出现红与绿，看起来就像「利好被标成红色」（真实用户投诉）。
      严重度走橙（`--bt-sev-high`）/ 灰。

   ⚠️ **约定只在这里定一次**：`badge-good` 到底该红还是该绿，改这两行即可，
      全站（JS 与 Jinja 模板）都跟着变，不需要逐个文件改。
--------------------------------------------------------------------------- */
.badge-good  { background: var(--bt-up);   color: #fff; }  /* 利好 / 上涨 / 买入：红 */
.badge-bad   { background: var(--bt-down); color: #fff; }  /* 利空 / 下跌 / 卖出：绿 */
.badge-flat  { background: var(--bt-flat); color: #fff; }  /* 中性：灰 */
.badge-sev-high { background: var(--bt-sev-high); color: #fff; }  /* 严重度：高 → 橙 */
.badge-sev-mid  { background: var(--bt-flat);     color: #fff; }  /* 严重度：中/低/未知 → 灰 */

/* ---------------- 按钮/表单 ---------------- */
.btn { border-radius: 6px; font-size: .8rem; padding: .28rem .6rem; }
.btn-sm { font-size: .75rem; padding: .18rem .5rem; }
.btn-primary { background: var(--bt-primary); border-color: var(--bt-primary); }
.btn-primary:hover { background: var(--bt-primary-dark); border-color: var(--bt-primary-dark); }
.form-control, .form-select { border-radius: 6px; border-color: var(--bt-border); font-size: .8rem; padding: .28rem .5rem; }
.form-control-sm, .form-select-sm { font-size: .75rem; padding: .18rem .45rem; }
.form-label { margin-bottom: .2rem; font-size: .76rem; color: #4b5568; }
[data-bs-theme="dark"] .form-label { color: var(--bt-muted); }
.form-control:focus, .form-select:focus {
  border-color: #9db9f9; box-shadow: 0 0 0 .15rem rgba(47, 111, 237, .12);
}
.nav-tabs { border-bottom: 1px solid var(--bt-border); }
.nav-tabs .nav-link { border: none; color: var(--bt-muted); font-size: .82rem; padding: .35rem .7rem; }
.nav-tabs .nav-link.active { color: var(--bt-primary); border-bottom: 2px solid var(--bt-primary); background: transparent; font-weight: 600; }

/* ---------------- 其他 ---------------- */
tr[data-code] { cursor: pointer; }
.pool-stock { cursor: pointer; }
.highlight-row { background-color: var(--bt-highlight) !important; }
.flash-row > td { animation: bt-flash 1.8s ease; }
@keyframes bt-flash {
  0% { background-color: #ffe9a8; }
  100% { background-color: transparent; }
}
.alert { border-radius: var(--bt-radius); font-size: .8rem; padding: .5rem .7rem; }
.modal-content { border: 0; border-radius: var(--bt-radius); box-shadow: 0 18px 44px rgba(20, 28, 48, .22); }
.modal-header { padding: .55rem .8rem; border-bottom: 1px solid var(--bt-border); }
.modal-body { padding: .7rem .8rem; font-size: .82rem; }
.modal-title { font-size: .92rem; font-weight: 600; }
.modal-body h6 { font-size: .82rem; font-weight: 650; margin: .5rem 0 .3rem; }
.app-main::-webkit-scrollbar, .app-sidebar::-webkit-scrollbar { width: 8px; height: 8px; }
.app-main::-webkit-scrollbar-thumb, .app-sidebar::-webkit-scrollbar-thumb { background: var(--bt-scroll); border-radius: 6px; }

/* 笔记编辑器 */
.note-item.active { background: var(--bt-primary); color: #fff; border-color: var(--bt-primary); }
.note-item .note-meta { font-size: .7rem; opacity: .75; }
.note-editor textarea { min-height: 60vh; resize: vertical; line-height: 1.6; }

/* 笔记附件：待上传区（可多选 / 拖拽 / Ctrl+V 粘贴） */
.pending-drop {
  border: 1px dashed var(--bt-border);
  border-radius: var(--bt-radius);
  padding: .45rem .55rem;
  background: var(--bt-header-bg);
}
.pending-drop.dragover { border-color: var(--bt-primary); background: var(--bt-primary-soft); }
.pending-list:not(:empty) { margin-top: .4rem; }
.pending-item { display: flex; align-items: center; gap: .4rem; padding: .15rem 0; }
.pending-item .pending-name { max-width: 320px; }
.pending-item .pending-ext { font-size: .78rem; color: var(--bt-muted); min-width: 3.5em; }
.attach-name { max-width: 420px; }

/* 选股复盘：左日期列表（宽度贴合日期文字，刚好放下即可） + 右详情 */
.row > .review-date-col { flex: 0 0 auto; width: max-content; max-width: 18em; min-width: 0; }
.review-date-col .card-header { padding: .5rem .4rem; text-align: left; }
.review-date-col .card-body { padding: .25rem .2rem; }
.review-date-col .review-date-item { padding: .5rem .4rem; width: 9em;text-align: center; }
.review-date-item { cursor: pointer; white-space: nowrap; }
.review-date-item.active { background: var(--bt-primary); border-color: var(--bt-primary); color: #fff; }

/* 赛道：主线赛道左列表固定 150px */
.row > .track-list-col { flex: 0 0 150px; width: 150px; max-width: 150px; min-width: 0; }
.track-list-col .track-item { padding: .45rem .5rem; white-space: normal; word-break: break-word; }

/* 赛道：全部赛道列表里的细分方向链接 */
.track-pool-link { cursor: pointer; }

/* ---------------- 选股记录（跨期台账）---------------- */
/* 顶部统计卡 + 检索框整块吸顶：列表上下滚动时统计与检索框始终可见，
   与首页 .dashboard-metrics 同一套做法（`.app-main` 是滚动容器，top:0 即贴到内容顶端） */
.sel-sticky {
  position: sticky; top: 0; z-index: 6;
  background: var(--bt-bg);
  padding-bottom: .35rem;
}
/* 顶部统计卡（2026-10-09 用户要求）：**固定 200px、绝不压缩** —— 宁可折行，也不把内容挤成一团。
   ⚠️ 不要改回 `flex: 0 1 200px`（可收缩）：窄窗口/窄内容区下卡片会被压到 100px 以下，
   曾经就是这么被挤坏的；`min-width: 200px` 是这条约束的硬保证。宽度够时 4 张正好一行。 */
.sel-topbar { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }
.sel-topbar .metric-row { flex: 0 0 auto; flex-wrap: wrap; gap: 8px; margin-bottom: 0; }
.sel-topbar .card-metric {
  flex: 0 0 200px; width: 200px; min-width: 200px; max-width: 200px; min-height: 74px;
}
.sel-topbar .card-metric .metric-label,
.sel-topbar .card-metric .metric-sub { white-space: nowrap; }
/* 检索框 + 口径文字同一行：**检索框在左**，口径文字跟随，匹配数贴在右端 */
.sel-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.sel-search { flex: 0 0 300px; max-width: 300px; }
.sel-note { min-width: 0; }
.sel-state { margin-left: auto; }
/* 列表区自己滚动（表头才能真的固定）：`.table-responsive` 的 overflow-x 会把
   th 的 position:sticky 关在它自己的滚动盒里 —— 页面滚动时表头不粘，所以这里
   显式给滚动盒一个高度（`max-height: 60vh` 是 JS 未执行时的兜底）。 */
.sel-table-scroll { max-height: 60vh; overflow: auto; }
.sel-table-scroll > table > thead th { position: sticky; top: 0; z-index: 3; }
/* 展开明细里的**内层**表头不得跟着吸顶：否则会盖住主表头 */
.sel-table-scroll tbody table > thead th { position: static; }
@media (max-width: 767.98px) {
  /* 移动端：卡片仍是 200px（不缩成 80px）自动折行；检索框独占一行 */
  .sel-search { flex: 1 1 100%; max-width: none; }
  .sel-state { margin-left: 0; }
}

/* ---------------- 浮窗（可拖动 / 可缩放，覆盖在当前页面之上） ---------------- */
/* 赛道页「全部赛道」股票池浮窗使用；个股外部行情已改为新标签页打开（quote_link.js） */
.quote-float {
  position: fixed;
  width: 980px;
  height: 660px;
  min-width: 360px;
  min-height: 260px;
  max-width: 98vw;
  max-height: 96vh;
  background: var(--bt-surface);
  color: var(--bt-text);
  border: 1px solid var(--bt-border);
  border-radius: var(--bt-radius);
  box-shadow: 0 18px 44px rgba(20, 28, 48, .28);
  z-index: 1080;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.quote-float-head {
  display: flex; align-items: center; gap: .5rem;
  padding: .32rem .55rem;
  background: var(--bt-header-bg);
  border-bottom: 1px solid var(--bt-border);
  cursor: move;
  touch-action: none;
  user-select: none;
}
.quote-float-title { font-size: .88rem; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; }
.quote-float-actions { display: flex; align-items: center; gap: .3rem; flex: 0 0 auto; margin-left: auto; }
.quote-float-body { position: relative; flex: 1 1 auto; min-height: 0; padding: 0; }
.quote-link { cursor: pointer; }

/* 首页大盘指数卡片 */
.card-index .index-row { display: flex; flex-wrap: wrap; gap: .35rem .9rem; }
.card-index .index-item { display: flex; align-items: baseline; gap: .3rem; font-variant-numeric: tabular-nums; }
.card-index .index-name { color: var(--bt-muted); font-size: .78rem; }
.card-index .index-close { font-weight: 650; font-size: .84rem; }
.card-index .index-pct { font-size: .8rem; }

/* 复盘页「为什么没入选」：分组内可滚动，避免上百行铺满整屏 */
.exclusion-scroll { max-height: 340px; overflow: auto; }
.exclusion-scroll thead th { position: sticky; top: 0; z-index: 1; }

/* 首页「利空股票（严禁买入）」：最多约 320px 高度后内部滚动 */
.negatives-scroll { max-height: 320px; overflow: auto; }

/* ---------------- 新闻详情浮窗（可拖动，展示来源 / 日期 / 原文入口） ---------------- */
.news-item { cursor: pointer; border-radius: 6px; padding: .2rem .3rem; }
.news-item:hover, .news-item:focus-visible { background: var(--bt-primary-soft); outline: none; }
.news-float {
  position: fixed;
  width: 840px;
  max-width: 96vw;
  background: var(--bt-surface);
  color: var(--bt-text);
  border: 1px solid var(--bt-border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .28);
  z-index: 1080;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.news-float-head {
  display: flex; align-items: center; justify-content: space-between; gap: .4rem;
  padding: .32rem .55rem;
  background: var(--bt-header-bg);
  border-bottom: 1px solid var(--bt-border);
  cursor: move;
  touch-action: none;
  user-select: none;
}
.news-float-title { font-size: .88rem; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.news-float-actions { display: flex; align-items: center; gap: .3rem; flex: 0 0 auto; }
.news-float-body { padding: .6rem .75rem; font-size: .82rem; max-height: 82vh; overflow: auto; }
.news-float-title-full { font-weight: 650; font-size: .92rem; margin-bottom: .4rem; }
.news-float .news-meta { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .4rem; }
.news-float .news-meta-table { font-size: .8rem; }
.news-float .news-meta-table th { width: 5.5em; color: var(--bt-muted); font-weight: 500; }
.news-summary-label { color: var(--bt-muted); font-size: .74rem; margin-bottom: .15rem; }
.news-summary-text { line-height: 1.55; white-space: pre-wrap; }
.news-url { margin-top: .4rem; }
.news-float .news-stocks-head { color: var(--bt-muted); font-size: .74rem; margin: .5rem 0 .2rem; }
.news-float .news-stocks-table { font-size: .8rem; margin-bottom: .2rem; }
.news-float .news-stocks-table th { color: var(--bt-muted); font-weight: 500; white-space: nowrap; }
.news-float .news-stocks-table td, .news-float .news-stocks-table th { padding: .18rem .4rem; }
@media (max-width: 991.98px) {
  .news-float { width: 96vw; }
}

/* 单击/双击弹窗时高亮被选中的行，便于与弹窗对比 */
tr.bt-selected > td { background-color: var(--bt-primary-soft) !important; }
tr.bt-selected > td:first-child { box-shadow: inset 3px 0 0 var(--bt-primary); }
tr.bt-selected:hover > td { background-color: var(--bt-primary-soft) !important; }
.signal-card.bt-selected { border-color: var(--bt-primary); box-shadow: 0 0 0 2px var(--bt-primary-soft); }

/* 可排序表头 */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--bt-primary); }
th.sortable .sort-ind { font-size: .7rem; color: var(--bt-muted); margin-left: .15rem; }

@media (max-width: 991.98px) {
  .quote-float { width: 96vw !important; height: 72vh !important; }
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 991.98px) {
  .app-sidebar {
    position: fixed; top: var(--bt-navbar-h); left: 0; bottom: 0; z-index: 1040;
    width: 76vw; max-width: 280px; transform: translateX(-100%);
    box-shadow: 6px 0 22px rgba(20, 28, 48, .18);
  }
  .app-sidebar.collapsed { width: 76vw; max-width: 280px; flex-basis: 76vw; overflow-y: auto; }
  .app-sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show {
    display: block; position: fixed; inset: var(--bt-navbar-h) 0 0 0;
    background: rgba(16, 22, 38, .35); z-index: 1035;
  }
  .app-main { padding: .6rem .6rem 1.5rem; }
}
