/* ===== 快乐8 遗漏统计 · 样式 ===== */
:root {
  --blue: #1678ff;
  --blue-dark: #0b5ed7;
  --blue-soft: #eef4ff;
  --blue-soft2: #e2edff;
  --red: #d9342b;
  --orange: #ef7d17;
  --green: #159a4a;
  --ink: #2b3445;
  --text: #3a4356;
  --muted: #8b95a7;
  --line: #e4e9f2;
  --line-strong: #d3dbe8;
  --bg: #f2f5f9;
  --card: #ffffff;
  --s1: #e8453c; --s2: #f0862a; --s3: #d9a72b; --s4: #2fa25c;
  --s5: #1fa39b; --s6: #2b78d6; --s7: #7551c4; --s8: #c4407f;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 13px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; color: var(--ink); }
button { font-family: inherit; font-size: 13px; cursor: pointer; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ===== 顶栏 ===== */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 10px 16px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 700; color: var(--ink); }
.brand .logo {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(135deg, var(--blue), #4aa3ff);
  color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700;
}
.brand small { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 2px; }
.tabs { display: flex; gap: 4px; background: var(--blue-soft); padding: 3px; border-radius: 9px; }
.tabs button {
  border: 0; background: transparent; color: var(--blue-dark);
  padding: 5px 14px; border-radius: 7px; font-size: 13px;
}
.tabs button.active { background: #fff; color: var(--blue-dark); font-weight: 600; box-shadow: 0 1px 3px rgba(22,120,255,.18); }
.topbar .spacer { flex: 1 1 auto; }
.data-meta { font-size: 12px; color: var(--muted); }
.data-meta b { color: var(--ink); font-weight: 600; }
.tb-actions { display: flex; gap: 8px; align-items: center; }

/* ===== 按钮 ===== */
.btn {
  border: 1px solid var(--line-strong); background: #fff; color: var(--text);
  padding: 5px 12px; border-radius: 7px; transition: .15s;
}
.btn:hover { border-color: var(--blue); color: var(--blue); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.btn.ghost { border-color: transparent; background: var(--blue-soft); color: var(--blue-dark); }
.btn.ghost:hover { background: var(--blue-soft2); }
.btn.sm { padding: 3px 9px; font-size: 12px; }

/* ===== 布局 ===== */
.wrap { padding: 14px 16px 40px; display: flex; flex-direction: column; gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.card-hd {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 14px; border-bottom: 1px solid var(--line);
}
.card-hd h3 { font-size: 14px; }
.card-hd .hint { font-size: 12px; color: var(--muted); }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sep { width: 1px; height: 20px; background: var(--line); margin: 0 2px; }
.label { font-size: 12px; color: var(--muted); }

/* ===== 分段控件 / 快捷排序 ===== */
.seg { display: inline-flex; flex-wrap: wrap; max-width: 100%; background: #f4f7fb; border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.seg button {
  border: 0; background: transparent; color: var(--text);
  padding: 4px 10px; border-radius: 6px; font-size: 12.5px; white-space: nowrap;
}
.seg button:hover { color: var(--blue); }
.seg button.active { background: #fff; color: var(--blue-dark); font-weight: 600; box-shadow: 0 1px 3px rgba(22,120,255,.16); }
.seg.sort button.active { background: var(--blue); color: #fff; box-shadow: none; }
.sortbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chips { display: flex; gap: 5px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line-strong); background: #fff; color: var(--text);
  border-radius: 20px; padding: 3px 10px; font-size: 12.5px;
}
.chip.on { background: var(--blue-soft2); border-color: #b9d7ff; color: var(--blue-dark); font-weight: 600; }
input[type="text"], input[type="number"], select, textarea {
  font-family: inherit; font-size: 13px; color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 7px; padding: 5px 9px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px rgba(22,120,255,.12); }

/* ===== 概览卡 ===== */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 13px; }
.stat .k { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 21px; font-weight: 700; color: var(--ink); margin-top: 3px; letter-spacing: -.3px; }
.stat .v small { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.stat .s { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ===== 号码球 / 分区色 ===== */
.ball {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  color: #fff; font-weight: 700; font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.ball.sm { width: 21px; height: 21px; font-size: 11.5px; }
.ball.lg { width: 40px; height: 40px; font-size: 17px; }
.s1 { background: var(--s1); } .s2 { background: var(--s2); } .s3 { background: var(--s3); } .s4 { background: var(--s4); }
.s5 { background: var(--s5); } .s6 { background: var(--s6); } .s7 { background: var(--s7); } .s8 { background: var(--s8); }
.s1t { color: var(--s1); } .s2t { color: var(--s2); } .s3t { color: var(--s3); } .s4t { color: var(--s4); }
.s5t { color: var(--s5); } .s6t { color: var(--s6); } .s7t { color: var(--s7); } .s8t { color: var(--s8); }

/* ===== 表格 ===== */
/* 表格容器：手机上浏览器地址栏会伸缩，100vh 不准，用 dvh 兜一层（不支持的浏览器自动忽略第二行） */
.tablewrap { overflow: auto; max-height: calc(100vh - 250px); max-height: calc(100dvh - 230px); border-radius: 0 0 10px 10px; }
table.grid { border-collapse: separate; border-spacing: 0; width: 100%; font-variant-numeric: tabular-nums; }
table.grid th, table.grid td { border-bottom: 1px solid var(--line); padding: 5px 8px; text-align: center; white-space: nowrap; }
table.grid thead th {
  position: sticky; top: 0; z-index: 5;
  background: var(--blue-soft); color: #42506b; font-weight: 600; font-size: 12.5px;
  border-bottom: 1px solid var(--line-strong);
  user-select: none;
}
table.grid thead th.sortable { cursor: pointer; }
table.grid thead th.sortable:hover { background: var(--blue-soft2); color: var(--blue-dark); }
table.grid thead th .arw { color: var(--blue); font-size: 11px; margin-left: 1px; }
table.grid thead th.active { background: var(--blue); color: #fff; }
table.grid thead th.active .arw { color: #fff; }
table.grid tbody tr:hover td { background: #f6faff; }
table.grid tbody tr.top3 td { background: #fffaf2; }
table.grid tbody tr.top3:hover td { background: #fff5e6; }
table.grid td.no { color: var(--muted); width: 46px; }
table.grid td.ballcell { width: 58px; }
table.grid td.omit { font-weight: 600; color: var(--ink); }
table.grid td.maxomit { font-weight: 700; color: var(--red); }
table.grid td.prob { font-weight: 700; color: var(--blue-dark); }
table.grid td.zero { color: var(--muted); font-weight: 400; }
/* 宸︿晶鍐荤粨鍒楋紙left 鍋忕Щ鐢辫剼鏈寜瀹為檯鍒楀鍔ㄦ€佽绠楋級 */
table.grid th.fix, table.grid td.fix,
table.trend th.fix, table.trend td.fix { position: sticky; }
table.grid th.fix, table.trend th.fix { z-index: 8; background: var(--blue-soft); }
table.grid td.fix, table.trend td.fix { z-index: 6; background: #fff; }
table.grid thead th.fix.active, table.trend thead th.fix.active { background: var(--blue); color: #fff; }
table.grid tbody tr:hover td.fix, table.trend tbody tr:hover td.fix { background: #f6faff; }
table.grid tbody tr.top3 td.fix { background: #fffaf2; }
.reachcell { display: flex; align-items: center; gap: 6px; justify-content: center; }
.reachcell .bar { width: 54px; margin: 0; }
.reachcell span { font-size: 11.5px; color: #7d8798; min-width: 34px; text-align: left; }

/* 进度条 / 迷你条 */
.bar { position: relative; height: 6px; width: 74px; background: #eef1f6; border-radius: 4px; margin: 0 auto; overflow: hidden; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #7fb4ff, var(--blue)); border-radius: 4px; }
.bar.hot > i { background: linear-gradient(90deg, #ffb066, var(--red)); }

.tag { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 5px; font-weight: 600; }
.tag.near { background: #ffece8; color: var(--red); }
.tag.warn { background: #fff3e2; color: var(--orange); }
.tag.hit { background: #eef2f7; color: var(--muted); }
.tag.cool { background: var(--blue-soft2); color: var(--blue-dark); }
.dots { display: inline-flex; gap: 2px; justify-content: center; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: #e6ebf3; display: block; }
.dots i.on { background: var(--blue); }

/* ===== 走势表 ===== */
table.trend { border-collapse: separate; border-spacing: 0; font-size: 11.5px; font-variant-numeric: tabular-nums; }
table.trend th, table.trend td { border-right: 1px solid #eef1f6; border-bottom: 1px solid #eef1f6; text-align: center; padding: 0; height: 24px; min-width: 24px; }
table.trend thead th { position: sticky; top: 0; z-index: 5; background: var(--blue-soft); color: #42506b; font-weight: 500; font-size: 11px; padding: 3px 2px; }
table.trend thead th.sortable { cursor: pointer; font-weight: 600; }
table.trend thead th.active { background: var(--blue); color: #fff; }
table.trend tbody tr:hover td { background: #f6faff; }
table.trend td.fix { white-space: nowrap; }
table.trend td.hit { padding: 0; }
table.trend td.hit span {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  color: #fff; font-weight: 700; font-size: 11px; margin: 1px;
}
table.trend td.omit1 { color: #6b7688; }
table.trend td.omit2 { color: #4f5f7d; }
table.trend td.omit3 { color: #35496e; font-weight: 600; }
table.trend td.omit4 { color: #1f3760; font-weight: 700; background: #f1f6ff; }
table.trend td.zone-end, table.trend th.zone-end { border-right: 1px solid #cfd8e6; }
table.trend td.cur { background: #fff8e8; font-weight: 700; color: var(--orange); }

/* ===== 抽屉（号码详情） ===== */
.drawer-mask { position: fixed; inset: 0; background: rgba(23,32,51,.45); opacity: 0; pointer-events: none; transition: .2s; z-index: 60; }
.drawer-mask.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 520px; max-width: 94vw;
  background: #fff; z-index: 61; box-shadow: -8px 0 28px rgba(23,32,51,.16);
  transform: translateX(102%); transition: transform .22s ease;
  display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.drawer-hd { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.drawer-hd .t { font-size: 15px; font-weight: 600; color: var(--ink); }
.drawer-hd .t small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.drawer-bd { padding: 14px 16px 40px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.close-x { margin-left: auto; border: 0; background: #f2f5f9; width: 28px; height: 28px; border-radius: 8px; color: var(--muted); font-size: 15px; }
.close-x:hover { background: #e6ebf3; color: var(--ink); }
.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kv .item { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
.kv .item .k { font-size: 11.5px; color: var(--muted); }
.kv .item .v { font-size: 17px; font-weight: 700; color: var(--ink); }
.kv .item .v small { font-size: 11px; color: var(--muted); font-weight: 400; }
h4.sec { font-size: 13px; color: var(--ink); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
h4.sec::before { content: ""; width: 3px; height: 13px; border-radius: 2px; background: var(--blue); display: block; }
.gaplist { display: flex; flex-direction: column; gap: 4px; }
.gapline { display: grid; grid-template-columns: 34px 1fr 118px; gap: 8px; align-items: center; font-size: 12px; }
.gapline .g { font-weight: 700; color: var(--red); text-align: right; }
.gapline .b { height: 14px; background: #f1f4f9; border-radius: 4px; overflow: hidden; }
.gapline .b > i { display: block; height: 100%; background: linear-gradient(90deg, #ffd0a8, var(--orange)); border-radius: 4px; }
.gapline .b > i.cur { background: linear-gradient(90deg, #ffbfb8, var(--red)); }
.gapline .m { color: var(--muted); font-size: 11.5px; }
.heat { display: flex; flex-wrap: wrap; gap: 3px; }
.heat i { width: 12px; height: 12px; border-radius: 3px; background: #eaeef5; }
.heat i.on { background: var(--blue); }
.heat i.cur { outline: 2px solid #ffd7a1; }

/* ===== 提示 / 弹层 ===== */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: rgba(28,38,58,.94); color: #fff; padding: 9px 16px; border-radius: 9px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: .22s; z-index: 90; max-width: 80vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.modal-mask { position: fixed; inset: 0; background: rgba(23,32,51,.45); z-index: 70; display: none; place-items: center; }
.modal-mask.open { display: grid; }
.modal { background: #fff; border-radius: 12px; width: 620px; max-width: 94vw; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.modal h3 { font-size: 15px; }
.modal textarea { width: 100%; height: 190px; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.modal .foot { display: flex; gap: 8px; justify-content: flex-end; }
.note { font-size: 12px; color: var(--muted); line-height: 1.8; }
.note code { background: #f2f5f9; padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: block; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #ccd5e2; border-radius: 6px; border: 2px solid #f2f5f9; }
::-webkit-scrollbar-thumb:hover { background: #b6c2d4; }
::-webkit-scrollbar-track { background: #f2f5f9; }
.hidden { display: none !important; }

/* ===== 站点外壳：板块导航 / 模块头部 / 数据来源 ===== */
.modnav { display: flex; gap: 4px; background: var(--blue-soft); padding: 3px; border-radius: 9px; flex-wrap: wrap; }
.modnav button {
  border: 0; background: transparent; color: var(--blue-dark); padding: 5px 13px;
  border-radius: 7px; font-size: 13px; display: inline-flex; align-items: center; gap: 5px;
}
.modnav button:hover { background: #fff; }
.modnav button.active { background: #fff; font-weight: 600; box-shadow: 0 1px 3px rgba(22,120,255,.18); }
.modnav button em { font-style: normal; font-size: 10px; color: #fff; background: #b9c4d6; border-radius: 4px; padding: 0 4px; line-height: 15px; }
.modnav button.active em { background: var(--orange); }
.module { display: flex; flex-direction: column; gap: 12px; }
.modhead {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px;
}
.modtitle { display: flex; align-items: baseline; gap: 9px; }
.modtitle h2 { font-size: 16px; }
.datasrc { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(21,154,74,.14); }
.dot.off { background: #c3ccda; }

/* ===== 红球 / 蓝球 配色（双色球、大乐透用；快乐8 继续使用 s1~s8 分区色） ===== */
.sr { background: #d9342b; }
.sb { background: #2b6fd6; }
.srt { color: #d9342b; }
.sbt { color: #2b6fd6; }
/* 大乐透后区、七星彩第 7 位等特殊号码，稍作区分 */
.sgold { background: linear-gradient(180deg, #e8a020, #c47a00); }

/* ===== 数字型彩种（福彩3D / 排列三）：位数字显示 ===== */
.sdg { background: linear-gradient(180deg, #46567a, #2b3445); }
.ball.digitball { border-radius: 9px; }

/* ===== 随机摇号 · 3D 摇奖机 ===== */
.btn.dice {
  border-color: #ffd18a; background: linear-gradient(135deg, #fff5e0, #ffe7c2); color: #8a5200; font-weight: 600;
  display: inline-flex; align-items: center; gap: 5px;
}
.btn.dice:hover { border-color: #f5a623; color: #7a4700; background: linear-gradient(135deg, #fff0d3, #ffdda5); }
.btn.dice span { font-size: 14px; }

.dm-mask { background: radial-gradient(120% 90% at 50% 0%, rgba(20, 34, 64, .88), rgba(5, 9, 17, .93)); }
.dm {
  width: 760px; max-width: 96vw; max-height: 94vh; overflow: auto;
  background: linear-gradient(180deg, #16233d 0%, #0d1526 58%, #0a1120 100%);
  border: 1px solid rgba(120, 165, 255, .24); border-radius: 18px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .06);
  color: #e6edfb; display: flex; flex-direction: column; gap: 13px; padding: 0 0 14px;
}
.dm-hd { display: flex; align-items: center; gap: 12px; padding: 14px 16px 0; }
.dm-title { display: flex; align-items: center; gap: 10px; }
.dm-icon {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 17px;
  background: linear-gradient(135deg, #ffd76a, #e8453c); box-shadow: 0 6px 18px rgba(232, 69, 60, .35);
}
.dm-title b { font-size: 15px; color: #fff; }
.dm-title small { display: block; color: #93a4c4; font-size: 12px; margin-top: 3px; }
.dm .close-x { margin-left: auto; background: rgba(255, 255, 255, .08); color: #b9c6dd; }
.dm .close-x:hover { background: rgba(255, 255, 255, .16); color: #fff; }

/* ---- 舞台：聚光灯 + 旋转光束 + 3D 滚筒 ---- */
.dm-stage {
  position: relative; margin: 0 16px; border-radius: 14px; overflow: hidden;
  background: radial-gradient(90% 70% at 50% 10%, #23375f 0%, #16233d 44%, #0b1424 100%);
  border: 1px solid rgba(120, 165, 255, .18);
  padding: 16px 14px 20px; display: flex; flex-direction: column; align-items: center; gap: 16px;
  perspective: 1100px; perspective-origin: 50% 40%;
}
.dm-spot {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(38% 46% at 50% 20%, rgba(255, 236, 178, .22), transparent 70%);
}
.dm-beam {
  position: absolute; left: 50%; top: -330px; width: 740px; height: 740px; margin-left: -370px; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .13) 0deg 5deg, transparent 5deg 30deg);
  opacity: .55; animation: dm-beam 30s linear infinite;
  -webkit-mask-image: radial-gradient(closest-side, #000 18%, transparent 72%);
  mask-image: radial-gradient(closest-side, #000 18%, transparent 72%);
}
@keyframes dm-beam { to { transform: rotate(360deg); } }

.dm-machine { position: relative; width: 320px; height: 200px; display: grid; place-items: center; transform-style: preserve-3d; }
.dm-machine::after {
  content: ''; position: absolute; bottom: 6px; width: 200px; height: 42px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(120, 170, 255, .3), transparent 72%); filter: blur(1px);
}
.dm-drum { position: absolute; width: 120px; height: 120px; transform-style: preserve-3d; animation: dm-turn 3.6s linear infinite; }
.dm-machine.spinning .dm-drum { animation-duration: 1.1s; }
.dm-machine.slow .dm-drum { animation-duration: 2.6s; }
@keyframes dm-turn {
  from { transform: rotateX(14deg) rotateY(0deg); }
  to { transform: rotateX(14deg) rotateY(360deg); }
}

.dmb.drum {
  position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 12.5px;
  font-variant-numeric: tabular-nums; backface-visibility: visible;
  box-shadow: inset -3px -4px 9px rgba(0, 0, 0, .38), inset 3px 3px 7px rgba(255, 255, 255, .34), 0 2px 9px rgba(0, 0, 0, .35);
}
.dmb.drum.rolling { filter: blur(.4px); }

.dm-cage { position: absolute; inset: 0; pointer-events: none; transform-style: preserve-3d; animation: dm-turn 3.6s linear infinite; }
.dm-machine.spinning .dm-cage { animation-duration: 1.1s; }
.dm-machine.slow .dm-cage { animation-duration: 2.6s; }
.dm-cage::before, .dm-cage::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 252px; height: 252px; margin: -126px 0 0 -126px;
  border-radius: 50%; border: 1px solid rgba(150, 190, 255, .22);
}
.dm-cage::before { transform: rotateX(78deg) rotateY(0deg); }
.dm-cage::after { transform: rotateX(78deg) rotateY(62deg); }
.dm-cage { opacity: .9; }
.dm-dome {
  position: absolute; width: 212px; height: 212px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 34% 26%, rgba(255, 255, 255, .17), rgba(255, 255, 255, .03) 42%, transparent 63%);
  box-shadow: inset 0 0 44px rgba(140, 190, 255, .17), 0 0 0 1px rgba(150, 190, 255, .1);
}

/* ---- 结果位 ---- */
.dm-slots { position: relative; z-index: 3; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; align-items: flex-end; min-height: 66px; }
.dmg { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.dmg-name { font-size: 11.5px; color: #93a4c4; letter-spacing: .5px; }
.dmg-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.dmslot { position: relative; display: grid; place-items: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.dmslot.ballb {
  width: 44px; height: 44px; border-radius: 50%; color: #fff; font-size: 16px;
  box-shadow: inset -3px -5px 10px rgba(0, 0, 0, .35), inset 3px 3px 8px rgba(255, 255, 255, .34), 0 4px 13px rgba(0, 0, 0, .38);
}
.dmslot.digit {
  width: 50px; height: 62px; border-radius: 12px; font-size: 30px; color: #ffd76a;
  background: linear-gradient(180deg, #22304e, #131d31); border: 1px solid rgba(255, 215, 106, .28);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, .5), 0 4px 14px rgba(0, 0, 0, .35);
}
.dmslot.empty { background: rgba(255, 255, 255, .06); border: 1px dashed rgba(150, 190, 255, .3); box-shadow: none; }
.dmslot.rolling { animation: dm-jitter .16s linear infinite; }
@keyframes dm-jitter {
  0% { transform: translateY(-2px) scale(.985); }
  50% { transform: translateY(2px) scale(1.015); }
  100% { transform: translateY(-2px) scale(.985); }
}
.dmslot.locked { animation: dm-lock .52s cubic-bezier(.18, 1.5, .35, 1); }
@keyframes dm-lock {
  0% { transform: scale(2) rotateY(75deg); opacity: .1; }
  55% { transform: scale(.9) rotateY(-10deg); opacity: 1; }
  100% { transform: scale(1) rotateY(0deg); opacity: 1; }
}
.dmslot.locked::after {
  content: ''; position: absolute; inset: -9px; border-radius: inherit;
  border: 2px solid rgba(255, 255, 255, .9); animation: dm-ring .6s ease-out forwards;
}
@keyframes dm-ring { from { transform: scale(.65); opacity: .9; } to { transform: scale(1.7); opacity: 0; } }

.dm-burst { position: absolute; left: 50%; top: 62%; width: 0; height: 0; z-index: 5; pointer-events: none; }
.dm-burst i {
  position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 2px;
  background: linear-gradient(135deg, #ffd76a, #ff8a3d); animation: dm-spark .9s ease-out forwards;
}
@keyframes dm-spark {
  from { transform: translate(0, 0) scale(1) rotate(0deg); opacity: 1; }
  to { transform: translate(var(--dx), var(--dy)) scale(.2) rotate(220deg); opacity: 0; }
}

/* ---- 底部：玩法 / 按钮 / 记录 ---- */
.dm-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; padding: 0 16px; }
.dm-hint { font-size: 12px; color: #93a4c4; }
.dm-opts { display: inline-flex; gap: 3px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(140, 180, 255, .16); border-radius: 9px; padding: 3px; }
.dm-opts button { border: 0; background: transparent; color: #c3d2ee; padding: 4px 9px; border-radius: 7px; font-size: 12px; }
.dm-opts button:hover { color: #fff; }
.dm-opts button.on { background: linear-gradient(135deg, #ffd76a, #f5a623); color: #3a2a06; font-weight: 700; }
.dm-actions { display: flex; gap: 10px; justify-content: center; padding: 0 16px; }
.dm .btn.primary {
  background: linear-gradient(135deg, #ff8a3d, #e8453c); border-color: transparent; color: #fff;
  padding: 8px 28px; font-size: 14px; border-radius: 10px; box-shadow: 0 8px 22px rgba(232, 69, 60, .35);
}
.dm .btn.primary:hover { background: linear-gradient(135deg, #ff9c58, #f05147); }
.dm .btn.primary:disabled { opacity: .55; cursor: default; box-shadow: none; }
.dm .btn.ghost { background: rgba(255, 255, 255, .08); color: #d6e2f8; }
.dm .btn.ghost:hover { background: rgba(255, 255, 255, .15); color: #fff; }
.dm .btn.ghost:disabled { opacity: .4; cursor: default; }
.dm-spin.busy { animation: dm-pulse 1s ease-in-out infinite; }
@keyframes dm-pulse { 50% { transform: scale(1.04); } }
.dm-hist { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 0 16px; font-size: 12px; color: #93a4c4; }
.dm-hist b { color: #c3d2ee; font-weight: 600; }
.dm-hitem { background: rgba(255, 255, 255, .07); border: 1px solid rgba(140, 180, 255, .14); border-radius: 7px; padding: 2px 8px; color: #d6e2f8; }
.dm-tip { font-size: 11.5px; color: #6c7c99; text-align: center; padding: 0 16px; line-height: 1.7; }

@media (prefers-reduced-motion: reduce) {
  .dm-beam, .dm-drum, .dm-cage, .dmslot.rolling, .dm-spin.busy { animation: none !important; }
}

/* ---- 3D 摇奖机（Three.js）：画布占舞台上半部分，CSS 版滚筒留作离线兜底 ---- */
.dm-canvas { display: none; }
.dm-stage.webgl { min-height: 470px; justify-content: flex-end; }
.dm-stage.webgl .dm-machine { display: none; }
.dm-stage.webgl .dm-canvas { display: block; }
/* 3D 还在下载：先盖住 CSS 版滚筒，避免第一次打开闪一下旧动画 */
.dm-loading {
  display: none; position: absolute; inset: 0; z-index: 4;
  flex-direction: column; gap: 12px; align-items: center; justify-content: center;
  color: #93a4c4; font-size: 12.5px; letter-spacing: .5px;
}
.dm-stage.loading { min-height: 470px; }
.dm-stage.loading .dm-machine { display: none; }
.dm-stage.loading .dm-loading { display: flex; }
.dm-loading i {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid rgba(150, 190, 255, .2); border-top-color: #6ea8ff;
  animation: dm-loading-turn .9s linear infinite;
}
@keyframes dm-loading-turn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .dm-loading i { animation-duration: 2.6s; } }
@media (max-width: 640px) {
  .dm-stage.webgl { min-height: 400px; }

  /* 分段控件换行后按钮变多，留一点缝让手指好点 */
  .seg { gap: 2px; }
  .seg button { padding: 6px 10px; }

  /* 统计范围那一排按钮在小屏会占两三行，收一点内边距别太占地方 */
  .card-hd { padding: 8px 12px; gap: 8px; }
  .wrap { padding: 10px 12px 32px; }
}