:root {
  --bg: #0b0d11;
  --bg-2: #151920;
  --panel: rgba(22, 26, 33, 0.78);
  --panel-deep: rgba(13, 15, 20, 0.86);
  --line: rgba(222, 189, 128, 0.2);
  --line-soft: rgba(255, 255, 255, 0.09);
  --gold: #d9b36a;
  --gold-bright: #f0d694;
  --gold-deep: #9a7435;
  --text: #f3ead8;
  --text-dim: #a89f8e;
  --red: #d8564f;
  --red-deep: #a63b38;
  --blue: #4f8fd8;
  --blue-deep: #2e5f99;
  --teal: #5f9d8f;
  --radius: 8px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
  --ball: 46px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  background-image:
    linear-gradient(180deg, rgba(11, 13, 17, 0.72), rgba(11, 13, 17, 0.88)),
    url("assets/backdrop.png");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
}

.site-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 22px 64px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(10, 12, 16, 0.74);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(240, 214, 148, 0.7);
  border-radius: 6px;
  background: linear-gradient(145deg, #f0d694, #b98f45);
  color: #1c160b;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 24px;
  font-weight: 700;
  box-shadow: 0 0 22px rgba(217, 179, 106, 0.22);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-text strong {
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 19px;
  letter-spacing: 0;
}

.brand-text small {
  margin-top: 3px;
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.18em;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.today {
  color: var(--text-dim);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.badge {
  padding: 6px 12px;
  border: 1px solid rgba(217, 179, 106, 0.42);
  border-radius: 999px;
  color: var(--gold-bright);
  background: rgba(217, 179, 106, 0.08);
  font-size: 12px;
  white-space: nowrap;
}

.page {
  padding-top: 40px;
}

.intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  padding: 10px 2px 30px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.intro h1 {
  margin: 0;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.22;
}

.intro-copy {
  max-width: 560px;
  margin: 14px 0 0;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.8;
}

.draw-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 360px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 19, 25, 0.7);
}

.draw-strip strong {
  color: var(--gold-bright);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.draw-label {
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(217, 179, 106, 0.14);
  color: var(--gold);
  font-size: 12px;
}

.draw-rule {
  color: var(--text-dim);
  font-size: 13px;
}

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(24, 28, 35, 0.84), rgba(15, 18, 24, 0.9));
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 62px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.panel-head h2 {
  margin: 0;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 18px;
  font-weight: 700;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mode-switch {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.mode-btn {
  min-width: 84px;
  padding: 9px 16px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.mode-btn:hover {
  color: var(--text);
}

.mode-btn.is-active {
  background: linear-gradient(140deg, #f0d694, #c99d52);
  color: #1c160b;
  box-shadow: 0 4px 16px rgba(217, 179, 106, 0.28);
}

.rule-line {
  color: var(--text-dim);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.ball-zone {
  padding: 22px 20px 8px;
}

.zone-back {
  padding-top: 14px;
}

.zone-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.zone-name {
  position: relative;
  padding-left: 14px;
  color: var(--gold-bright);
  font-size: 14px;
  font-weight: 700;
}

.zone-name::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--gold);
  transform: translateY(-50%) rotate(45deg);
}

.zone-back .zone-name {
  color: #9ec3ee;
}

.zone-back .zone-name::before {
  background: var(--blue);
}

.zone-hint {
  color: var(--text-dim);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.zone-hint b {
  color: var(--gold-bright);
  font-weight: 700;
}

.zone-back .zone-hint b {
  color: #9ec3ee;
}

.ball-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: 10px;
}

.ball {
  position: relative;
  justify-self: center;
  display: grid;
  place-items: center;
  width: var(--ball);
  height: var(--ball);
  padding: 0;
  border: 1px solid rgba(222, 189, 128, 0.34);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.03) 44%, rgba(0, 0, 0, 0.2)),
    #171b22;
  color: #d9d0bb;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  user-select: none;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.ball:hover {
  border-color: var(--gold-bright);
  transform: translateY(-2px);
}

.ball:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}

.ball.is-selected {
  border-color: var(--gold-bright);
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.05) 46%, rgba(0, 0, 0, 0.24)),
    var(--red);
  color: #fff;
  box-shadow: 0 0 0 2px rgba(240, 214, 148, 0.55), 0 0 20px rgba(216, 86, 79, 0.34);
}

.zone-back .ball.is-selected {
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.05) 46%, rgba(0, 0, 0, 0.24)),
    var(--blue);
  box-shadow: 0 0 0 2px rgba(240, 214, 148, 0.55), 0 0 20px rgba(79, 143, 216, 0.38);
}

.ball.is-limit {
  opacity: 0.42;
}

.ball.pop {
  animation: ball-pop 0.34s ease;
}

@keyframes ball-pop {
  0% { transform: scale(0.72); }
  55% { transform: scale(1.14); }
  100% { transform: scale(1); }
}

.current-line {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  margin: 18px 20px 0;
  padding: 10px 14px;
  border: 1px dashed rgba(222, 189, 128, 0.3);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
}

.current-label {
  flex: 0 0 auto;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
}

.current-nums {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.current-nums .placeholder {
  color: var(--text-dim);
  font-size: 13px;
}

.bet-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 20px 0;
}

.bet-switch {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.bet-btn {
  padding: 7px 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease;
}

.bet-btn:hover {
  color: var(--text);
}

.bet-btn.is-active {
  background: linear-gradient(140deg, #f0d694, #c99d52);
  color: #1c160b;
}

.bet-rule {
  color: var(--text-dim);
  font-size: 13px;
}

.ticket-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 14px;
  margin: 12px 20px 0;
  padding: 12px 14px;
  border: 1px solid rgba(222, 189, 128, 0.35);
  border-radius: var(--radius);
  background: rgba(217, 179, 106, 0.05);
}

.ticket-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  grid-column: 1 / -1;
}

.ticket-title {
  color: var(--gold-bright);
  font-size: 14px;
  font-weight: 700;
}

.ticket-zhushu {
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ticket-nums {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.ticket-nums .num-chip {
  width: 32px;
  height: 32px;
  font-size: 13px;
}

.ticket-preview .placeholder {
  color: var(--text-dim);
  font-size: 13px;
}

.num-chip {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(240, 214, 148, 0.5);
  border-radius: 50%;
  background: rgba(216, 86, 79, 0.18);
  color: #ffd9d4;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.num-chip.is-back {
  border-color: rgba(158, 195, 238, 0.6);
  background: rgba(79, 143, 216, 0.2);
  color: #cfe2f7;
}

.plus {
  color: var(--text-dim);
  font-size: 14px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 18px 20px 22px;
}

.btn {
  position: relative;
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
}

.btn:hover {
  border-color: rgba(222, 189, 128, 0.5);
  background: rgba(217, 179, 106, 0.08);
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}

.btn-primary {
  border-color: transparent;
  background: linear-gradient(140deg, #f0d694, #c99d52);
  color: #1c160b;
  box-shadow: 0 8px 22px rgba(217, 179, 106, 0.22);
}

.btn-primary:hover {
  background: linear-gradient(140deg, #f8e2a8, #d3a75b);
  box-shadow: 0 10px 28px rgba(217, 179, 106, 0.3);
}

.btn-primary::after {
  content: "";
  position: absolute;
  top: -40%;
  left: -60%;
  width: 45%;
  height: 180%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-20deg);
  animation: shimmer 3.4s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 62% { left: -60%; }
  100% { left: 130%; }
}

.btn-gold {
  border-color: rgba(222, 189, 128, 0.55);
  background: rgba(217, 179, 106, 0.06);
  color: var(--gold-bright);
}

.btn-gold:hover {
  background: rgba(217, 179, 106, 0.14);
}

.text-btn {
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.16s ease, background 0.16s ease;
}

.text-btn:hover {
  color: var(--gold-bright);
  background: rgba(217, 179, 106, 0.08);
}

.text-btn.is-armed {
  color: #ff9f98;
  background: rgba(216, 86, 79, 0.12);
}

.side {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.list-panel,
.stats-panel {
  overflow: hidden;
}

.stat-source {
  color: var(--text-dim);
  font-size: 12px;
}

.group-list {
  max-height: 420px;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.group-list::-webkit-scrollbar {
  width: 8px;
}

.group-list::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: rgba(217, 179, 106, 0.22);
}

.group-item {
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.028);
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.group-item:hover {
  border-color: rgba(222, 189, 128, 0.42);
  transform: translateY(-1px);
}

.group-item.leaving {
  opacity: 0;
  transform: translateX(16px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.group-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.mode-tag {
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(217, 179, 106, 0.12);
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
}

.mode-tag.is-ssq {
  background: rgba(79, 143, 216, 0.14);
  color: #9ec3ee;
}

.group-actions {
  display: flex;
  gap: 2px;
}

.group-actions .text-btn {
  padding: 4px 6px;
  font-size: 12px;
}

.group-nums {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.group-nums .num-chip {
  width: 27px;
  height: 27px;
  font-size: 12px;
}

.group-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: var(--text-dim);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.group-meta span {
  white-space: nowrap;
}

.group-meta strong {
  color: #cfc4ad;
  font-weight: 600;
}

.empty-state {
  padding: 42px 26px;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.8;
  text-align: center;
}

.empty-state.is-hidden {
  display: none;
}

.stats-body {
  padding: 16px;
}

.stats-empty {
  margin: 8px 0;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.8;
}

.stat-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.stat-card {
  padding: 10px 8px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
}

.stat-card b {
  display: block;
  color: var(--gold-bright);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.stat-card span {
  display: block;
  margin-top: 4px;
  color: var(--text-dim);
  font-size: 11px;
}

.hot-block + .hot-block {
  margin-top: 16px;
}

.hot-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
}

.hot-title b {
  color: var(--gold-bright);
}

.hot-block.is-back .hot-title b {
  color: #9ec3ee;
}

.hot-row {
  display: grid;
  grid-template-columns: 30px 1fr 30px;
  align-items: center;
  gap: 10px;
  min-height: 34px;
}

.hot-num {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid rgba(222, 189, 128, 0.4);
  border-radius: 50%;
  color: #eadfc5;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.hot-block.is-back .hot-num {
  border-color: rgba(158, 195, 238, 0.45);
  color: #cfe2f7;
}

.hot-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.hot-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #c99d52, #f0d694);
}

.hot-block.is-back .hot-fill {
  background: linear-gradient(90deg, #2e5f99, #7fb1e6);
}

.hot-count {
  color: var(--text-dim);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.live-section {
  margin-top: 44px;
  padding-top: 26px;
  border-top: 1px solid var(--line-soft);
}

.live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.live-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(24, 28, 35, 0.82), rgba(15, 18, 24, 0.9));
}

.live-card-label {
  color: var(--text-dim);
  font-size: 12px;
}

.live-card-value {
  display: block;
  margin-top: 6px;
  color: var(--gold-bright);
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.live-nums {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.live-nums .chip-sm {
  width: 32px;
  height: 32px;
  font-size: 13px;
}

.prize-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.prize-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-dim);
  font-size: 12px;
}

.prize-row b {
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 10, 14, 0.74);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-mask.is-hidden {
  display: none;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(10, 12, 16, 0.86), rgba(10, 12, 16, 0.95)),
    url("assets/backdrop.png");
  background-size: cover;
  background-position: center;
}

.auth-gate.is-hidden {
  display: none;
}

.auth-gate-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: min(420px, 100%);
}

.gate-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.gate-brand .brand-mark {
  width: 56px;
  height: 56px;
  font-size: 30px;
}

.gate-brand .brand-text strong {
  font-size: 24px;
}

.gate-brand .brand-text small {
  letter-spacing: 0.18em;
}

.gate-note {
  margin: 0;
  color: var(--text-dim);
  font-size: 12px;
  text-align: center;
}

body.is-locked {
  overflow: hidden;
}

body.is-locked .site-shell {
  visibility: hidden;
}

.auth-modal {
  position: relative;
  width: min(400px, 100%);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(26, 30, 38, 0.98), rgba(15, 18, 24, 0.98));
  box-shadow: var(--shadow);
}

.auth-modal h3 {
  margin: 0 0 16px;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 22px;
}

.auth-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-dim);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.auth-close:hover {
  color: var(--gold-bright);
  background: rgba(217, 179, 106, 0.1);
}

.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.auth-tab {
  flex: 1;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.auth-tab.is-active {
  background: linear-gradient(140deg, #f0d694, #c99d52);
  color: #1c160b;
}

.auth-field {
  display: block;
  margin-bottom: 12px;
  color: var(--text-dim);
  font-size: 13px;
}

.auth-field input {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 14px;
}

.auth-field input:focus {
  outline: none;
  border-color: var(--gold);
}

.auth-error {
  min-height: 18px;
  margin: 0 0 10px;
  color: #ff9f98;
  font-size: 12px;
}

.auth-submit {
  width: 100%;
}

.history-section,
.machine-section {
  margin-top: 44px;
  padding-top: 26px;
  border-top: 1px solid var(--line-soft);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 2px 20px;
}

.section-head h2 {
  margin: 0;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0;
}

.history-actions,
.machine-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.mode-switch-mini .mode-btn {
  min-width: 68px;
  padding: 8px 12px;
  font-size: 13px;
}

.data-status {
  padding: 5px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  white-space: nowrap;
}

.data-status.is-live {
  border-color: rgba(217, 179, 106, 0.45);
  color: var(--gold-bright);
}

.history-list-wrap {
  max-height: 560px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(22, 26, 33, 0.72), rgba(14, 17, 22, 0.88));
}

.history-list-wrap::-webkit-scrollbar {
  width: 8px;
}

.history-list-wrap::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: rgba(217, 179, 106, 0.22);
}

.history-row {
  display: grid;
  grid-template-columns: 92px 118px minmax(0, 1fr) 58px;
  align-items: center;
  gap: 14px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.16s ease;
}

.history-row:last-child {
  border-bottom: 0;
}

.history-row:hover {
  background: rgba(217, 179, 106, 0.055);
}

.history-issue {
  color: var(--gold-bright);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.history-date {
  color: var(--text-dim);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.history-nums {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.chip-sm {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(240, 214, 148, 0.48);
  border-radius: 50%;
  background: rgba(216, 86, 79, 0.16);
  color: #ffd9d4;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.chip-sm.is-back {
  border-color: rgba(158, 195, 238, 0.58);
  background: rgba(79, 143, 216, 0.18);
  color: #cfe2f7;
}

.history-nums .plus {
  font-size: 12px;
}

.machine-stage {
  position: relative;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(10, 12, 16, 0.62), rgba(10, 12, 16, 0.9)),
    url("assets/backdrop.png");
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.machine-canvas-wrap {
  width: 100%;
  height: 660px;
}

.machine-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  pointer-events: none;
  cursor: default;
}

.machine-footer {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  padding: 18px 2px 0;
}

.machine-result {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 10px 14px;
  border: 1px dashed rgba(222, 189, 128, 0.32);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
}

.machine-result .placeholder {
  color: var(--text-dim);
  font-size: 13px;
}

.machine-result .num-chip {
  width: 52px;
  height: 52px;
  font-size: 19px;
}

.machine-result .num-chip.pop {
  animation: ball-pop 0.34s ease;
}

.machine-refs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
}

.machine-refs figure {
  margin: 0;
}

.machine-refs img {
  display: block;
  width: min(460px, 100%);
  height: auto;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  object-fit: cover;
  opacity: 0.92;
}

.machine-refs figcaption {
  margin-top: 6px;
  color: var(--text-dim);
  font-size: 11px;
  text-align: center;
}

.reference-section {
  margin-top: 40px;
  padding-top: 26px;
  border-top: 1px solid var(--line-soft);
}

.footnote {
  padding: 34px 2px 0;
  border-top: 1px solid var(--line-soft);
  margin-top: 40px;
}

.footnote p {
  margin: 0;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.8;
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 40px));
  padding: 12px 20px;
  border: 1px solid rgba(222, 189, 128, 0.45);
  border-radius: var(--radius);
  background: rgba(18, 21, 27, 0.94);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.4);
  color: var(--text);
  font-size: 14px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.toast.is-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.shake {
  animation: shake 0.34s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-3px); }
}

@media (max-width: 1060px) {
  .stage {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}

@media (max-width: 900px) {
  .intro {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }

  .draw-strip {
    min-width: 0;
    width: 100%;
    flex-wrap: wrap;
  }

  .stage {
    grid-template-columns: 1fr;
  }

  .side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

@media (max-width: 640px) {
  .site-shell {
    padding: 0 14px 48px;
  }

  .topbar-meta .today {
    display: none;
  }

  .page {
    padding-top: 26px;
  }

  :root {
    --ball: 38px;
  }

  .ball-grid {
    grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
    gap: 8px;
  }

  .panel-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .rule-line {
    text-align: left;
  }

  .mode-switch {
    width: 100%;
  }

  .mode-btn {
    flex: 1;
  }

  .toolbar {
    padding: 16px 14px 18px;
  }

  .toolbar .btn {
    flex: 1 1 auto;
    padding: 10px 12px;
  }

  .current-line {
    margin: 14px 14px 0;
    align-items: flex-start;
  }

  .ball-zone {
    padding: 18px 14px 6px;
  }

  .side {
    grid-template-columns: 1fr;
  }

  .draw-strip {
    padding: 10px 12px;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .history-actions,
  .machine-actions {
    width: 100%;
  }

  .history-row {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "issue date load"
      "nums nums nums";
    row-gap: 10px;
    padding: 12px 14px;
  }

  .history-issue {
    grid-area: issue;
  }

  .history-date {
    grid-area: date;
  }

  .history-row .text-btn {
    grid-area: load;
    justify-self: end;
  }

  .history-nums {
    grid-area: nums;
  }

  .machine-canvas-wrap {
    height: 400px;
  }

  .machine-footer {
    grid-template-columns: 1fr;
  }

  .machine-refs {
    flex-wrap: wrap;
  }

  .machine-refs img {
    width: 100%;
    height: 130px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
