/* =========================================================
   开奖数据中心 —— 基础与主题
   ========================================================= */
:root {
  --ball-front-bg: linear-gradient(160deg, #2f6fd0, #17408f);
  --ball-back-bg: linear-gradient(160deg, #f0713a, #c0321c);
  --radius: 12px;
  --maxw: 1080px;
  --tap: 44px;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-2: 0 4px 12px rgba(16, 24, 40, .10), 0 1px 3px rgba(16, 24, 40, .06);
}

html[data-theme="light"] {
  --bg: #f4f6fa;
  --bg-card: #ffffff;
  --bg-sunken: #eef1f7;
  --bg-zebra: #f7f9fc;
  --bg-sel: #e6f0ff;
  --fg: #14181f;
  --fg-2: #4a5568;
  --fg-3: #5f6b7a;
  --line: #e2e7f0;
  --line-strong: #c9d2e0;
  --accent: #1f6feb;
  --accent-soft: #e6f0ff;
  --hot: #b32619;
  --cold: #2f6fd0;
  --hit: #1f6feb;
  --miss-bg: #fbfcfe;
  --grid: #eef1f7;
  --warn-bg: #fff6e5;
  --warn-fg: #8a5a00;
  --warn-line: #f2d08a;
}

html[data-theme="dark"] {
  --bg: #0e1116;
  --bg-card: #171b22;
  --bg-sunken: #1d232c;
  --bg-zebra: #1a1f27;
  --bg-sel: #1e2c42;
  --fg: #e8ecf3;
  --fg-2: #a9b4c4;
  --fg-3: #7b8798;
  --line: #262d38;
  --line-strong: #38424f;
  --accent: #4d8dfa;
  --accent-soft: #1c2b44;
  --hot: #ff6b5e;
  --cold: #63a4ff;
  --hit: #4d8dfa;
  --miss-bg: #141a21;
  --grid: #232a34;
  --warn-bg: #2a2213;
  --warn-fg: #f0c274;
  --warn-line: #5c4a20;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 6px 18px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
  padding-bottom: 96px;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }

/* ================= 顶栏 ================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg-card) 92%, transparent);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 10px 14px 6px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--fg);
  font-weight: 700;
  letter-spacing: .3px;
  flex: 0 0 auto;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 9px;
  background: var(--ball-front-bg);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}
.brand-text { font-size: 15px; white-space: nowrap; }

.game-tabs {
  display: flex;
  gap: 4px;
  margin-left: auto;
  padding: 3px;
  background: var(--bg-sunken);
  border-radius: 999px;
  flex: 0 1 auto;
  min-width: 0;
}
.tab {
  border: 0;
  background: transparent;
  color: var(--fg-2);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  min-height: 34px;
  transition: background .18s, color .18s;
  white-space: nowrap;
  flex: 0 0 auto;
}
.tab[aria-selected="true"] {
  background: var(--bg-card);
  color: var(--fg);
  box-shadow: var(--shadow-1);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 15px;
  flex: 0 0 auto;
}
.icon-btn:hover { border-color: var(--line-strong); }

/* 倒计时 */
.countdown-bar {
  display: flex;
  align-items: baseline;
  gap: 8px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2px 14px 8px;
  font-size: 13px;
  color: var(--fg-2);
  flex-wrap: wrap;
}
.cd-label { color: var(--fg-3); }
.cd-value {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--accent);
  font-size: 14px;
}
.cd-next { color: var(--fg-3); font-size: 12px; }

/* 非最新提示 */
.freshtip {
  max-width: var(--maxw);
  margin: 0 auto 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--warn-bg);
  color: var(--warn-fg);
  border: 1px solid var(--warn-line);
  font-size: 13px;
  line-height: 1.45;
}

/* 主导航 */
.mainnav {
  display: flex;
  gap: 2px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 8px 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.mainnav::-webkit-scrollbar { display: none; }
.mainnav a {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 9px;
  color: var(--fg-2);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.mainnav a:hover { background: var(--bg-sunken); text-decoration: none; }
.mainnav a.active { background: var(--accent-soft); color: var(--accent); }

/* ================= 布局 ================= */
.view {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 14px 32px;
}
.loading { padding: 40px 0; text-align: center; color: var(--fg-3); }

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 14px;
  margin-bottom: 14px;
}
.card-plain { box-shadow: none; }

.sec-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
}
.sec-title .spacer { flex: 1 1 auto; }
.sec-note {
  margin: -6px 0 12px;
  color: var(--fg-3);
  font-size: 12.5px;
  line-height: 1.6;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-sunken);
  color: var(--fg-2);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.pill-accent { background: var(--accent-soft); color: var(--accent); }

/* ================= 号码球 ================= */
.balls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.balls.nowrap { flex-wrap: nowrap; }
/* 表格与缩略行内不允许换行，避免行高跳动 */
table.data .balls,
.mini-balls { flex-wrap: nowrap; }
.ball {
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: var(--ball-front-bg);
  box-shadow: inset 0 -2px 6px rgba(0, 0, 0, .18), 0 1px 3px rgba(16, 24, 40, .18);
  flex: 0 0 auto;
  line-height: 1;
}
.ball.back { background: var(--ball-back-bg); }
/* 双位数（后区 10-14）等比缩字，但字号下限 14px 由下方规则保证 */
.ball.wide { letter-spacing: -.8px; }
.ball.sm { width: 32px; height: 32px; font-size: 15px; }
.ball.sm.wide { font-size: 14px; }
.ball.xs { width: 28px; height: 28px; font-size: 14px; }
.ball.xs.wide { font-size: 14px; }
.ball-sep {
  width: 1px; height: 26px;
  background: var(--line-strong);
  margin: 0 2px;
}

/* ================= 首页大卡片 ================= */
.hero { padding: 18px 16px 16px; }
.hero-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.hero-issue {
  font-size: 13px;
  color: var(--fg-3);
  font-weight: 600;
}
.hero-issue b {
  display: block;
  font-size: 22px;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}
.hero-date { font-size: 13px; color: var(--fg-3); }
.hero-actions { margin-left: auto; display: flex; gap: 8px; }

.hero-balls { margin: 4px 0 16px; }
.hero-balls .ball { width: 46px; height: 46px; font-size: 19px; }

.hero-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}
.meta-item { min-width: 0; }
.meta-k { font-size: 12px; color: var(--fg-3); margin-bottom: 2px; }
.meta-v {
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* ================= 按钮 ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 40px;
  padding: 8px 13px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--bg-card);
  color: var(--fg-2);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .16s, background .16s, color .16s;
}
.btn:hover { border-color: var(--line-strong); color: var(--fg); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { filter: brightness(1.06); color: #fff; }
.btn-ghost { background: transparent; }

/* ================= 近10期缩略 ================= */
.mini-list { display: flex; flex-direction: column; gap: 2px; }
.mini-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border-radius: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--fg);
  min-height: 48px;
}
.mini-row:last-child { border-bottom: 0; }
.mini-row:hover { background: var(--bg-sunken); text-decoration: none; }
.mini-issue {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 14px;
  flex: 0 0 auto;
  min-width: 52px;
}
.mini-date {
  font-size: 12px;
  color: var(--fg-3);
  flex: 0 0 auto;
  min-width: 74px;
}
.mini-balls { display: flex; gap: 4px; flex: 1 1 auto; flex-wrap: nowrap; min-width: 0; }
.mini-balls .balls { flex-wrap: nowrap; gap: 4px; }
.mini-row .ball { width: 28px; height: 28px; font-size: 14px; }
.mini-arrow { color: var(--fg-3); font-size: 16px; flex: 0 0 auto; }

/* ================= 表格 ================= */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 10px;
}
table.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
  white-space: nowrap;
}
table.data th,
table.data td {
  padding: 9px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
table.data thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-sunken);
  color: var(--fg-2);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}
table.data tbody tr:nth-child(even) { background: var(--bg-zebra); }
table.data tbody tr:hover { background: var(--bg-sunken); }
table.data tbody tr.selected { background: var(--bg-sel); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.num { font-variant-numeric: tabular-nums; text-align: right; }
table.data th.num { text-align: right; }
table.data td.clickable { cursor: pointer; }
table.data .ball { width: 28px; height: 28px; font-size: 14px; }
table.data .balls { flex-wrap: nowrap; gap: 4px; }
td.balls-cell { display: flex; gap: 4px; align-items: center; }
table.data tr:focus-within { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ================= 表单 ================= */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.field > label { font-size: 11.5px; color: var(--fg-3); font-weight: 600; }
input[type="text"],
input[type="date"],
input[type="number"],
select {
  height: 36px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-card);
  color: var(--fg);
  font-size: 13.5px;
  font-family: inherit;
  min-width: 0;
  max-width: 100%;
}
select { padding-right: 4px; cursor: pointer; }
input:focus, select:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent);
  outline-offset: 0;
  border-color: var(--accent);
}
.field-grow { flex: 1 1 140px; }
.filter-actions { display: flex; gap: 8px; align-items: flex-end; }

.seg {
  display: inline-flex;
  padding: 2px;
  background: var(--bg-sunken);
  border-radius: 8px;
}
.seg button {
  border: 0;
  background: transparent;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-3);
  cursor: pointer;
  min-height: 30px;
}
.seg button[aria-pressed="true"] {
  background: var(--bg-card);
  color: var(--fg);
  box-shadow: var(--shadow-1);
}

/* ================= 分页 ================= */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.pager-info { font-size: 13px; color: var(--fg-3); }
.pager-btns { display: flex; gap: 6px; align-items: center; }

/* ================= 走势图 ================= */
.trend-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 10px;
  max-height: 72vh;
  overflow-y: auto;
}
table.trend {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
table.trend th, table.trend td {
  padding: 0;
  border-right: 1px solid var(--grid);
  border-bottom: 1px solid var(--grid);
  text-align: center;
  height: 30px;
  min-width: 30px;
}
table.trend thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--bg-sunken);
  color: var(--fg-2);
  font-weight: 700;
  font-size: 12px;
}
table.trend thead th.issue-col,
table.trend tbody td.issue-col {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--bg-card);
  min-width: 56px;
  font-weight: 700;
  text-align: left;
  padding: 0 7px;
  border-right: 1px solid var(--line-strong);
  white-space: nowrap;
}
table.trend thead th.issue-col {
  z-index: 4;
  background: var(--bg-sunken);
}
table.trend .grp-start { border-left: 2px solid var(--line-strong); }
table.trend td.hit {
  color: #fff;
  font-weight: 700;
}
table.trend td.hit.front { background: var(--hit); }
table.trend td.hit.back { background: #d2601c; }
html[data-theme="dark"] table.trend td.hit.front { background: #2f6fd0; }
html[data-theme="dark"] table.trend td.hit.back { background: #b0511a; }
table.trend td.miss {
  color: var(--fg-3);
  background: var(--miss-bg);
  font-size: 11.5px;
}
table.trend tr:nth-child(even) td.miss { background: var(--bg-zebra); }

.legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--fg-3);
  margin-top: 10px;
}
.legend i {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: -1px;
}

/* 表头内的位置名（第二行小字） */
table.trend thead th .th-sub {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--fg-3);
  line-height: 1.1;
  white-space: nowrap;
}
table.trend thead th {
  height: auto;
  padding: 3px 0;
  line-height: 1.15;
}

/* 走势表内期号链接 */
table.trend td.issue-col a {
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
table.trend td.issue-col a:hover { color: var(--accent); }

/* 小节标题 */
.sub-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0 6px;
  font-size: 15px;
  font-weight: 700;
}

/* 展开更多 */
.more-box {
  margin-top: 12px;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}
.more-box > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  padding: 4px 0;
  list-style: none;
}
.more-box > summary::-webkit-details-marker { display: none; }
.more-box > summary::before {
  content: '▸ ';
  display: inline-block;
  transition: transform .15s;
}
.more-box[open] > summary::before { content: '▾ '; }
.more-table {
  max-height: 340px;
  overflow-y: auto;
}

/* 图表标题 */
.chart-title {
  font-size: 12.5px;
  color: var(--fg-3);
  font-weight: 600;
  margin-bottom: 2px;
}
.chart-box + .chart-box { margin-top: 14px; }

.hc-pos { font-size: 12px; flex: 0 0 auto; min-width: 46px; }

/* 位置遗漏统计表 */
.pos-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.pos-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: var(--bg-sunken);
  min-width: 0;
}
.pos-card h4 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
}
.pos-card dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 8px;
  margin: 0;
  font-size: 12.5px;
}
.pos-card dt { color: var(--fg-3); }
.pos-card dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.pos-table {
  max-height: 208px;
  overflow-y: auto;
  background: var(--bg-card);
  border-color: var(--line);
}
.pos-table table.data { font-size: 12px; }
.pos-table table.data th,
.pos-table table.data td { padding: 5px 7px; }
.pos-table table.data tbody tr:hover { background: var(--bg-sunken); }

/* ================= 统计 ================= */
.chart-box {
  position: relative;
  width: 100%;
  height: auto;
  margin-top: 6px;
}
.chart-canvas {
  width: 100%;
  height: 190px;
}
.chart-box.short .chart-canvas { height: 165px; }
.chart-canvas svg { display: block; }
.chart-box svg { display: block; max-width: 100%; height: auto; }
.chart-box.tall { height: auto; }

.hotcold {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.hc-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.hc-block h4 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.hc-hot h4 { color: var(--hot); }
.hc-cold h4 { color: var(--cold); }
.hc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 13px;
}
.hc-row .rank {
  width: 18px;
  color: var(--fg-3);
  font-variant-numeric: tabular-nums;
}
.hc-row .cnt { color: var(--fg-3); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.hc-bar {
  flex: 1 1 auto;
  height: 8px;
  border-radius: 4px;
  background: var(--bg-sunken);
  overflow: hidden;
  min-width: 40px;
}
.hc-bar > i { display: block; height: 100%; border-radius: 4px; }
.hc-hot .hc-bar > i { background: var(--hot); }
.hc-cold .hc-bar > i { background: var(--cold); }

.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.kv {
  background: var(--bg-sunken);
  border-radius: 10px;
  padding: 9px 11px;
}
.kv .k { font-size: 11.5px; color: var(--fg-3); }
.kv .v {
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ================= 详情 ================= */
.detail-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  flex-wrap: wrap;
}
.detail-nav .spacer { flex: 1 1 auto; }

/* ================= 空态 ================= */
.empty {
  padding: 34px 12px;
  text-align: center;
  color: var(--fg-3);
  font-size: 13.5px;
}

/* ================= 页脚 ================= */
.footer {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  padding: 7px 14px calc(7px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg-card) 94%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  text-align: center;
}
.footer-main {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--fg-2);
  max-width: var(--maxw);
  margin-inline: auto;
}
.footer-sub {
  margin: 3px 0 0;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--hot);
}

/* ================= 开奖直播（仅嵌入） ================= */
.live-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #e23a2e;
  margin-right: 5px;
  vertical-align: 1px;
  box-shadow: 0 0 0 3px rgba(226, 58, 46, .16);
  animation: livePulse 1.8s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 3px rgba(226, 58, 46, .16); }
  50% { opacity: .55; box-shadow: 0 0 0 5px rgba(226, 58, 46, .06); }
}
.pill-live {
  background: #fdecea;
  color: #b3261e;
}
html[data-theme="dark"] .pill-live {
  background: #3a1a17;
  color: #ff8a7e;
}

.live-card { padding: 12px; }
.live-head { margin-bottom: 2px; }

.live-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 11px;
  margin: 8px 0 12px;
  border-radius: 9px;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  font-size: 12.5px;
}
.live-status.is-live {
  background: #fdecea;
  border-color: #f5c2bd;
  color: #8c1d14;
}
html[data-theme="dark"] .live-status.is-live {
  background: #3a1a17;
  border-color: #5c2b25;
  color: #ffb3a8;
}
.live-status-main { font-weight: 600; }
.live-status-sub { color: var(--fg-3); }
.live-status.is-live .live-status-sub { color: inherit; opacity: .85; }
.live-status b {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

/* 裁切容器：只露出官方页的直播区，不允许拖动 */
.live-crop {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0b0e13;
  /* 内容全部脱离文档流，scrollHeight 恒等于自身高度，无法被滚动 */
}
.live-inner {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.live-frame {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  border: 0;
  transform-origin: 0 0;
  /* width/height 由 JS 按 renderWidth/renderHeight 写入 */
}
.live-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

@media (max-width: 560px) {
  .live-card { padding: 10px; }
}

/* ================= 通用标签 ================= */
.tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.tag-ok { background: #e6f4ea; color: #1a6b3c; }
html[data-theme="dark"] .tag-ok { background: #17301f; color: #7dd6a3; }

.reason-list {
  display: grid;
  gap: 10px;
}
.reason-item {
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--bg-sunken);
  border-left: 3px solid var(--accent);
}
.reason-h {
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 2px;
}
.reason-b {
  font-size: 12.8px;
  line-height: 1.65;
  color: var(--fg-2);
}

/* ================= 号码推算 ================= */
.warn-band {
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  color: var(--warn-fg);
  font-size: 13px;
  line-height: 1.65;
  margin-bottom: 12px;
}
.warn-band b { color: inherit; }

.pred-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  margin-bottom: 10px;
  background: var(--bg-sunken);
}
.pred-block:last-child { margin-bottom: 0; }
.pred-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 9px;
}
.pred-name {
  font-size: 14px;
  font-weight: 700;
}
.pred-desc {
  font-size: 12px;
  color: var(--fg-3);
  line-height: 1.5;
}
.pred-balls { margin: 0 0 8px; }
.pred-balls .ball { width: 38px; height: 38px; font-size: 17px; }
.pred-meta {
  font-size: 12.5px;
  color: var(--fg-2);
  font-variant-numeric: tabular-nums;
}
.pred-meta b { color: var(--fg); }

/* 稳定性检验 */
.robust-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  margin-bottom: 12px;
  background: var(--bg-sunken);
}
.robust-block:last-of-type { margin-bottom: 0; }
.robust-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 9px;
}
.robust-head .spacer { flex: 1 1 auto; }
.robust-sig {
  background: var(--bg-sel) !important;
  font-weight: 700;
}
.robust-block .table-wrap { background: var(--bg-card); }

/* ================= 工具类 ================= */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.mono { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.text-muted { color: var(--fg-3); }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  background: var(--bg-sunken);
  padding: 1px 4px;
  border-radius: 4px;
  overflow-wrap: anywhere;
  word-break: break-all;
}
.sec-note { overflow-wrap: anywhere; }
.meta-v, .kv .v { overflow-wrap: anywhere; word-break: break-word; }
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* ================= 响应式 ================= */
@media (max-width: 560px) {
  .view { padding: 10px 10px 24px; }
  .card { padding: 12px; border-radius: 11px; }
  .brand-text { display: none; }
  .topbar-row { padding: 9px 10px 6px; gap: 8px; }
  .mainnav { padding: 0 6px 6px; }
  .hero { padding: 14px 12px; }
  .hero-balls .ball { width: 38px; height: 38px; font-size: 17px; }
  .hero-balls { gap: 6px; }
  .hero-meta { gap: 8px; }
  .mini-date { min-width: 0; display: none; }
  .mini-row { gap: 8px; padding: 8px 4px; }
  .mini-row .ball { width: 30px; height: 30px; font-size: 14px; }
  .mini-balls { gap: 3px; }
  .chart-canvas { height: 175px; }
  .chart-box.short .chart-canvas { height: 155px; }
}

@media (max-width: 400px) {
  .mini-issue { min-width: 44px; font-size: 13px; }
  .mini-row { gap: 5px; padding: 7px 2px; }
  .mini-row .ball { width: 24px; height: 24px; font-size: 14px; }
  .mini-balls { gap: 1px; }
  .mini-balls .balls { gap: 1px; }
  .mini-arrow { display: none; }
  .hero-balls .ball { width: 34px; height: 34px; font-size: 16px; }
  .hero-balls { gap: 5px; }
}

/* 超窄屏（320-340）：收紧号码球间距，保持一行 7 球不换行 */
@media (max-width: 340px) {
  .hero-balls .balls { gap: 5px; }
  .hero-balls .ball { width: 30px; height: 30px; font-size: 15px; }
  .ball-sep { margin: 0 1px; height: 20px; }
  .hero { padding: 12px 10px; }
  .card { padding: 10px; }
  .view { padding: 8px 8px 20px; }
  .mini-row .ball { width: 22px; height: 22px; font-size: 14px; }
}

@media print {
  .topbar, .footer, .mainnav { display: none; }
  body { padding-bottom: 0; }
}