:root {
  color-scheme: light;
  --bg: #f3f9ff;
  --surface: #ffffff;
  --surface-2: #f7fbff;
  --ink: #182236;
  --muted: #6b7890;
  --line: #dbe7f3;
  --line-strong: #c9d8e8;
  --red: #c91926;
  --gold: #ffd32a;
  --green: #18a558;
  --blue: #1188ff;
  --shadow: 0 10px 24px rgba(20, 27, 41, .08);
  --car-1: #ffd200;
  --car-2: #008cff;
  --car-3: #4b4f58;
  --car-4: #ff7a00;
  --car-5: #16d8ff;
  --car-6: #5236ff;
  --car-7: #d7dde6;
  --car-8: #f5222d;
  --car-9: #8b0000;
  --car-10: #18a558;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(54, 162, 235, .10), rgba(255, 211, 42, .08) 40%, rgba(24, 165, 88, .06) 78%),
    var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

.pc10-stage {
  width: min(100%, 920px);
  margin: 0 auto;
  background: rgba(255, 255, 255, .46);
  border-left: 1px solid rgba(219, 231, 243, .72);
  border-right: 1px solid rgba(219, 231, 243, .72);
  min-height: 100vh;
}

.pc10-top {
  padding: 15px clamp(12px, 3vw, 22px) 14px;
  background: linear-gradient(135deg, #ffffff, #eef9ff 58%, #fff9ec);
  border-bottom: 4px solid #f0c35a;
}

.brand-row,
.issue-line,
.panel-title,
.champion-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand-row {
  flex-wrap: wrap;
}

.brand-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brand-title strong {
  font-size: clamp(20px, 4.8vw, 26px);
  letter-spacing: 0;
}

.brand-title span,
.issue-line,
.panel-title span {
  color: var(--muted);
  font-size: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 9px;
  border: 1px solid #bfe9d3;
  border-radius: 999px;
  background: #eefaf4;
  color: #0b7a49;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.warn {
  border-color: #ffd8a8;
  background: #fff7ed;
  color: #b54708;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2ee285;
  box-shadow: 0 0 0 4px rgba(46, 226, 133, .14);
}

@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(46, 226, 133, .14); transform: scale(1); }
  50% { box-shadow: 0 0 0 7px rgba(46, 226, 133, .22); transform: scale(1.08); }
}

@media (prefers-reduced-motion: no-preference) {
  .status-pill:not(.warn) .live-dot {
    animation: live-pulse 1.6s ease-in-out infinite;
  }
}

.status-pill.warn .live-dot {
  background: #ff9f43;
  box-shadow: 0 0 0 4px rgba(255, 159, 67, .14);
  animation: none;
}

.issue-line {
  margin-top: 12px;
  flex-wrap: wrap;
}

.issue-line b {
  color: var(--ink);
  font-weight: 900;
}

.pc10-body {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.pc10-body[hidden] {
  display: none !important;
}

.result-panel,
.source-panel,
.rule-panel,
.champion-panel,
.lane-panel,
.pk-panel,
.metrics-panel,
.history-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.result-panel,
.source-panel,
.pk-panel,
.metrics-panel,
.history-panel {
  padding: 11px;
}

.panel-title {
  margin-bottom: 9px;
  font-size: 14px;
  font-weight: 900;
}

.rank-track {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 4px;
}

.rank-track li {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 5px 1px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.rank-track small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.ball,
.formula-car,
.mini-rank .ball {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 900;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18), 0 2px 5px rgba(17, 24, 39, .14);
}

.ball {
  width: 25px;
  height: 25px;
  font-size: 12px;
}

.car-1 { background: var(--car-1) !important; color: #111827 !important; }
.car-2 { background: var(--car-2) !important; color: #fff !important; }
.car-3 { background: var(--car-3) !important; color: #fff !important; }
.car-4 { background: var(--car-4) !important; color: #fff !important; }
.car-5 { background: var(--car-5) !important; color: #082f49 !important; }
.car-6 { background: var(--car-6) !important; color: #fff !important; }
.car-7 { background: var(--car-7) !important; color: #111827 !important; }
.car-8 { background: var(--car-8) !important; color: #fff !important; }
.car-9 { background: var(--car-9) !important; color: #fff !important; }
.car-10 { background: var(--car-10) !important; color: #fff !important; }

.ball.car-10,
.lane-car-tile.car-10 {
  font-size: 10px;
}

.keno-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 6px;
}

.keno-ball {
  aspect-ratio: 1;
  min-height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f7fbff;
  border: 1.45px solid #d8e6f2;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.keno-ball.is-head,
.keno-ball.is-tail {
  opacity: .76;
  color: #536176;
  background: repeating-linear-gradient(-45deg, #e8edf4, #e8edf4 4px, #dbe3ed 4px, #dbe3ed 8px);
  border-color: #c2cedc;
}

.pc28-a {
  border-color: var(--gold);
  box-shadow: 0 0 0 1.45px rgba(255, 211, 42, .20);
}

.pc28-b {
  border-color: var(--green);
  box-shadow: 0 0 0 1.45px rgba(24, 165, 88, .18);
}

.pc28-c {
  border-color: var(--blue);
  box-shadow: 0 0 0 1.45px rgba(17, 136, 255, .18);
}

.formula-summary {
  margin-top: 10px;
}

.pc28-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f5fbff);
  overflow: hidden;
}

.pc28-title {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 900;
}

.pc28-title span {
  color: var(--muted);
  font-size: 11px;
}

.pc28-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 8px 6px;
  font-weight: 900;
}

.pc28-chip {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 14px;
  font-weight: 900;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .16);
}

.pc28-chip.yellow { background: var(--car-1); color: #111827; }
.pc28-chip.green { background: var(--car-10); color: #fff; }
.pc28-chip.blue { background: var(--car-2); color: #fff; }
.pc28-chip.white {
  background: #fff;
  color: #111827;
  border: 1px solid #cbd5e1;
}

.pc28-lines {
  padding: 4px 10px 10px;
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
}

.pc28-lines b,
.pc28-tail {
  color: var(--ink);
  font-weight: 900;
}

.formula-pair-grid {
  display: grid;
  gap: 10px;
}

.rule-panel {
  padding: 11px 12px;
  display: grid;
  gap: 6px;
  border-left: 4px solid var(--red);
}

.rule-panel strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.rule-panel .rule-highlight {
  color: var(--ink);
  font-weight: 900;
}

.champion-panel {
  padding: 11px 12px;
}

.champion-row strong {
  display: grid;
  gap: 4px;
  font-size: 14px;
  font-weight: 900;
}

.champion-row .ball {
  width: 34px;
  height: 34px;
  font-size: 16px;
}

.lane-panel {
  padding: 11px;
}

.lane-grid {
  display: grid;
  grid-template-columns: 32px repeat(9, minmax(0, 1fr));
  gap: 5px 4px;
  align-items: center;
  font-size: 11px;
  font-weight: 900;
}

.lane-label {
  color: var(--muted);
  text-align: right;
}

.lane-num {
  min-height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid #d7e0eb;
  border-radius: 5px;
  background: #f8fafc;
  color: #07152b;
}

.lane-car-tile {
  width: 27px;
  max-width: 100%;
  min-height: 27px;
  justify-self: center;
  display: grid;
  place-items: center;
  border-radius: 5px;
  border: 0;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 1px 3px rgba(24, 34, 54, .10);
}

.formula-table {
  display: grid;
  gap: 4px;
}

.formula-table-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
}

.formula-table-title span {
  color: var(--muted);
  font-size: 11px;
}

.formula-header,
.formula-row {
  display: grid;
  grid-template-columns: 30px 34px 65px minmax(0, 1fr) 47px;
  gap: 4px;
  align-items: center;
}

.formula-header {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  padding: 0 2px 2px;
}

.formula-row {
  min-height: 31px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 800;
}

.formula-row > span,
.formula-row > strong {
  min-width: 0;
}

.formula-car {
  width: 24px;
  height: 24px;
  font-size: 11px;
}

.mono {
  font-family: Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.formula-decimal {
  overflow: hidden;
  text-overflow: ellipsis;
}

.secondary-pk {
  min-height: 44px;
  margin-top: 8px;
  padding: 8px;
  border: 1px dashed #bac7d7;
  border-radius: 8px;
  background: #fbfcfe;
}

.secondary-pk-head {
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.secondary-pk-empty {
  color: #98a2b3;
  font-size: 12px;
  font-weight: 800;
}

.secondary-list {
  display: grid;
  gap: 7px;
}

.tie-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.tie-group-title {
  padding: 5px 8px;
  background: #edf2f7;
  color: #536176;
  font-size: 11px;
  font-weight: 900;
}

.secondary-row {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 6px;
  align-items: center;
  padding: 5px 7px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 800;
}

.secondary-row .ball {
  width: 24px;
  height: 24px;
  font-size: 11px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.metrics div {
  min-height: 58px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.metrics strong {
  font-size: 20px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}

th,
td {
  padding: 9px 7px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  background: var(--surface-2);
}

td {
  font-size: 13px;
}

.mini-rank {
  display: flex;
  gap: 4px;
}

.mini-rank .ball {
  width: 23px;
  height: 23px;
  font-size: 11px;
}

#pc10-rule-guide {
  margin: 0 12px 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(17, 136, 255, .08), rgba(255, 211, 42, .07) 42%, rgba(24, 165, 88, .05)),
    var(--bg);
  box-shadow: 0 18px 42px rgba(20, 27, 41, .10);
}

#pc10-rule-guide .pc10-guide-inner {
  display: grid;
  gap: 12px;
}

#pc10-rule-guide .pc10-guide-title {
  margin: 2px 0 4px;
  text-align: center;
  font-size: clamp(20px, 3vw, 28px);
  line-height: 1.25;
  font-weight: 900;
  letter-spacing: 0;
  color: var(--ink);
}

#pc10-rule-guide .pc10-guide-source,
#pc10-rule-guide .pc10-guide-note,
#pc10-rule-guide .pc10-guide-step {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow);
}

#pc10-rule-guide .pc10-guide-source {
  padding: 12px;
}

#pc10-rule-guide .pc10-guide-source-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 800;
}

#pc10-rule-guide .pc10-guide-source-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

#pc10-rule-guide .pc10-guide-source-numbers,
#pc10-rule-guide .pc10-guide-result-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

#pc10-rule-guide .pc10-guide-num {
  min-width: 32px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

#pc10-rule-guide .pc10-guide-num.trimmed {
  color: var(--muted);
  border-color: #b9c7d8;
  background: #edf2f8;
  box-shadow: inset 0 0 0 1px rgba(107, 120, 144, .12);
}

#pc10-rule-guide .pc10-guide-num.p1 {
  border-color: var(--gold);
}

#pc10-rule-guide .pc10-guide-num.p2 {
  border-color: var(--green);
}

#pc10-rule-guide .pc10-guide-num.p3 {
  border-color: var(--blue);
}

#pc10-rule-guide .pc10-guide-note {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border-left: 4px solid var(--red);
  font-size: 14px;
  line-height: 1.58;
  font-weight: 900;
}

#pc10-rule-guide .pc10-guide-note b,
#pc10-rule-guide .pc10-guide-pc28-row b {
  color: #05070b;
  font-weight: 900;
}

#pc10-rule-guide .pc10-guide-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#pc10-rule-guide .pc10-guide-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
}

#pc10-rule-guide .pc10-guide-step.wide {
  grid-column: 1 / -1;
}

#pc10-rule-guide .pc10-step-no {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

#pc10-rule-guide .pc10-guide-step h3 {
  margin: 1px 0 6px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
}

#pc10-rule-guide .pc10-guide-step p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  font-weight: 800;
}

#pc10-rule-guide .pc10-guide-pc28-grid {
  display: grid;
  gap: 8px;
}

#pc10-rule-guide .pc10-guide-pc28-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 900;
}

#pc10-rule-guide .pc10-guide-pc28-row strong {
  text-align: center;
  font-weight: 900;
}

#pc10-rule-guide .pc10-guide-pc28-row > span {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: baseline;
}

#pc10-rule-guide .pc10-guide-nowrap {
  white-space: nowrap;
}

#pc10-rule-guide .pc10-guide-pc28-balls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

#pc10-rule-guide .pc10-guide-pc28-chip {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 900;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12);
}

#pc10-rule-guide .pc10-guide-pc28-chip.yellow { background: var(--car-1); color: #111827; }
#pc10-rule-guide .pc10-guide-pc28-chip.green { background: var(--car-10); color: #fff; }
#pc10-rule-guide .pc10-guide-pc28-chip.blue { background: var(--car-2); color: #fff; }

#pc10-rule-guide .pc10-guide-car,
#pc10-rule-guide .pc10-guide-final-chip {
  width: 30px;
  min-width: 30px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .10);
}

#pc10-rule-guide .pc10-guide-lanes {
  display: grid;
  grid-template-columns: repeat(9, 38px);
  justify-content: start;
  gap: 5px;
}

#pc10-rule-guide .pc10-guide-lanes > div {
  display: grid;
  gap: 4px;
  justify-items: center;
  width: 38px;
  padding: 6px 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: linear-gradient(180deg, #ffffff, #f7fbff);
}

#pc10-rule-guide .pc10-guide-lanes > div > span:not(.pc10-guide-car) {
  width: 30px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

#pc10-rule-guide .pc10-guide-score-table {
  display: grid;
  gap: 4px;
  margin-top: 2px;
}

#pc10-rule-guide .pc10-guide-score-head,
#pc10-rule-guide .pc10-guide-score-table > div:not(.pc10-guide-score-head) {
  display: grid;
  grid-template-columns: 42px 82px minmax(84px, 1fr) 52px;
  gap: 6px;
  align-items: center;
}

#pc10-rule-guide .pc10-guide-score-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

#pc10-rule-guide .pc10-guide-score-table > div:not(.pc10-guide-score-head) {
  padding: 6px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

#pc10-rule-guide .pc10-guide-score-table > div.is-tie {
  border-color: rgba(201, 25, 38, .36);
  background: #fff7f8;
}

#pc10-rule-guide .pc10-guide-score-table strong {
  text-align: right;
}

#pc10-rule-guide .pc10-guide-rank-list {
  display: grid;
  gap: 6px;
}

#pc10-rule-guide .pc10-guide-rank-list > div {
  display: grid;
  grid-template-columns: 44px 34px auto;
  justify-content: start;
  align-items: center;
  gap: 6px;
  padding: 5px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

#pc10-rule-guide .pc10-guide-rank-list > div > span:first-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

#pc10-rule-guide .pc10-guide-rank-list strong {
  text-align: left;
}

#pc10-rule-guide .pc10-guide-rank-list .tie-dark {
  color: #8b0000;
  font-weight: 900;
}

#pc10-rule-guide .pc10-guide-step.align-left-step {
  grid-template-columns: 1fr;
  position: relative;
}

#pc10-rule-guide .pc10-guide-step.align-left-step .pc10-step-no {
  position: absolute;
  left: 12px;
  top: 12px;
}

#pc10-rule-guide .pc10-guide-step.align-left-step h3 {
  min-height: 28px;
  padding-left: 38px;
  display: flex;
  align-items: center;
}

#pc10-rule-guide .pc10-guide-champion-lines {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
  font-weight: 900;
}

#pc10-rule-guide .pc10-guide-champion-lines div {
  display: flex;
  align-items: center;
  justify-content: start;
  gap: 7px;
  min-height: 28px;
}

#pc10-rule-guide .pc10-guide-car-sequence {
  display: grid;
  grid-template-columns: repeat(9, 30px);
  justify-content: start;
  gap: 5px;
  align-items: center;
}

#pc10-rule-guide .pc10-guide-tie-box {
  display: grid;
  gap: 6px;
  padding: 9px;
  border: 1px solid rgba(201, 25, 38, .32);
  border-radius: 10px;
  background: #fff7f8;
  font-size: 13px;
  line-height: 1.55;
  font-weight: 900;
}

#pc10-rule-guide .pc10-guide-tie-box > div:first-child {
  color: var(--muted);
}

#pc10-rule-guide .pc10-guide-tie-box > div:not(:first-child) {
  display: grid;
  grid-template-columns: 34px auto auto;
  justify-content: start;
  justify-items: start;
  align-items: center;
  gap: 8px;
}

#pc10-rule-guide .pc10-guide-tie-box strong {
  padding-top: 4px;
  border-top: 1px solid rgba(201, 25, 38, .20);
  color: var(--ink);
}

#pc10-rule-guide .pc10-guide-final {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #f7fbff);
}

#pc10-rule-guide .pc10-guide-final > div:first-child {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

#pc10-rule-guide .pc10-guide-final-chip {
  width: 34px;
  height: 32px;
  border-radius: 7px;
  font-size: 14px;
}

#pc10-rule-guide .pc10-guide-origin,
#pc10-rule-guide .pc10-guide-time-text {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.75;
  font-weight: 900;
}

#pc10-rule-guide .pc10-guide-time-text {
  margin-bottom: 10px;
}

#pc10-rule-guide .pc10-guide-time-table {
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(82px, .72fr) minmax(0, 1.7fr);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

#pc10-rule-guide .pc10-guide-time-table > div {
  display: flex;
  align-items: center;
  padding: 13px 16px;
  border-bottom: 1px solid #e6ebf2;
  color: var(--ink);
}

#pc10-rule-guide .pc10-guide-time-table > div:nth-child(-n + 2) {
  background: #f7f6fb;
  color: #27325a;
}

#pc10-rule-guide .pc10-guide-time-table > div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

@media (max-width: 620px) {
  .pc10-body {
    padding: 9px;
    gap: 8px;
  }

  .brand-title span,
  .issue-line,
  .panel-title span {
    font-size: 11px;
  }

  .seconds-line {
    display: none;
  }

  .result-panel,
  .source-panel,
  .pk-panel,
  .metrics-panel,
  .history-panel {
    padding: 10px;
  }

  .keno-grid {
    gap: 5px;
  }

  .keno-ball {
    min-height: 25px;
    font-size: 11px;
  }

  .rank-track {
    gap: 3px;
  }

  .rank-track li {
    border-radius: 7px;
  }

  .rank-track small {
    font-size: 9px;
  }

  .ball {
    width: 22px;
    height: 22px;
    font-size: 11px;
  }

  .lane-grid {
    grid-template-columns: 28px repeat(9, minmax(0, 1fr));
    gap: 4px 3px;
    font-size: 10px;
  }

  .lane-num {
    min-height: 24px;
    border-radius: 4px;
  }

  .lane-car-tile {
    width: 24px;
    min-height: 24px;
    border-radius: 4px;
    font-size: 11px;
  }

  .formula-header,
  .formula-row {
    grid-template-columns: 25px 28px 55px minmax(0, 1fr) 40px;
    gap: 3px;
  }

  .formula-row {
    min-height: 30px;
    font-size: 10px;
  }

  .formula-car {
    width: 22px;
    height: 22px;
    font-size: 10px;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
  }

  th,
  td {
    padding: 8px 3px;
    font-size: 12px;
    overflow: hidden;
    vertical-align: middle;
  }

  .history-panel th:nth-child(1),
  .history-panel td:nth-child(1) {
    font-size: 11px;
  }

  /* 时间列可在空格处折行，避免溢出被号码球盖住 */
  .history-panel th:nth-child(2),
  .history-panel td:nth-child(2) {
    font-size: 11px;
    white-space: normal;
    line-height: 1.25;
    word-break: keep-all;
  }

  /* PC10：期号 / 时间 / 号码 */
  #panel-pc10 .history-panel th:nth-child(1),
  #panel-pc10 .history-panel td:nth-child(1) {
    width: 24%;
  }

  #panel-pc10 .history-panel th:nth-child(2),
  #panel-pc10 .history-panel td:nth-child(2) {
    width: 24%;
  }

  #panel-pc10 .history-panel th:nth-child(3),
  #panel-pc10 .history-panel td:nth-child(3) {
    width: 52%;
  }

  /* PC5：期号 / 时间 / 号码 / 和值 */
  #panel-pc5 .history-panel th:nth-child(1),
  #panel-pc5 .history-panel td:nth-child(1) {
    width: 22%;
  }

  #panel-pc5 .history-panel th:nth-child(2),
  #panel-pc5 .history-panel td:nth-child(2) {
    width: 26%;
  }

  #panel-pc5 .history-panel th:nth-child(3),
  #panel-pc5 .history-panel td:nth-child(3) {
    width: 38%;
  }

  #panel-pc5 .history-panel th:nth-child(4),
  #panel-pc5 .history-panel td:nth-child(4) {
    width: 14%;
    text-align: center;
  }

  /* PC28：窄屏号码列只留三球，运算符/和值徽章隐藏，和值改走独立列 */
  #panel-pc28 .history-panel .mini-rank-pc28 .mini-op,
  #panel-pc28 .history-panel .mini-rank-pc28 .mini-sum {
    display: none;
  }

  #panel-pc28 .history-panel th:nth-child(1),
  #panel-pc28 .history-panel td:nth-child(1) {
    width: 22%;
  }

  #panel-pc28 .history-panel th:nth-child(2),
  #panel-pc28 .history-panel td:nth-child(2) {
    width: 26%;
  }

  #panel-pc28 .history-panel th:nth-child(3),
  #panel-pc28 .history-panel td:nth-child(3) {
    width: 28%;
  }

  #panel-pc28 .history-panel th:nth-child(4),
  #panel-pc28 .history-panel td:nth-child(4) {
    width: 8%;
    text-align: center;
  }

  #panel-pc28 .history-panel th:nth-child(5),
  #panel-pc28 .history-panel td:nth-child(5),
  #panel-pc28 .history-panel th:nth-child(6),
  #panel-pc28 .history-panel td:nth-child(6) {
    width: 8%;
    text-align: center;
    padding-left: 1px;
    padding-right: 1px;
  }

  .mini-rank {
    gap: 2px;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  #panel-pc5 .history-panel td:nth-child(3),
  #panel-pc28 .history-panel td:nth-child(3),
  #panel-pc10 .history-panel td:nth-child(3) {
    min-width: 0;
  }

  .mini-rank .ball {
    flex: 0 1 auto;
    width: clamp(14px, 4vw, 19px);
    height: clamp(14px, 4vw, 19px);
    min-width: 12px;
    font-size: clamp(8px, 2.5vw, 10px);
  }

  .mini-rank-pc28 .mini-op {
    padding: 0 1px;
    font-size: 11px;
  }

  .mini-rank-pc28 .mini-sum {
    min-width: 18px;
    height: 18px;
    padding: 0 3px;
    font-size: 10px;
    flex-shrink: 1;
  }

  #pc10-rule-guide {
    margin: 0 8px 12px;
    padding: 12px;
    border-radius: 14px;
  }

  #pc10-rule-guide .pc10-guide-steps {
    grid-template-columns: 1fr;
  }

  #pc10-rule-guide .pc10-guide-step {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 8px;
    padding: 10px;
  }

  #pc10-rule-guide .pc10-guide-step.wide {
    grid-template-columns: 1fr;
    position: relative;
  }

  #pc10-rule-guide .pc10-guide-step.wide .pc10-step-no,
  #pc10-rule-guide .pc10-guide-step.align-left-step .pc10-step-no {
    position: absolute;
    left: 10px;
    top: 10px;
  }

  #pc10-rule-guide .pc10-guide-step.wide h3,
  #pc10-rule-guide .pc10-guide-step.align-left-step h3 {
    min-height: 28px;
    padding-left: 38px;
    display: flex;
    align-items: center;
    font-size: 14px;
  }

  #pc10-rule-guide .pc10-guide-source-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  #pc10-rule-guide .pc10-guide-source-numbers {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 3px;
  }

  #pc10-rule-guide .pc10-guide-num {
    width: 100%;
    min-width: 0;
    height: 24px;
    font-size: 10px;
    border-radius: 5px;
  }

  #pc10-rule-guide .pc10-guide-pc28-row {
    grid-template-columns: 50px minmax(0, 1fr);
  }

  #pc10-rule-guide .pc10-guide-lanes {
    grid-template-columns: repeat(9, 25px);
    gap: 2px;
    justify-content: start;
    width: 100%;
  }

  #pc10-rule-guide .pc10-guide-lanes > div {
    gap: 3px;
    width: 25px;
    padding: 0;
    border-radius: 7px;
  }

  #pc10-rule-guide .pc10-guide-lanes > div > span:not(.pc10-guide-car),
  #pc10-rule-guide .pc10-guide-lanes .pc10-guide-car {
    width: 23px;
    min-width: 23px;
    height: 22px;
    border-radius: 4px;
    font-size: 10px;
  }

  #pc10-rule-guide .pc10-guide-score-head,
  #pc10-rule-guide .pc10-guide-score-table > div:not(.pc10-guide-score-head) {
    grid-template-columns: 34px 61px minmax(76px, 1fr) 45px;
    gap: 4px;
  }

  #pc10-rule-guide .pc10-guide-score-table > div:not(.pc10-guide-score-head) {
    padding: 5px;
    font-size: 11px;
  }

  #pc10-rule-guide .pc10-guide-car {
    width: 29px;
    min-width: 29px;
    height: 26px;
    font-size: 12px;
  }

  #pc10-rule-guide .pc10-guide-car-sequence {
    grid-template-columns: repeat(9, 23px);
    gap: 2px;
  }

  #pc10-rule-guide .pc10-guide-car-sequence .pc10-guide-car {
    width: 23px;
    min-width: 23px;
    height: 24px;
    font-size: 10px;
  }

  #pc10-rule-guide .pc10-guide-final-chip {
    width: 100%;
    min-width: 0;
    height: 24px;
    border-radius: 5px;
    font-size: 10px;
  }

  #pc10-rule-guide .pc10-guide-result-row {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 3px;
  }

  #pc10-rule-guide .pc10-guide-origin,
  #pc10-rule-guide .pc10-guide-time-text {
    font-size: 13px;
    line-height: 1.65;
  }

  #pc10-rule-guide .pc10-guide-time-table {
    grid-template-columns: 72px minmax(0, 1fr);
    font-size: 12px;
  }

  #pc10-rule-guide .pc10-guide-time-table > div {
    padding: 11px 8px;
  }
}

@media (max-width: 380px) {
  .pc10-top {
    padding: 13px 10px 12px;
  }

  .pc10-body {
    padding: 8px;
  }

  .formula-header,
  .formula-row {
    grid-template-columns: 24px 27px 52px minmax(0, 1fr) 38px;
  }
}

/* ===== 本站扩展：BCLC 置顶 + 玩法标签 ===== */

.bclc-hero {
  border-left: 4px solid var(--blue);
}

.bclc-meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

@font-face {
  font-family: "Tilt Neon";
  src: url("./fonts/TiltNeon.ttf") format("truetype");
  font-display: swap;
}

.game-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #eef5fb;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}

.game-tab {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  font-weight: 400;
  font-family: "Tilt Neon", sans-serif;
  letter-spacing: .04em;
  line-height: 1.2;
  padding: 11px 8px;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.game-tab:hover {
  background: rgba(255, 255, 255, .72);
}

.game-tab.is-active {
  background: #fff;
  border-color: #c9daf0;
  box-shadow: 0 4px 12px rgba(24, 34, 54, .08);
}

.game-tab[data-tab="pc28"] {
  color: #d4a017;
  text-shadow: 0 0 8px rgba(255, 211, 42, .45);
}

.game-tab[data-tab="pc5"] {
  color: #0d9488;
  text-shadow: 0 0 8px rgba(25, 227, 166, .4);
}

.game-tab[data-tab="pc10"] {
  color: #c91926;
  text-shadow: 0 0 8px rgba(201, 25, 38, .35);
}

.game-tab span {
  display: inline-block;
  transform-origin: 50% 70%;
}

@keyframes tab-letter-jelly {
  0%, 100% { transform: scale(1, 1); }
  20% { transform: scale(1.06, 0.96); }
  40% { transform: scale(0.97, 1.04); }
  60% { transform: scale(1.03, 0.98); }
  80% { transform: scale(0.99, 1.01); }
}

@media (prefers-reduced-motion: no-preference) {
  .game-tab span {
    animation: tab-letter-jelly 1.2s ease-in-out infinite;
  }

  .game-tab span:nth-child(2) { animation-delay: .08s; }
  .game-tab span:nth-child(3) { animation-delay: .16s; }
  .game-tab span:nth-child(4) { animation-delay: .24s; }
}

.game-tab:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.tab-panel {
  display: grid;
  gap: 10px;
}

.tab-panel[hidden] {
  display: none !important;
}

.pc28-result-row {
  display: flex;
  justify-content: center;
  padding: 6px 0 2px;
}

.pc28-result-row .pc28-main {
  padding: 4px 0;
}

.pc28-metrics,
.pc5-metrics {
  margin-top: 10px;
}

.rank-track-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.live-result {
  font-size: 18px;
}

.pc10-guide {
  /* 旧版大卡片样式废弃，改由 .rule-guide-panel 对齐结果区 */
  display: none;
}

.rule-guide-panel {
  display: grid;
  gap: 10px;
}

.rule-guide-panel > .rule-panel {
  margin: 0;
}

.rule-guide-panel .rule-panel strong {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
  color: var(--ink);
}

.rule-steps-box {
  margin-top: 0;
}

.rule-steps {
  display: grid;
  gap: 6px;
  padding: 8px 10px 10px;
}

.rule-step-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.rule-step-no {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.rule-step-body strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
}

.rule-step-body p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.55;
}

@media (max-width: 640px) {
  .game-tab {
    font-size: 16px;
    padding: 10px 4px;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rank-track {
    gap: 3px;
  }

  .ball {
    width: 22px;
    height: 22px;
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .game-tab {
    transition: none;
  }
}

/* BCLC 随标签切换的分组高亮 */
.keno-grid[data-mode="pc5"] .keno-ball,
.keno-grid[data-mode="pc10"] .keno-ball,
.keno-grid[data-mode="pc28"] .keno-ball {
  transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.keno-ball.pc5-g1 {
  border-color: #ff7a00;
  background: #fff4e8;
  box-shadow: 0 0 0 1.45px rgba(255, 122, 0, .18);
}
.keno-ball.pc5-g2 {
  border-color: #16d8ff;
  background: #eafbff;
  box-shadow: 0 0 0 1.45px rgba(22, 216, 255, .18);
  color: #082f49;
}
.keno-ball.pc5-g3 {
  border-color: #5236ff;
  background: #f1eeff;
  box-shadow: 0 0 0 1.45px rgba(82, 54, 255, .18);
}
.keno-ball.pc5-g4 {
  border-color: #e11d8a;
  background: #fff0f7;
  box-shadow: 0 0 0 1.45px rgba(225, 29, 138, .16);
}
.keno-ball.pc5-g5 {
  border-color: #18a558;
  background: #ebfaf1;
  box-shadow: 0 0 0 1.45px rgba(24, 165, 88, .18);
}

.keno-ball.pc10-up {
  border-color: #1188ff;
  background: #eaf4ff;
  box-shadow: 0 0 0 1.45px rgba(17, 136, 255, .16);
}
.keno-ball.pc10-down {
  border-color: #f0a202;
  background: #fff8e8;
  box-shadow: 0 0 0 1.45px rgba(240, 162, 2, .18);
}

@media (prefers-reduced-motion: reduce) {
  .keno-grid[data-mode="pc5"] .keno-ball,
  .keno-grid[data-mode="pc10"] .keno-ball,
  .keno-grid[data-mode="pc28"] .keno-ball {
    transition: none;
  }
}

/* 历史记录：PC28 / PC5 与 PC10 同排彩色球；+/-/= 保持纯文字 */
.mini-rank {
  align-items: center;
  flex-wrap: nowrap;
}

.mini-op {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  min-width: 0;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.mini-sum {
  display: inline-grid;
  place-items: center;
  min-width: 23px;
  height: 23px;
  padding: 0 5px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #111827;
  font-size: 11px;
  font-weight: 900;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .08);
}

.mini-tag {
  margin-left: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.mini-rank-pc28,
.mini-rank-pc5 {
  gap: 3px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: #0b5cab;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.nav-link:hover {
  background: #eef9ff;
}

.nav-link:active {
  transform: scale(0.98);
}

.nav-link:disabled {
  opacity: .45;
  cursor: default;
  transform: none;
}

.query-bar {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.query-bar-field {
  display: grid;
  gap: 4px;
  min-width: min(100%, 220px);
  flex: 1;
}

.query-bar-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.query-bar input {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}

.query-bar input::placeholder {
  color: #8a97ab;
  font-weight: 600;
}

.query-bar input:focus {
  outline: 2px solid #1188ff;
  outline-offset: 1px;
}

.query-btn {
  min-height: 40px;
  padding: 8px 16px;
  border: 0;
  border-radius: 8px;
  background: #0b5cab;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.query-btn:hover {
  background: #094a8a;
}

.query-btn:active {
  transform: scale(0.98);
}

.query-error {
  margin: 12px;
  padding: 10px 12px;
  border: 1px solid #ffd8a8;
  border-radius: 8px;
  background: #fff7ed;
  color: #b54708;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

@media (max-width: 620px) {
  .header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .query-bar .nav-link,
  .query-btn {
    flex: 1 1 auto;
  }
}
