/* ============ 题材跟踪 theme.css ============ */
/* 全站统一版心（与 .wrap/.dash 共用 --gl-content 令牌） */
.page { max-width: var(--gl-content, 1720px); margin: 0 auto; padding: 20px 22px 46px; }
.th-head { padding: 10px 4px 12px; }
.th-title { font-size: 22px; font-weight: 700; color: #27548c; }
.th-sub { font-size: 13px; font-weight: 400; color: #5a6478; margin-left: 8px; }
.th-meta { font-size: 12px; color: #5a6478; margin-top: 4px; }
.th-meta b { color: #0a0a0a; }
.th-note { font-size: 12px; color: #8a93a5; margin-top: 6px; line-height: 1.7;
  background: #fafafa; border: 1px dashed #e3e4e6; border-radius: 8px; padding: 7px 12px; }
.th-note b { color: #27548c; }

.th-card { padding: 12px 14px; margin-bottom: 14px; }
.th-hide { display: none; }
.th-empty { color: #8a93a5; text-align: center; padding: 46px 0; font-size: 14px; }
.sec-title { font-size: 15px; font-weight: 700; color: #0a0a0a; margin-bottom: 10px; }
.th-lab { font-size: 12px; font-weight: 400; color: #8a93a5; margin-left: 6px; }

/* ---- 题材环境带 ---- */
.th-regime { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px; margin-bottom: 14px; }
.rg-cell { background: #fff; border: 1px solid #e8edf5; border-radius: 10px;
  padding: 10px 12px; min-width: 0; }
.rg-k { font-size: 11.5px; color: #8a93a5; }
.rg-v { font-size: 19px; font-weight: 700; color: #0a0a0a; margin-top: 3px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.rg-v small { font-size: 11.5px; font-weight: 400; color: #8a93a5; margin-left: 4px; }
.rg-d { font-size: 11px; color: #a8b0c0; margin-top: 2px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }

/* ---- 榜单表 ---- */
.th-scroll { overflow: auto; max-height: 720px; }
.th-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.th-table th { position: sticky; top: 0; background: #f7f9fd; color: #5a6478;
  font-weight: 600; padding: 7px 6px; border-bottom: 1px solid #e3e4e6;
  white-space: nowrap; z-index: 1; }
.th-table td { padding: 7px 6px; border-bottom: 1px solid #f0f3f8; white-space: nowrap; }
.th-table th.tl, .th-table td.tl { text-align: left; }
.th-table th:not(.tl), .th-table td:not(.tl) { text-align: right; }
.th-table tbody tr { cursor: pointer; transition: background .12s; }
.th-table tbody tr:hover { background: #f2f6ff; }
.th-table tbody tr.active { background: #e8efff; }
.th-table .tname { font-weight: 600; color: #0a0a0a; max-width: 150px;
  overflow: hidden; text-overflow: ellipsis; }
.th-table .rk { color: #8a93a5; }
.th-table tr:nth-child(-n+3) .rk { color: #e0554d; font-weight: 700; }
.th-table .sub { color: #a8b0c0; font-size: 11px; }

/* 红涨绿跌（A 股口径，与全站 pos/neg 一致） */
.pos { color: #d93636; }
.neg { color: #0a9d4c; }
.flat { color: #5a6478; }

/* 强度分条 */
.sc-bar { display: inline-block; width: 54px; height: 7px; border-radius: 4px;
  background: #edf0f6; vertical-align: middle; position: relative;
  overflow: hidden; margin-right: 6px; }
.sc-bar i { position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, #6f9bd6, #27548c); border-radius: 4px; }
.sc-bar i.hi { background: linear-gradient(90deg, #e8a33d, #b45309); }
.sc-num { font-variant-numeric: tabular-nums; color: #3d4557; }

/* ---- 详情网格 ---- */
.th-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px; align-items: start; }
.th-detail .th-card { margin-bottom: 0; }
.th-detail > .th-wide { grid-column: 1 / -1; }

/* ---- 题材强度卡 ---- */
.ti-top { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.ti-score { flex: none; width: 96px; text-align: center; border-radius: 12px;
  padding: 10px 6px; color: #fff;
  background: linear-gradient(135deg, #3f6fa8, #27548c); }
.ti-score b { display: block; font-size: 30px; font-weight: 700; line-height: 1.1;
  font-variant-numeric: tabular-nums; }
.ti-score small { font-size: 10.5px; opacity: .88; }
.ti-name { flex: 1; min-width: 0; }
.ti-name h3 { margin: 0; font-size: 17px; color: #0a0a0a; }
.ti-name h3 span { font-size: 12px; font-weight: 400; color: #a8b0c0; margin-left: 6px; }
.ti-sub { font-size: 12px; color: #8a93a5; margin-top: 3px; }

.th-kpi { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px; margin-bottom: 12px; }
.kpi-c { background: #fafbfe; border: 1px solid #eef1f7; border-radius: 8px;
  padding: 7px 9px; min-width: 0; }
.kpi-k { font-size: 11px; color: #8a93a5; white-space: nowrap; }
.kpi-v { font-size: 14.5px; font-weight: 700; margin-top: 2px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.kpi-d { font-size: 10.5px; color: #a8b0c0; margin-top: 1px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }

/* 强度分拆解 */
.pd-list { margin-top: 2px; }
.pd-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) 62px;
  gap: 10px; align-items: center; padding: 5px 0; }
.pd-k { font-size: 12px; color: #3d4557; white-space: nowrap; }
.pd-bar { height: 9px; border-radius: 5px; background: #eef1f7; overflow: hidden; }
.pd-bar i { display: block; height: 100%; border-radius: 5px;
  background: linear-gradient(90deg, #7fa6d8, #27548c); }
.pd-v { font-size: 11.5px; color: #5a6478; text-align: right;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  font-weight: 600; color: #3d4557; }
.pd-sum { border-top: 1px dashed #e8edf5; margin-top: 6px; padding-top: 6px;
  font-size: 11.5px; color: #8a93a5; line-height: 1.7; }

/* ---- 生命周期卡 ---- */
.life-badge { border-radius: 12px; padding: 16px 10px; text-align: center;
  color: #fff; font-size: 22px; font-weight: 700; letter-spacing: 2px; margin-bottom: 10px; }
.life-badge small { display: block; font-size: 11px; font-weight: 400;
  opacity: .85; margin-top: 5px; letter-spacing: 0; }
.life-signals ul { list-style: none; margin: 0; padding: 0; }
.life-signals li { font-size: 12.5px; color: #3d4557; padding: 5px 0;
  border-bottom: 1px dashed #f0f0f2; }
.life-signals li:last-child { border-bottom: 0; }

.life-hist-t { font-size: 12.5px; font-weight: 600; color: #0a0a0a;
  margin: 14px 0 10px; }
.hist-bar { position: relative; height: 34px; background: #f2f4f9;
  border-radius: 8px; overflow: visible; }
.hist-bar .seg { position: absolute; top: 9px; height: 16px; border-radius: 8px;
  background: linear-gradient(90deg, #c9d9ff, #8fb0ff); }
.hist-bar .q { position: absolute; top: 0; bottom: 0; width: 2px; background: #b9c2d4; }
.hist-bar .q span { position: absolute; top: -16px; left: 50%;
  transform: translateX(-50%); font-size: 10px; color: #8a93a5; white-space: nowrap; }
.hist-bar .cur { position: absolute; top: -3px; width: 3px; height: 40px;
  background: #e0554d; border-radius: 2px; }
.hist-bar .cur span { position: absolute; bottom: -16px; left: 50%;
  transform: translateX(-50%); font-size: 10px; color: #e0554d; font-weight: 700; white-space: nowrap; }
.life-hist-d { font-size: 12px; color: #5a6478; margin-top: 24px; line-height: 1.7; }

/* ---- 图表 ---- */
.th-chart { width: 100%; height: 360px; min-width: 0; }
.th-chart-sm { width: 100%; height: 132px; min-width: 0; }

/* ---- 时间轴列表 ---- */
.tl-list { margin-top: 6px; max-height: 300px; overflow: auto; }
.tl-day { margin-bottom: 10px; }
.tl-day-h { font-size: 12.5px; font-weight: 700; color: #0a0a0a; margin-bottom: 5px; }
.tl-day-h .cnt { color: #d93636; }
.tl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tl-chip { font-size: 11.5px; background: #fafafa; border: 1px solid #e5eaf2;
  border-radius: 6px; padding: 4px 8px; color: #3d4557; }
.tl-chip b { color: #d93636; font-weight: 600; }
.tl-chip .lb { color: #d97a1f; font-weight: 700; }

/* ---- 个股表 ---- */
.role { display: inline-block; font-size: 11px; padding: 3px 7px;
  border-radius: 9px; font-weight: 600; }
.role-leader { background: #ffe3e0; color: #d93636; }
.role-core { background: #fff1e0; color: #d97a1f; }
.role-follower { background: #eef0f4; color: #7a8296; }
.prec { display: inline-block; font-size: 11px; padding: 3px 7px; border-radius: 9px; }
.prec-1 { background: #e5edff; color: #27548c; font-weight: 600; }
.prec-0 { background: #f2f3f6; color: #a8b0c0; }
.rel-bar { display: inline-block; width: 72px; height: 8px; border-radius: 4px;
  background: #edf0f6; position: relative; overflow: hidden; vertical-align: middle; }
.rel-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; }
.rel-hi { background: linear-gradient(90deg, #ff8a80, #d93636); }
.rel-mid { background: linear-gradient(90deg, #ffd180, #d97a1f); }
.rel-lo { background: #b9c2d4; }
.stock-name { font-weight: 600; color: #0a0a0a; }
.stock-code { color: #a8b0c0; font-size: 11px; margin-left: 3px; }

/* ---- 移动端 ---- */
@media (max-width: 1180px) {
  .th-regime { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .th-detail { grid-template-columns: minmax(0, 1fr); }
  .th-detail > .th-wide { grid-column: auto; }
}
@media (max-width: 1080px) {
  .th-scroll { max-height: 340px; }
  .th-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hist-bar .q span { display: none; }
}
@media (max-width: 640px) {
  .th-regime { grid-template-columns: minmax(0, 1fr); }
  .ti-top { flex-wrap: wrap; }
}

/* 表头排序指示 */
.th-table th.sort { cursor: pointer; user-select: none; }
.th-table th.sort::after { content: '⇅'; color: #c0c8d8; margin-left: 3px; font-size: 10px; }
.th-table th.sort.on-asc::after { content: '↑'; color: #27548c; }
.th-table th.sort.on-desc::after { content: '↓'; color: #27548c; }

/* 关联题材列：允许换行以承载更多 chips（2026-10-27） */
.th-table td.tl-wrap { white-space: normal; }

/* 两卡同行等高：kCard 弹性填充，图表占满剩余高度（2026-10-27） */
#kCard { display: flex; flex-direction: column; }
#kCard .th-chart { flex: 1; min-height: 0; height: auto; }
/* 关联题材 chips 多行排布：inline-block 防止行间重叠 */
.th-table td.tl-wrap { line-height: 2.1; }
.th-table td.tl-wrap .tl-chip { display: inline-block; line-height: 1.4; }
/* .th-detail 默认 align-items:start 会阻止拉伸 → 两卡显式 stretch 才能同高 */
.th-detail > #lifeCard, .th-detail > #kCard { align-self: stretch; }
/* 单列断点下 flex 高度塌为 0 → 图表保底高度 */
#kCard .th-chart { min-height: 320px; }
