/* ══════════════════════════════════════════════════════════════════════════
   Sic Bo 页面：骰子走势图 + 数值分析（2026-10-27）
   —— 照 K3 参考站 /history 的「福彩3D 式骰子走势图 / 和值数据 / 组合号」搬过来。
   颜色全部用 #sb-grid2 里的深色变量（--card / --card2 / --border / --text /
   --muted / --gold / --gold-ink），所以跟骰宝页面本身是一套皮肤。
   ⚠️ 类名（.fx-* / .sb-cell / .cb-row / .sd-*）是 sicbo-trend.js 按名字找的，
      改名 = 整块图空白或点不动。
   ══════════════════════════════════════════════════════════════════════════ */

/* 卡片：沿用 details.cp 的壳，里面的 .panel 别再套一层亮底 */
details.sb-tr-card .cp-in { padding: 0 12px 14px !important; }
details.sb-tr-card .panel {
  background: transparent !important; border: none !important; box-shadow: none !important;
  margin: 0 !important; padding: 0 !important;
}
.sb-tr-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0 0 10px;
}
.sb-tr-hint { flex: 1 1 160px; font-size: 11.5px; line-height: 1.45; color: var(--muted); }
.sb-tr-chips { display: flex; gap: 5px; flex-wrap: wrap; margin-left: auto; }
.sb-tr-chip {
  font-size: 11px; color: var(--muted); cursor: pointer; user-select: none;
  padding: 3px 9px; border: 1px solid var(--border); border-radius: 20px;
  background: var(--card2); white-space: nowrap;
}
.sb-tr-chip.on { border-color: var(--gold); color: var(--gold-ink); background: rgba(245,196,81,.12); }

/* 说明行（照 K3 的 .legend） */
.sb-tr-card .legend {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--muted); margin-bottom: 10px;
}

/* ---------- 🎲 骰子走势图（福彩3D 式） ---------- */
.fx-scroll {
  overflow: auto; max-height: 420px; -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
}
.fx-inner {
  position: relative; display: table; margin: 0 auto;
  --fxw: 26px; --fxq: 56px; --fxball: 17px; --fxfs: 11px; --fxqfs: 10px; --fxz: 1;
}
.fx-lines { position: absolute; left: 0; top: 0; pointer-events: none; }
.fx-t { border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.fx-t th, .fx-t td { padding: 0; text-align: center; }
.fx-q {
  position: sticky; left: 0; z-index: 2; background: var(--card);
  width: var(--fxq); min-width: var(--fxq);
  font-size: var(--fxqfs, 10px); font-weight: 400; color: var(--muted);
  text-align: left !important; padding-left: 4px !important; white-space: nowrap;
}
.fx-q i { font-style: normal; color: var(--gold-ink); font-size: var(--fxqfs, 10px); }
.fx-top {
  color: var(--text); font-size: 12px; font-weight: 700;
  text-align: left !important; padding: 4px 0 2px 4px !important;
}
.fx-sum td.fx-q { font-size: var(--fxfs); }
.fx-pos {
  font-size: 11px; color: var(--text); font-weight: 600; padding: 4px 0 0 !important;
  background: var(--card2); border-top: 1px solid var(--border);
}
.fx-n {
  width: var(--fxw); min-width: var(--fxw); height: 22px;
  font-size: var(--fxfs); color: var(--muted); font-weight: 400;
}
.fx-t thead .fx-n { height: 18px; font-size: var(--fxfs); color: #8f99b3; border-bottom: 1px solid var(--border); }
.fx-t thead tr:nth-child(1) th { position: sticky; top: 0; z-index: 3; background: var(--card); }
.fx-t thead tr:nth-child(2) th { position: sticky; top: 18px; z-index: 3; background: var(--card); }
.fx-t thead tr:nth-child(1) th.fx-q { z-index: 4; }
/* 🔴 全站主题里有 `body.cosmic-inner th{background:rgba(...,.16) !important}`，
   会把走势图表头的底色冲成半透明，滚动时下面的数字/红球透上来，看着像糊成一片。
   这里用更高的选择器 + !important 钉成不透明底色（表头两组分开，DIE 1/2/3 仍用 card2）。 */
body.cosmic-inner .sb-tr-card .fx-t thead th { background: var(--card) !important; }
body.cosmic-inner .sb-tr-card .fx-t thead th.fx-pos { background: var(--card2) !important; }
body.cosmic-inner .sb-tr-card .fx-q { background: var(--card) !important; }
.fx-t tbody td:nth-child(8), .fx-t tbody td:nth-child(14),
.fx-t tfoot td:nth-child(8), .fx-t tfoot td:nth-child(14) { border-left: 1px solid var(--border); }
.fx-t thead tr:first-child th:nth-child(3), .fx-t thead tr:first-child th:nth-child(4) { border-left: 1px solid var(--border); }
.fx-hit { background: none; }
.fx-ball {
  display: inline-block; width: var(--fxball); height: var(--fxball); line-height: var(--fxball);
  border-radius: 50%; background: #e0393b; color: #fff;
  font-size: 11px; font-weight: 700; text-align: center;
  vertical-align: middle; box-shadow: 0 0 0 1px rgba(255,255,255,.18) inset;
}
.fx-m { color: #6f7a91; font-size: var(--fxfs); }
.fx-sum td { border-top: 1px solid var(--border); height: 20px; font-size: var(--fxfs); background: var(--card); }
.fx-sum .fx-n { color: var(--muted); }
.fx-sum .fx-n.now { color: var(--gold-ink); font-weight: 700; }
.fx-first td { background: rgba(245,196,81,.075); }
.fx-first .fx-q { color: var(--gold-ink); font-weight: 700; }
.fx-first .fx-ball { box-shadow: 0 0 6px rgba(224,57,59,.7); }
.fx-new {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold); margin-left: 3px; vertical-align: middle;
  box-shadow: 0 0 5px rgba(245,196,81,.9);
}

/* ---------- 📊 和值号 + 组合号 ---------- */
.tr-wrap { margin: 0 -2px; }
.sb { display: flex; flex-wrap: wrap; gap: 5px; }
.sb-cell {
  width: 40px; box-sizing: border-box; padding: 5px 0 4px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 8px; background: var(--card2);
  text-align: center; font-variant-numeric: tabular-nums;
  transition: border-color .12s, background .12s;
}
.sb-cell b { display: block; font-size: 14px; font-weight: 700; color: var(--text); }
.sb-cell em { display: block; font-size: 10px; font-style: normal; color: var(--muted); }
.sb-cell.hot em { color: var(--gold-ink); }
.sb-cell.cold em { color: var(--red); }
.sb-cell:active { background: var(--border); }
.sb-cell.on { border-color: var(--gold); background: rgba(245,196,81,.14); }
.sb-cell.on b { color: var(--gold-ink); }

.combo-wrap { margin: 10px 0 2px; }
.cb-row { display: flex; align-items: flex-start; gap: 6px; margin-bottom: 7px; }
.cb-t {
  flex: 0 0 50px; padding-top: 6px; font-size: 11px; color: var(--muted);
  letter-spacing: .5px; line-height: 1.2;
}
.cb-row .sb { flex: 1 1 auto; min-width: 0; }
.cb-row .sb-cell { width: 38px; }
.cb-row .sb-cell b { font-size: 12.5px; letter-spacing: -.5px; }
.cb-row .sb-cell em { font-size: 9.5px; }
.combo-wrap .sd { margin-top: 8px; }

/* 点开某个和值 / 组合后的逐期明细 */
.sd { margin-top: 12px; }
.sd-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 12px; color: var(--muted); padding: 8px 10px; margin-bottom: 8px;
  background: var(--card2); border-radius: 8px;
}
.sd-head b { color: var(--gold-ink); }
.sd-back { color: var(--muted); cursor: pointer; white-space: nowrap; }
.sd-back:active { color: var(--gold-ink); }
.sd-sum { margin-left: auto; font-variant-numeric: tabular-nums; }
.sd-body { max-height: 380px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; }
.sd-t { width: 100%; border-collapse: collapse; font-size: 12px; }
.sd-t td { padding: 6px 10px; border-bottom: 1px solid var(--border); }
.sd-t tr:last-child td { border-bottom: none; }
.sd-q { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 11px; width: 84px; }
.sd-r { color: var(--muted); }
.sd-t tr.hit { background: rgba(245,196,81,.12); }
.sd-t tr.hit .sd-r b { color: var(--gold-ink); }
.sd-t tr.hit .sd-r i { font-style: normal; color: var(--muted); font-size: 11px; margin-left: 8px; }

@media (max-width: 400px) {
  .cb-t { flex-basis: 42px; font-size: 10px; }
  .cb-row .sb-cell { width: 35px; }
  .cb-row .sb-cell b { font-size: 11.5px; }
  .sb-cell { width: 36px; }
  .sb-tr-card .legend { font-size: 10.5px; gap: 8px; }
}
