/* 大字、高对比、大按钮、触屏友好 */
:root {
  --bg: #fff7e8;
  --bg2: #ffe9c7;
  --card: #ffffff;
  --ink: #1d2433;
  --ink-soft: #4a5468;
  --accent: #ff5d73;
  --accent-ink: #ffffff;
  --go: #13a36b;
  --line: #1d2433;
  --sel: #ffd23f;
  --focus: #3a86ff;
  --radius: 22px;
  font-size: 18px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 20% 0%, #fffdf6 0, var(--bg) 45%, var(--bg2) 100%) fixed;
  min-height: 100vh; min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.5;
}
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
button:focus-visible, a:focus-visible { outline: 4px solid var(--focus); outline-offset: 3px; }
svg { display: block; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; max-width: 900px; margin: 0 auto;
}
.topbar .title { flex: 1; min-width: 0; font-size: 1.25rem; font-weight: 800; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  width: 52px; height: 52px; flex: none; border-radius: 16px;
  border: 3px solid var(--line); background: var(--card);
  display: grid; place-items: center; padding: 0; font-weight: 800; font-size: .95rem;
  box-shadow: 0 4px 0 var(--line); transition: transform .08s;
  text-decoration: none; color: var(--ink);
}
.icon-btn svg { width: 28px; height: 28px; }
.icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.icon-btn[aria-pressed="true"].toggle { background: var(--sel); }

.big-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 64px; padding: 0 28px; border-radius: 999px;
  border: 3px solid var(--line); background: var(--accent); color: var(--accent-ink);
  font-size: 1.3rem; font-weight: 800; box-shadow: 0 5px 0 var(--line);
  text-decoration: none; transition: transform .08s, opacity .2s;
}
.big-btn svg { width: 30px; height: 30px; }
.big-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--line); }
.big-btn.secondary { background: var(--card); color: var(--ink); }
.big-btn.go { background: var(--go); }
.big-btn:disabled { opacity: .35; cursor: default; transform: none; box-shadow: 0 5px 0 var(--line); }

/* ---------- 首页 ---------- */
.hub { max-width: 900px; margin: 0 auto; padding: 8px 16px 40px; }
.hub h1 { font-size: 2.2rem; margin: 8px 0 0; text-align: center; }
.hub .sub { text-align: center; color: var(--ink-soft); margin: 4px 0 24px; font-size: 1.1rem; }
.cards { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.card {
  background: var(--card); border: 3px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 6px 0 var(--line); padding: 18px; display: flex; flex-direction: column; gap: 12px;
  text-decoration: none; color: inherit;
}
.card .art { height: 120px; display: flex; align-items: center; justify-content: center; gap: 4px; }
.card .art svg { width: 56px; height: 56px; }
.card h2 { margin: 0; font-size: 1.4rem; }
.card p { margin: 0; color: var(--ink-soft); }
.card.soon { opacity: .55; box-shadow: none; border-style: dashed; }
.card .tag { align-self: flex-start; font-weight: 800; padding: 4px 14px; border-radius: 999px; background: var(--bg2); }
.card:not(.soon) .tag { background: var(--accent); color: #fff; }
.footer { text-align: center; color: var(--ink-soft); margin-top: 32px; font-size: .95rem; }
.footer a { color: inherit; }


/* ---------- 游戏页通用 ---------- */
.game { max-width: 900px; margin: 0 auto; padding: 0 16px 24px; display: flex; flex-direction: column; gap: 12px; }

/* ---------- 弹窗 ---------- */
dialog {
  border: 3px solid var(--line); border-radius: 28px; padding: 24px; max-width: min(560px, calc(100vw - 32px));
  width: 100%; background: var(--card); color: var(--ink); box-shadow: 0 8px 0 var(--line);
  max-height: calc(100dvh - 32px);
}
dialog::backdrop { background: rgba(29, 36, 51, .45); }
dialog h2 { margin: 0 0 8px; font-size: 1.9rem; text-align: center; }
dialog .face { width: 110px; height: 110px; margin: 0 auto 8px; }
dialog .tip { font-size: 1.2rem; font-weight: 700; text-align: center; background: var(--bg); border-radius: 18px; padding: 14px; margin: 12px 0; }
dialog .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
dialog.math { max-width: min(680px, calc(100vw - 32px)); }
dialog.math h3 { margin: 18px 0 4px; font-size: 1.25rem; }
dialog.math p { margin: 6px 0; font-size: 1.05rem; }
.levels-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 12px; margin-top: 12px; }
.lv-btn {
  height: 76px; border-radius: 20px; border: 3px solid var(--line); background: var(--card);
  font-size: 1.6rem; font-weight: 800; box-shadow: 0 4px 0 var(--line); position: relative;
}
.lv-btn.done { background: #c9f2dc; }
.lv-btn.current { background: var(--sel); }
.lv-btn:disabled { opacity: .35; box-shadow: none; }
.lv-btn small { position: absolute; bottom: 3px; left: 0; right: 0; font-size: .7rem; letter-spacing: 2px; }
dialog.rules h3 { margin: 16px 0 4px; font-size: 1.25rem; }
.rules-list { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 10px; counter-reset: r; }
.rules-list li { display: flex; align-items: center; gap: 12px; font-size: 1.1rem; font-weight: 700; background: var(--bg); border-radius: 18px; padding: 10px 12px; }
.rule-art { flex: none; width: 76px; height: 56px; display: flex; align-items: center; justify-content: center; gap: 2px; }
.rule-art svg { width: 36px; height: 36px; }
.fx-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 1000; }

@media (max-width: 520px) {
  :root { font-size: 16px; }
  .topbar { gap: 6px; padding: 10px 12px; }
  .topbar .title { font-size: 1.05rem; }
  .icon-btn { width: 46px; height: 46px; border-radius: 14px; }
  .icon-btn svg { width: 24px; height: 24px; }
}
/* 用户开了「减少动态效果」：不做任何动画（尤其不要无限循环的动画） */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- 鸽子与糖果 ---------- */
.ask-row { display: flex; align-items: center; gap: 12px; }
.ask { flex: 1; margin: 0; font-size: 1.35rem; line-height: 1.35; }
.status { margin: 0; min-height: 1.6em; font-weight: 800; font-size: 1.1rem; text-align: center; }
.status.warn { color: #c2253f; }
.status.info { color: #1d5fc9; }
.status.soft { color: var(--ink-soft); font-weight: 700; }
.pboard {
  background: rgba(255, 255, 255, .65); border: 3px solid var(--line); border-radius: var(--radius);
  padding: 14px; min-height: 240px; display: flex; flex-direction: column; gap: 14px; justify-content: center;
}
.pbar { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.pactions, .least-ctrl { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }
.icon-btn.hint, .big-btn.hint { outline: 4px solid var(--g1, #ff8c1a); outline-offset: 3px; }
.icon-btn:disabled { opacity: .35; cursor: default; box-shadow: none; transform: none; }
.small-txt { font-size: 1rem; }
.n-val { min-width: 2.4em; text-align: center; font-size: 2rem; }

/* 第一章：电线上的鸽子 + 窝 */
.wire { min-height: 56px; display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; align-items: flex-end;
  border-bottom: 3px solid #7a8396; padding-bottom: 2px; }
.witem svg { width: 50px; height: 42px; }
.nests { display: grid; gap: 10px; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); }
.nest-wrap { display: flex; flex-direction: column; align-items: center; border-radius: 18px; padding: 6px 2px 0; cursor: pointer; }
.nest-wrap.over { background: repeating-linear-gradient(135deg, #ffe36e 0 10px, #fff3b0 10px 20px); }
.nest-wrap.glow { outline: 4px solid #ff8c1a; outline-offset: 2px; }
.nest-in { display: flex; flex-wrap: wrap-reverse; justify-content: center; align-items: flex-end; gap: 2px; min-height: 48px; margin-bottom: -10px; position: relative; z-index: 1; }
.pitem { padding: 0; border: 0; background: none; border-radius: 10px; }
.pitem svg { width: 46px; height: 38px; }
.pitem.extra { background: rgba(255, 93, 115, .3); }
.slot { width: 40px; height: 34px; border: 3px dashed #a39b8b; border-radius: 50%; margin: 2px 3px; }
.nest-btn { width: 100%; max-width: 130px; padding: 0; border: 0; background: none; position: relative; text-align: center; }
.nest-btn svg { width: 100%; height: auto; }
.nest-btn .cnt { display: block; font-weight: 800; font-size: .95rem; white-space: nowrap; }
.nest-wrap.over .cnt { color: #c2253f; }

/* 第二章：分糖 */
.pool { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pool-sweets, .plate { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; }
.pool-sweets { min-height: 30px; }
.psweet svg { width: 32px; height: 24px; }
.pool-n { font-size: 1.15rem; }
.kids { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.kid { display: flex; flex-direction: column; align-items: center; gap: 6px; background: var(--card); border: 3px solid var(--line); border-radius: 20px; padding: 8px 6px; }
.kid > svg { width: 64px; height: 64px; }
.kid.same { box-shadow: 0 0 0 6px var(--sel); }
.kid .plate { min-height: 28px; max-width: 120px; }
.kid .plate .psweet svg { width: 24px; height: 18px; }
.kid .amt { font-size: 2rem; line-height: 1; }
.kid .pm { display: flex; gap: 8px; }
.kid .pm .icon-btn { width: 48px; height: 48px; }

/* 第三章：楼梯 + 比一比 */
.least-top { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.faces { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; }
.faces .face svg { width: 34px; height: 34px; }
.faces .more { font-weight: 800; margin-left: 4px; }
.kid-n { font-size: 1.3rem; }
.stair { width: 100%; max-height: 170px; }
.stair-note { margin: 0; text-align: center; color: var(--ink-soft); font-weight: 700; }
.compare { display: flex; flex-direction: column; gap: 8px; }
.cmp-row { display: flex; flex-direction: column; gap: 2px; font-weight: 700; }
.cmp-head { display: flex; justify-content: space-between; gap: 8px; }
.cmp-head b { font-size: 1.15rem; }
.cmp-track { height: 22px; border: 3px solid var(--line); border-radius: 999px; background: #fff; overflow: hidden; }
.cmp-bar { height: 100%; }
.cmp-bar.need { background: #2ec4b6; }
.cmp-bar.need.over { background: #ff5d73; }
.cmp-bar.have { background: #ffb627; }
.verdict { margin: 0; text-align: center; font-size: 1.2rem; font-weight: 800; padding: 6px 10px; border-radius: 14px; }
.verdict small { display: block; font-size: .9rem; font-weight: 700; color: var(--ink-soft); }
.verdict.ok { background: #d6f5ec; }
.verdict.forced { background: #ffe0e5; }

/* 奥数真题卡片 */
.oly-card { background: #fffbe6; border: 3px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: 0 5px 0 var(--line); }
.oly-source { margin: 0 0 8px; font-size: .9rem; font-weight: 800; color: #8a5a00; }
.oly-q { margin: 0; font-size: 1.1rem; font-weight: 700; }
.oly-note { margin: 8px 0 0; font-size: .9rem; color: var(--ink-soft); }
.oly-src-small { font-size: .9rem; font-weight: 800; color: #8a5a00; background: #fffbe6; border-radius: 12px; padding: 8px 12px; }

/* 弹窗里的小零件 */
.lv-chapter { margin: 14px 0 0; font-size: 1.15rem; }
.lv-btn svg { width: 34px; height: 34px; margin: 0 auto; }
dialog .face svg { width: 100%; height: 100%; }
.rule-art { width: 96px; }
.rule-art svg { width: 40px; height: 34px; }
.rule-art .arrow { font-weight: 800; }
.pm-demo, .nope-demo { display: flex; gap: 4px; }
.pm-demo svg, .nope-demo svg { width: 28px; height: 28px; }

/* 解答、想一想：没有游戏的关卡 */
.lesson { display: flex; flex-direction: column; gap: 12px; }
.lesson-art { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.lesson-text, .lesson-q { margin: 0; font-size: 1.15rem; font-weight: 700; line-height: 1.6; }
.art-nests .nest-wrap { cursor: default; }
.art-nests { max-width: 420px; margin: 0 auto; width: 100%; }
.art-kids .kid { padding: 6px 4px; }
.art-kids .kid > svg { width: 48px; height: 48px; }
.art-formula { margin: 0; text-align: center; font-size: 1.3rem; font-weight: 800; }
.art-formula .teal { color: #13866f; }
.big-answer { margin: 0; text-align: center; font-size: 2.2rem; font-weight: 900; color: #c2253f; }
.reveal { margin: 0; padding: 10px 14px; border-radius: 16px; font-size: 1.1rem; font-weight: 700; }
.reveal b { display: block; font-size: .95rem; }
.hint-box { background: #e3eeff; }
.answer-box { background: #d6f5ec; }
.big-btn.toggle-big[aria-pressed="true"] { background: var(--sel); }
.drawer { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; padding: 12px; border: 3px solid var(--line); border-radius: 12px; background: #e9d2b4; max-width: 320px; margin: 0 auto; box-shadow: inset 0 -10px 0 #d2b38c; }
.sock { width: 30px; height: 38px; }
.sock-boxes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 360px; margin: 0 auto; width: 100%; }
.sock-box { display: flex; justify-content: center; gap: 2px; padding: 10px 4px; border: 3px solid var(--line); border-radius: 12px; background: #fff; min-height: 70px; }
.sock.pop { outline: 3px dashed #c2253f; outline-offset: 2px; border-radius: 8px; }
.tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.ntile { display: inline-grid; place-items: center; width: 42px; height: 42px; border: 3px solid var(--line); border-radius: 12px; background: #fff; font-weight: 800; font-size: 1.15rem; }
.ntile.picked { background: var(--sel); }
.ntile.sixth { background: #ffb3c0; outline: 3px dashed #c2253f; outline-offset: 2px; }
.ntile.clash { background: #ffe0e5; text-decoration: line-through; }
.pair-boxes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.pair-box { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 2px; border: 3px solid var(--line); border-radius: 12px; background: #fff7e8; }
.pair-box small { font-weight: 800; color: var(--ink-soft); }
.hands { width: 100%; max-width: 230px; margin: 0 auto; }

@media (max-width: 520px) {
  .ask { font-size: 1.15rem; }
  .pboard { padding: 10px 8px; }
  .nests { gap: 4px; }
  .pitem svg { width: 36px; height: 30px; }
  .slot { width: 30px; height: 26px; }
  .witem svg { width: 40px; height: 34px; }
  .kids { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 6px; }
  .kid > svg { width: 52px; height: 52px; }
  .kid .pm .icon-btn { width: 42px; height: 42px; }
  .kids-4 .kids { grid-template-columns: repeat(2, 1fr); }
  .oly-q { font-size: 1rem; }
  .lesson-text, .lesson-q { font-size: 1.05rem; }
  .pair-boxes { gap: 3px; }
  .ntile { width: 36px; height: 36px; font-size: 1rem; }
  .pair-box .ntile { width: 34px; }
  .oly-card { padding: 10px 12px; }
  .n-val { font-size: 1.6rem; }
}
.hub-nest { display: flex; flex-wrap: wrap; justify-content: center; width: 100px; }
.card .art .hub-nest svg { width: 44px; height: 38px; }
.card .art .hub-nest svg:last-child { width: 96px; height: 42px; margin-top: -8px; }
.kids.art-kids { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.art-kids .plate .psweet svg { width: 18px; height: 14px; }
.portrait { margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.portrait svg { width: 170px; height: auto; }
.portrait figcaption { font-size: .9rem; font-weight: 700; color: var(--ink-soft); text-align: center; }

/* ---------- 公平切蛋糕 ---------- */
.cut-board { padding: 8px; }
.csvg { width: 100%; max-width: 560px; margin: 0 auto; aspect-ratio: 1; touch-action: none; display: block; user-select: none; -webkit-user-select: none; }
.csvg .cut { stroke: #1d2433; stroke-width: .9; stroke-linecap: round; }
.csvg .cut.helper { stroke: #6b7280; stroke-width: .45; stroke-dasharray: 1.6 1.1; }
.csvg .cut.helper.last { stroke: #1d2433; stroke-width: .7; stroke-dasharray: none; }
.csvg .cut.win { stroke: #e63946; stroke-width: 1.2; stroke-dasharray: none; }
.csvg .pt { fill: #3a86ff; stroke: #fff; stroke-width: .5; }
.csvg .pt.sel { fill: #ffd23f; stroke: #1d2433; stroke-width: .6; }
.csvg .pt.glow { fill: #ff8c1a; stroke: #1d2433; stroke-width: .5; r: 2.2; }
.csvg .hint-ring { fill: none; stroke: #ff8c1a; stroke-width: .8; stroke-dasharray: 1.4 1; }
.reveal-wrap { display: flex; flex-direction: column; gap: 8px; }
.read-art { width: 220px; max-width: 70vw; height: auto; }
.card .art #cut-art svg, #cut-art svg { width: 120px; height: 100px; }
.portrait-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.portrait-row .portrait svg { width: 100%; max-width: 160px; }
.portrait figcaption b { display: block; color: var(--ink); }
.portrait figcaption span { font-weight: 600; }

/* ---------- 加一的秘密 ---------- */
.wheels { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; max-width: 480px; margin: 0 auto; width: 100%; }
.wheel { display: flex; flex-direction: column; align-items: center; gap: 4px; background: #1d2433; border-radius: 14px; padding: 6px 2px; }
.wheel .dg { font-size: 2.2rem; line-height: 1.1; color: #fff; font-variant-numeric: tabular-nums; }
.wheel.lead .dg { color: #66708a; }
.wheel .wbtn { width: 40px; height: 36px; border-radius: 10px; box-shadow: 0 3px 0 var(--line); }
.wheel .wbtn svg { width: 22px; height: 22px; }
.wheels.locked .wbtn { visibility: hidden; }
.sums { display: flex; flex-direction: column; gap: 8px; }
.srow { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 8px 12px; }
.slabel { font-size: 1.05rem; min-width: 8.5em; }
.slabel b { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.sdigits { font-weight: 700; font-variant-numeric: tabular-nums; }
.sdigits i { font-style: normal; color: var(--ink-soft); margin: 0 2px; }
.sdigits b { font-size: 1.25rem; }
.sdigits .nine, .odo .nine { background: #ffe36e; border-radius: 4px; }
.sdigits .zero, .odo .zero { background: #cfe0ff; border-radius: 4px; }
.sdigits .plus, .odo .plus { background: #c9f2dc; border-radius: 4px; }
.badge { font-weight: 800; font-size: .9rem; border-radius: 999px; padding: 1px 10px; }
.badge.ok { background: #c9f2dc; color: #0d6b45; }
.badge.no { background: #ffe0e5; color: #a01a33; }
.change { margin: 0; text-align: center; font-weight: 800; font-size: 1.15rem; }
.change b { font-size: 1.6rem; }
.change.down b { color: #c2253f; }
.change.up b { color: #13866f; }
.odo { display: inline-flex; gap: 3px; font-weight: 900; font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.odo span { display: inline-block; min-width: 1.1em; text-align: center; border: 2px solid var(--line); border-radius: 6px; background: #fff; }
.odo.big { font-size: 2rem; justify-content: center; width: 100%; height: 100%; align-items: center; }
#digit-art { flex-direction: column; gap: 2px; }
#digit-art .odo { font-size: 1.3rem; }
.odo-arrow { color: #c2253f; }
.carry-art { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; }
.carry-arrow { font-weight: 900; color: #c2253f; font-size: 1.2rem; }
.mod-table { border-collapse: collapse; margin: 0 auto; font-weight: 700; text-align: center; }
.mod-table th, .mod-table td { border: 2px solid var(--line); padding: 4px 10px; }
.mod-table th { font-size: .85rem; background: var(--bg2); }
.mod-table tr.hit td { background: #c9f2dc; font-weight: 900; }
@media (max-width: 520px) {
  .wheels { gap: 3px; }
  .wheel .dg { font-size: 1.7rem; }
  .wheel .wbtn { width: 38px; height: 34px; }
  .slabel { min-width: 0; }
}



/* ---------- 加号游戏 ---------- */
.ones { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; row-gap: 8px; max-width: 560px; margin: 0 auto; }
.one { display: inline-grid; place-items: center; width: 28px; height: 44px; font-size: 1.7rem; font-weight: 900; font-variant-numeric: tabular-nums; border-radius: 8px; }
.one.b0 { background: #ffe9a8; }
.one.b1 { background: #cfe0ff; }
.gap { width: 24px; height: 44px; padding: 0; border: 0; background: transparent; border-radius: 6px; font-size: 1.5rem; font-weight: 900; color: #e63946; position: relative; }
.gap:not(.on)::after { content: ""; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; background: #9aa3b5; }
.gap.on { background: #ffe0e5; }
.ones:not(.locked) .gap:hover { background: #fff3c4; }
.ones.demo .one { width: 18px; height: 28px; font-size: 1.1rem; }
.ones.demo .gap { width: 12px; height: 28px; font-size: 1rem; display: inline-grid; place-items: center; }
.counts { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.crow { display: flex; align-items: center; gap: 8px; }
.crow .rep { min-width: 3.2em; text-align: right; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.crow .times { font-weight: 800; color: var(--ink-soft); }
.crow .cval { min-width: 2.6em; text-align: center; font-size: 1.5rem; }
.crow.singles { border-top: 2px dashed #9aa3b5; padding-top: 6px; }
.crow.singles.bad .cval { color: #c2253f; }
.cnote { color: var(--ink-soft); font-weight: 700; }
.psum { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.pieces { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; align-items: center; font-weight: 800; }
.pieces i { font-style: normal; color: #e63946; }
.piece { background: #fff; border: 2px solid var(--line); border-radius: 999px; padding: 0 10px; font-variant-numeric: tabular-nums; }
.meters { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.meter { display: flex; flex-direction: column; align-items: center; background: #fff; border: 3px solid var(--line); border-radius: 16px; padding: 4px 16px; min-width: 120px; }
.meter span { font-weight: 800; font-size: .9rem; color: var(--ink-soft); }
.meter b { font-size: 1.8rem; font-variant-numeric: tabular-nums; }
.meter small { font-weight: 700; color: var(--ink-soft); }
.meter.hit { background: #c9f2dc; }
.meter.over { background: #ffe0e5; }
.win-plus { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; }
.win-plus b { font-size: 2.4rem; }
.win-plus span { font-weight: 800; color: #e63946; }
.win-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; height: 100%; align-content: center; }
.win-chips span { display: grid; place-items: center; height: 32px; border: 2px solid var(--line); border-radius: 8px; background: #c9f2dc; font-weight: 900; font-size: 1rem; }
#plus-art { flex-direction: column; gap: 6px; }
.plus-eq { font-size: 1rem; }
@media (max-width: 520px) {
  .one { width: 22px; height: 38px; font-size: 1.4rem; }
  .gap { width: 20px; height: 40px; }
  .one { height: 40px; }
  .crow .rep { font-size: 1.25rem; }
  .crow .icon-btn { width: 42px; height: 42px; }
}

/* ---------- 涂立方体 ---------- */
.stepper { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
.cube-board { align-items: center; }
.cube-stage { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cube-row { display: flex; align-items: center; gap: 10px; }
.scene { --size: 170px; --half: 85px; width: var(--size); height: var(--size); perspective: 700px; touch-action: none; cursor: grab; margin: 24px; }
.scene.locked { cursor: default; }
.cube3d { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform .3s ease; }
.cube3d.dragging { transition: none; }
.cface { position: absolute; inset: 0; border: 4px solid #1d2433; border-radius: 14px; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: #fff; box-shadow: inset 0 0 0 6px rgba(29, 36, 51, .06); cursor: pointer; }
.cface.painted { box-shadow: inset 0 0 0 6px rgba(255, 255, 255, .25); }
.cface:focus-visible { outline: 4px solid var(--focus); outline-offset: -8px; }
.collection { width: 100%; min-height: 104px; }
.collection h3 { margin: 4px 0; text-align: center; font-size: 1.05rem; }
.nets { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.net-item { display: flex; flex-direction: column; align-items: center; padding: 4px; border-radius: 10px; }
.net-item small { font-weight: 800; color: var(--ink-soft); }
.net-item.flash { background: #ffe36e; }
.net { display: grid; grid-template-columns: repeat(4, 14px); grid-template-rows: repeat(3, 14px); gap: 2px; }
.net span { border: 2px solid #1d2433; border-radius: 3px; }
.net.small { grid-template-columns: repeat(4, 10px); grid-template-rows: repeat(3, 10px); gap: 1px; }
.net.small span { border-width: 1.5px; border-radius: 2px; }
.net-groups { display: flex; flex-direction: column; gap: 8px; }
.net-group { display: flex; align-items: center; gap: 12px; justify-content: center; }
.net-group > b { width: 1.5em; text-align: right; }
.win-nets { height: 100%; align-content: center; gap: 6px; }
.mini-cube { position: relative; width: 44px; height: 44px; }
.mini-cube span { position: absolute; border: 2px solid #1d2433; }
.mini-cube .mt { left: 10px; top: 0; width: 26px; height: 12px; background: #2fb67c; transform: skewX(-40deg); transform-origin: bottom left; }
.mini-cube .mf { left: 0; top: 12px; width: 26px; height: 26px; background: #fff; }
.mini-cube .mr { left: 26px; top: 12px; width: 12px; height: 26px; background: #2fb67c; transform: skewY(-40deg); transform-origin: top left; }
.mini-cube.big { transform: scale(1.9); }
@media (prefers-reduced-motion: reduce) { .cube3d { transition: none; } }
@media (max-width: 520px) {
  .scene { --size: 150px; --half: 75px; margin: 20px; }
  .turn { width: 44px; height: 44px; }
}

/* ---------- 小棒拼正方形 ---------- */
.stick-board { gap: 10px; }
.stdiv { margin: 0; text-align: center; font-weight: 800; font-size: 1.1rem; }
.sq-svg { width: 100%; max-width: 220px; margin: 0 auto; display: block; }
.stick-board > .sq-svg { max-width: 130px; }
.side-rows { display: flex; flex-direction: column; gap: 6px; }
.side-row { display: grid; grid-template-columns: 64px 1fr 56px; align-items: center; gap: 6px; }
.side-name { min-height: 44px; border-radius: 12px; border: 3px solid var(--line); background: var(--card); font-weight: 800; padding: 0 4px; }
.track { display: flex; height: 44px; border: 3px dashed #9aa3b5; border-radius: 10px; background: #fff; overflow: hidden; cursor: pointer; }
.side-row.full .track { border-style: solid; border-color: #13866f; }
.seg { height: 100%; border: 0; border-right: 2px solid #1d2433; padding: 0; font-weight: 900; font-size: .95rem; color: #1d2433; min-width: 0; overflow: hidden; }
.side-sum { text-align: right; font-variant-numeric: tabular-nums; }
.side-row.full .side-sum { color: #13866f; }
.pile-sticks { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; padding-bottom: 6px; border-bottom: 2px dashed #d6cdb8; min-height: 40px; }
.stick { height: 36px; flex: none; border: 3px solid var(--line); border-radius: 8px; font-weight: 900; font-size: 1rem; text-align: right; padding: 0 8px; color: #1d2433; }
.stick.sel { outline: 4px solid #ff8c1a; outline-offset: 2px; }
.pick-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; max-width: 420px; margin: 0 auto; width: 100%; }
.pick { min-height: 48px; border-radius: 12px; border: 3px solid var(--line); background: var(--card); font-weight: 800; font-size: 1.2rem; }
.pick.on { background: #c9f2dc; }
.count-art { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.count-art .sq-svg { max-width: 160px; }
.read-squares { display: flex; gap: 10px; justify-content: center; }
.read-squares figure { margin: 0; text-align: center; font-weight: 800; flex: 1; max-width: 200px; }
dialog .face .sq-svg { max-width: 110px; }
#stick-art svg { width: 130px; height: 108px; }
@media (max-width: 520px) {
  .side-row { grid-template-columns: 52px 1fr 46px; gap: 4px; }
  .side-name { font-size: .9rem; }
}

/* ---------- 字母转转乐 ---------- */
.letter-board { gap: 10px; }
.ltile { display: inline-grid; place-items: center; width: 100%; aspect-ratio: 1; max-width: 46px; border: 3px solid var(--line); border-radius: 10px; background: #fff; font-weight: 900; font-size: 1.4rem; }
.ltile.small { max-width: 30px; border-width: 2px; border-radius: 6px; font-size: .95rem; }
.ltile.tiny { max-width: 22px; border-width: 1.5px; border-radius: 4px; font-size: .7rem; }
.rule-card { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.rule-card > b { font-size: .9rem; color: var(--ink-soft); }
.rule-grid { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 30px)); gap: 3px 4px; justify-items: center; }
.rule-grid i { font-style: normal; font-weight: 900; color: var(--ink-soft); line-height: 1; }
.chalkboard { background: #1f4d3a; border: 4px solid #8a6414; border-radius: 14px; padding: 8px 6px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.chalkboard .day-label { color: #f6f3ea; font-weight: 800; }
.today { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 46px)); gap: 4px; justify-content: center; width: 100%; }
.loops-line { margin: 0; text-align: center; font-weight: 800; }
.history { display: flex; flex-direction: column; gap: 3px; align-items: center; min-height: 152px; }
.hist-row { display: flex; align-items: center; gap: 8px; }
.hist-row small { min-width: 5em; text-align: right; color: var(--ink-soft); font-weight: 700; white-space: nowrap; }
.hist-tiles { display: flex; gap: 2px; }
.hist-tiles .ltile.tiny { width: 22px; }
.split-art { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.split-group { display: flex; gap: 3px; padding: 6px; border: 3px dashed #9aa3b5; border-radius: 12px; }
.split-group .ltile.small { width: 30px; }
.loop-diagram { width: 100%; max-width: 460px; margin: 0 auto; display: block; }
.mini-rule { font-weight: 900; font-size: 1.1rem; }
#letter-art { flex-direction: column; gap: 6px; }
.today.mini { --n: 4; grid-template-columns: repeat(4, 34px); }
@media (max-width: 520px) {
  .ltile { font-size: 1.15rem; border-width: 2px; }
  .hist-row small { min-width: 4em; font-size: .75rem; }
}

/* 文化课：天干地支 */
.gz-year { display: flex; flex-direction: column; align-items: center; gap: 2px; background: #b3261e; color: #ffe9a8; border: 4px solid #8a6414; border-radius: 14px; padding: 10px; text-align: center; }
.gz-year b { font-size: 1.35rem; }
.gz-year small { font-weight: 800; color: #fff3c4; }
.gz-title { margin: 4px 0 0; font-size: 1rem; text-align: center; }
.gz-row { display: grid; gap: 4px; }
.gz-row.stems { grid-template-columns: repeat(5, 1fr); }
.gz-row.branches { grid-template-columns: repeat(6, 1fr); }
.gz-card { position: relative; display: flex; flex-direction: column; align-items: center; border: 3px solid var(--line); border-radius: 10px; background: #fff; padding: 14px 2px 4px; }
.gz-card small { position: absolute; top: 2px; left: 4px; font-weight: 900; font-size: .75rem; color: var(--ink-soft); }
.gz-card b { font-size: 1.5rem; line-height: 1.1; }
.gz-card i { font-style: normal; font-size: .7rem; font-weight: 700; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.gz-card.cur { background: #ffd23f; box-shadow: 0 0 0 3px #b3261e; }
.gz-card.cur small { color: #1d2433; }
