/* ============================================================
 * pages.css — 页面特定样式
 * 依据《系统全新UI设计方案》§三 各页面详细设计
 * 仅包含模板未提供、设计方案明确要求的组件样式
 * ============================================================ */

/* ---------- 页面头部工具条（标题 + 操作按钮） ---------- */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}
.page-head .page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- 指标卡片行（§1.5 数据卡片：一行4个 grid） ---------- */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}
.metric-card {
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border);
  padding: 20px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.metric-card .metric-name { font-size: 12px; color: var(--text-sub); }
.metric-card .metric-value { margin: 6px 0; }
.metric-card .metric-delta { font-size: 12px; }
.metric-card.gold-edge { border-top: 3px solid var(--brand-gold); }

/* ---------- 双栏 / 三栏布局行（minmax(0,1fr) 防表格撑破列宽） ---------- */
.row-2col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
.row-2col-3-2 { display: grid; grid-template-columns: minmax(0,3fr) minmax(0,2fr); gap: 20px; margin-bottom: 24px; }
.row-2col-2-3 { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,3fr); gap: 20px; margin-bottom: 24px; }
.mb-24 { margin-bottom: 24px; }

/* ---------- 内容面板（白卡片 + 标题） ---------- */
.panel {
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border);
  padding: 20px;
  height: 100%;
  box-sizing: border-box;
  /* V8.88-P3/P7：全局兜底——td/工具栏内溢出内容绘制越界会压到相邻面板，
     overflow:hidden 使其裁剪在面板内（.table-scroll 有意滚动的行为不受影响） */
  overflow: hidden;
}
.panel > .panel-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.panel > .panel-title .panel-tools { display: flex; gap: 8px; align-items: center; }

/* ---------- 经济周期四象限（§3.3） ---------- */
.cycle-tabs { display: flex; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.cycle-tab {
  flex: 1;
  min-width: 100px;
  text-align: center;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
  color: var(--text-sub);
  background: var(--card-bg);
}
.cycle-tab.active {
  border-color: var(--brand-red);
  background: var(--brand-red);
  color: #FFFFFF;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(196, 30, 58, 0.3);
}
.cycle-meta { font-size: 12px; color: var(--text-sub); display: flex; gap: 24px; flex-wrap: wrap; }

/* ---------- 因子方向说明 / 数据处理说明区（§3.3 §3.4 §3.5） ---------- */
.alert-factor {
  border: 1px solid var(--warn);
  border-left: 4px solid var(--warn);
  background: rgba(251, 140, 0, 0.08);
  border-radius: 4px;
  padding: 16px 20px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-main);
}
.alert-factor .alert-title {
  font-weight: 700;
  color: var(--warn);
  margin-bottom: 6px;
  font-size: 14px;
}
body[data-theme="dark"] .alert-factor { color: var(--text-main); }

/* ---------- 因子选择标签（时序图切换，§3.3） ---------- */
.factor-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.factor-tag {
  padding: 4px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 12px;
  color: var(--text-sub);
  cursor: pointer;
  background: var(--card-bg);
  user-select: none;
}
.factor-tag.active {
  background: var(--brand-red);
  color: #FFFFFF;
  border-color: var(--brand-red);
}

/* ---------- 信号跟踪列表（§3.2） ---------- */
.signal-list { list-style: none; margin: 0; padding: 0; }
.signal-list li {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
  align-items: baseline;
}
.signal-list li:last-child { border-bottom: none; }
.signal-list .sig-date {
  color: var(--text-weak);
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
  white-space: nowrap;
}
/* U-3：信号 <2 条时面板自动降高（贴合内容，右侧不再大面积留空） */
.panel.sig-sparse { align-self: start; height: auto; }

/* ---------- TOP 列表（§3.2 TOP3 行业） ---------- */
.top-list { list-style: none; margin: 0; padding: 0; }
.top-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border);
}
.top-list li:last-child { border-bottom: none; }
.top-rank {
  width: 24px; height: 24px;
  border-radius: 4px;
  background: var(--brand-gold);
  color: #1A1A1A;
  font-weight: 700;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.top-rank.r1 { background: var(--brand-red); color: #FFFFFF; }
.top-rank.r2 { background: var(--brand-gold); }
.top-rank.r3 { background: #E0E0E0; color: #666; }

/* ---------- 权重条形（因子实验室 §3.1 已纳入因子权重） ---------- */
.weight-bar-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.weight-bar-row .wb-name { width: 110px; font-size: 13px; color: var(--text-main); flex-shrink: 0; }
.weight-bar-row .wb-track {
  flex: 1; height: 10px; border-radius: 5px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  overflow: hidden;
}
.weight-bar-row .wb-fill { height: 100%; background: var(--brand-red); border-radius: 5px; }
.weight-bar-row .wb-val {
  width: 52px; text-align: right; font-size: 13px;
  font-family: "JetBrains Mono", Consolas, monospace;
  color: var(--text-sub);
}

/* ---------- 缓存进度条（因子实验室 §3.1） ---------- */
.cache-progress {
  height: 14px;
  border-radius: 7px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  overflow: hidden;
  margin: 10px 0;
}
.cache-progress .cp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-red), var(--brand-gold));
  border-radius: 7px;
  transition: width 0.4s ease;
}
.cache-progress .cp-fill.warn { background: var(--warn); }
.cache-progress .cp-fill.critical { background: var(--danger); }

/* ---------- 热力图单元格（行业×因子 §3.4） ---------- */
.heatmap-cell {
  display: inline-block;
  width: 100%;
  height: 34px;
  border-radius: 4px;
  color: #FFFFFF;
  font-size: 12px;
  line-height: 34px;
  text-align: center;
  font-family: "JetBrains Mono", Consolas, monospace;
}

/* ---------- 异步任务进度（因子实验室 §4.1） ---------- */
.task-progress { margin: 12px 0; }
.task-progress .tp-track {
  height: 8px; border-radius: 4px; background: var(--bg-light);
  border: 1px solid var(--border); overflow: hidden;
}
.task-progress .tp-fill {
  height: 100%; background: var(--brand-red);
  transition: width 0.5s ease; border-radius: 4px;
}
.task-progress .tp-text { font-size: 12px; color: var(--text-sub); margin-top: 4px; }
@keyframes tp-stripes {
  from { background-position: 0 0; }
  to   { background-position: 24px 0; }
}
.task-progress .tp-fill.running {
  background-image: linear-gradient(45deg,
    rgba(255,255,255,.2) 25%, transparent 25%, transparent 50%,
    rgba(255,255,255,.2) 50%, rgba(255,255,255,.2) 75%, transparent 75%);
  background-size: 24px 24px;
  animation: tp-stripes 1s linear infinite;
}

/* ---------- 报告类型标签选择（§3.7 三选一） ---------- */
.radio-tabs { display: flex; gap: 0; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; width: max-content; }
.radio-tabs .rt-item {
  padding: 8px 24px;
  font-size: 14px;
  color: var(--text-sub);
  cursor: pointer;
  background: var(--card-bg);
  border-right: 1px solid var(--border);
  user-select: none;
}
.radio-tabs .rt-item:last-child { border-right: none; }
.radio-tabs .rt-item.active { background: var(--brand-red); color: #FFFFFF; font-weight: 700; }

/* ---------- 验证指标卡片（因子实验室 §3.3 六项指标） ---------- */
.verify-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.verify-grid .vg-2 { grid-column: span 2; }
.verify-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  background: var(--card-bg);
}
.verify-card.pass { border-color: var(--success); }
.verify-card.fail { border-color: var(--danger); }
.verify-card .vc-name { font-size: 12px; color: var(--text-sub); margin-bottom: 6px; }
.verify-card .vc-value {
  font-size: 26px; font-weight: 700;
  font-family: "JetBrains Mono", Consolas, monospace;
  color: var(--text-main);
}
.verify-card .vc-verdict { font-size: 12px; margin-top: 6px; }
.verify-card .vc-verdict.pass { color: var(--success); }
.verify-card .vc-verdict.fail { color: var(--danger); }

/* ---------- 综合判定徽章 ---------- */
.verdict-banner {
  display: flex; align-items: center; gap: 12px;
  margin-top: 16px; padding: 14px 18px;
  border-radius: 8px;
  background: rgba(46, 125, 50, 0.08);
  border: 1px solid var(--success);
}
.verdict-banner.invalid { background: rgba(183, 28, 28, 0.08); border-color: var(--danger); }
.verdict-banner .vb-text { font-size: 14px; color: var(--text-main); }

/* ---------- 黄金双板块（§3.5） ---------- */
.dual-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.board-tag {
  display: inline-block;
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 10px;
  background: var(--brand-gold);
  color: #1A1A1A;
  margin-left: 8px;
}
.board-tag.low { background: var(--bg-light); color: var(--text-sub); border: 1px solid var(--border); }

/* ---------- 登录页 ---------- */
.login-brand { text-align: center; margin-bottom: 28px; }
.login-brand img { width: 72px; height: 72px; border-radius: 14px; margin-bottom: 12px; }
.login-brand .lb-system { font-size: 20px; font-weight: 700; color: var(--text-main); }
.login-brand .lb-owner { font-size: 12px; color: var(--text-weak); margin-top: 4px; }
.login-error {
  display: none;
  background: rgba(183, 28, 28, 0.08);
  border: 1px solid var(--danger);
  color: var(--danger);
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 13px;
  margin-bottom: 16px;
}
.login-error.show { display: block; }
.login-footer { text-align: center; font-size: 12px; color: var(--text-weak); margin-top: 20px; }

/* ---------- 错误页 ---------- */
.error-wrap {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.error-card {
  text-align: center;
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 60px 80px;
  max-width: 480px;
}
.error-card .ec-code {
  font-size: 72px; font-weight: 700; color: var(--brand-red);
  font-family: "JetBrains Mono", Consolas, monospace;
  line-height: 1;
}
.error-card .ec-title { font-size: 20px; font-weight: 700; color: var(--text-main); margin: 12px 0 8px; }
.error-card .ec-desc { font-size: 14px; color: var(--text-sub); margin-bottom: 28px; }
.error-card .ec-actions { display: flex; gap: 12px; justify-content: center; }

/* ---------- 设置页开关行 ---------- */
.switch-table { width: 100%; border-collapse: collapse; }
.switch-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
.switch-table tr:last-child td { border-bottom: none; }
.tf-switch {
  position: relative;
  display: inline-block;
  width: 44px; height: 24px;
}
.tf-switch input { opacity: 0; width: 0; height: 0; }
.tf-switch .sl {
  position: absolute; inset: 0;
  background: #CFCFCF;
  border-radius: 12px;
  transition: 0.2s;
  cursor: pointer;
}
.tf-switch .sl:before {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: #FFFFFF;
  border-radius: 50%;
  transition: 0.2s;
}
.tf-switch input:checked + .sl { background: var(--brand-red); }
.tf-switch input:checked + .sl:before { transform: translateX(20px); }

/* ---------- 因子池筛选行 ---------- */
.filter-bar {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-bar .fb-item { display: flex; flex-direction: column; gap: 4px; }
.filter-bar .fb-item label { font-size: 12px; color: var(--text-sub); }
.filter-bar input, .filter-bar select {
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--card-bg);
  color: var(--text-main);
  padding: 0 10px;
  font-size: 14px;
  min-width: 160px;
}

/* ---------- 表格容器（横向滚动，移动端可用） ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* 超宽表格（如13行业打分表）按需加 .wide 类 */
.table-scroll .table-quant.wide { min-width: 720px; }

/* U-1：名称列长文本省略号 + title 全称（避免"美元兑人民币(自建)归一化"等换行拥挤粘连） */
.table-quant td.factor-name,
.table-quant td.name-cell {
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* U-4：品牌浅底提示条（替代高饱和黄块）——随主题品牌色浅底，与主界面同源不割裂 */
.brand-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 14px;
  margin-bottom: 14px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--text-sub);
  background: linear-gradient(90deg,
    rgba(192, 17, 31, 0.07),
    rgba(192, 17, 31, 0.02));
  border: 1px solid rgba(192, 17, 31, 0.18);
}
body[data-theme="dark"] .brand-strip {
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.02));
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--text-sub);
}
.brand-strip .bs-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--warn, #FB8C00);
  margin-right: 5px;
}
.brand-strip .bs-note { opacity: .75; }
.brand-strip .bs-link {
  margin-left: auto;
  color: var(--brand-red);
  text-decoration: underline;
  font-weight: 600;
}

/* ---------- 因子详情弹窗 ---------- */
.modal-quant .modal-content {
  background: var(--card-bg);
  border-radius: 8px;
  border: none;
  color: var(--text-main);
}
.modal-quant .modal-header {
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
}
.modal-quant .modal-title { font-size: 16px; font-weight: 700; }
.modal-quant .modal-body { padding: 20px; }
.modal-quant .modal-footer { border-top: 1px solid var(--border); padding: 12px 20px; gap: 8px; }
.detail-kv { display: grid; grid-template-columns: 100px 1fr; gap: 8px 12px; font-size: 14px; }
.detail-kv .dk-k { color: var(--text-sub); }
.detail-kv .dk-v { color: var(--text-main); }

/* ---------- 状态点（Supervisor 状态等） ---------- */
.status-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  margin-right: 6px; vertical-align: middle;
}
.status-dot.on { background: var(--success); }
.status-dot.off { background: #9E9E9E; }
.status-dot.err { background: var(--danger); }

/* ---------- 响应式（§1.4 平板/移动端） ---------- */
@media (max-width: 1199px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .verify-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 991px) {
  .row-2col, .row-2col-3-2, .row-2col-2-3, .dual-board { grid-template-columns: 1fr; }
}
/* V8.88-P7：K线需要宽画布——<1200px 时双栏布局改单列堆叠（先于 991 断点生效） */
@media (max-width: 1199px) {
  .row-2col:has(#kline-gold),
  .row-2col:has(.kline-toolbar) { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .verify-grid { grid-template-columns: 1fr; }
  .panel { padding: 14px; }
  .error-card { padding: 40px 24px; }
  .cycle-tab { min-width: 70px; padding: 8px 10px; font-size: 13px; }
}
@media (max-width: 480px) {
  .metric-grid { grid-template-columns: 1fr; }
}

/* ---------- V8.88-R25（P3）：统一「源不可达 / 空数据」空态组件（全站唯一空态族） ----------
 * K3 演示数据全站清零后，断网/接口失败时各页渲染本组件；零造假：不回填示例值。
 * 结构：.empty-state > .empty-icon + .empty-title + .empty-hint (+ .empty-detail) */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 36px 16px;
  text-align: center;
  border: 1px dashed var(--border-soft, #E5E5E5);
  border-radius: 8px;
  background: var(--bg-light, #FAFAFA);
}
.empty-state .empty-icon { font-size: 26px; color: var(--text-weak); line-height: 1; }
.empty-state .empty-title { font-size: 14px; font-weight: 700; color: var(--text-main); }
.empty-state .empty-hint { font-size: 12px; color: var(--text-sub); line-height: 1.7; max-width: 460px; }
.empty-state .empty-detail {
  font-size:12px; color: var(--text-weak); line-height: 1.6;
  max-width: 520px; word-break: break-all;
  font-family: "JetBrains Mono", Consolas, monospace;
}

/* ---------- V8.88-R25（R6）：行情页自定义工作台 ----------
 * 结构（market.html + market.js）：
 *   #wb-editbar 编辑条（仅 body.wb-editing 时显示）
 *     └ .wb-editbar-inner > .wb-editbar-tip + .wb-editbar-btns > .wb-editbtn
 *     └ #wb-drawer 添加卡片抽屉 > .wb-drawer-group > .wb-drawer-gtitle + .wb-drawer-item*
 *   #wb-grid 卡片栅格 > .wb-card(.w-full | .w-half)[data-wb-id]
 *     └ .panel > .panel-title( .wb-sub + .wb-tools + .wb-titletools ) + .wb-body
 * 布局：两列栅格，w-full 占满整行、w-half 单列；<=900px 折叠单列。
 * 编辑态：卡片虚线描边，卡内工具钮（↑↓⇔✕）仅编辑态显示。 */

/* ---- 栅格 ---- */
#wb-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}
#wb-grid .wb-card { min-width: 0; }
#wb-grid .wb-card.w-full { grid-column: 1 / -1; }
#wb-grid .wb-card.w-half { grid-column: auto / span 1; }
/* panel 自带 margin-bottom:14px（行内）——栅格内由 gap 统一间距，置零防叠加 */
#wb-grid .panel { margin-bottom: 0 !important; }

/* ---- 卡壳标题行 ---- */
.wb-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-titletools { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
/* 卡内工具钮（✕摘除/↑↓调序/⇔宽度）：默认隐藏，仅自定义模式显示 */
.wb-tools { display: none; margin-left: auto; }
body.wb-editing .wb-tools { display: inline-flex; gap: 4px; align-items: center; }
.wb-btn {
  width: 24px; height: 24px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--card-bg);
  color: var(--text-sub);
  font-size: 12px; line-height: 1;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color .15s, color .15s, background .15s;
}
.wb-btn:hover { border-color: var(--brand-red); color: var(--brand-red); }
.wb-btn.wb-btn-x:hover { border-color: #D32F2F; background: rgba(211, 47, 47, .08); color: #D32F2F; }

/* ---- 编辑态视觉：卡片虚线描边提示可编排 ---- */
body.wb-editing #wb-grid .wb-card > .panel {
  border: 1px dashed rgba(196, 30, 58, .45);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* ---- 编辑条 ---- */
#wb-editbar {
  margin-bottom: 14px;
}
.wb-editbar-inner {
  background: linear-gradient(90deg, #fdf6f7, #fbf4f0);
  border: 1px solid #eccfd4;
  border-radius: 8px;
  padding: 12px 16px;
}
body[data-theme="dark"] .wb-editbar-inner {
  background: linear-gradient(90deg, rgba(196,30,58,.12), rgba(196,30,58,.05));
  border-color: rgba(196,30,58,.35);
}
.wb-editbar-tip { font-size: 12.5px; color: var(--text-sub); line-height: 1.7; }
.wb-editbar-tip b { color: var(--brand-red); }
.wb-editbar-btns { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.wb-editbtn {
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--card-bg);
  color: var(--text-main);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.wb-editbtn:hover { border-color: var(--brand-red); }
.wb-editbtn-primary {
  background: var(--brand-red);
  border-color: var(--brand-red);
  color: #FFFFFF;
}
.wb-editbtn-primary:hover { opacity: .88; background: var(--brand-red); }

/* ---- 添加卡片抽屉 ---- */
#wb-drawer {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-bg);
  padding: 14px 16px;
  max-height: 420px;
  overflow-y: auto;
}
.wb-drawer-group { margin-bottom: 12px; }
.wb-drawer-group:last-child { margin-bottom: 0; }
.wb-drawer-gtitle {
  font-size: 12px; font-weight: 700; color: var(--brand-red);
  margin-bottom: 8px; padding-bottom: 4px;
  border-bottom: 1px solid var(--border-soft, #EFEFEF);
}
.wb-drawer-item {
  display: flex; align-items: center; gap: 12px;
  padding: 7px 10px; border-radius: 4px;
}
.wb-drawer-item:hover { background: var(--table-hover, #F7F7F7); }
.wb-drawer-info { min-width: 0; flex: 1; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.wb-drawer-info b { font-size: 13px; color: var(--text-main); }
.wb-drawer-desc { font-size:12px; color: var(--text-sub); }
.wb-btn-add {
  flex-shrink: 0;
  padding: 5px 14px;
  border: 1px solid var(--brand-red);
  border-radius: 4px;
  background: transparent;
  color: var(--brand-red);
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.wb-btn-add:hover { background: var(--brand-red); color: #FFFFFF; }
.wb-btn-add.on { border-color: var(--border); color: var(--text-weak); cursor: default; background: transparent; }

/* ---- KPI 指标盒（dash.kpi 卡） ---- */
.wb-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.wb-kpi-box {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
  background: var(--bg-light, #FAFAFA);
}
.wb-kpi-label { font-size:12px; color: var(--text-sub); }
.wb-kpi-val { font-size: 16px; font-weight: 700; color: var(--text-main); margin: 5px 0 3px; word-break: break-all; }
.wb-kpi-delta { font-size:12px; color: var(--text-sub); }

/* ---- TOP 榜单（dash.top3 卡） ---- */
.wb-toplist { display: flex; flex-direction: column; gap: 8px; padding: 4px 2px; }
.wb-top-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border-soft, #EFEFEF);
  border-radius: 6px;
  font-size: 13px;
  background: var(--card-bg);
}

/* ---- 信号流（dash.signals / industry.changes 卡） ---- */
.wb-siglist { list-style: none; margin: 0; padding: 4px 2px; }
.wb-siglist li {
  display: flex; gap: 10px; align-items: baseline;
  padding: 7px 4px;
  border-bottom: 1px dashed var(--border-soft, #EFEFEF);
  font-size: 12.5px; color: var(--text-main);
}
.wb-siglist li:last-child { border-bottom: 0; }
.sig-date { flex-shrink: 0; font-size:12px; color: var(--text-weak); font-family: "JetBrains Mono", Consolas, monospace; }

/* ---- 异动时间轴（dash.signals 优化） ---- */
.wb-timeline { list-style: none; margin: 0; padding: 6px 2px; position: relative; }
.wb-timeline-item { position: relative; padding: 0 0 14px 22px; }
.wb-timeline-item:last-child { padding-bottom: 2px; }
.wb-timeline-item::before {
  content: ""; position: absolute; left: 4px; top: 10px; bottom: -2px;
  width: 2px; background: var(--border-soft, #EFEFEF);
}
.wb-timeline-item:last-child::before { display: none; }
.wb-timeline-dot {
  position: absolute; left: 0; top: 4px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--brand-red, #C0111F); box-shadow: 0 0 0 2px rgba(192, 17, 31, 0.18);
}
.wb-timeline-item:first-child .wb-timeline-dot { background: var(--brand-red, #C0111F); }
.wb-timeline-date { font-size:12px; color: var(--text-weak); font-family: "JetBrains Mono", Consolas, monospace; margin-bottom: 2px; }
.wb-timeline-text { font-size: 12.5px; color: var(--text-main); line-height: 1.5; }

/* ---- 自选趋势墙（market.trendWall，N1） ---- */
.wb-trend-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.wb-trend-card:hover { border-color: var(--brand-red, #C0111F); box-shadow: 0 0 0 1px var(--brand-red, #C0111F) inset; }

/* ---- 统计格子（数据健康 N8 / 因子 IC 归因 N5） ---- */
.wb-stat {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--card-bg);
}
.wb-stat-label { font-size:12px; color: var(--text-sub); margin-bottom: 4px; }
.wb-stat-val { font-size: 16px; font-weight: 700; color: var(--text-main); }

/* ---- 响应式：窄屏半宽折叠为全宽单列 ---- */
@media (max-width: 900px) {
  #wb-grid { grid-template-columns: 1fr; }
  #wb-grid .wb-card.w-half { grid-column: auto; }
}

/* ===== V8.88-R41（W11③）：K 线左置角标堆叠容器（HA/盘中快照）===== */
.kline-host { position: relative; }
.kl-lg-badges {
  position: absolute; left: 8px; top: 8px; z-index: 6;
  display: flex; flex-direction: column;
  align-items: flex-start; gap: 4px; pointer-events: none;
}
.kl-lg-badges .kl-bdg {
  color: #fff; font: 11px/1.4 sans-serif;
  padding: 3px 8px; border-radius: 3px; white-space: nowrap;
}
