:root {
  --bg: #f3ecdf;
  --paper: #fffdf8;
  --ink: #231c16;
  --muted: #74685d;
  --line: #e5d8c6;
  --red: #c8102e;
  --red-deep: #8c0c20;
  --blue: #164e9b;
  --gold: #8d6a16;
  --ok: #1c7a4a;
  --warn: #9a5b12;
  --shadow: 0 12px 32px rgba(74, 42, 18, 0.08);
  --page: 1120px;
  --serif: "Palatino Linotype", Palatino, "Songti SC", "SimSun", serif;
  --sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; max-width: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(980px 460px at -6% -10%, rgba(200, 16, 46, 0.18), transparent 56%),
    radial-gradient(860px 440px at 108% -8%, rgba(22, 78, 155, 0.18), transparent 52%),
    radial-gradient(720px 380px at 78% 108%, rgba(28, 122, 74, 0.12), transparent 48%),
    radial-gradient(640px 320px at 18% 92%, rgba(196, 122, 18, 0.12), transparent 50%),
    linear-gradient(180deg, #f8efe4 0%, #f4e7d6 46%, #efe6f4 100%);
  min-height: 100vh;
}
button, input, select, textarea { font-family: inherit; color: inherit; }
button, label, .chip, input, select { scroll-margin-top: 160px; scroll-margin-bottom: 110px; }
a { color: var(--red-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-direction: column; align-items: stretch;
  width: min(var(--page), calc(100% - 24px));
  margin: 0 auto;
  padding: 0;
  background: linear-gradient(180deg, #fff7f2, #fffdf8);
  border: 1px solid #e7d3bf;
  border-top: 0;
  border-radius: 0 0 22px 22px;
  box-shadow: 0 16px 36px rgba(74, 42, 18, 0.14);
  overflow: hidden;
}
.topbar-main {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 22px 18px;
  color: #fff;
  background:
    radial-gradient(480px 140px at 0% 0%, rgba(255, 214, 140, 0.28), transparent 62%),
    radial-gradient(420px 160px at 100% 120%, rgba(150, 196, 255, 0.35), transparent 60%),
    linear-gradient(105deg, #7d1022 0%, #c8102e 36%, #9a3418 70%, #163e86 100%);
  position: relative;
}
.topbar-main::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 5px;
  background: linear-gradient(90deg, #ffd36a, #fff6df 42%, #b9d4ff);
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand:hover { text-decoration: none; }
.topbar .brand { gap: 14px; }
.seal {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #e23b4a, #c8102e 52%, #164e9b);
  color: #fff;
  font-family: var(--serif); font-weight: 700; letter-spacing: 1px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.4), 0 0 0 2px #e7b34a;
}
.topbar .seal {
  width: 58px; height: 58px; font-size: 28px;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.5), 0 0 0 3px #f0c14d, 0 8px 16px rgba(40, 8, 16, .28);
}
.brand h1 { margin: 0; font-family: var(--serif); font-size: 20px; font-weight: 700; }
.topbar .brand h1 { font-size: 28px; letter-spacing: 1px; color: #fff; }
.brand small { display: block; color: var(--muted); font-family: var(--sans); font-size: 12px; letter-spacing: 0.5px; }
.topbar .brand small { color: rgba(255,255,255,.86); font-size: 13px; margin-top: 2px; }
.nav-desk { display: flex; gap: 8px; padding: 10px 14px 12px; }
.nav-desk a, .tabbar a {
  color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 999px; font-size: 14px;
}
.nav-desk a {
  flex: 1; text-align: center; padding: 9px 8px; font-size: 15px;
  background: #fff; border: 1px solid #eadccb;
}
.topbar .userbox { color: #fff; font-size: 15px; gap: 10px; }
.topbar .btn.small { padding: 7px 14px; font-size: 13px; background: #fff; color: #231c16; }
.topbar .btn.primary { background: #fff4d4; color: #8c1024; border-color: #f0c14d; }
.nav-desk a:hover, .tabbar a:hover { text-decoration: none; }
.nav-desk a.on, .tabbar a.on { font-weight: 700; }
.goodnews {
  display: flex; align-items: stretch; height: 32px; min-height: 32px; max-height: 32px;
  background: #fff6df; color: #7a2d16; font-size: 14px; overflow: hidden;
}
.goodnews b {
  flex: none; display: flex; align-items: center; padding: 0 12px;
  background: #c8102e; color: #fff; font-size: 13px; letter-spacing: 1px; font-weight: 700;
}
.goodnews-view { flex: 1; min-width: 0; overflow: hidden; }
.goodnews-track { display: flex; width: max-content; height: 32px; align-items: center; animation: news-marquee 40s linear infinite; }
.goodnews-track > div { display: flex; align-items: center; height: 32px; }
.goodnews-track span { padding-right: 56px; white-space: nowrap; line-height: 32px; }
.goodnews:hover .goodnews-track { animation-play-state: paused; }
@keyframes news-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .goodnews-track { animation: none; }
}
.tone-red.on { background: #ffe1dc; color: #9d1228; }
.tone-blue.on { background: #e3eeff; color: #163e86; }
.tone-gold.on { background: #fff0cc; color: #8a5410; }
.tone-green.on { background: #def6e8; color: #146b40; }
.tone-rose.on { background: #fde4f2; color: #8d2460; }
.tone-ink.on { background: #ece7ff; color: #3d2e86; }
.userbox { display: flex; align-items: center; gap: 8px; font-size: 14px; }
#app { max-width: 100%; overflow-x: hidden; }
.wrap, .footer { width: min(var(--page), calc(100% - 28px)); }
.wrap { margin: 22px auto 80px; max-width: 100%; }
.wrap-wide { width: min(var(--page), calc(100% - 28px)); }
.footer { margin-left: auto; margin-right: auto; }
.page-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-end; margin-bottom: 16px; }
.page-head.center { justify-content: center; text-align: center; }
.page-head h2 { margin: 0; font-family: var(--sans); font-size: 22px; font-weight: 700; font-style: normal; color: #9d1228; }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .page-head h2 {
    background: linear-gradient(90deg, #c8102e, #c47a12 48%, #164e9b);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}
.page-head p { margin: 6px 0 0; color: var(--muted); }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;
}
.grid-2 { display: grid; grid-template-columns: 1.3fr .7fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.hero-card { padding: 22px; background: linear-gradient(180deg, #fff6f4, #fffdf8); border-top: 4px solid var(--red); }
.countdown { background: linear-gradient(180deg, #f4f8ff, #fffdf8); border-top: 4px solid var(--blue); }
.kicker { color: var(--gold); letter-spacing: 2px; font-size: 12px; margin: 0 0 6px; }
.issue { font-family: var(--sans); font-size: 20px; font-weight: 700; font-style: normal; margin: 0; }
.date-line { color: var(--muted); margin: 4px 0 14px; }

.balls { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ball {
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-style: normal; font-family: var(--sans);
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 -6px 8px rgba(0,0,0,.18), 0 4px 8px rgba(60,20,10,.12);
}
.ball.sm { width: 30px; height: 30px; font-size: 12px; }
.ball.xs { width: 16px; height: 16px; font-size: 9px; box-shadow: none; }
.ball.tiny { width: 18px; height: 18px; font-size: 10px; box-shadow: none; flex: 0 0 18px; }
.balls-fit { display: inline-flex; flex-wrap: nowrap; align-items: center; justify-content: flex-start; width: auto; gap: 4px; }
.ball.red { background: radial-gradient(circle at 35% 30%, #ff7d7d, var(--red) 58%, var(--red-deep)); }
.ball.blue { background: radial-gradient(circle at 35% 30%, #7eb0ff, var(--blue) 60%, #0e326b); }
.plus { color: var(--muted); font-weight: 700; }

.countdown { text-align: center; }
.countdown .when { color: var(--muted); margin-bottom: 8px; }
.countdown .pick-go { margin-top: 14px; }
.count-row { display: flex; justify-content: center; gap: 8px; }
.count-num {
  min-width: 64px; color: #fff8ee; border-radius: 12px; padding: 8px 6px;
  font-variant-numeric: tabular-nums;
}
.count-num:nth-child(1) { background: linear-gradient(180deg, #e23b4a, #8c0c20); }
.count-num:nth-child(2) { background: linear-gradient(180deg, #e0a03a, #8d5a10); }
.count-num:nth-child(3) { background: linear-gradient(180deg, #2f9a62, #146b40); }
.count-num:nth-child(4) { background: linear-gradient(180deg, #3a74d6, #163e86); }
.count-num b { display: block; font-size: 26px; font-family: var(--serif); }
.count-num span { font-size: 12px; color: rgba(255, 248, 238, 0.86); }

.entry {
  display: block; padding: 16px; border-radius: 16px; background: var(--paper);
  border: 1px solid var(--line); color: inherit; text-decoration: none; min-height: 112px;
}
.entry:hover { text-decoration: none; transform: translateY(-1px); }
.grid-4 .entry:nth-child(1) { background: linear-gradient(160deg, #fff5f3, #ffe4df); border-color: #f0b8b0; }
.grid-4 .entry:nth-child(1) strong { color: #9d1228; }
.grid-4 .entry:nth-child(2) { background: linear-gradient(160deg, #f4f8ff, #e3eeff); border-color: #b9cef2; }
.grid-4 .entry:nth-child(2) strong { color: #163e86; }
.grid-4 .entry:nth-child(3) { background: linear-gradient(160deg, #fff8ea, #ffe8bf); border-color: #efd09a; }
.grid-4 .entry:nth-child(3) strong { color: #8a5410; }
.grid-4 .entry:nth-child(4) { background: linear-gradient(160deg, #f3fbf6, #d9f3e4); border-color: #b7e0c6; }
.grid-4 .entry:nth-child(4) strong { color: #146b40; }
.entry strong {
  display: block;
  font-family: "Microsoft YaHei", "PingFang SC", "Heiti SC", sans-serif;
  font-size: 18px;
  font-weight: 700;
  font-style: normal;
  margin-bottom: 6px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.entry span { color: var(--muted); font-size: 13px; line-height: 1.5; }

.btn {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 8px 14px; font-size: 14px;
}
a.btn { display: inline-block; color: inherit; text-decoration: none; }
.btn:hover { border-color: #c9b39a; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-deep); }
.btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger { background: #fff; color: var(--red-deep); border-color: #efc3c3; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-size: 14px; }
.field span { color: var(--muted); }
input[type="text"], input[type="password"], input[type="number"], input[type="date"], select, textarea {
  border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 12px; font-size: 16px; width: 100%;
}
textarea { min-height: 140px; resize: vertical; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline input, .inline select { width: auto; }
.help { color: var(--muted); font-size: 13px; line-height: 1.6; }
.warn { color: var(--warn); }
.ok { color: var(--ok); }
.err { color: var(--red-deep); background: #fff1f0; border-radius: 10px; padding: 8px 10px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
#filterForm.admin-filters { flex-wrap: nowrap; align-items: center; min-width: 0; max-width: 100%; }
#filterForm.admin-filters input,
#filterForm.admin-filters select { flex: 1 1 0; width: 0; min-width: 0; padding-left: 8px; padding-right: 8px; }
#filterForm.admin-filters .btn { flex: 0 0 auto; width: auto; }
.hist-head {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  margin-bottom: 14px; padding: 16px 18px;
  background: linear-gradient(180deg, rgba(255, 253, 248, .98), rgba(255, 246, 234, .96));
  border: 1px solid rgba(224, 177, 90, .55); border-radius: 18px;
  box-shadow: 0 10px 26px rgba(141, 106, 22, .08);
}
.hist-head .page-head { margin: 0; min-width: 0; }
.hist-head .page-head p { margin: 4px 0 0; font-size: 13px; line-height: 1.5; }
.hist-search {
  display: flex; align-items: center; flex: 0 1 280px; min-width: 220px;
  background: #fff; border: 1px solid #e7d3ae; border-radius: 999px; padding: 4px;
  box-shadow: inset 0 1px 2px rgba(90, 60, 20, .05);
}
.hist-search:focus-within { border-color: #d7b16a; box-shadow: 0 0 0 3px rgba(224, 177, 90, .28); }
.hist-search input[type="text"] {
  flex: 1; min-width: 0; width: auto; border: 0; background: transparent; box-shadow: none;
  border-radius: 999px; padding: 8px 10px 8px 14px; font-size: 16px;
}
.hist-search input[type="text"]:focus { outline: none; }
.hist-search .btn { flex: none; padding: 8px 16px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12px; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: #fbf6ee; }
tr.win { background: #fff6f4; }
tr.jackpot { background: #fff4d2; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; }
.hist-scroll { overflow: hidden; }
.hist-table { width: 100%; table-layout: fixed; }
.hist-table th, .hist-table td { white-space: nowrap; padding: 8px 6px; overflow: hidden; }
.hist-table th:nth-child(1), .hist-table td:nth-child(1) { width: 17%; }
.hist-table th:nth-child(2), .hist-table td:nth-child(2) { width: 20%; }
.hist-table th:nth-child(4), .hist-table td:nth-child(4) { width: 9%; }
.hist-table th:nth-child(5), .hist-table td:nth-child(5) { width: 9%; }
.hist-table .balls { display: flex; flex-wrap: nowrap; gap: 4px; width: 100%; container-type: inline-size; }
.hist-table .ball.sm {
  flex: none;
  width: min(28px, calc((100cqi - 28px) / 7));
  height: min(28px, calc((100cqi - 28px) / 7));
  font-size: min(12px, calc((100cqi - 28px) / 16));
}
.hist-table .ball.blue { margin-left: 4px; }
@media (max-width: 900px) {
  .hist-table { font-size: 12px; }
  .hist-table th, .hist-table td { padding: 8px 2px; }
  .hist-table th:nth-child(1), .hist-table td:nth-child(1) { width: 18%; }
  .hist-table th:nth-child(2), .hist-table td:nth-child(2) { width: 22%; }
  .hist-table th:nth-child(4), .hist-table td:nth-child(4) { width: 10%; }
  .hist-table th:nth-child(5), .hist-table td:nth-child(5) { width: 10%; }
  .hist-table .balls { gap: 2px; }
  .hist-table .ball.blue { margin-left: 2px; }
  .hist-table .ball.sm {
    width: min(26px, calc((100cqi - 14px) / 7));
    height: min(26px, calc((100cqi - 14px) / 7));
    font-size: min(11px, calc((100cqi - 14px) / 14));
  }
}

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.tabs button { border: 1px solid transparent; background: transparent; border-radius: 999px; padding: 7px 12px; color: var(--muted); }
.tabs button.on { background: linear-gradient(180deg, #3a74d6, #164e9b); color: #fff; border-color: #164e9b; }
.stat-tabs { flex-wrap: nowrap; gap: 4px; }
.stat-tabs button { padding: 6px 8px; font-size: 13px; white-space: nowrap; }
.stat-dim { border-radius: 3px; background: #e7f0ff; padding: 10px; margin: 0 0 12px; }
.stat-dim-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.stat-dim-line:last-of-type { margin-bottom: 0; }
.stat-dim button { border: 1px solid #d5e3f7; background: #fff; border-radius: 3px; padding: 5px 8px; color: #31445f; font-size: 13px; }
.stat-dim button.on { background: linear-gradient(180deg, #3a74d6, #164e9b); color: #fff; border-color: #164e9b; }
.stat-dim button.dim { background: rgba(255, 255, 255, 0.55); color: #31445f; border-color: transparent; font-weight: 700; }
.stat-dim button.dim.on { background: #fff; color: #c8102e; border-color: #fff; box-shadow: 0 1px 3px rgba(22, 48, 90, 0.16); }
.stat-dim-note { margin: 0; flex: 1; min-width: 0; font-size: 13px; color: #31445f; line-height: 1.45; }
.stat-dim-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.stat-dim.is-fold { padding: 8px 10px; }
.stat-dim.is-fold .stat-dim-bar { margin-top: 0; }
.stat-dim button.stat-fold-btn {
  flex: none; margin-left: auto; background: #fff; color: #164e9b; border: 1px solid #9eb6de;
  font-weight: 700; box-shadow: none;
}
.stat-dim .stat-custom input { border-radius: 3px; }
.stat-custom { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; font-style: normal; white-space: nowrap; flex: none; }
.stat-custom input { width: 56px; padding: 5px 4px; text-align: center; border: 1px solid var(--line); border-radius: 10px; font-size: 16px; font-style: normal; background: #fff; }

.step { margin-bottom: 12px; }
.pick-stack { display: flex; flex-direction: column; gap: 10px; }
.pick-stack > .step,
#pickChoice > .step { margin-bottom: 0; }
.pick-stack > .step-nav { margin: 0; }
.tail-group { margin-top: 14px; }
.choice-lines { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.choice-line { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; min-width: 0; }
.choice-line .choice-label { margin: 0; flex: none; width: 4.5em; }
.choice-line .chips { flex: 1; flex-wrap: nowrap; min-width: 0; gap: 4px; }
.choice-line .chip { flex: 1 1 0; min-width: 0; width: auto; height: 30px; padding: 0 2px; }
.choice-line .chip.road-all { flex: none; width: auto; min-width: 36px; padding: 0 6px; font-size: 12px; }
.choice-label { margin: 0 0 8px; font-size: 14px; font-weight: 700; font-style: normal; color: var(--ink); }
.card.step {
  background: #fff3d4;
  border-color: #e0b15a;
  box-shadow: 0 10px 28px rgba(141, 106, 22, 0.16);
}
.step-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.step-no {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(180deg, #e23b4a, #8c0c20); color: #fff;
  display: grid; place-items: center; font-size: 13px; flex: none;
}
.step-head h3 { margin: 0; font-size: 16px; flex: 1; min-width: 4em; }
.step-count { margin-left: auto; max-width: 100%; font-size: 12px; line-height: 1.35; text-align: right; font-variant-numeric: tabular-nums; color: var(--red-deep); font-weight: 700; font-style: normal; }
.pick-progress { margin: 10px 0 0; }
#pickChoice > .pick-progress { margin: 0; }
.pick-progress-track { display: flex; gap: 2px; align-items: stretch; height: 18px; }
.pick-progress-track button {
  flex: 1 1 0; min-width: 0; height: 18px; padding: 0; border: 0; border-radius: 2px;
  background: #efe6d6; cursor: pointer;
}
.pick-progress-track button.done { background: #e7a3a8; }
.pick-progress-track button.been { background: #f0c7a2; }
.pick-progress-track button.on { background: #c8102e; box-shadow: inset 0 -3px 0 #ffd36a; }
.pick-progress-track button.wait,
.pick-progress-track button:disabled { background: #efe6d6; opacity: 1; cursor: default; }
.pick-progress-track button.done:hover,
.pick-progress-track button.been:hover { filter: brightness(0.92); }
.pick-progress-meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin: 6px 0 0; font-size: 13px; color: #31445f; }
.pick-progress-meta span { flex: 1 1 12em; min-width: 0; }
.pick-progress-meta b { flex: none; font-style: normal; color: var(--ink); }
.step-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0; }
.step-nav b { font-size: 15px; font-weight: 600; font-style: normal; }
.step-dots { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.step-dots button {
  width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: #fff;
  font-size: 11px; font-style: normal; padding: 0;
}
.step-dots button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.step-countline { margin: 0 0 10px; font-weight: 700; font-style: normal; font-variant-numeric: tabular-nums; }
.zone-pick { display: grid; gap: 8px; margin: 8px 0; }
#zoneAdd { margin-top: 8px; }
.zone-schemes { display: grid; gap: 6px; margin-top: 8px; }
.zone-schemes:empty { display: none; }
.zone-scheme {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: #fff;
}
.zone-scheme b { flex: none; font-style: normal; }
.zone-scheme span { flex: 1; min-width: 0; font-size: 13px; }
.zone-scheme .btn { flex: none; }
.zone-rows { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.zone-row { display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; }
.zone-row .name { flex: none; width: 42px; font-weight: 700; font-size: 13px; line-height: 1.15; min-width: 0; }
.zone-row .name .zone-range { font-size: 10px; }
.zone-chips { display: flex; flex: 1; flex-wrap: nowrap; gap: 3px; min-width: 0; }
.zone-row .chip { flex: 1 1 0; min-width: 0; width: auto; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.zone-row .chip.road-all { flex: none; width: auto; min-width: 34px; padding: 0 4px; font-size: 12px; }
.zone-row .unit { flex: none; font-size: 13px; }
.step-trend-scroll { overflow: auto; max-height: 320px; border: 1px solid var(--line); border-radius: 12px; }
.step-trend { width: 100%; border-collapse: collapse; font-size: 13px; font-family: var(--sans); font-style: normal; }
.step-trend th, .step-trend td { font-size: 13px; font-style: normal; font-weight: 400; text-align: center; padding: 6px 4px; white-space: nowrap; }
.step-trend th { font-size: 12px; font-weight: 600; color: var(--muted); position: sticky; top: 0; background: #faf6ef; }
.step-trend .draw-nums { text-align: left; }
.step-trend tr.fit td { background: #f8e7e4; }
.step-trend td.mark { color: var(--red-deep); font-weight: 700; }
.step-trend-compact { table-layout: fixed; width: 100%; }
.step-trend-compact th, .step-trend-compact td { padding: 6px 2px; }
.step-trend-compact th:first-child,
.step-trend-compact td:first-child { width: 62px; font-size: 12px; padding-left: 2px; padding-right: 2px; }
.step-trend tr.nums td { text-align: center; white-space: normal; padding: 0 1px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.step-trend tr.nums .balls-fit { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; width: 100%; }
.step-trend tr.nums .ball.tiny { width: 16px; height: 16px; font-size: 9px; flex-basis: 16px; }
.zone-range { display: block; font-size: 11px; font-weight: 400; color: var(--muted); line-height: 1.2; }
.step-trend tr.nums .ball { margin: 0; }
.step-trend .draw-nums .balls-fit { width: auto; justify-content: flex-start; }
.step-trend td.on { background: #f8e7e4; color: var(--red-deep); font-weight: 700; }
.zone-trends { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.zone-trends h4 { margin: 0 0 6px; font-size: 14px; font-weight: 600; font-style: normal; }
.zone-trends .step-trend-scroll { max-height: 280px; }
.zgrp { display: inline-flex; gap: 3px; margin-right: 6px; padding: 2px; border-radius: 8px; }
.zgrp.z1 { background: #ffe4df; }
.zgrp.z2 { background: #fff6df; box-shadow: inset 0 0 0 1px #efd09a; }
.zgrp.z3 { background: #e7e4ff; }
.pick-stat { background: linear-gradient(180deg, #f3f7ff, #fffdf8); border-color: #c5d4f2; }
.pick-trend { background: linear-gradient(180deg, #f3fbf6, #fffdf8); border-color: #c5e3d0; }
.pick-trend h3, .pick-stat h3 { margin: 8px 0; font-size: 15px; font-weight: 600; }
.stat-step-title { margin: 0 0 8px; text-align: center; font-family: var(--sans); font-size: 20px; font-weight: 700; font-style: normal; }
.stat-meaning { margin: 0 0 8px; }
.tail-group .help { margin: 0 0 8px; }
.pick-trend .trend-scroll { max-height: 260px; }
.mini-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.mini { border: 1px solid var(--line); border-radius: 8px; padding: 2px 6px; font-size: 12px; font-style: normal; background: #fff; }
.mini.on { background: #f8e7e4; color: var(--red-deep); font-weight: 700; }
.bar-col.on span { color: var(--red-deep); font-weight: 700; }
.bar-col.on .bar i { background: linear-gradient(180deg, #5b8def, var(--blue)); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-line { flex-wrap: nowrap; }
.chips-line .chip { flex: 1 1 0; min-width: 0; padding: 6px 4px; text-align: center; white-space: nowrap; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 10px; font-size: 13px;
}
.chip.on { background: linear-gradient(180deg, #e23b4a, #a11228); color: #fff; border-color: #a11228; }
.range-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sum-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sum-row .step-no { grid-row: 1 / span 2; }
.sum-row .sum-count { grid-column: 2; justify-self: end; max-width: 100%; text-align: right; font-size: 12px; line-height: 1.35; font-weight: 700; font-style: normal; color: var(--red-deep); }
.sum-row .btn { grid-column: 3; grid-row: 1 / span 2; }
.sum-row b { font-style: normal; }
.sum-row p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.stat-line { display: flex; gap: 6px; }
.bars-pair { display: flex; align-items: flex-end; gap: 8px; }
.bars-pair .bars { flex: 1; min-width: 0; justify-content: space-evenly; overflow: visible; }
.bars-pair .bar-col { width: auto; flex: 1; min-width: 0; }
.blue-left, .result-blues {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px 6px; margin-top: 12px;
}
.blue-card {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 0; width: 100%; padding: 4px 2px; border: 1px solid transparent; border-radius: 12px;
  background: transparent; color: inherit; font: inherit;
}
.blue-card em, .blue-card span { font-size: 12px; font-style: normal; color: var(--muted); line-height: 1.2; }
.blue-card.on { border-color: var(--blue); background: #eef4ff; }
#funnelCard { position: static; }
.funnel-cond {
  display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 4px 8px; align-items: center;
  width: 100%; text-align: left; border-bottom: 1px solid var(--line);
  padding: 8px 0; color: inherit; font: inherit;
}
.funnel-cond b { font-style: normal; font-weight: 600; }
.funnel-cond span { color: var(--muted); font-size: 13px; min-width: 0; }
.result-label { margin: 16px 0 8px; font-size: 16px; }
.result-blues { margin-top: 0; align-items: start; }
.result-blue-item { display: flex; flex-direction: column; align-items: center; gap: 12px; min-width: 0; }
.result-blue-item .btn.small { width: 100%; padding: 4px 0; }
.result-blue-item.swap .ball { box-shadow: 0 0 0 3px #e0b15a; }
.blue-pick { margin-top: 8px; }
.modal-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.modal-bar h3 { margin: 0; }
.sum-count { color: var(--red-deep); font-variant-numeric: tabular-nums; white-space: nowrap; }
.red-sum .btn-row { margin-top: 14px; }
.range-row input[type="number"] { width: 88px; }
.edge-modes { margin-top: 12px; }
.edge-ranges { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.edge-ranges input[type="number"] { width: 72px; height: 36px; padding: 2px 8px; border-radius: 8px; font-size: 16px; }
.result-total { margin: 0 0 12px; text-align: center; font-size: 16px; font-weight: 700; }
.result-total b { color: var(--red-deep); font-style: normal; font-size: 22px; }
.sample-box { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.miss-list { display: grid; gap: 0; margin-top: 8px; }
.miss-row { display: grid; grid-template-columns: 7.5em 4.5em minmax(0, 1fr); gap: 8px; align-items: start; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.miss-row b { font-style: normal; }
.miss-row.is-bad { background: #fff1f0; border-radius: 8px; padding-left: 8px; padding-right: 8px; }
.miss-row .bad { color: var(--red-deep); font-weight: 700; }
.check-flow h3 { margin: 18px 0 8px; }
.check-flow h3:first-child { margin-top: 0; }
.check-draw { margin: 8px 0 4px; }
.check-draw .ball { width: 44px; height: 44px; font-size: 16px; }
.check-flow table { width: 100%; }
@media (max-width: 640px) {
  .miss-row { grid-template-columns: 5.2em 3.6em minmax(0, 1fr); gap: 6px; font-size: 12px; }
  .check-draw .ball { width: 36px; height: 36px; font-size: 14px; }
}
.miss-row .ok { color: var(--ok); }
.miss-row .skip { color: var(--muted); }
.blue-card.swap { box-shadow: 0 0 0 2px #e0b15a; }
.checkline { display: flex; gap: 8px; align-items: center; font-size: 14px; }

#funnelCard h3 { margin-bottom: 4px; }
.pick-live {
  position: sticky; top: 68px; z-index: 5;
  display: flex; justify-content: space-between; gap: 8px; align-items: center;
  background: var(--ink); color: #fff8ee; border-radius: 14px; padding: 10px 14px; margin-bottom: 12px;
}
.pick-live b { font-family: var(--serif); font-size: 22px; color: #fff; }
.funnel-row { display: grid; grid-template-columns: 92px 1fr 88px; gap: 8px; align-items: center; margin: 6px 0; font-size: 12px; }
.funnel-track { background: #f3e7d8; border-radius: 999px; height: 8px; overflow: hidden; }
.funnel-bar { height: 100%; background: linear-gradient(90deg, var(--red), #e07a3d); border-radius: 999px; }
.funnel-bar.good { background: var(--ok); }
.funnel-num { text-align: right; font-variant-numeric: tabular-nums; }

.tighten { display: grid; gap: 8px; }
.tight-now { margin: 8px 0; font-size: 15px; }
.tight-now b { color: var(--red-deep); font-size: 18px; font-variant-numeric: tabular-nums; }
.tighten label {
  display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: center;
  border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: #fff;
}
.tighten-must {
  border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: #fff;
  position: relative; z-index: 6;
}
.tighten-must.on { border-color: #e0b15a; background: #fffaf0; }
.tighten-must-row {
  display: grid; grid-template-columns: max-content minmax(0, 1fr) auto; gap: 8px; align-items: center;
}
.tighten label.must-check,
.tighten-must-row .must-check {
  display: flex; align-items: center; gap: 8px; width: max-content; max-width: max-content;
  margin: 0; border: 0; padding: 0; background: transparent; box-shadow: none;
  grid-template-columns: none;
}
.tighten-must-row .must-check span { font-weight: 700; min-width: 3.2em; }
.must-select {
  position: relative; z-index: 3; width: 100%;
  border: 1px solid #ead6b4; border-radius: 10px; background: #fff9f0;
  padding: 8px 12px; text-align: left; font-size: 13px; color: #8a5410; cursor: pointer;
  pointer-events: auto;
}
.tighten-must.on .must-select { border-color: #f0b8b0; background: #fff; color: #231c16; }
.must-grid {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; position: relative; z-index: 8;
}
.must-ball {
  position: relative; z-index: 7;
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid #f0b8b0; background: #fff;
  color: #9d1228; font-size: 12px; font-weight: 700; cursor: pointer; padding: 0;
  pointer-events: auto; user-select: none;
}
.must-ball.on {
  background: #c8102e !important; border-color: #c8102e !important; color: #fff !important;
}
.tag { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; font-style: normal; }
.bet-list { max-height: 420px; overflow: auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 10px; }
.bet-list.sample-list { max-height: 520px; }
.sample-save { display: flex; justify-content: center; margin-top: 14px; }
.sample-save .save-big { width: 100%; padding: 14px 18px; font-size: 16px; font-weight: 700; }
.lock-box { text-align: center; padding: 28px 12px 16px; border: 1px dashed var(--line); border-radius: 16px; background: #fff8f4; margin-top: 8px; }
.lock-mark { font-size: 32px; line-height: 1.2; }
.lock-text { margin: 8px 0 6px; color: var(--red-deep); font-size: 16px; font-weight: 700; }
.lock-go { margin-top: 12px; }
.more-reds { display: block; width: 100%; margin: 10px 0 0; }
.tiny-ops { display: flex; gap: 8px; margin: 10px 0 4px; }
.chase-box h3 { margin: 0 0 8px; }
.chase-box .btn-row { margin-top: 10px; }
.tiny-ops .btn { flex: none; }
.result-label em.result-n { margin-left: 8px; font-style: normal; font-weight: 400; color: var(--muted); font-size: 13px; }
.row-ops { margin-left: auto; display: flex; gap: 8px; align-items: center; flex: none; }
.restart-line { display: flex; justify-content: center; margin: 8px 0 0; }
.mine-hero {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 14px; padding: 18px 20px;
  border-radius: 18px; color: #fff;
  background: linear-gradient(105deg, #7d1022 0%, #c8102e 40%, #9a3418 100%);
}
.mine-seal {
  width: 48px; height: 48px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: rgba(255,255,255,.18); border: 2px solid rgba(255,255,255,.45);
  font-size: 22px; font-weight: 700;
}
.mine-hero b { display: block; font-size: 20px; color: #fff; }
.mine-hero em {
  display: inline-block; margin-top: 6px; font-style: normal;
  padding: 2px 10px; border-radius: 999px; font-size: 12px;
  background: rgba(255,255,255,.2); color: #fff;
}
.mine-menu { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.mine-member {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid #ead9b4; border-radius: 14px; padding: 14px 16px;
}
.mine-member-main {
  flex: 1; min-width: 0;
  display: grid; grid-template-columns: 36px 1fr; grid-template-rows: auto auto; column-gap: 10px;
  align-items: center; color: inherit; text-decoration: none;
}
.mine-member-main:hover { text-decoration: none; }
.mine-member-main i {
  grid-row: 1 / span 2; width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center; color: #fff; font-style: normal; font-weight: 700; font-size: 14px;
  background: linear-gradient(180deg, #e23b4a, #c8102e);
}
.mine-member-main b { font-size: 15px; }
.mine-member-main span { grid-column: 2; color: var(--muted); font-size: 13px; line-height: 1.45; }
.mine-open { flex: none; white-space: nowrap; padding: 8px 14px; }
.member-hero {
  margin-bottom: 14px; padding: 22px 24px; border-radius: 18px; color: #fff;
  background: linear-gradient(105deg, #7d1022 0%, #c8102e 42%, #9a3418 100%);
}
.member-hero .kicker { color: rgba(255,255,255,.78); }
.member-hero h3 { margin: 0 0 8px; color: #fff; font-size: 24px; }
.member-hero p { margin: 0; color: rgba(255,255,255,.92); line-height: 1.5; }
.member-buy .pay-grid { margin-top: 4px; }
.mine-menu a {
  display: grid; grid-template-columns: 36px 1fr; grid-template-rows: auto auto; column-gap: 10px;
  align-items: center; background: #fff; border: 1px solid #ead9b4;
  border-radius: 14px; padding: 14px 16px; color: inherit; text-decoration: none;
}
.mine-menu a:hover { border-color: #e0b15a; text-decoration: none; }
.mine-menu i {
  grid-row: 1 / span 2; width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center; color: #fff; font-style: normal; font-weight: 700; font-size: 14px;
}
.mine-menu i.tone-red { background: linear-gradient(180deg, #e23b4a, #c8102e); }
.mine-menu i.tone-blue { background: linear-gradient(180deg, #3a74d6, #164e9b); }
.mine-menu i.tone-gold { background: linear-gradient(180deg, #e0a03a, #8d5a10); }
.mine-menu i.tone-green { background: linear-gradient(180deg, #3aa36a, #1c7a4a); }
.mine-menu a b { font-size: 15px; }
.mine-menu a span { grid-column: 2; color: var(--muted); font-size: 13px; line-height: 1.45; }
.mine-guest h3 { margin: 4px 0 8px; }
.promo-box textarea { min-height: 72px; margin: 8px 0; }
.panel { padding: 0; overflow: hidden; }
.panel h3 {
  margin: 0; padding: 8px 16px; text-align: center; color: #fff;
  font-size: 16px; font-weight: 700; letter-spacing: 1px;
  background: linear-gradient(90deg, #9d1228, #c8102e);
}
.panel-blue h3 { background: linear-gradient(90deg, #164e9b, #3a74d6); }
.panel-gold h3 { background: linear-gradient(90deg, #8d5a10, #e0a03a); }
.panel-body { padding: 12px 16px 16px; }
.panel-body > .help:first-child { margin: 0 0 10px; }
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pay-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  border: 1px solid #ead9b4; border-radius: 14px; padding: 14px; background: #fff8f6;
  text-align: left; cursor: pointer;
}
.pay-card b { font-size: 15px; }
.pay-card .help { margin: 0; }
.pay-card.tone-rose { background: linear-gradient(180deg, #fff1f3, #fff8f6); border-color: #f0c2c8; }
.pay-card.tone-gold { background: linear-gradient(180deg, #fff6e4, #fffdf6); border-color: #ead3a0; }
.pay-card.tone-green { background: linear-gradient(180deg, #eef8f2, #f8fffb); border-color: #b7e0c6; }
.pay-card.tone-blue { background: linear-gradient(180deg, #eef3ff, #f8fbff); border-color: #c5d4f0; }
.pay-card.on { border-color: #c8102e; box-shadow: inset 0 0 0 2px #c8102e; }
.qr-box { display: flex; justify-content: center; margin: 8px 0; }
.qr-box img, .qr-box canvas { width: 180px; height: 180px; }
.pay-shot { width: min(180px, 100%); border-radius: 8px; display: block; margin: 8px 0; }
@media (max-width: 640px) {
  .mine-menu, .pay-grid { grid-template-columns: 1fr; }
}
.pick-enter { animation: pick-in .28s ease; }
@keyframes pick-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.blue-action-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.blue-action-row .blue-action-del { margin-left: auto; }
.blue-action-row .btn.on { box-shadow: inset 0 0 0 2px #e0b15a; }
.bet { display: flex; justify-content: flex-start; gap: 8px; align-items: center; flex-wrap: nowrap; padding-bottom: 6px; border-bottom: 1px dashed var(--line); }
.bet > span:first-child:not(.balls) { flex: none; width: 2em; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.bet > div:first-of-type { flex: 1; min-width: 0; }
.bet .balls { flex: none; flex-wrap: nowrap; }
.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.stat { background: #faf6ef; border-radius: 12px; padding: 10px; text-align: center; }
.stat b { display: block; font-family: var(--serif); font-size: 20px; }
.stat span { color: var(--muted); font-size: 12px; }

.bars { display: flex; align-items: flex-end; gap: 6px; min-height: 160px; overflow-x: auto; padding-top: 8px; }
.bar-col { width: 36px; flex: none; text-align: center; font-size: 11px; color: var(--muted); }
.bar-col .bar {
  height: 120px; display: flex; align-items: flex-end; justify-content: center;
}
.bar-col .bar i {
  display: block; width: 18px; border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #e15b4a, var(--red-deep)); min-height: 2px;
}
.bar-col b { display: block; color: var(--ink); font-size: 11px; }
.tail-stats { display: grid; gap: 8px; min-width: 0; }
.tail-stats .bars { min-width: 0; overflow: hidden; gap: 2px; }
.tail-stats .bar-col { width: auto; flex: 1 1 0; min-width: 0; }
.tail-stats .bar-col b, .tail-stats .bar-col span { display: block; overflow: hidden; white-space: nowrap; }
.tail-stats .bar-col .bar i { width: 70%; max-width: 18px; }
.tail-stats.compact { gap: 2px; }
.tail-stats.compact .help { margin: 0; line-height: 1.3; }
.tail-stats.compact .bars { min-height: 0; padding-top: 0; }
.tail-stats.compact .bar-col .bar { height: 42px; }
.chart { width: 100%; height: auto; background: #faf6ef; border-radius: 12px; }
.trend-card { padding: 12px; }
.trend-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.trend-bar .help { margin: 0; }
.pre-sum { display: flex; flex-wrap: wrap; gap: 10px 16px; font-size: 13px; margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.pre-sum .blue-txt { color: var(--blue); }
.trend-scroll { overflow: auto; max-height: calc(100vh - 230px); border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.trend-sheet { position: relative; display: inline-block; min-width: 100%; }
.trend-sheet svg { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 1; }
.trend-grid { border-collapse: separate; border-spacing: 0; font-size: 12px; font-family: var(--sans); font-style: normal; font-variant-numeric: tabular-nums; }
.trend-grid th, .trend-grid td {
  border-right: 1px solid #f0e4d6; border-bottom: 1px solid #f0e4d6;
  text-align: center; padding: 0; height: 20px; min-width: 22px; white-space: nowrap;
  font-family: var(--sans); font-style: normal; font-size: 12px; font-weight: 400;
}
.trend-grid thead th { position: sticky; top: 0; background: #faf6ef; z-index: 5; font-weight: 600; font-size: 11px; height: 22px; }
.trend-grid thead tr:nth-child(2) th { top: 22px; font-weight: 600; font-size: 10px; color: #8a7564; }
.trend-grid .issue { position: sticky; left: 0; z-index: 4; background: #fff; min-width: 74px; width: 74px; font-size: 12px; font-weight: 600; font-style: normal; font-family: var(--sans); }
.trend-grid td.issue[colspan] { width: auto; min-width: 102px; }
.trend-grid .wk { position: sticky; left: 74px; z-index: 4; background: #fffdf8; min-width: 28px; width: 28px; color: var(--muted); }
.trend-grid thead .issue, .trend-grid thead .wk { z-index: 8; background: #faf6ef; }
.trend-grid .z1 { background: #fff1ee; }
.trend-grid .z2 { background: #fff8ea; }
.trend-grid .z3 { background: #f3f0ff; }
.trend-grid .zb { background: #eaf2ff; }
.trend-grid .edge, .trend-grid .tail { border-left: 2px solid #e4d3c0; }
.trend-grid .miss { color: #c0b0a0; font-size: 10px; }
.trend-grid .mark { background: #e5f6ea; color: #1c7a4a; font-weight: 700; }
.trend-grid td.red-hit, .trend-grid td.blue-hit { padding: 1px; }
.trend-grid .stat-row td { background: #faf6ef; font-weight: 700; color: #5c5148; height: 24px; }
.trend-grid .stat-row .issue { background: #faf6ef; }
.trend-grid td.pre-cell { cursor: pointer; }
.trend-grid td.pre-cell:hover { background: #fff1ea; }
.trend-grid .ghost { color: #ddd2c6; font-size: 10px; }
.trend-grid td.pre-cell:hover .ghost { color: #8a7564; }
.trend-grid .pre-ops { min-width: 108px; background: #fff; }
.trend-grid .pre-ops .btn { margin: 1px; }
.heat { display: grid; grid-template-columns: repeat(11, 1fr); gap: 6px; }
.cell { border-radius: 10px; padding: 8px 4px; text-align: center; color: #fff; }
.cell b { display: block; }
.cell small { opacity: .9; }
.rank { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-variant-numeric: tabular-nums; }

.mask {
  position: fixed; inset: 0; background: rgba(35, 28, 22, .45); z-index: 40;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  width: min(720px, 100%); min-width: 0; background: var(--paper); border-radius: 18px 18px 0 0;
  padding: 18px; max-height: 88vh; overflow: hidden;
  display: flex; flex-direction: column;
}
.modal-body { flex: 1; min-height: 0; overflow: auto; }
.modal-foot { flex: none; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.modal-foot .btn { width: 100%; }
.banner {
  background: #fff6df; border: 1px solid #efd7a4; border-radius: 12px; padding: 10px 12px; margin-bottom: 12px;
  display: flex; justify-content: space-between; gap: 8px; align-items: center;
}
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 999px; z-index: 50;
  bottom: calc(100px + env(safe-area-inset-bottom, 0px));
}
.footer { color: var(--muted); font-size: 12px; text-align: center; padding: 8px 16px 24px; }
.tabbar {
  position: fixed; left: 12px; right: 12px; z-index: 20;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  display: none; justify-content: space-around; align-items: stretch;
  min-height: 72px; padding: 8px;
  border-radius: 24px;
  background: rgba(255, 252, 247, 0.96);
  border: 1px solid rgba(224, 177, 90, 0.5);
  box-shadow: 0 12px 32px rgba(74, 42, 18, 0.16), inset 0 1px 0 #fff;
  backdrop-filter: blur(16px);
}
.tabbar a {
  flex: 1; display: flex; align-items: center; justify-content: center;
  margin: 0 3px; padding: 12px 2px; font-size: 16px; font-weight: 600; line-height: 1.2;
  border-radius: 16px; color: #6f5e4e; background: transparent; box-shadow: none;
}
.tabbar a::after { content: none; }
.tabbar a.on,
.tabbar .tone-red.on,
.tabbar .tone-blue.on,
.tabbar .tone-gold.on,
.tabbar .tone-green.on,
.tabbar .tone-rose.on,
.tabbar .tone-ink.on {
  background: linear-gradient(180deg, #e23b4a, #c8102e);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(200, 16, 46, 0.28);
}
.empty { color: var(--muted); padding: 18px 0; }
.num-inputs { display: flex; flex-wrap: wrap; gap: 6px; }
.num-inputs input { width: 54px; text-align: center; padding: 8px 4px; }
.pick-grid { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; min-width: 0; }
button.pick-ball {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line);
  background: #fff; color: var(--muted); font-weight: 700; padding: 0; box-shadow: none; flex: 0 0 32px;
}
button.pick-ball.on { color: #fff; border-color: transparent; }
button.pick-ball.on.red { background: radial-gradient(circle at 35% 30%, #ff7d7d, var(--red) 58%, var(--red-deep)); }
button.pick-ball.on.blue { background: radial-gradient(circle at 35% 30%, #7eb0ff, var(--blue) 60%, #0e326b); }
.auto-meta { display: grid; grid-template-columns: 88px 1fr; gap: 6px 10px; margin: 0 0 12px; }
.auto-meta b { font-weight: 700; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.admin-body { background: #efe7db; }
.admin-shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
  .side { background: linear-gradient(180deg, #6e1630, #1d3f78); color: #f6efe6; padding: 18px 14px; }
.side a { display: block; color: #f6efe6; text-decoration: none; padding: 10px 12px; border-radius: 10px; }
.side a.on, .side a:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.side .brand { padding: 0 0 8px; }
.side .brand h1, .side .brand small { color: #f6efe6; }
.admin-main { padding: 20px; min-width: 0; }
.page-head .btn-row { flex: none; }
.bill-card { margin-bottom: 14px; }
.bill-card h3 { margin: 8px 0; font-size: 16px; }
.plan-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) 88px 108px minmax(0, 1.4fr) auto auto; gap: 8px; align-items: end; margin: 12px 0; }
.plan-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); min-width: 0; }
.plan-grid .checkline { flex-direction: row; align-items: center; margin-bottom: 10px; color: inherit; font-size: 14px; }
.pay-config { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.pay-config textarea, .bill-card textarea { min-height: 88px; }
.draw-entry { margin: 0 0 12px; }
.summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.summary .card b { font-family: var(--serif); font-size: 28px; }
.login-card { width: min(420px, calc(100% - 28px)); margin: 0 auto 24px; padding: 22px 22px 18px; }
.page-head.center { margin-bottom: 10px; }
.auth-form .field { margin-bottom: 14px; }
.auth-form .field span { font-size: 13px; font-weight: 700; color: #6f5e4e; }
.auth-form input[type="text"],
.auth-form input[type="password"] {
  display: block; width: 100%; height: 46px; margin: 0; padding: 0 14px;
  border: 1px solid #e4d3b4; border-radius: 12px; background: #fff;
  font-size: 16px; line-height: 46px; box-shadow: none;
}
.auth-form .code-line { display: flex; gap: 8px; align-items: center; }
.auth-form .code-line input { flex: 1; min-width: 0; width: auto; }
.auth-form .code-line .btn { height: 46px; padding: 0 12px; white-space: nowrap; }
.auth-form .btn.primary { display: block; width: 100%; height: 46px; margin-top: 4px; }
.auth-extra { margin: 14px 0 0; text-align: center; font-size: 13px; }
.auth-links { display: flex; justify-content: space-between; align-items: center; margin: 12px 0 0; font-size: 13px; }
.auth-links button { border: 0; background: none; padding: 0; color: var(--red-deep); font-size: 13px; cursor: pointer; }
.addr-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.addr-pick select { min-width: 0; }
.wd-form { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.wd-form .field { margin: 0; }
.wd-ways { display: flex; flex-direction: column; gap: 8px; }
.wd-ways > span { color: var(--muted); font-size: 14px; }
.wd-ways .chips { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wd-ways .chip { height: 42px; font-size: 15px; }
.wd-form > .btn.primary { height: 44px; }
.rate-default { margin-bottom: 14px; }
.code-gen-line { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.code-gen-line .tag { flex: none; color: var(--muted); font-size: 13px; font-weight: 700; }
.code-gen-line .chip { position: relative; flex: none; display: inline-flex; align-items: center; margin: 0; cursor: pointer; }
.code-gen-line .chip input[type="radio"] { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.code-gen-line .btn { flex: none; }
.rate-line { display: flex; align-items: center; gap: 8px; }
.rate-line input[type="text"] { width: 72px; flex: none; text-align: center; padding: 8px 6px; }

@media (min-width: 901px) {
  .modal { align-self: center; border-radius: 18px; }
  .mask { align-items: center; }
}
@media (max-width: 900px) {
  input, select, textarea { font-size: 16px !important; }
  .nav-desk { display: none; }
  .tabbar { display: flex; }
  .topbar { width: 100%; border-radius: 0; border-left: 0; border-right: 0; box-shadow: none; }
  .topbar-main { padding: 12px 14px 14px; }
  .topbar .seal { width: 46px; height: 46px; font-size: 22px; }
  .topbar .brand h1 { font-size: 22px; white-space: nowrap; }
  .topbar .brand small { display: none; }
  .goodnews, .goodnews-track, .goodnews-track > div, .goodnews-track span { height: 30px; min-height: 30px; max-height: 30px; line-height: 30px; }
  .goodnews { font-size: 13px; }
  .topbar .userbox { flex-shrink: 0; }
  .wrap { margin-bottom: 28px; }
  .footer { padding-bottom: calc(108px + env(safe-area-inset-bottom, 0px)); }
  .grid-2, .grid-3, .grid-4, .split, .stat-grid, .summary, .admin-shell { grid-template-columns: 1fr; }
  .heat { grid-template-columns: repeat(6, 1fr); }
  .trend-scroll { max-height: calc(100vh - 300px); }
  .pick-live { top: 64px; }
  .page-head h2 { font-size: 20px; }
  .hist-head { flex-direction: column; align-items: stretch; padding: 14px; }
  .hist-search { flex: none; min-width: 0; width: 100%; }
  .addr-pick { grid-template-columns: 1fr; }
  .pick-trend .trend-scroll { max-height: 220px; }
  .zone-trends { grid-template-columns: 1fr; }
  .plan-grid, .pay-config { grid-template-columns: 1fr; }
  .admin-body { overflow-x: hidden; }
  .admin-shell { display: block; min-width: 0; }
  .side {
    position: sticky; top: 0; z-index: 30;
    display: block; padding: 10px 10px 8px;
  }
  .side .brand { display: flex; align-items: center; gap: 8px; padding: 0 2px 8px; }
  .side .brand h1 { font-size: 18px; margin: 0; }
  .side .seal { width: 36px; height: 36px; font-size: 16px; }
  .side-links {
    display: flex; flex-wrap: wrap; gap: 6px;
  }
  .side-links a { flex: none; white-space: nowrap; padding: 8px 12px; background: rgba(255,255,255,.1); }
  .side-links a.on { background: #fff; color: #c8102e; font-weight: 700; }
  .admin-main { padding: 12px 12px 24px; overflow-x: hidden; }
  .admin-main .card, #shopAdmin, #drawRoot, #newsRoot, #userRoot, #codeRoot {
    max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
  .admin-main .page-head { flex-direction: column; align-items: stretch; }
  .admin-main .page-head .btn-row { width: 100%; }
  .admin-main .summary { grid-template-columns: 1fr 1fr; }
  #filterForm.admin-filters { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .rate-line { flex-wrap: wrap; }
  .admin-main table { width: max-content; min-width: 100%; font-size: 13px; }
  .admin-main th, .admin-main td { white-space: nowrap; padding: 8px 6px; }
  .modal { width: calc(100% - 12px); margin: 0 auto; }
}
