/* ==========================================================================
   组件层：卡片 / 表格 / KPI / 标签 / 过滤器 / 图表容器 / 列表
   ========================================================================== */

/* ------------------------------ 栅格 ------------------------------ */
.grid { display: grid; gap: 12px; margin-bottom: 12px; }
.g-1  { grid-template-columns: 1fr; }
.g-2  { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g-3  { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g-4  { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g-21 { grid-template-columns: 2fr 1fr; }
.g-12 { grid-template-columns: 1fr 2fr; }
.g-31 { grid-template-columns: 3fr 1fr; }
.g-13 { grid-template-columns: 1fr 3fr; }
/* .card.fill-y：让表体“按同排最高卡片的高度”撑满并内部滚动，消除卡片底部空白。
   关键是 height:0 —— 使表格在栅格测算行高时只贡献 min-height（而不是几十行的自然高度，
   否则会把整行撑到 800px+）；实际渲染时再由 flex-grow 填满卡片剩余空间。
   ui.table 此时不要再传 maxHeight（内联 max-height 会阻止撑满）；表头 sticky 不受影响。 */
.card.fill-y > .card-bd { display: flex; flex-direction: column; min-height: 0; }
.card.fill-y > .card-bd > .tbl-wrap {
  flex: 1 1 auto; height: 0; min-height: 280px; max-height: none; overflow: auto;
}
.g-11 { grid-template-columns: 1fr 1fr; }
@media (max-width: 1360px) { .g-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 1100px) {
  .g-2,.g-3,.g-21,.g-12,.g-31,.g-13,.g-11 { grid-template-columns: 1fr; }
  .g-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

/* ------------------------------ 卡片 ------------------------------ */
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; min-width: 0; overflow: hidden;
}
.card-hd {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 13px; border-bottom: 1px solid var(--border);
  background: var(--panel-2); flex: 0 0 auto; min-height: 39px;
}
.card-title { font-size: 13px; font-weight: 700; letter-spacing: .2px; display: flex; align-items: center; gap: 6px; }
.card-title .bar { width: 3px; height: 13px; border-radius: 2px; background: var(--accent); }
.card-sub { font-size: 11px; color: var(--muted); font-weight: 400; }
.card-act { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.card-bd { padding: 11px 13px; flex: 1; min-width: 0; }
.card-bd.flush { padding: 0; }
.card-bd.tight { padding: 7px 9px; }
.card.plain { box-shadow: none; }

/* .card.white：白底深字的浅色卡片变体，用于「交易日历」等需要强对比/真实纸面观感的模块。
   覆盖默认深色面板（var(--panel)/var(--panel-2)）及其标题/副标题色，仅作用于带 .white 类的卡片。 */
.card.white { background: #ffffff; border-color: #e3e3e3; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.card.white > .card-hd { background: #f5f6f8; border-bottom-color: #e3e3e3; }
.card.white > .card-hd .card-title { color: #1f2329; }
.card.white > .card-hd .card-sub { color: #8a8f99; }
.card.white > .card-bd { color: #1f2329; }

/* 结论横幅 */
.banner {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--panel);
  box-shadow: var(--shadow); margin-bottom: 12px;
}
.banner .b-ico {
  width: 34px; height: 34px; border-radius: 9px; flex: 0 0 34px;
  display: grid; place-items: center; font-size: 17px;
}
.banner .b-main { flex: 1; min-width: 0; }
.banner .b-title { font-size: 13.5px; font-weight: 700; margin-bottom: 2px; }
.banner .b-text { color: var(--text-2); font-size: 12.5px; line-height: 1.62; white-space: pre-wrap; }
.banner.bullish  { border-left: 3px solid var(--up); }
.banner.bullish  .b-ico { background: var(--up-soft); color: var(--up); }
.banner.bearish  { border-left: 3px solid var(--down); }
.banner.bearish  .b-ico { background: var(--down-soft); color: var(--down); }
.banner.neutral  { border-left: 3px solid var(--muted); }
.banner.neutral  .b-ico { background: var(--flat-soft); color: var(--text-2); }
.banner.warn     { border-left: 3px solid var(--warn); }
.banner.warn     .b-ico { background: var(--warn-soft); color: var(--warn); }
.banner.danger   { border-left: 3px solid var(--danger); }
.banner.danger   .b-ico { background: var(--up-soft); color: var(--danger); }

/* ------------------------------ KPI ------------------------------ */
.kpis { display: grid; gap: 10px; margin-bottom: 12px; }
.kpi {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 13px; box-shadow: var(--shadow);
  position: relative; overflow: hidden; min-width: 0;
}
.kpi-label { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.kpi-value {
  font-size: 21px; font-weight: 700; font-family: var(--mono);
  letter-spacing: -.4px; line-height: 1.28; margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kpi-sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-spark { position: absolute; right: 8px; bottom: 6px; opacity: .5; }
.kpi.tone-up   .kpi-value { color: var(--up); }
.kpi.tone-down .kpi-value { color: var(--down); }
.kpi.tone-accent .kpi-value { color: var(--accent); }
.kpi.tone-warn .kpi-value { color: var(--warn); }

/* ===================== 策略看板 mac liquid glass 变体 =====================
   仅作用于 .kbgl 作用域（strategy-kanban 页面 box/toolbar 加的专属类），
   不污染全站通用 .card/.kpi/.toolbar。
   把白底实色卡片换成淡玻璃：半透明白 + 背景模糊 + 白边 + 顶部高光 + 柔阴影。
   数字色（tone-up 红 / tone-down 蓝 / tone-accent 靛 / tone-warn 橙）本就是饱和深色，
   在白玻璃底上无需改动即清晰。日历格子、弹框三色对比卡的涨跌实色块（数据语义）保持不动，
   作为玻璃容器内的实心数据芯片。 */
/* 看板 KPI 卡：对齐驾驶舱顶部 .ch-kpi 的 mac 玻璃子层质感（淡玻璃+模糊+白边+顶部高光），
   并整体居中（驾驶舱同为居中）。 */
.kbgl .kpi {
  background: rgba(255,255,255,.42);
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 13px;
  box-shadow: 0 4px 16px rgba(31,45,80,.07), inset 0 1px 0 rgba(255,255,255,.9);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  backdrop-filter: blur(12px) saturate(160%);
  text-align: center;
}
/* 看板 KPI 单行 7 列时收窄：数字字号略收，必要时换行（不截断），避免长值被省略号吃掉。
   三行均居中，匹配驾驶舱 .ch-kpi 的居中展示。 */
.kbgl .kpis .kpi-label { justify-content: center; }
.kbgl .kpis .kpi-value { font-size: 19px; white-space: normal; line-height: 1.22; text-align: center; }
.kbgl .kpis .kpi-sub { white-space: normal; text-align: center; }
.kbgl .card,
.kbgl .card.white {
  background: rgba(255,255,255,.5);
  border-color: rgba(255,255,255,.65);
  border-radius: 16px;
  box-shadow: 0 6px 24px rgba(31,45,80,.10), inset 0 1px 0 rgba(255,255,255,.9);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
}
.kbgl .card-hd,
.kbgl .card.white > .card-hd {
  background: rgba(255,255,255,.35);
  border-bottom-color: rgba(255,255,255,.5);
}
.toolbar.kbgl {
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(31,45,80,.08), inset 0 1px 0 rgba(255,255,255,.9);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
}

/* ------------------------------ 表格 ------------------------------ */
.tbl-wrap { width: 100%; overflow: auto; }
.tbl-wrap.scroll-y { max-height: 420px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.tbl th {
  position: sticky; top: 0; z-index: 2;
  background: var(--panel-2); color: var(--muted);
  font-weight: 600; font-size: 11.5px; text-align: left;
  padding: 7px 9px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.tbl td {
  padding: 6px 9px; border-bottom: 1px solid #f1f3f8;
  white-space: nowrap; color: var(--text-2);
}
table.tbl tbody tr:hover td { background: #f7f9fd; }
table.tbl tbody tr:last-child td { border-bottom: none; }
/* 【2026-10-09】持仓表「账户浮动盈亏(合计)」合计行（ui.table opt.foot） */
table.tbl tfoot td { border-top: 2px solid var(--line, #e2e8f0); font-weight: 700; padding-top: 8px; }
table.tbl tfoot td.name { color: var(--text); }
table.tbl td.num, table.tbl th.num { text-align: right; font-family: var(--mono); }
table.tbl td.mid, table.tbl th.mid { text-align: center; }
table.tbl td.name { color: var(--text); font-weight: 600; }
table.tbl td.wrap { white-space: normal; min-width: 200px; line-height: 1.5; }
table.tbl.dense td { padding: 4px 8px; font-size: 12px; }
table.tbl .rk {
  display: inline-grid; place-items: center; width: 17px; height: 17px;
  border-radius: 5px; background: var(--flat-soft); color: var(--muted);
  font-size: 10.5px; font-weight: 700; font-family: var(--mono);
}
table.tbl tr:nth-child(1) .rk { background: #fdebeb; color: #d0342c; }
table.tbl tr:nth-child(2) .rk { background: #fdf1e2; color: #c47a12; }
table.tbl tr:nth-child(3) .rk { background: #eef2fb; color: #4a6ec0; }
.clickable { cursor: pointer; }

/* 涨跌色 */
.up    { color: var(--up)   !important; }
.down  { color: var(--down) !important; }
.flat  { color: var(--flat) !important; }
.b-up   { background: var(--up-soft);   color: var(--up); }
.b-down { background: var(--down-soft); color: var(--down); }

/* ------------------------------ 标签 ------------------------------ */
.tag {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 7px; border-radius: 5px; font-size: 11px; font-weight: 600;
  background: var(--flat-soft); color: var(--text-2); white-space: nowrap;
  line-height: 1.65;
}
.tag.up      { background: var(--up-soft);     color: var(--up) !important; }
.tag.down    { background: var(--down-soft);   color: var(--down) !important; }
.tag.accent  { background: var(--accent-soft); color: var(--accent); }
.tag.warn    { background: var(--warn-soft);   color: var(--warn); }
.tag.info    { background: var(--info-soft);   color: var(--info); }
.tag.purple  { background: var(--purple-soft); color: var(--purple); }
.tag.ghost   { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.tag.lg      { padding: 3px 10px; font-size: 12px; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }

.pill-pct {
  display: inline-block; min-width: 58px; text-align: right;
  padding: 1px 7px; border-radius: 5px; font-family: var(--mono);
  font-size: 12px; font-weight: 700;
}

/* ------------------------------ 过滤器 / 按钮 ------------------------------ */
.toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 12px; padding: 9px 12px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.toolbar .tb-label { font-size: 11.5px; color: var(--muted); margin-right: -3px; }
.toolbar .spacer { margin-left: auto; }

.seg { display: inline-flex; background: var(--bg-sub); border-radius: 8px; padding: 2px; gap: 2px; }
.seg button {
  border: none; background: transparent; cursor: pointer;
  padding: 4px 11px; border-radius: 6px;
  font-size: 12px; color: var(--text-2); font-family: inherit;
  white-space: nowrap; transition: all .14s;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--panel); color: var(--accent); font-weight: 700; box-shadow: 0 1px 3px rgba(24,39,75,.12); }

select.sel, input.inp {
  border: 1px solid var(--border); background: var(--panel);
  border-radius: 7px; padding: 4px 9px; font-size: 12px;
  color: var(--text); font-family: inherit; outline: none; min-width: 92px;
  transition: border-color .15s;
}
select.sel:focus, input.inp:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input.inp::placeholder { color: var(--faint); }

.btn {
  border: 1px solid var(--border); background: var(--panel);
  border-radius: 7px; padding: 4px 12px; font-size: 12px;
  color: var(--text-2); cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 5px; transition: all .15s;
}
.btn:hover { background: var(--bg-sub); border-color: var(--border-strong); color: var(--text); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { background: #2b51c2; border-color: #2b51c2; color: #fff; }
.btn.danger { color: var(--up); }
.btn.danger:hover { background: var(--up-soft); border-color: var(--up-line); color: var(--up); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.mini-btn {
  border: none; background: var(--flat-soft); color: var(--text-2);
  border-radius: 6px; padding: 2px 8px; font-size: 11px; cursor: pointer; font-family: inherit;
}
.mini-btn:hover { background: var(--border); }

/* ------------------------------ 列表 / 新闻 ------------------------------ */
.news-list { display: flex; flex-direction: column; }
.news-item {
  display: flex; gap: 10px; padding: 10px 13px;
  border-bottom: 1px solid #f1f3f8; transition: background .14s;
}
.news-item:last-child { border-bottom: none; }
.news-item:hover { background: #f7f9fd; }
.news-item .n-bar { width: 3px; border-radius: 3px; flex: 0 0 3px; background: var(--flat); }
.news-item.bullish .n-bar { background: var(--up); }
.news-item.bearish .n-bar { background: var(--down); }
.news-item .n-main { flex: 1; min-width: 0; }
.news-item .n-title {
  font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.news-item .n-title a { color: inherit; }
.news-item .n-title a:hover { color: var(--accent); text-decoration: none; }
.news-item .n-sum {
  font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.news-item .n-meta {
  display: flex; align-items: center; gap: 7px; margin-top: 5px;
  font-size: 11px; color: var(--faint); flex-wrap: wrap;
}
.news-item .n-side { flex: 0 0 54px; text-align: right; }
.impact-bar { height: 3px; border-radius: 3px; background: var(--flat-soft); overflow: hidden; margin-top: 4px; }
.impact-bar i { display: block; height: 100%; border-radius: 3px; background: var(--warn); }

.evt-list { display: flex; flex-direction: column; gap: 1px; }
.evt {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 7px 10px; border-radius: var(--radius-sm); transition: background .14s;
}
.evt:hover { background: var(--bg-sub); }
.evt .e-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 6px; flex: 0 0 7px; background: var(--muted); }
.evt.info .e-dot   { background: var(--info); }
.evt.warn .e-dot   { background: var(--warn); }
.evt.danger .e-dot { background: var(--up); }
.evt .e-main { flex: 1; min-width: 0; }
.evt .e-title { font-size: 12.5px; color: var(--text); font-weight: 600; line-height: 1.45; }
.evt .e-desc  { font-size: 11.5px; color: var(--muted); margin-top: 1px; line-height: 1.5; word-break: break-word; }

/* 复盘-收盘复盘「关键异动 / 关键新闻」：每项占一行（标题与明细同行，超长截断），字体样式不变 */
.evt-list.evt-single .e-main { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.evt-list.evt-single .e-title { font-size: 12.5px; color: var(--text); font-weight: 600; line-height: 1.45; flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.evt-list.evt-single .e-desc  { font-size: 11.5px; color: var(--muted); margin-top: 0; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; min-width: 0; }
.evt .e-time  { font-size: 10.5px; color: var(--faint); font-family: var(--mono); white-space: nowrap; margin-top: 2px; }

/* 盘中异动事件流（A股热点雷达）：单行紧凑布局，标题/明细/时间横向排列，
   涨跌幅与日期之间用 gap 留白分隔，避免连写；仅作用于 .evt-inline，不影响其余事件列表 */
.evt.evt-inline { align-items: baseline; padding: 5px 10px; }
.evt.evt-inline .e-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
.evt.evt-inline .e-title { font-weight: 600; }
.evt.evt-inline .e-detail { font-size: 11.5px; color: var(--muted); font-family: var(--mono); white-space: nowrap; }
.evt.evt-inline .e-when { font-size: 10.5px; color: var(--faint); font-family: var(--mono); white-space: nowrap; margin-left: auto; }

/* 侧栏事件项 */
.alert-item {
  padding: 8px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--panel-2);
  margin-bottom: 6px; animation: toastIn .22s;
}
.alert-item .a-hd { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.alert-item .a-title { font-size: 12.5px; font-weight: 600; margin-top: 2px; line-height: 1.45; }
.alert-item .a-desc { font-size: 11.5px; color: var(--muted); margin-top: 1px; word-break: break-word; }

/* ------------------------------ 阶梯 / 徽章块 ------------------------------ */
.ladder { display: flex; flex-direction: column; gap: 8px; }
.ladder-row { display: flex; gap: 9px; align-items: flex-start; }
.ladder-key {
  flex: 0 0 60px; text-align: center; padding: 3px 0;
  border-radius: 6px; font-size: 12px; font-weight: 700;
  background: var(--up-soft); color: var(--up); font-family: var(--mono);
}
.ladder-val { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.chip {
  padding: 2px 7px; border-radius: 5px; font-size: 11.5px;
  background: var(--bg-sub); color: var(--text-2); cursor: default; white-space: nowrap;
}
.chip.up { background: var(--up-soft); color: var(--up); }
.chip.down { background: var(--down-soft); color: var(--down); }

/* ------------------------------ 通用状态 ------------------------------ */
.empty {
  padding: 30px 14px; text-align: center; color: var(--faint);
  font-size: 12.5px; display: flex; flex-direction: column; align-items: center; gap: 7px;
}
.empty.sm { padding: 18px 10px; font-size: 12px; }
.empty .e-ico { font-size: 24px; opacity: .48; }

.loading { padding: 42px; display: flex; justify-content: center; align-items: center; gap: 9px; color: var(--muted); }
.spinner {
  width: 15px; height: 15px; border: 2px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite;
}
.skeleton {
  background: linear-gradient(90deg, #eef1f6 25%, #f6f8fb 50%, #eef1f6 75%);
  background-size: 200% 100%; animation: sk 1.3s infinite; border-radius: 6px;
}
@keyframes sk { 0% { background-position: 200% 0 } 100% { background-position: -200% 0 } }

.err-box {
  padding: 12px 14px; border-radius: var(--radius);
  background: var(--up-soft); border: 1px solid var(--up-line);
  color: var(--up); font-size: 12.5px;
}

/* ------------------------------ 图表 ------------------------------ */
.chart { width: 100%; display: block; overflow: visible; }
.chart text { font-family: var(--mono); fill: var(--muted); }
.chart .axis-line { stroke: var(--border); stroke-width: 1; }
.chart .grid-line { stroke: #f0f2f7; stroke-width: 1; }
.chart .hover-line { stroke: var(--faint); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-tip {
  position: fixed; z-index: 95; pointer-events: none;
  background: rgba(27,36,49,.95); color: #fff; border-radius: 7px;
  padding: 6px 9px; font-size: 11.5px; line-height: 1.62;
  box-shadow: var(--shadow-lg); font-family: var(--mono); white-space: nowrap;
  opacity: 0; transition: opacity .12s;
}
.chart-tip.show { opacity: 1; }
.chart-tip b { color: #fff; font-weight: 700; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); padding: 2px 0 6px; }
.legend i { display: inline-block; width: 9px; height: 3px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }

/* 热力网格 */
.heat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 5px; }
.heat-cell {
  border-radius: 6px; padding: 7px 8px; min-height: 50px;
  display: flex; flex-direction: column; justify-content: space-between;
  cursor: default; transition: transform .12s; overflow: hidden;
}
.heat-cell:hover { transform: translateY(-1px); }
.heat-cell .h-name { font-size: 11.5px; font-weight: 600; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.heat-cell .h-pct { font-size: 13px; font-weight: 700; font-family: var(--mono); }

/* 进度条 */
.pbar { height: 6px; background: var(--flat-soft); border-radius: 4px; overflow: hidden; display: flex; }
.pbar i { display: block; height: 100%; }
.pbar i.up { background: var(--up); }
.pbar i.down { background: var(--down); }
.pbar i.flat { background: var(--faint); }

/* 定义列表 */
.dl { display: grid; grid-template-columns: auto 1fr; gap: 5px 13px; font-size: 12.5px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; color: var(--text); font-family: var(--mono); text-align: right; }

/* 描述行 */
.rowline { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px dashed #eef1f6; font-size: 12.5px; }
.rowline:last-child { border-bottom: none; }
.rowline .rl-k { color: var(--muted); display: flex; align-items: center; gap: 6px; min-width: 0; }
.rowline .rl-v { font-family: var(--mono); font-weight: 600; white-space: nowrap; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(20,28,42,.4); z-index: 80;
  display: grid; place-items: center; padding: 20px; animation: fadeIn .16s;
}
@keyframes fadeIn { from { opacity: 0 } }
.modal {
  background: var(--panel); border-radius: 12px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 640px; max-height: 86vh; display: flex; flex-direction: column;
  animation: modalIn .2s cubic-bezier(.2,.9,.3,1.1); overflow: hidden;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.98) } }
.modal-hd { display: flex; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 14px; }
.modal-bd { padding: 14px 16px; overflow-y: auto; }
.modal-ft { padding: 10px 16px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: var(--panel-2); }
.form-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.form-row label { flex: 0 0 80px; font-size: 12.5px; color: var(--text-2); }
.form-row .inp, .form-row .sel { flex: 1; }

.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt8 { margin-top: 8px; } .mb8 { margin-bottom: 8px; } .mb0 { margin-bottom: 0; }

/* ==========================================================================
   总览驾驶舱（overview.js）—— 英雄区 / 模块墙 / 顶栏行情脉搏
   ========================================================================== */

/* ---- 英雄区：综合研判 + 关键 KPI（深色渐变，白字） ---- */
.cockpit-hero {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  padding: 16px 20px; border-radius: 18px;
  /* mac liquid glass：淡蓝白通透玻璃 + 背景模糊 + 顶部高光描边 */
  background: linear-gradient(135deg, rgba(255,255,255,.74), rgba(230,239,255,.56));
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: 0 8px 30px rgba(31,45,80,.10), inset 0 1px 0 rgba(255,255,255,.9);
  color: #16202e; margin-bottom: 14px;
}
.cockpit-hero .ch-left { flex: 1 1 240px; min-width: 200px; }
.cockpit-hero .ch-verdict { font-size: 25px; font-weight: 800; letter-spacing: .5px; line-height: 1.2; color: #16202e; }
.cockpit-hero .ch-sub { margin-top: 6px; font-size: 12.5px; line-height: 1.6; color: #46566b; }
.cockpit-hero .ch-score { font-family: var(--mono); font-size: 12px; margin-top: 9px; color: #5b6577; }
.cockpit-hero .ch-kpis {
  flex: 0 1 auto; min-width: 0; display: flex; gap: 6px; flex-wrap: nowrap;
  align-items: stretch; justify-content: flex-end; margin-top: 0;
}
/* 英雄区 KPI 卡：hero 玻璃内的子层淡玻璃，深色标签 + 数字由 JS 内联加深红/蓝/灰。 */
.ch-kpi {
  flex: 0 0 116px; min-width: 0; text-align: center;
  background: rgba(255,255,255,.42); border: 1px solid rgba(255,255,255,.65);
  border-radius: 13px; padding: 9px 8px; color: #46566b;
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  backdrop-filter: blur(12px) saturate(160%);
  box-shadow: 0 2px 10px rgba(31,45,80,.07), inset 0 1px 0 rgba(255,255,255,.85);
}
.ch-kpi .k { font-size: 11px; color: #5b6577; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-kpi .v { font-size: 16px; font-weight: 700; font-family: var(--mono); font-variant-numeric: tabular-nums; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- 模块速览卡片墙 ---- */
.mod-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.mod-card { transition: box-shadow .16s, transform .16s; }
.mod-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.mod-card .card-hd .m-go,
.mod-card .card-act .m-go { color: var(--accent); font-weight: 600; font-size: 11.5px; }
.mod-card .card-bd { padding: 11px 13px; }
.mod-card .m-ft { padding: 0 13px 11px; }

/* ---- 顶栏行情脉搏 ---- */
.pulse { display: flex; align-items: center; gap: 11px; min-width: 0; overflow: hidden; flex: 1 1 auto; cursor: pointer; }
.pulse .p-item { display: flex; align-items: baseline; gap: 4px; font-size: 12px; white-space: nowrap; }
.pulse .p-item .pl { color: var(--muted); font-size: 11px; }
.pulse .p-item .pv { font-family: var(--mono); font-weight: 700; }
@media (max-width: 1180px) { .pulse { display: none; } }

/* ===================== 登录/注册门（简易鉴权） ===================== */
.auth-gate {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #eef2fb 0%, #f6f8fc 60%, #eaf0ff 100%);
  padding: 20px;
}
.auth-card {
  width: 360px; max-width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 26px 26px 22px;
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.auth-logo {
  width: 40px; height: 40px; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.auth-title { font-size: 17px; font-weight: 700; color: var(--text); }
.auth-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.auth-field { margin-bottom: 12px; }
.auth-label { font-size: 12px; color: var(--text-2); margin-bottom: 5px; font-weight: 600; }
.auth-field .inp { width: 100%; }
.auth-msg {
  display: none; color: var(--up); font-size: 12px;
  background: var(--up-soft); border: 1px solid var(--up-line);
  padding: 7px 10px; border-radius: var(--radius-sm); margin: 2px 0 12px;
}
.auth-switch {
  margin-top: 16px; text-align: center; font-size: 12px;
  display: flex; gap: 6px; justify-content: center; align-items: center;
}
.auth-link { color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: none; }
.auth-link:hover { text-decoration: underline; }

/* 顶栏用户框 */
.user-box { display: flex; align-items: center; gap: 8px; }
.user-name { font-size: 12px; color: var(--text-2); font-weight: 600; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== 量化策略 · 最近一天交易信号卡片流（2026-08-09 增加，回退漏带样式，本次补回） ===== */
.sig-block { margin-top: 2px; }
.sig-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sig-head-t { font-size: 12px; font-weight: 600; color: var(--text-2); }
.sig-head .spacer { flex: 1; }
.sig-hint { font-size: 11px; color: var(--muted); white-space: nowrap; }
.sig-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.sig-grid.lg { grid-template-columns: repeat(3, 1fr); }

.sig-card {
  position: relative; min-width: 0;
  border: 1px solid var(--border); border-left-width: 3px; border-radius: 8px;
  background: var(--panel-2); padding: 8px 10px; cursor: pointer;
  transition: box-shadow .14s, transform .14s, border-color .14s;
}
.sig-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.sig-card.buy  { border-left-color: var(--up); }
.sig-card.sell { border-left-color: var(--down); }
.sig-card.flat { border-left-color: var(--flat); }

.sig-top { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.sig-op { font-size: 11px; font-weight: 700; line-height: 1.5; padding: 1px 7px; border-radius: 5px; white-space: nowrap; }
.sig-op.up   { background: var(--up-soft);   color: var(--up); }
.sig-op.down { background: var(--down-soft); color: var(--down); }
.sig-op.flat { background: var(--flat-soft); color: var(--text-2); }
.sig-name { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sig-why {
  margin-left: auto; flex: 0 0 16px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--flat-soft); color: var(--muted);
  font-size: 11px; display: flex; align-items: center; justify-content: center; cursor: help;
}
.sig-sub { display: flex; align-items: center; gap: 5px; margin-bottom: 6px; font-size: 11px; color: var(--muted); overflow: hidden; }
.sig-sub .sig-code { font-family: var(--mono); color: var(--text-2); font-weight: 600; }
.sig-sub .sig-ind { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sig-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-family: var(--mono); font-size: 11px; }
.sig-foot .sig-amt { font-weight: 600; }
.sig-foot .sig-earn { font-weight: 700; }
.sig-foot .sig-px { color: var(--text-2); }
.sig-reason { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border); font-size: 11px; line-height: 1.4; color: var(--text-2); }

.sig-more {
  margin-top: 8px; width: 100%; border: none; background: transparent; cursor: pointer;
  color: var(--accent); font-size: 11.5px; padding: 4px 0; border-radius: 6px; text-align: center;
}
.sig-more:hover { background: var(--accent-soft); }

/* 空态占位容器：.sig-none 用于弹窗内「没有匹配的信号」；.sig-empty 用于驾驶舱策略模块
   「最近一天暂无交易信号」。两者此前共用同一条规则（padding 20px / gap 6px / 图标 22px），
   实测 .sig-empty 高度 ~122px，在驾驶舱三个策略模块里连占三块、空白过多，
   故 2026-10-16 拆分为两条规则并单独压缩 .sig-empty（保持弹窗内 .sig-none 原样）。 */
.sig-none {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 20px 10px; color: var(--muted); font-size: 12px; text-align: center;
}

/* 驾驶舱「暂无交易信号」空态：高度压缩到原来的约 2/3（122px → ~81px）。
   压缩手段=收紧纵向 padding(20→11) + 行间距(6→3) + 图标(22→17px) + 收紧两行文本行高，
   不改文案、不改结构，保证有信号时的卡片区高度不受影响。 */
.sig-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 11px 10px; color: var(--muted); font-size: 12px; text-align: center;
}
.sig-empty-ic { font-size: 17px; line-height: 1.1; opacity: .5; }
.sig-empty-sub { font-size: 11px; line-height: 1.4; opacity: .85; }

/* 通用悬停浮层容器（ui.hoverTip 挂载点；默认隐，光标旁浮现） */
.hover-tip {
  position: fixed; left: 0; top: 0; z-index: 9999;
  pointer-events: none;
  min-width: 180px; max-width: 360px;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  color: var(--text);
  font-size: 12px; line-height: 1.5;
  opacity: 0; transform: translateY(2px);
  transition: opacity .12s ease, transform .12s ease;
}
.hover-tip.show { opacity: 1; transform: translateY(0); }

/* 信号卡片悬停浮层（交易原因全文 / 完整字段） */
.ht-t { font-size: 12.5px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.ht-r { display: flex; gap: 8px; padding: 2px 0; font-size: 12px; line-height: 1.5; }
.ht-k { flex: 0 0 64px; color: var(--muted); }
.ht-v { flex: 1; min-width: 0; color: var(--text); }
.ht-v.up { color: var(--up); } .ht-v.down { color: var(--down); } .ht-v.flat { color: var(--flat); }
.ht-why { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--border); font-size: 12px; line-height: 1.5; }
.ht-why-k { color: var(--muted); font-weight: 600; margin-right: 6px; }
.ht-why-v { color: var(--text-2); }

/* ===== 通用分页组件（ui.paged）：统一页码样式（2026-08-11 增加，回退漏带样式，本次补回） ===== */
.pg { min-width: 0; }
.pg-bd { min-width: 0; }
.pager {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border);
}
.pg-info { font-size: 12px; color: var(--muted); white-space: nowrap; }
.pg-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.pg-gap { color: var(--muted); padding: 0 2px; font-size: 12px; user-select: none; }
.pg-btn {
  min-width: 26px; height: 26px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--panel);
  border-radius: 6px; color: var(--text-2); font-size: 12px; font-family: inherit;
  cursor: pointer; transition: all .14s; line-height: 1;
}
.pg-btn:hover:not(:disabled) { background: var(--bg-sub); border-color: var(--border-strong); color: var(--text); }
.pg-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.pg-btn:disabled { opacity: .45; cursor: not-allowed; }
.pager select.sel { margin-left: 2px; }

/* ------------------------------ 图表定高容器 ------------------------------
   svg.chart 默认 width:100% + height:auto，会随卡片变宽而等比"长高"。
   需要固定像素高度（多卡齐高）时，用 .chart-fit 包一层并设 style="height:XXXpx"，
   svg 改为按高度定尺寸、宽度自适应并居中，比例不失真。 */
.chart-fit { display: flex; align-items: center; justify-content: center; width: 100%; min-width: 0; }
.chart-fit > svg.chart { width: auto; height: 100%; max-width: 100%; }

/* 缺失的复合栅格补齐（历史遗留：JS 用过但 CSS 未定义，会退化成单列） */
.g-211 { grid-template-columns: 2fr 1fr 1fr; }
.g-112 { grid-template-columns: 1fr 1fr 2fr; }
@media (max-width: 1100px) { .g-211, .g-112 { grid-template-columns: 1fr; } }

/* ==========================================================================
   历史复盘记录（review-summary 每日总结）—— 双栏 zigzag 卡片墙
   设计目标：① 两栏瀑布，按时间倒序（左上=最新、右上=次新、左新右旧）；
            ② 每张卡片左色条按情绪分着色（红涨/绿跌/灰平），一眼辨多空；
            ③ 结论（重点）作主体、次日关注作行动项，弱化次要信息。
   ========================================================================== */
.hist-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}
.hist-card {
  border: 1px solid var(--border);
  border-left: 3px solid var(--flat);
  border-radius: var(--radius-sm);
  background: var(--panel);
  padding: 9px 12px 10px;
  transition: box-shadow .14s, transform .14s, border-color .14s;
}
.hist-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.hist-card.hc-bull { border-left-color: var(--up); }
.hist-card.hc-bear { border-left-color: var(--down); }
.hist-card.hc-neut { border-left-color: var(--muted); }

.hc-hd { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.hc-date { font-size: 13.5px; font-weight: 700; font-family: var(--mono); color: var(--text); letter-spacing: .2px; }
.hc-tags { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.hc-sent {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; font-family: var(--mono);
  padding: 1px 7px; border-radius: 5px; white-space: nowrap;
}
.hc-sent i.hc-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: 0 0 6px; }
.hc-sent.up    { background: var(--up-soft);   color: var(--up); }
.hc-sent.down  { background: var(--down-soft); color: var(--down); }
.hc-sent.muted { background: var(--flat-soft); color: var(--muted); }

/* 卡片正文：每一项独立成行（结论 / 次日关注 各自成块换行），参照"最新每日总结全文"的清晰排版 */
.hc-body { margin-top: 4px; }
.hc-row { padding: 6px 0; }
.hc-row + .hc-row { border-top: 1px dashed var(--border); }
.hc-label {
  font-size: 11px; font-weight: 700; color: var(--muted);
  letter-spacing: .3px; margin-bottom: 3px;
}
.hc-focus-label { color: var(--accent); }
.hc-text {
  font-size: 12.5px; line-height: 1.7; color: var(--text-2);
  white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere;
}
.hc-focus-text { color: var(--accent); }
/* 窄屏退化为单栏，避免结论文字被压得过窄 */
@media (max-width: 900px) { .hist-grid { grid-template-columns: 1fr; } }

/* 可输入过滤下拉选择（combobox）—— 替代原生 select 处理超多选项（如全 A 股 5000+） */
.combo { position: relative; display: inline-block; }
.combo-input { width: 240px; }
.combo-panel {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 60;
  min-width: 320px; max-height: 320px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px;
}
.combo-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 9px; border-radius: 6px; cursor: pointer;
  font-size: 12px; color: var(--text); white-space: nowrap;
}
.combo-opt:hover { background: var(--bg-sub); }
.combo-opt.active { background: var(--accent-soft); color: var(--accent); }
.combo-opt .c-code { font-variant-numeric: tabular-nums; color: var(--text-2); min-width: 82px; }
.combo-opt.active .c-code { color: var(--accent); }
.combo-opt .c-name { color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.combo-opt .c-tag { margin-left: auto; font-size: 10.5px; color: var(--faint); padding-left: 8px; }
.combo-opt mark { background: var(--accent-soft); color: var(--accent); border-radius: 3px; padding: 0 1px; }
.combo-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 12px; }
.combo-foot { padding: 6px 8px 2px; color: var(--faint); font-size: 10.5px; text-align: center; border-top: 1px solid var(--border); margin-top: 4px; }


/* 个股全景面板（回测交易记录页：基本面/估值资金面/研报风险/新闻/行业/概念） */
.p-strip { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.p-strip .tag { margin: 0; }
.p-dl { display: grid; grid-template-columns: 92px 1fr; gap: 5px 12px; font-size: 13px; }
.p-dl-k { color: var(--muted); }
.p-dl-v { color: var(--text, #222); font-weight: 600; font-variant-numeric: tabular-nums; }
/* 个股全景：指标网格，每行 3 个（key 在上、value 在下），提升空间利用率 */
.p-metrics { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px 16px; font-size: 13px; }
/* 指标同行紧凑：key 在左、value 在右（右对齐），一行展示 */
.p-metric { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.p-metric-k { color: var(--muted); font-size: 12px; white-space: nowrap; flex: 0 0 auto; }
.p-metric-v { color: var(--text, #222); font-weight: 600; font-variant-numeric: tabular-nums; font-size: 13px; white-space: nowrap; text-align: right; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; }
/* 业绩预告等需拉通占满整行的块 */
.p-fc { grid-column: 1 / -1; margin-top: 4px; padding: 8px 10px; background: var(--accent-soft, rgba(20,140,200,.08)); border-radius: 6px; }
@media (max-width: 1100px) { .p-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 560px) { .p-metrics { grid-template-columns: 1fr; } }
.p-sub { font-size: 12px; font-weight: 700; color: var(--accent); margin: 0 0 6px; }
.p-rz { display: flex; flex-direction: column; }
/* 每条研报/公告/新闻 单行展示：标题截断 + 风险徽标 + 机构/评级/目标价/风险标签 + 日期 同行 */
.p-rz-item { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border); white-space: nowrap; overflow: hidden; }
.p-rz-item:last-child { border-bottom: none; }
.p-rz-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--text, #222); }
.p-rz-title a { color: inherit; text-decoration: none; }
.p-rz-title a:hover { color: var(--accent); text-decoration: underline; }
.p-rz-meta { flex: 0 0 auto; font-size: 12px; color: var(--muted); }
.p-rz-tags { flex: 0 0 auto; display: inline-flex; gap: 4px; }
.p-rz-tags .tag { margin: 0; }
.p-rz-date { flex: 0 0 auto; font-size: 12px; color: var(--muted); }
.p-bs { flex: 0 0 auto; color: var(--down); font-size: 12px; font-weight: 700; }

/* 策略选股：左侧点选股票 -> 右侧联动展示近90日K线，选中行高亮 */
table.tbl tbody tr.clickable { cursor: pointer; }
table.tbl tbody tr.clickable:hover { background: rgba(127,127,127,.10); }
table.tbl tbody tr.sel { background: rgba(15,155,108,.18); }
table.tbl tbody tr.sel td:first-child { box-shadow: inset 3px 0 0 #0f9b6c; }
