/* 方块九九 · 方块像素风样式 */
:root {
  --ink: #1b1b1b;
  --ink-soft: #343434;
  --stone: #c6c6c6;
  --stone-2: #a8a8a8;
  --stone-3: #8a8a8a;
  --stone-4: #6f6f6f;
  --dirt: #8b5a2b;
  --dirt-dark: #5e3a1a;
  --grass: #6aa84f;
  --grass-dark: #4e7d39;
  --grass-light: #8fd06a;
  --gold: #f2c94c;
  --gold-dark: #b8860b;
  --diamond: #4aedd9;
  --red: #c0504d;
  --red-dark: #8a3a34;
  --green: #5b9d3f;
  --sky: #8fd0f0;
  --white: #f6f6f6;
  --shadow: 0 6px 0 rgba(0, 0, 0, .25);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(#6db9e8 0%, #a9ddf2 55%, #d9efc8 55%, #d9efc8 100%);
  overflow-x: hidden;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
.pixel-sprite { image-rendering: pixelated; vertical-align: middle; }
.muted { color: #6a6a6a; font-size: 13px; line-height: 1.55; }
.screen { display: none; }
.screen.active { display: block; animation: screenIn .18s ease-out; }
@keyframes screenIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- 世界背景 ---------- */
.world-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(#6db9e8 0%, #a9ddf2 55%, #d9efc8 55%, #d9efc8 100%);
  pointer-events: none;
}
.sun {
  position: absolute;
  top: 5%;
  right: 8%;
  width: 84px;
  height: 84px;
  background: #ffe066;
  box-shadow: 0 0 0 10px rgba(255, 224, 102, .28), 0 0 0 20px rgba(255, 224, 102, .12);
}
.cloud {
  position: absolute;
  width: 64px;
  height: 18px;
  background: #fff;
  opacity: .85;
  box-shadow: 16px -16px 0 #fff, 32px 0 0 #fff, 48px -8px 0 #fff;
}
.cloud.c1 { top: 12%; left: -12%; animation: drift 70s linear infinite; }
.cloud.c2 { top: 22%; left: -30%; animation: drift 95s linear infinite; animation-delay: -30s; transform: scale(.75); }
.cloud.c3 { top: 7%; left: -55%; animation: drift 120s linear infinite; animation-delay: -60s; transform: scale(.55); }
@keyframes drift { to { transform: translateX(130vw); } }
.hill {
  position: absolute;
  bottom: 10vh;
  left: 0;
  width: 100%;
  height: 15vh;
  background: linear-gradient(#8bc34a, #6aa84f);
  clip-path: polygon(0 100%, 0 55%, 5% 55%, 5% 40%, 10% 40%, 10% 55%, 18% 55%, 18% 28%, 24% 28%, 24% 55%, 32% 55%, 32% 42%, 40% 42%, 40% 55%, 50% 55%, 50% 30%, 58% 30%, 58% 55%, 66% 55%, 66% 45%, 74% 45%, 74% 55%, 82% 55%, 82% 25%, 90% 25%, 90% 55%, 100% 55%, 100% 100%);
  opacity: .55;
}
.hill.h2 {
  bottom: 8vh;
  height: 11vh;
  background: linear-gradient(#a5d66f, #8bc34a);
  opacity: .5;
  transform: scaleX(-1);
}
.ground {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 12vh;
  background:
    linear-gradient(#6aa84f 0 10px, #4e7d39 10px 16px, transparent 16px),
    repeating-linear-gradient(90deg, #8b5a2b 0 24px, #7a4a24 24px 48px);
  border-top: 4px solid #3f2a10;
  opacity: .85;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: relative;
  z-index: 20;
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 20px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
body[data-screen="practice"] .topbar { display: none; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 4px;
  text-align: left;
}
.brand-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: #4a2f1a;
  border: 3px solid var(--ink);
  box-shadow: inset 3px 3px 0 #7a4a24, inset -3px -3px 0 #2b1a0c, 0 4px 0 rgba(0, 0, 0, .2);
}
.brand-text {
  font-size: 21px;
  font-weight: 900;
  letter-spacing: .06em;
  line-height: 1;
  color: #fff;
  text-shadow: 2px 2px 0 #2b1a0c;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.brand-text small {
  font-size: 10px;
  letter-spacing: .22em;
  font-weight: 700;
  opacity: .9;
}
.top-actions { display: flex; align-items: center; gap: 8px; }
.streak-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 10px;
  background: #3b2a17;
  color: #ffe9a8;
  border: 3px solid var(--ink);
  box-shadow: inset 2px 2px 0 #6b4a25, inset -2px -2px 0 #241608;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.streak-chip b { color: var(--gold); font-size: 15px; }
.icon-btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  background: #4a4a4a;
  color: #f4f4f4;
  border: 3px solid var(--ink);
  box-shadow: 0 4px 0 rgba(0, 0, 0, .22);
  cursor: pointer;
  position: relative;
}
.icon-btn.off { opacity: .72; }
.icon-btn.off::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  top: 50%;
  height: 3px;
  background: var(--red);
  transform: rotate(-38deg);
  box-shadow: 0 0 0 1px #fff;
}
.voice-glyph { font-size: 11px; font-weight: 900; }
.icon-btn:active { transform: translateY(2px); }

/* ---------- 通用面板与按钮 ---------- */
.panel {
  background: var(--stone);
  border: 4px solid var(--ink);
  box-shadow: inset 4px 4px 0 #e8e8e8, inset -4px -4px 0 #8a8a8a, var(--shadow);
  position: relative;
}
.panel-kicker {
  display: block;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .18em;
  color: #5f5f5f;
  text-transform: uppercase;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 48px;
  padding: 10px 18px;
  background: var(--stone);
  color: var(--ink);
  border: 4px solid var(--ink);
  box-shadow: 0 5px 0 var(--ink);
  font-weight: 900;
  letter-spacing: .02em;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  user-select: none;
  transition: transform .06s ease, filter .12s ease;
}
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.btn.primary {
  background: var(--grass);
  color: #fff;
  text-shadow: 2px 2px 0 #2f4f1f;
  box-shadow: 0 5px 0 var(--ink);
}
.btn.danger {
  background: var(--red);
  color: #fff;
  text-shadow: 2px 2px 0 #5a1f1c;
  box-shadow: 0 5px 0 var(--ink);
}
.btn.small { min-height: 40px; padding: 7px 12px; font-size: 13px; border-width: 3px; }
.btn.tiny { min-height: 34px; padding: 4px 10px; font-size: 12px; border-width: 3px; box-shadow: 0 3px 0 var(--ink); }
.btn.big { min-height: 56px; padding: 12px 24px; font-size: 18px; }
.text-btn {
  border: 0;
  background: transparent;
  color: #3f3f3f;
  font-weight: 800;
  font-size: 13px;
  padding: 8px 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.text-btn:active { transform: translateY(1px); }

/* ---------- 底部导航 ---------- */
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: calc(10px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(4, minmax(64px, 1fr));
  gap: 4px;
  width: min(520px, calc(100vw - 24px));
  padding: 6px;
  background: #3b3b3b;
  border: 4px solid var(--ink);
  box-shadow: inset 3px 3px 0 #5d5d5d, inset -3px -3px 0 #232323, 0 6px 0 rgba(0, 0, 0, .3);
  transition: transform .22s ease, opacity .22s ease;
}
.bottom-nav.hidden { transform: translate(-50%, 130%); opacity: 0; pointer-events: none; }
.bottom-nav button {
  border: 3px solid transparent;
  background: transparent;
  color: #bdbdbd;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  min-height: 48px;
}
.bottom-nav button .nav-ico { font-size: 17px; line-height: 1; }
.bottom-nav button.active {
  color: #fff;
  background: #565656;
  border-color: #1b1b1b;
  box-shadow: inset 2px 2px 0 #7a7a7a, inset -2px -2px 0 #333;
}
.bottom-nav button:active { transform: translateY(1px); }

/* ---------- 首页 ---------- */
#main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 6px 20px 100px;
}
body[data-screen="practice"] #main { padding-top: 16px; padding-bottom: 24px; }
.home-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 4px 0 16px;
}
.hero-copy h1 {
  margin: 0 0 4px;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.1;
  color: #fff;
  letter-spacing: .03em;
  text-shadow: 3px 3px 0 #2b4a1c;
}
.hero-copy p {
  margin: 0;
  color: #33502a;
  font-size: 13px;
  font-weight: 800;
  background: rgba(255, 255, 255, .55);
  display: inline-block;
  padding: 4px 9px;
  border-left: 4px solid var(--grass);
}
.daily-panel {
  width: min(330px, 40vw);
  padding: 12px 14px;
  background: #e8e8e8;
}
.daily-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.daily-count { font-size: 22px; font-weight: 900; }
.daily-count small { font-size: 11px; color: #666; font-weight: 700; }
.goal-bar {
  height: 14px;
  margin: 8px 0 7px;
  background: #4a4a4a;
  border: 3px solid var(--ink);
  box-shadow: inset 2px 2px 0 #2b2b2b;
  overflow: hidden;
}
.goal-bar i {
  display: block;
  height: 100%;
  background: repeating-linear-gradient(90deg, #8fd06a 0 8px, #6aa84f 8px 16px);
  transition: width .35s ease;
}
.daily-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 10px; font-weight: 700; color: #4f4f4f; }
.daily-days { white-space: nowrap; color: #2f6e1e; }

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 18px;
  align-items: start;
}
.mine-map { padding: 14px; background: #a9a9a9; }
.map-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.map-head h2 { margin: 2px 0 0; font-size: 22px; letter-spacing: .03em; }
.mode-tag {
  background: #3b3b3b;
  color: var(--gold);
  border: 3px solid var(--ink);
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 900;
  box-shadow: inset 2px 2px 0 #5d5d5d;
  white-space: nowrap;
}
.mine-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.mine-card {
  position: relative;
  aspect-ratio: 1.62;
  min-height: 90px;
  min-width: 0;
  width: 100%;
  padding: 14px 8px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(#9d9d9d, #7c7c7c);
  border: 4px solid var(--ink);
  box-shadow: 0 5px 0 rgba(0, 0, 0, .28);
  color: #fff;
  cursor: pointer;
  overflow: hidden;
  transition: transform .08s ease, filter .12s ease;
}
.mine-card:hover { filter: brightness(1.06); }
.mine-card:active { transform: translateY(3px); }
.mine-card .mine-grass {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 12px;
  background: repeating-linear-gradient(90deg, #6aa84f 0 7px, #4e7d39 7px 14px);
  border-bottom: 3px solid #2f4f1f;
  box-shadow: inset 0 3px 0 #8fd06a;
}
.mine-card .mine-number {
  font-size: clamp(32px, 4.6vw, 46px);
  line-height: 1;
  font-weight: 900;
  text-shadow: 3px 3px 0 #2b2b2b;
  margin-top: 2px;
}
.mine-card .mine-label { font-size: 11px; font-weight: 800; opacity: .9; margin-top: 3px; }
.mine-card .mine-ore { position: absolute; top: 16px; right: 10px; opacity: .95; }
.mine-card .mine-stars { display: flex; gap: 2px; margin-top: 5px; min-height: 13px; align-items: center; }
.mine-card .mine-stars em { font-style: normal; font-size: 10px; color: #ededed; font-weight: 700; letter-spacing: .1em; }
.mine-card .mine-plays { position: absolute; bottom: 3px; left: 6px; font-size: 9px; color: #e0e0e0; }
.mine-card.done { box-shadow: 0 5px 0 rgba(0, 0, 0, .28), 0 0 0 3px rgba(74, 237, 217, .45); }
.star { display: inline-flex; line-height: 0; }
.star.off { opacity: .3; filter: grayscale(1); }

.home-side { display: grid; gap: 12px; }
.radar-card, .challenge-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  text-align: left;
  cursor: pointer;
  border: 4px solid var(--ink);
  min-height: 78px;
}
.radar-card { background: #3f5634; color: #f2f7e8; box-shadow: 0 5px 0 rgba(0, 0, 0, .28); }
.challenge-card { background: #5b3d1f; color: #fff2d0; box-shadow: 0 5px 0 rgba(0, 0, 0, .28); }
.radar-card:active, .challenge-card:active { transform: translateY(2px); }
.radar-card .radar-copy, .challenge-card .radar-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.radar-copy b { font-size: 15px; }
.radar-copy small { font-size: 10px; opacity: .8; font-weight: 700; }
.radar-icon, .challenge-icon { flex: 0 0 auto; filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, .35)); }
.card-arrow { font-size: 26px; font-weight: 900; opacity: .8; }
.lock-mark { opacity: .9; }
.challenge-card.locked { filter: grayscale(.35); cursor: not-allowed; }
.challenge-card.locked small { color: #ffcf7a; }
.inventory { padding: 11px; background: #3b3b3b; color: #eee; box-shadow: inset 4px 4px 0 #5d5d5d, inset -4px -4px 0 #232323, var(--shadow); }
.inv-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; font-size: 12px; font-weight: 800; }
.inv-head .panel-kicker { color: #bcbcbc; }
.hotbar { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; }
.slot {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: #4a4a4a;
  border: 2px solid #1b1b1b;
  box-shadow: inset 2px 2px 0 #6a6a6a, inset -2px -2px 0 #2b2b2b;
  position: relative;
  overflow: hidden;
}
.slot.filled { background: #565f4e; }
.slot-num { font-size: 11px; color: #9a9a9a; font-weight: 900; }
.inv-hint { margin-top: 7px; font-size: 9px; color: #b5b5b5; text-align: center; }

/* ---------- 练习 ---------- */
#screen-practice { max-width: 940px; margin: 0 auto; }
.practice-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.practice-top .btn { background: #4a4a4a; color: #f0f0f0; box-shadow: 0 5px 0 var(--ink); }
.round-title { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 800; }
.round-title b { font-size: 17px; white-space: nowrap; }
.round-count, .challenge-clock {
  background: #3b3b3b;
  color: #eee;
  border: 3px solid var(--ink);
  padding: 5px 9px;
  font-size: 12px;
  box-shadow: inset 2px 2px 0 #5d5d5d;
  white-space: nowrap;
}
.challenge-clock { color: var(--gold); font-size: 17px; min-width: 64px; text-align: center; }
.rt-short { display: none; }
.challenge-clock.danger { color: #ff8a80; animation: pulse .6s steps(2) infinite; }
@keyframes pulse { 50% { background: #6b2a26; } }
.combo-chip { display: flex; align-items: center; gap: 6px; }
.combo-inner {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #e8e8e8;
  border: 3px solid var(--ink);
  box-shadow: inset 2px 2px 0 #fff, inset -2px -2px 0 #8f8f8f;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.combo-inner b { color: #a05a00; font-size: 14px; }
.combo-inner.hot { background: #ffe08a; animation: comboPop .35s ease; }
@keyframes comboPop { 50% { transform: scale(1.08) rotate(-2deg); } }
.score-chip { background: #3b2a17; color: var(--gold); border: 3px solid var(--ink); padding: 4px 8px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.xp-wrap {
  height: 18px;
  background: #3b3b3b;
  border: 4px solid var(--ink);
  box-shadow: inset 3px 3px 0 #232323, inset -3px -3px 0 #5d5d5d;
  margin-bottom: 16px;
  overflow: hidden;
}
.xp-wrap i {
  display: block;
  height: 100%;
  width: 0;
  background: repeating-linear-gradient(90deg, #8fd06a 0 10px, #6aa84f 10px 20px);
  box-shadow: inset 0 3px 0 #c4f0a5;
  transition: width .3s ease;
}
.practice-layout { display: block; }
.question-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 250px; padding: 8px 0 12px; }
.question-block {
  position: relative;
  width: min(100%, 430px);
  aspect-ratio: 1.55;
  background: linear-gradient(#8f8f8f, #6b6b6b);
  border: 6px solid var(--ink);
  box-shadow: inset 6px 6px 0 #b5b5b5, inset -6px -6px 0 #4a4a4a, 0 10px 0 var(--ink), 0 14px 0 rgba(0, 0, 0, .2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: filter .15s ease;
}
.q-face {
  width: calc(100% - 28px);
  height: calc(100% - 28px);
  background:
    linear-gradient(rgba(255, 255, 255, .04), rgba(255, 255, 255, 0)),
    repeating-linear-gradient(0deg, #2f2f2f 0 14px, #333 14px 28px),
    repeating-linear-gradient(90deg, #2f2f2f 0 14px, #333 14px 28px);
  border: 4px solid var(--ink);
  box-shadow: inset 4px 4px 0 #1a1a1a, inset -4px -4px 0 #4a4a4a;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  font-size: clamp(36px, 8vw, 64px);
  font-weight: 900;
  letter-spacing: .02em;
  text-shadow: 3px 3px 0 #000;
  padding: 10px 18px;
  white-space: nowrap;
  overflow: hidden;
}
.q-face .eq { color: var(--gold); font-size: .62em; }
#qAnswer { color: var(--diamond); min-width: 1.15em; text-align: center; }
#qAnswer.has-typed { color: #fff; text-shadow: 3px 3px 0 #000; }
.block-shine {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 18px;
  height: 18px;
  background: rgba(255, 255, 255, .22);
  box-shadow: 22px 0 0 rgba(255, 255, 255, .1);
  pointer-events: none;
}
.question-block.is-correct { animation: blockWin .45s ease; filter: drop-shadow(0 0 14px rgba(143, 208, 106, .8)); }
.question-block.is-wrong { animation: shake .4s ease; filter: drop-shadow(0 0 12px rgba(192, 80, 77, .75)); }
@keyframes blockWin { 50% { transform: scale(1.04) rotate(-1deg); } }
@keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(4px); } }
.mascot {
  position: absolute;
  right: 0;
  bottom: -6px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  pointer-events: none;
  max-width: 55%;
}
.mascot-sprite { filter: drop-shadow(2px 3px 0 rgba(0, 0, 0, .25)); }
.mascot-bubble {
  background: #fffbe8;
  border: 3px solid var(--ink);
  box-shadow: inset 2px 2px 0 #fff, inset -2px -2px 0 #d6cfa8;
  padding: 4px 7px;
  font-size: 10px;
  font-weight: 800;
  margin-bottom: 12px;
  position: relative;
}
.mascot-bubble::after {
  content: "";
  position: absolute;
  left: -7px;
  bottom: 6px;
  width: 8px;
  height: 8px;
  background: #fffbe8;
  border-left: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  transform: rotate(45deg);
}
.float-reward {
  position: absolute;
  top: 8%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--gold);
  color: #3b2600;
  border: 3px solid var(--ink);
  box-shadow: inset 2px 2px 0 #ffe9a8, 0 4px 0 rgba(0, 0, 0, .25);
  padding: 5px 12px;
  font-size: 14px;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  z-index: 3;
}
.float-reward.show { animation: floatUp .9s ease forwards; }
@keyframes floatUp {
  0% { opacity: 0; transform: translateX(-50%) translateY(10px) scale(.8); }
  20% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1.05); }
  75% { opacity: 1; transform: translateX(-50%) translateY(-26px) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-40px) scale(.95); }
}
.answer-column { width: 100%; max-width: 560px; margin: 0 auto; }
.answer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 2px 9px;
}
.q-timer {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  flex: 0 0 auto;
  background: #3b3b3b;
  color: #eee;
  border: 3px solid var(--ink);
  box-shadow: inset 2px 2px 0 #5d5d5d;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.q-timer-label { color: #bdbdbd; }
.q-timer b {
  display: inline-block;
  min-width: 2.3em;
  text-align: right;
  font-size: 17px;
  line-height: 1.1;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.q-timer small { font-size: 9px; color: #bdbdbd; }
.q-timer.mid b { color: #ffd166; }
.q-timer.slow b { color: #ff8a80; }
.q-timer.good b { color: #8fd06a; }
.q-tip {
  font-size: 10px;
  font-weight: 800;
  color: #4f4f4f;
  text-align: right;
  line-height: 1.35;
}
.answer-area { min-height: 150px; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; max-width: 480px; margin: 0 auto; }
.choice-btn {
  position: relative;
  min-height: 78px;
  background: linear-gradient(#d9c08a, #b8945a);
  border: 4px solid var(--ink);
  box-shadow: 0 6px 0 var(--ink);
  font-size: clamp(28px, 5vw, 38px);
  font-weight: 900;
  color: #2b1d0e;
  cursor: pointer;
  text-shadow: 1px 1px 0 #f5e3b8;
  transition: transform .06s ease, filter .12s;
}
.choice-btn:hover { filter: brightness(1.05); }
.choice-btn:active { transform: translateY(3px); box-shadow: 0 3px 0 var(--ink); }
.choice-btn .choice-key {
  position: absolute;
  top: 4px;
  left: 8px;
  font-size: 10px;
  font-weight: 900;
  color: #6b4a1e;
  background: rgba(255, 255, 255, .35);
  border: 1px solid rgba(0, 0, 0, .2);
  padding: 0 3px;
}
.choice-btn.correct { background: #5b9d3f; color: #fff; text-shadow: 2px 2px 0 #2f4f1f; box-shadow: 0 6px 0 var(--ink); }
.choice-btn.wrong { background: #b24b47; color: #fff; text-shadow: 2px 2px 0 #5a1f1c; box-shadow: 0 6px 0 var(--ink); }
.choice-btn:disabled { cursor: default; }
.answer-tools { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding: 0 4px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; max-width: 430px; margin: 0 auto; }
.key-btn {
  min-height: 62px;
  background: var(--stone);
  border: 4px solid var(--ink);
  box-shadow: 0 5px 0 var(--ink);
  font-size: 26px;
  font-weight: 900;
  cursor: pointer;
}
.key-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.key-btn.util { font-size: 20px; background: #b5b5b5; }
.key-btn.dig {
  background: var(--grass);
  color: #fff;
  font-size: 24px;
  text-shadow: 2px 2px 0 #2f4f1f;
  box-shadow: 0 5px 0 var(--ink);
}
.hint-area { margin-top: 14px; }
.hint-panel, .feedback-panel {
  background: #f2e5c4;
  border: 4px solid var(--ink);
  box-shadow: inset 3px 3px 0 #fff6da, inset -3px -3px 0 #cdbb8c, var(--shadow);
  padding: 13px;
  color: #2b1d0e;
}
.feedback-panel { background: #f4d9c8; }
.feedback-time {
  display: inline-block;
  margin: 0 0 8px;
  padding: 2px 7px;
  background: #e6b8a6;
  border: 2px solid #8a5a48;
  font-size: 10px;
  font-weight: 800;
  color: #6b2a1c;
}
.feedback-head, .hint-head { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.feedback-head b, .hint-head b { font-size: 15px; display: block; }
.feedback-head small, .hint-head small { font-size: 11px; color: #6b4a1e; font-weight: 700; }
.x-mark {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  background: var(--red);
  color: #fff;
  border: 3px solid var(--ink);
  font-weight: 900;
  font-size: 18px;
  box-shadow: inset 2px 2px 0 #e0807d;
}
.correct-line { font-size: 22px; font-weight: 900; margin: 6px 0 10px; letter-spacing: .03em; }
.correct-line b { color: #2f6e1e; font-size: 26px; }
.feedback-actions, .hint-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.area-model { margin: 9px 0 6px; }
.area-grid { display: grid; gap: 2px; width: max-content; max-width: 100%; padding: 5px; background: #3b3b3b; border: 3px solid var(--ink); box-shadow: inset 2px 2px 0 #232323; }
.area-grid .mb { display: block; background: #6aa84f; box-shadow: inset 1px 1px 0 #a5de7b, inset -1px -1px 0 #3f6b2d; }
.area-grid .mb.gold { background: var(--gold); box-shadow: inset 1px 1px 0 #ffe9a8, inset -1px -1px 0 #b8860b; }
.area-labels { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 11px; font-weight: 800; margin-top: 6px; }
.area-labels span { background: #fff8e4; border: 2px solid #8a6a3a; padding: 2px 5px; }
.area-labels .gold-text { border-color: var(--gold-dark); background: #fff1b8; }
.area-labels .sum { border-color: #2f6e1e; background: #dff0d0; color: #2f6e1e; }

/* ---------- 结算 ---------- */
.summary-wrap { max-width: 680px; margin: 8px auto 0; }
.summary-panel {
  padding: 24px 20px 20px;
  text-align: center;
  background: #d9d9d9;
  overflow: hidden;
}
.summary-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg, transparent 0 18px, rgba(255, 255, 255, .22) 18px 36px);
  pointer-events: none;
}
.summary-ore { position: relative; display: inline-flex; animation: oreBob 2.2s ease-in-out infinite; filter: drop-shadow(4px 6px 0 rgba(0, 0, 0, .2)); }
@keyframes oreBob { 50% { transform: translateY(-6px) rotate(2deg); } }
.summary-panel h1 { position: relative; margin: 8px 0 2px; font-size: clamp(26px, 5vw, 38px); letter-spacing: .04em; text-shadow: 2px 2px 0 #fff; }
.summary-sub { position: relative; margin: 0 0 10px; font-size: 12px; font-weight: 800; color: #5f5f5f; }
.summary-stars { position: relative; display: flex; justify-content: center; gap: 8px; margin: 8px 0 14px; }
.summary-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px auto;
  max-width: 430px;
}
.summary-grid > div { background: #f2f2f2; border: 3px solid var(--ink); box-shadow: inset 2px 2px 0 #fff, inset -2px -2px 0 #b5b5b5; padding: 8px 4px; }
.summary-grid.four { grid-template-columns: repeat(4, 1fr); max-width: 470px; }
.summary-recall {
  position: relative;
  margin: 0 auto 10px;
  max-width: 470px;
  padding: 6px 9px;
  background: #f2e5c4;
  border: 3px solid var(--ink);
  box-shadow: inset 2px 2px 0 #fff6da;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.45;
}
.summary-grid b { display: block; font-size: 25px; line-height: 1.1; }
.summary-grid span { font-size: 10px; font-weight: 800; color: #666; }
.summary-wrong { position: relative; text-align: left; margin: 12px 0; padding: 10px; background: #f2e5c4; border: 3px solid var(--ink); box-shadow: inset 2px 2px 0 #fff6da; }
.summary-wrong h3 { margin: 0 0 6px; font-size: 12px; }
.wrong-chip { display: inline-flex; gap: 6px; align-items: baseline; background: #fff8e4; border: 2px solid #8a6a3a; padding: 3px 6px; margin: 3px 4px 0 0; font-size: 11px; font-weight: 700; }
.wrong-chip b { color: #8a3a34; }
.summary-wrong-link { display: block; margin-top: 3px; font-size: 11px; color: #8a3a34; }
.summary-perfect { position: relative; margin: 12px 0; font-size: 13px; font-weight: 900; color: #2f6e1e; }
.summary-ultimate { position: relative; display: inline-flex; align-items: center; gap: 6px; margin: 8px 0; padding: 6px 10px; background: var(--gold); border: 3px solid var(--ink); box-shadow: inset 2px 2px 0 #ffe9a8; font-size: 12px; font-weight: 900; }
.summary-actions { position: relative; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.big-score { position: relative; font-size: 72px; line-height: 1; font-weight: 900; color: #2f6e1e; text-shadow: 4px 4px 0 #fff; margin: 6px 0; }
.big-score small { font-size: 18px; color: #5f5f5f; margin-left: 4px; }

/* ---------- 页头 ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 8px 0 14px;
}
.page-head h1 { margin: 2px 0 3px; font-size: clamp(24px, 3.6vw, 36px); letter-spacing: .03em; color: #fff; text-shadow: 3px 3px 0 #2b4a1c; }
.page-sub { margin: 0; font-size: 12px; font-weight: 700; color: #33502a; background: rgba(255, 255, 255, .5); display: inline-block; padding: 3px 7px; }
.mode-switch { display: flex; gap: 4px; background: #3b3b3b; border: 4px solid var(--ink); padding: 4px; box-shadow: inset 3px 3px 0 #5d5d5d; }
.mode-btn { border: 3px solid transparent; background: transparent; color: #c9c9c9; font-size: 12px; font-weight: 800; padding: 7px 10px; cursor: pointer; white-space: nowrap; }
.mode-btn.active { background: var(--gold); color: #3b2600; border-color: var(--ink); box-shadow: inset 2px 2px 0 #ffe9a8, inset -2px -2px 0 #b8860b; }

/* ---------- 口诀图鉴 ---------- */
.table-layout { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.table-card { padding: 12px; background: #a9a9a9; }
.table-grid { display: grid; grid-template-columns: 24px repeat(9, 1fr); gap: 3px; max-width: 660px; margin: 0 auto; }
.tg-corner, .tg-head {
  display: grid;
  place-items: center;
  min-height: 24px;
  font-size: 10px;
  font-weight: 900;
  color: #fff;
  background: #4a4a4a;
  border: 2px solid var(--ink);
  box-shadow: inset 1px 1px 0 #6a6a6a, inset -1px -1px 0 #2b2b2b;
}
.tg-header-row { display: contents; }
.tg-cell {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-height: 0;
  padding: 0;
  font-size: clamp(9px, 1.5vw, 15px);
  font-weight: 900;
  color: #f4f4f4;
  background: #7e7e7e;
  border: 2px solid var(--ink);
  box-shadow: inset 2px 2px 0 #a5a5a5, inset -2px -2px 0 #565656;
  cursor: pointer;
  text-shadow: 1px 1px 0 #333;
}
.tg-cell.blank { visibility: hidden; border-color: transparent; box-shadow: none; background: transparent; cursor: default; }
.tg-cell.weak { background: #9d4a44; box-shadow: inset 2px 2px 0 #c97c75, inset -2px -2px 0 #632b27; }
.tg-cell.learning { background: #a78a3a; box-shadow: inset 2px 2px 0 #d4b95c, inset -2px -2px 0 #6d571e; }
.tg-cell.mastered { background: #4e7d39; box-shadow: inset 2px 2px 0 #8fd06a, inset -2px -2px 0 #2f4f1f; }
.tg-cell.selected { outline: 3px solid var(--gold); outline-offset: 1px; z-index: 2; }
.tg-cell.same-product { box-shadow: inset 0 0 0 3px var(--diamond), inset 2px 2px 0 #a5a5a5; }
.tg-cell:active { transform: translateY(1px); }
.table-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 14px; margin-top: 10px; font-size: 10px; font-weight: 800; color: #3b3b3b; }
.table-legend span { display: inline-flex; align-items: center; gap: 4px; }
.lg { width: 12px; height: 12px; border: 2px solid var(--ink); display: inline-block; }
.lg.unseen { background: #7e7e7e; }
.lg.weak { background: #9d4a44; }
.lg.learning { background: #a78a3a; }
.lg.mastered { background: #4e7d39; }
.table-detail { padding: 14px; background: #e2e2e2; }
.detail-eq { font-size: clamp(26px, 4.5vw, 40px); font-weight: 900; letter-spacing: .03em; margin: 2px 0; }
.detail-eq b { color: #2f6e1e; }
.detail-phrase { display: inline-block; background: #3b3b3b; color: var(--gold); border: 3px solid var(--ink); box-shadow: inset 2px 2px 0 #5d5d5d; padding: 5px 10px; font-size: 17px; font-weight: 900; letter-spacing: .08em; margin: 4px 0 10px; }
.detail-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 6px; }
.detail-block { margin-top: 10px; padding-top: 9px; border-top: 3px dashed #9a9a9a; }
.detail-block h3, .same-list h3 { font-size: 12px; margin: 0 0 4px; }
.commute { font-size: 11px; font-weight: 800; color: #2f4f1f; background: #dff0d0; border-left: 4px solid var(--grass); padding: 5px 7px; margin: 8px 0; }
.same-list { margin-top: 8px; }
.same-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.same-chip { background: #fff; border: 2px solid #8a8a8a; padding: 3px 6px; font-size: 11px; font-weight: 800; }
.same-chip.on { border-color: #2f6e1e; background: #dff0d0; }

/* ---------- 成就 ---------- */
.badge-progress { text-align: right; background: #3b3b3b; color: #eee; border: 4px solid var(--ink); padding: 7px 12px; box-shadow: inset 3px 3px 0 #5d5d5d; }
.badge-progress b { display: block; font-size: 22px; color: var(--gold); line-height: 1.1; }
.badge-progress span { font-size: 10px; font-weight: 800; }
.progress-line { height: 14px; background: #3b3b3b; border: 3px solid var(--ink); box-shadow: inset 2px 2px 0 #232323; margin-bottom: 16px; overflow: hidden; }
.progress-line i { display: block; height: 100%; background: repeating-linear-gradient(90deg, #f2c94c 0 9px, #d4a92c 9px 18px); transition: width .4s ease; }
.badge-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.badge-card { display: flex; align-items: center; gap: 10px; padding: 11px; background: #d2d2d2; border: 4px solid var(--ink); box-shadow: inset 3px 3px 0 #ececec, inset -3px -3px 0 #8f8f8f, var(--shadow); }
.badge-card.off { filter: grayscale(1); opacity: .62; }
.badge-card.on { background: #f2e5c4; box-shadow: inset 3px 3px 0 #fff6da, inset -3px -3px 0 #cdbb8c, var(--shadow); }
.badge-ico { flex: 0 0 auto; width: 50px; height: 50px; display: grid; place-items: center; background: #3b3b3b; border: 3px solid var(--ink); box-shadow: inset 2px 2px 0 #5d5d5d; }
.badge-copy { min-width: 0; }
.badge-copy b { display: block; font-size: 14px; }
.badge-copy small { display: block; font-size: 10px; color: #4f4f4f; line-height: 1.4; }
.badge-copy em { display: inline-flex; align-items: center; gap: 3px; margin-top: 3px; font-style: normal; font-size: 9px; font-weight: 800; color: #2f6e1e; }
.badge-copy .locked-label { color: #777; }

/* ---------- 家长控制台 ---------- */
.local-tag { display: inline-flex; align-items: center; gap: 5px; background: #3b3b3b; color: #ddd; border: 3px solid var(--ink); padding: 5px 8px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.parent-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 14px; align-items: start; }
.parent-grid .panel { padding: 13px; }
.panel-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.panel-title h3 { margin: 0; font-size: 15px; }
.panel-title span { font-size: 9px; font-weight: 700; color: #666; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.stat { background: #f1f1f1; border: 3px solid var(--ink); box-shadow: inset 2px 2px 0 #fff, inset -2px -2px 0 #b5b5b5; padding: 8px 4px; text-align: center; }
.stat b { display: block; font-size: 20px; line-height: 1.15; }
.stat span { font-size: 9px; font-weight: 800; color: #666; }
.heat-grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 2px; max-width: 340px; margin: 0 auto; }
.hm-cell { aspect-ratio: 1; display: grid; place-items: center; border: 1px solid #333; font-size: clamp(7px, 1.1vw, 10px); font-weight: 900; color: rgba(255, 255, 255, .92); }
.hm-cell.blank { visibility: hidden; }
.hm-cell.unseen { background: #8a8a8a; }
.hm-cell.weak { background: #a24c46; }
.hm-cell.learning { background: #b18f35; }
.hm-cell.mastered { background: #4e7d39; }
.heat-legend { display: flex; flex-wrap: wrap; gap: 7px 12px; margin-top: 7px; font-size: 9px; font-weight: 800; color: #4f4f4f; }
.heat-legend span { display: inline-flex; align-items: center; gap: 3px; }
.heat-legend i { width: 9px; height: 9px; border: 1px solid var(--ink); display: inline-block; }
.growth-panel { grid-column: 1 / -1; }
.growth-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-width: 560px; margin: 0 auto 9px; }
.gstat {
  background: #3b3b3b;
  color: #eee;
  border: 3px solid var(--ink);
  box-shadow: inset 2px 2px 0 #5d5d5d;
  padding: 6px 4px;
  text-align: center;
}
.gstat b { display: block; font-size: 19px; line-height: 1.15; color: var(--gold); font-variant-numeric: tabular-nums; }
.gstat span { font-size: 9px; font-weight: 800; color: #cfcfcf; }
.growth-chart {
  background: #ececec;
  border: 3px solid var(--ink);
  box-shadow: inset 2px 2px 0 #fff, inset -2px -2px 0 #b5b5b5;
  padding: 6px 4px 2px;
}
.growth-chart svg { display: block; width: 100%; max-width: 560px; height: auto; margin: 0 auto; }
.g-grid { stroke: #b5b5b5; stroke-width: 1; stroke-dasharray: 3 3; }
.g-axis { fill: #6a6a6a; font-size: 8px; font-weight: 700; font-family: var(--font); }
.g-area { fill: rgba(106, 168, 79, .18); }
.g-line { fill: none; stroke: #4e7d39; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.g-dot { fill: #8fd06a; stroke: #1b1b1b; stroke-width: 1; }
.growth-empty { margin: 14px 4px; text-align: center; }
.growth-trend {
  display: block;
  width: max-content;
  max-width: 100%;
  margin: 7px auto 0;
  padding: 3px 8px;
  border: 2px solid var(--ink);
  background: #d9d9d9;
  font-size: 10px;
  font-weight: 800;
}
.growth-trend.good { background: #dff0d0; color: #2f6e1e; }
.growth-trend.warn { background: #f4d9c8; color: #8a3a34; }
.growth-note { max-width: 560px; margin: 6px auto 0; font-size: 9px; color: #666; line-height: 1.5; text-align: center; }
.wrong-panel { grid-column: 1 / -1; }
.wrong-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 9px; }
.wrong-total { margin: 0; font-size: 11px; font-weight: 800; color: #555; }
.wrong-total b { color: #b23a2f; font-size: 14px; }
.wrong-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.wrong-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "eq count" "detail act";
  gap: 3px 8px;
  align-items: center;
  padding: 7px 8px;
  background: #fff;
  border: 3px solid var(--ink);
  box-shadow: inset 2px 2px 0 #fff, inset -2px -2px 0 #c9c9c9;
}
.wrong-card.fixed { background: #eef6e6; }
.wrong-eq { grid-area: eq; min-width: 0; }
.wrong-eq b { display: block; font-size: 17px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.wrong-eq em { font-style: normal; color: #2f6e1e; }
.wrong-eq small { font-size: 10px; color: #666; font-weight: 700; }
.wrong-count {
  grid-area: count;
  align-self: start;
  background: #b23a2f;
  color: #fff;
  border: 2px solid var(--ink);
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}
.wrong-card.fixed .wrong-count { background: #5b8a3c; }
.wrong-detail { grid-area: detail; min-width: 0; font-size: 10px; font-weight: 700; color: #666; }
.wrong-detail b { color: #b23a2f; }
.wrong-ok { color: #2f6e1e; font-weight: 900; }
.wrong-todo { color: #a24c46; font-weight: 900; }
.wrong-card .btn { grid-area: act; }
.empty-note { font-size: 12px; color: #666; padding: 8px 0; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 2px dashed #a5a5a5; font-size: 12px; font-weight: 800; }
.settings-row:last-of-type { border-bottom: 0; }
.settings-row small { display: block; font-size: 9px; color: #777; font-weight: 700; margin-top: 2px; }
.seg { display: flex; border: 3px solid var(--ink); box-shadow: inset 2px 2px 0 #fff, inset -2px -2px 0 #8a8a8a; }
.seg-btn { border: 0; background: #b5b5b5; padding: 6px 9px; font-size: 11px; font-weight: 800; cursor: pointer; }
.seg-btn.on { background: var(--grass); color: #fff; text-shadow: 1px 1px 0 #2f4f1f; }
.select, .text-input { background: #fff; border: 3px solid var(--ink); box-shadow: inset 2px 2px 0 #d0d0d0; padding: 6px 7px; font-size: 12px; font-weight: 700; max-width: 150px; }
.text-input { width: 130px; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.privacy-note { display: flex; align-items: flex-start; gap: 5px; margin: 10px 0 0; font-size: 9px; color: #666; line-height: 1.5; }
.toggle { width: 52px; height: 28px; border: 3px solid var(--ink); background: #6f6f6f; position: relative; cursor: pointer; box-shadow: inset 2px 2px 0 #4a4a4a; padding: 0; flex: 0 0 auto; }
.toggle span { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; background: #d9d9d9; border: 2px solid var(--ink); transition: left .15s ease; }
.toggle.on { background: var(--grass); }
.toggle.on span { left: 26px; background: #f0ffe6; }

/* ---------- 弹窗与提示 ---------- */
.modal-layer { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; }
.modal-layer[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 20, 12, .62); }
.modal {
  position: relative;
  width: min(520px, 100%);
  max-height: 86dvh;
  overflow: auto;
  padding: 20px;
  background: #e2e2e2;
  animation: modalIn .18s ease-out;
}
@keyframes modalIn { from { transform: translateY(12px) scale(.98); opacity: .5; } }
.modal h2 { margin: 0 0 10px; font-size: 22px; letter-spacing: .03em; }
.modal-body { font-size: 13px; line-height: 1.65; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.onboard-art { display: flex; justify-content: center; gap: 8px; margin: 2px 0 10px; }
.onboard-lead { font-weight: 900; font-size: 15px; margin: 0 0 8px; }
.onboard-list { margin: 0 0 10px; padding-left: 18px; }
.onboard-list li { margin: 4px 0; }
.toast-layer { position: fixed; top: 76px; right: max(12px, calc((100vw - 1180px) / 2)); z-index: 110; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 310px;
  padding: 9px 12px;
  background: #3b3b3b;
  color: #f4f4f4;
  border: 4px solid var(--ink);
  box-shadow: inset 3px 3px 0 #5d5d5d, 0 5px 0 rgba(0, 0, 0, .25);
  transform: translateX(120%);
  opacity: 0;
  transition: transform .25s ease, opacity .25s ease;
}
.toast.in { transform: none; opacity: 1; }
.toast.gold { background: #4a3514; border-color: var(--ink); box-shadow: inset 3px 3px 0 #7a5a28, 0 0 0 3px var(--gold), 0 5px 0 rgba(0, 0, 0, .25); }
.toast b { display: block; font-size: 12px; }
.toast small { display: block; font-size: 10px; color: #cfcfcf; }
.toast.gold small { color: #ffe9a8; }
.toast-ico { flex: 0 0 auto; }
#confetti { position: fixed; inset: 0; z-index: 90; pointer-events: none; }

/* ---------- 响应式 ---------- */
@media (min-width: 980px) {
  .table-layout { grid-template-columns: minmax(0, 1fr) 330px; }
  .table-detail { position: sticky; top: 14px; }
}
@media (min-width: 900px) and (orientation: landscape) {
  .practice-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .95fr); gap: 26px; align-items: center; min-height: calc(100dvh - 180px); }
  .question-stage { min-height: 330px; }
  .question-block { width: min(100%, 440px); }
  .answer-column { max-width: none; }
}
@media (max-width: 900px) {
  .home-grid { grid-template-columns: 1fr; }
  .home-side { grid-template-columns: 1fr 1fr; }
  .home-side .inventory { grid-column: 1 / -1; }
  .parent-grid { grid-template-columns: 1fr; }
}
@media (max-width: 899px) and (orientation: portrait) {
  body[data-screen="practice"] #main { padding-bottom: 28px; }
  .practice-layout {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(16px, 2.4vh, 24px);
    min-height: calc(100dvh - 156px);
    padding-bottom: 4px;
  }
  .question-stage { min-height: clamp(190px, 26vh, 250px); }
  .answer-column { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .answer-tools { margin-top: 14px; }
  .keypad { gap: 12px; max-width: min(100%, 400px); }
  .key-btn { min-height: clamp(50px, 6.6vh, 58px); }
}
@media (max-width: 640px) {
  .topbar { padding: 10px 12px 6px; }
  .sun { display: none; }
  .cloud { opacity: .55; }
  #main { padding: 6px 12px 104px; }
  .brand-text { font-size: 17px; }
  .brand-text small { font-size: 8px; letter-spacing: .14em; }
  .brand-icon { width: 38px; height: 38px; }
  .brand-icon .pixel-sprite { width: 28px; height: 28px; }
  .streak-chip { padding: 5px 6px; font-size: 10px; }
  .streak-chip .pixel-sprite { width: 14px; height: 14px; }
  .icon-btn { width: 38px; height: 38px; }
  .icon-btn .pixel-sprite { width: 17px; height: 17px; }
  .home-hero { flex-direction: column; align-items: stretch; gap: 8px; }
  .hero-copy h1 { font-size: 25px; }
  .daily-panel { width: 100%; }
  .home-side { grid-template-columns: 1fr; }
  .radar-card, .challenge-card { min-height: 68px; }
  .mine-map { padding: 10px; }
  .mine-grid { gap: 10px; }
  .mine-card { min-height: 88px; min-width: 0; padding-top: 11px; }
  .mine-card .mine-number { font-size: 32px; }
  .mine-card .mine-label { display: none; }
  .mine-card .mine-plays { display: none; }
  .mine-card .mine-ore { top: 14px; right: 4px; }
  .mine-card .mine-ore .pixel-sprite { width: 25px; height: 25px; }
  .h1 { font-size: 22px; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 8px; }
  .page-head h1 { font-size: 25px; }
  .mode-switch { align-self: stretch; }
  .mode-btn { flex: 1; }
  .practice-top { flex-wrap: wrap; }
  .practice-top .btn { order: 1; }
  .round-title { order: 2; flex: 1; justify-content: flex-end; }
  .rt-long { display: none; }
  .rt-short { display: inline; }
  .combo-chip { order: 3; margin-left: auto; }
  .question-stage { min-height: clamp(176px, 24vh, 210px); }
  .question-block { width: 100%; aspect-ratio: 1.65; }
  .q-face { font-size: clamp(32px, 11vw, 52px); gap: 7px; }
  .mascot { display: none; }
  .choice-btn { min-height: 66px; }
  .key-btn { min-height: 54px; font-size: 23px; }
  .q-tip { font-size: 9px; }
  .summary-grid.four { gap: 5px; }
  .summary-grid.four b { font-size: 18px; }
  .summary-panel { padding: 18px 12px; }
  .summary-actions .btn { flex: 1; min-width: 120px; }
  .badge-grid { grid-template-columns: 1fr; }
  .table-grid { grid-template-columns: 20px repeat(9, 1fr); gap: 2px; }
  .tg-cell { font-size: clamp(8px, 2.1vw, 12px); }
  .tg-corner, .tg-head { min-height: 20px; font-size: 8px; }
  .table-card { padding: 7px; }
  .settings-row { align-items: flex-start; }
  .select, .text-input { max-width: 132px; }
  .toast-layer { top: 64px; right: 10px; left: 10px; align-items: stretch; }
  .toast { max-width: none; }
}
@media (orientation: portrait) and (max-width: 899px) and (max-height: 780px) {
  body[data-screen="practice"] #main { padding-top: 8px; padding-bottom: 14px; }
  .practice-top { margin-bottom: 6px; }
  .xp-wrap { height: 14px; margin-bottom: 10px; }
  .practice-layout { min-height: calc(100dvh - 128px); gap: 12px; padding-bottom: 0; }
  .question-stage { min-height: clamp(150px, 23vh, 200px); padding: 2px 0 6px; }
  .question-block { aspect-ratio: 1.9; }
  .answer-meta { margin-bottom: 6px; }
  .keypad { gap: 9px; }
  .key-btn { min-height: clamp(44px, 6.4vh, 50px); }
  .answer-tools { margin-top: 10px; }
  .answer-column { padding-bottom: 4px; }
}
@media (orientation: portrait) and (max-width: 899px) and (max-height: 660px) {
  body[data-screen="practice"] #main { padding-top: 6px; padding-bottom: 10px; }
  .practice-top { margin-bottom: 4px; }
  .xp-wrap { height: 12px; margin-bottom: 8px; }
  .practice-layout { min-height: calc(100dvh - 122px); gap: 8px; }
  .question-stage { min-height: 132px; padding: 0 0 4px; }
  .question-block { aspect-ratio: 2.1; }
  .answer-meta { margin-bottom: 5px; }
  .keypad { gap: 8px; }
  .answer-tools { margin-top: 8px; }
  .answer-column { padding-bottom: 2px; }
  .q-timer b { font-size: 15px; }
  .q-tip { font-size: 9px; }
  .choice-btn { min-height: 56px; }
}
@media (max-width: 380px) {
  .brand-text small { display: none; }
  .streak-chip span { display: none; }
  .mine-card .mine-label { display: none; }
  .tg-cell { font-size: 8px; }
  .summary-grid b { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .cloud { display: none; }
}

/* ---------- 全屏按钮 ---------- */
[data-fullscreen] { touch-action: manipulation; }
[data-fullscreen] .fs-enter,
[data-fullscreen] .fs-exit {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
[data-fullscreen] .fs-exit { display: none; }
[data-fullscreen].is-fs .fs-enter { display: none; }
[data-fullscreen].is-fs .fs-exit { display: block; }

/* 练习页顶栏：combo + 全屏按钮 */
.practice-tools { display: flex; align-items: center; gap: 8px; order: 3; margin-left: auto; }
.practice-top .combo-chip { order: 0; margin-left: 0; }
