/* =========================================================
   方块数学世界 · 视觉样式
   移动端优先，适配安卓平板 / 手机 / 桌面浏览器
   ========================================================= */

:root {
  --ink: #26342d;
  --ink-soft: #41544a;
  --muted: #718077;
  --cream: #fffaf0;
  --panel: #fffdf7;
  --line: rgba(38, 52, 45, .14);
  --line-strong: rgba(38, 52, 45, .24);
  --green: #78d94f;
  --green-deep: #3c8d2c;
  --green-dark: #25611c;
  --green-soft: #e4f9d8;
  --gold: #ffc84a;
  --gold-deep: #b77a0b;
  --blue: #5bbcf5;
  --pink: #ff8fb1;
  --purple: #b59cff;
  --red: #e85b57;
  --red-soft: #ffe6e2;
  --sky-1: #79cef5;
  --sky-2: #d8f5ff;
  --sky-3: #eefbff;
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 13px;
  --shadow-card: 0 2px 0 rgba(255, 255, 255, .8) inset, 0 8px 0 rgba(44, 69, 50, .07), 0 18px 38px rgba(47, 81, 60, .12);
  --shadow-btn: 0 4px 0 var(--green-dark), 0 8px 18px rgba(46, 112, 36, .22);
  --font: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", system-ui, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at 50% -10%, #fbfff2 0 20%, transparent 50%),
    linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 36%, var(--sky-3) 62%, #f7ffe9 100%);
  overflow-x: hidden;
}

button, input {
  font: inherit;
  color: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #1f6fd1;
  outline-offset: 3px;
}

img { max-width: 100%; display: block; }

/* ---------- 背景世界 ---------- */
.world-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.sun {
  position: absolute;
  top: 5vh;
  right: 8vw;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 38%, #fff9c8 0 22%, #ffe36a 50%, #ffd44d 72%);
  box-shadow: 0 0 60px rgba(255, 226, 96, .55), 0 0 140px rgba(255, 226, 96, .28);
}

.cloud {
  position: absolute;
  width: 190px;
  height: 54px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  filter: blur(.2px);
  opacity: .8;
  animation: cloudDrift 38s linear infinite;
}
.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: inherit;
}
.cloud::before { width: 82px; height: 82px; left: 28px; top: -36px; }
.cloud::after { width: 58px; height: 58px; right: 32px; top: -22px; }
.cloud-a { top: 12%; left: -220px; animation-duration: 46s; }
.cloud-b { top: 28%; left: -320px; transform: scale(.7); animation-duration: 62s; animation-delay: -22s; opacity: .55; }
.cloud-c { top: 6%; left: -180px; transform: scale(1.25); animation-duration: 72s; animation-delay: -48s; opacity: .45; }

.float-cube {
  position: absolute;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: linear-gradient(135deg, #b7f59b, #65c946);
  border: 2px solid rgba(255, 255, 255, .55);
  box-shadow: 10px 10px 0 rgba(50, 120, 40, .12);
  transform: rotate(12deg);
  animation: floaty 7s ease-in-out infinite;
  opacity: .55;
}
.cube-a { left: 5%; bottom: 20%; }
.cube-b { right: 7%; bottom: 14%; width: 26px; height: 26px; background: linear-gradient(135deg, #ffe89a, #ffc13c); animation-delay: -2.5s; }
.cube-c { left: 16%; top: 30%; width: 20px; height: 20px; background: linear-gradient(135deg, #b6e8ff, #55b9ef); animation-delay: -4s; }

.hills {
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: -8vh;
  height: 42vh;
  background:
    radial-gradient(ellipse at 20% 100%, #b9e98e 0 36%, transparent 37%),
    radial-gradient(ellipse at 55% 100%, #a8df7e 0 42%, transparent 43%),
    radial-gradient(ellipse at 85% 100%, #c6ef9e 0 34%, transparent 35%),
    linear-gradient(180deg, transparent 0 48%, #b9e88f 49% 100%);
  opacity: .7;
}

/* ---------- 布局 ---------- */
.app {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100% - 28px));
  margin: 0 auto;
  padding-bottom: calc(108px + var(--safe-bottom));
}

.screens { min-height: 60vh; }

.screen { display: none; }
.screen.active {
  display: block;
  animation: screenIn .32s ease both;
}

body.focus-mode .topbar,
body.focus-mode .bottom-nav { display: none; }
body.focus-mode .app { padding-bottom: 24px; }
body.modal-open { overflow: hidden; }

.screen.focus {
  max-width: 900px;
  margin: 0 auto;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  color: var(--green-deep);
  text-transform: uppercase;
}
.eyebrow.light { color: #dfffd0; }

.muted { color: var(--muted); }
.tiny { font-size: 12px; }

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: -.02em; }

.card {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 10px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: 22px;
  background: rgba(255, 253, 247, .82);
  box-shadow: 0 8px 26px rgba(50, 93, 65, .12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
  min-width: 0;
}

.brand-cube {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(145deg, #b7f59b, #63c83f);
  border: 2px solid #fff;
  box-shadow: inset -8px -8px 0 rgba(43, 116, 27, .16), 0 4px 0 #3c8d2c;
  overflow: hidden;
}
.brand-cube::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 4px;
  background:
    linear-gradient(90deg, transparent 46%, rgba(255,255,255,.8) 47% 53%, transparent 54%),
    linear-gradient(0deg, transparent 46%, rgba(255,255,255,.8) 47% 53%, transparent 54%);
  opacity: .75;
}
.brand-cube i,
.brand-cube b {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: #2f7d24;
  opacity: .5;
}
.brand-cube i { left: 7px; top: 7px; }
.brand-cube b { right: 7px; bottom: 7px; }

.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text b {
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
}
.brand-text small {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.desktop-nav {
  display: none;
  align-items: center;
  gap: 4px;
  margin-left: 16px;
}
.nav-link {
  padding: 9px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.nav-link:hover { background: rgba(120, 217, 79, .14); }
.nav-link.active { background: var(--green-soft); color: var(--green-dark); }

.top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.player-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px 5px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.player-avatar,
.player-avatar svg,
.player-avatar img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: block;
  object-fit: cover;
  background: #e8ffdd;
}
#player-name { display: none; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(44, 69, 50, .08);
}
.icon-btn:hover { background: #f4ffe9; }
.icon-btn:active { transform: translateY(1px); box-shadow: none; }

/* ---------- 首页 ---------- */
.home-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 18px;
}

.hero {
  position: relative;
  min-height: 470px;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(14, 66, 43, .05), rgba(12, 46, 31, .55)),
    linear-gradient(180deg, #8fe1ff 0%, #c8f5ff 56%, #eaffd8 100%);
  isolation: isolate;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(10, 45, 29, .78) 0%, rgba(10, 45, 29, .52) 44%, rgba(10, 45, 29, .05) 78%),
    linear-gradient(0deg, rgba(9, 38, 26, .78) 0%, rgba(9, 38, 26, .1) 48%, transparent 72%);
  pointer-events: none;
}
.hero-scene {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-scene svg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: translateX(6%);
  transition: transform .6s ease;
}
.hero-content {
  position: relative;
  z-index: 3;
  max-width: 560px;
  min-height: 470px;
  padding: 34px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #fff;
}
.hero h1 {
  margin: 8px 0 14px;
  font-size: clamp(38px, 7vw, 64px);
  line-height: 1.03;
  font-weight: 900;
  text-shadow: 0 3px 0 rgba(30, 74, 35, .22);
}
.hero h1 em {
  font-style: normal;
  color: #ffe36a;
  text-shadow: 0 4px 0 rgba(78, 78, 10, .25);
}
.hero-desc {
  max-width: 470px;
  margin-bottom: 22px;
  color: rgba(255, 255, 255, .9);
  line-height: 1.7;
  font-size: 15px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}
.hero-badges span {
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, .9);
  backdrop-filter: blur(6px);
}

.hero-guide {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 4;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 58%;
  pointer-events: none;
}
.hero-guide .bubble {
  margin-bottom: 12px;
  padding: 10px 13px;
  border-radius: 16px 16px 4px 16px;
  background: rgba(255, 253, 247, .94);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  box-shadow: 0 8px 20px rgba(20, 50, 35, .18);
}
.guide-avatar,
.guide-avatar svg,
.guide-avatar img {
  width: 84px;
  height: 112px;
  display: block;
  object-fit: contain;
  object-position: bottom;
  filter: drop-shadow(0 8px 12px rgba(20, 50, 35, .25));
}

.home-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.daily { padding: 20px; }
.daily-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.daily h2 { margin: 4px 0 0; font-size: 21px; }
.ring {
  --p: 0;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: conic-gradient(var(--green) calc(var(--p) * 1%), #e9f2e5 0);
  position: relative;
}
.ring::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: var(--panel);
}
.ring span {
  position: relative;
  z-index: 1;
  font-size: 12px;
  font-weight: 900;
  color: var(--green-deep);
}
.daily-progress {
  height: 10px;
  margin: 16px 0 10px;
  border-radius: 999px;
  background: #eaf2e4;
  overflow: hidden;
}
.daily-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #9ce86f, #55bd35);
  transition: width .5s ease;
}
.daily .muted { font-size: 12px; margin-bottom: 12px; line-height: 1.55; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.stat {
  padding: 15px 14px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 8px;
}
.stat-icon { font-size: 20px; grid-row: span 2; }
.stat b { font-size: 21px; line-height: 1.1; }
.stat small { color: var(--muted); font-size: 11px; }

.section { margin-top: 28px; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.section-head h2 { margin: 4px 0 0; font-size: 25px; }
.section-head.tight { align-items: center; margin-bottom: 12px; }
.section-head.tight h3 { margin: 0; font-size: 18px; }

.text-btn {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--green-deep);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.text-btn:hover { color: var(--green-dark); text-decoration: underline; }
.danger-text { color: var(--red); }

.unit-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(236px, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding: 2px 2px 14px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.unit-strip::-webkit-scrollbar { display: none; }
.unit-strip > * { scroll-snap-align: start; }

.unit-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 22px;
  background: linear-gradient(150deg, var(--unit-light) 0%, #fffdf7 58%);
  background: linear-gradient(150deg, color-mix(in srgb, var(--unit-light) 55%, #fff) 0%, #fffdf7 58%);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}
.unit-card::after {
  content: "";
  position: absolute;
  right: -28px;
  top: -28px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--unit-color);
  opacity: .14;
}
.unit-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 0 rgba(44, 69, 50, .07), 0 22px 42px rgba(47, 81, 60, .16);
}
.unit-card:active { transform: translateY(0); }

.unit-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.unit-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 54px;
  border-radius: 16px 16px 12px 12px;
  background: linear-gradient(145deg, var(--unit-light), var(--unit-color));
  border: 2px solid rgba(255, 255, 255, .9);
  box-shadow: 0 5px 0 var(--unit-dark);
  font-size: 27px;
  position: relative;
  z-index: 1;
}
.unit-top-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.grade-pill {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .8);
  border: 1px solid var(--line);
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
}
.unit-stars { color: #d6c8a1; font-size: 13px; letter-spacing: 1px; }
.unit-stars .on { color: #f5a623; }

.unit-card h3 { margin: 12px 0 4px; font-size: 17px; }
.unit-card .island-name { color: var(--muted); font-size: 11px; margin-bottom: 8px; }
.unit-card p { margin: 0 0 14px; color: var(--ink-soft); font-size: 12px; line-height: 1.6; }
.unit-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}
.unit-bottom .state {
  font-size: 10px;
  font-weight: 800;
  color: var(--green-deep);
}
.unit-go {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .22);
}
.unit-card.done .unit-go { background: var(--green-deep); }

.official-hint {
  margin-top: 12px;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background:
    radial-gradient(circle at 8% 40%, rgba(255, 143, 177, .18), transparent 30%),
    linear-gradient(135deg, #fff8f9, #fffdf7);
  border-color: #f3d9df;
}
.official-hint[hidden] { display: none; }
.official-hint-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: #ffe9f0;
  font-size: 20px;
}
.official-hint b { display: block; font-size: 12.5px; margin-bottom: 2px; }
.official-hint p { margin: 0; color: var(--muted); font-size: 10.5px; line-height: 1.55; }
.official-hint > div { flex: 1; min-width: 180px; }
.official-hint .btn { min-height: 38px; padding: 0 13px; font-size: 11px; }

.home-quote {
  margin-top: 26px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background:
    radial-gradient(circle at 92% 20%, rgba(255, 211, 92, .22), transparent 32%),
    var(--panel);
}
.quote-cube {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: #f1ffdf;
  border: 1px solid #d7f3c2;
  font-size: 26px;
  flex: 0 0 auto;
}
.home-quote h3 { margin: 0 0 4px; font-size: 16px; }
.home-quote p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.home-quote .btn { margin-left: auto; }

/* ---------- 通用按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 15px;
  border: 2px solid transparent;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease;
  text-decoration: none;
}
.btn:active { transform: translateY(2px); }
.btn-primary {
  background: linear-gradient(180deg, #8ee665, #64c93d);
  color: #123a0c;
  border-color: rgba(255, 255, 255, .5);
  box-shadow: var(--shadow-btn);
}
.btn-primary:hover { filter: brightness(1.04); }
.btn-primary:active { box-shadow: 0 2px 0 var(--green-dark); }
.btn-glass {
  background: rgba(255, 255, 255, .16);
  color: #fff;
  border-color: rgba(255, 255, 255, .36);
  backdrop-filter: blur(8px);
}
.btn-glass:hover { background: rgba(255, 255, 255, .25); }
.btn-soft {
  background: #f1ffe7;
  color: var(--green-dark);
  border-color: #d4f3c1;
  box-shadow: 0 3px 0 #cbe9b8;
}
.btn-soft:hover { background: #e8ffd9; }
.btn-ghost {
  background: #fff;
  color: var(--ink-soft);
  border-color: var(--line);
  box-shadow: 0 3px 0 rgba(44, 69, 50, .07);
}
.btn-ghost:hover { background: #f8fbf5; }
.btn-danger {
  background: #fff4f2;
  color: #b23a35;
  border-color: #f0c5bf;
  box-shadow: 0 3px 0 #e8c2bc;
}
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- 页面头部 ---------- */
.screen-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 28px 0 18px;
}
.screen-head.compact { align-items: center; margin-bottom: 14px; }
.screen-head h1 { margin: 3px 0 6px; font-size: clamp(28px, 5vw, 40px); }
.screen-head p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; max-width: 680px; }
.back-btn {
  padding: 9px 0;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.back-btn:hover { color: var(--green-deep); }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.head-progress {
  flex: 0 0 auto;
  min-width: 108px;
  padding: 12px 16px;
  text-align: right;
}
.head-progress b { display: block; font-size: 22px; }
.head-progress small { color: var(--muted); font-size: 10px; }

/* ---------- 知识群岛 ---------- */
.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}
.dot-green { background: var(--green); box-shadow: 0 0 0 3px rgba(120, 217, 79, .18); }
.dot-blue { background: var(--blue); box-shadow: 0 0 0 3px rgba(91, 188, 245, .16); }
.dot-gold { background: var(--gold); box-shadow: 0 0 0 3px rgba(255, 200, 74, .18); }

.map-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

/* ---------- 知识卡 ---------- */
.learn-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.concept { padding: 22px; }
.concept-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.concept-avatar,
.concept-avatar svg,
.concept-avatar img {
  width: 62px;
  height: 82px;
  object-fit: contain;
  object-position: bottom;
  flex: 0 0 auto;
}
.concept-hero .bubble {
  padding: 10px 13px;
  border-radius: 14px 14px 14px 4px;
  background: #f2ffe8;
  border: 1px solid #d7f2c6;
  font-size: 13px;
  line-height: 1.55;
  font-weight: 700;
  color: var(--green-dark);
}
.concept h1 { margin: 2px 0 3px; font-size: clamp(26px, 4.6vw, 36px); }
.concept .island-name { color: var(--muted); font-size: 12px; margin-bottom: 18px; }
.concept-lead {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 20px;
}
.point-list {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: grid;
  gap: 10px;
}
.point-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f7fbf2;
  border: 1px solid #e7f1dd;
  font-size: 13px;
  line-height: 1.65;
}
.point-list .num {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--green);
  color: #173a0e;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 2px 0 var(--green-deep);
}
.formula-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 92% 12%, rgba(255, 255, 255, .1), transparent 30%),
    linear-gradient(145deg, #2f5f3a, #213f2b);
  color: #ecffe2;
  margin-bottom: 12px;
}
.formula-card::after {
  content: "∑";
  position: absolute;
  right: 12px;
  bottom: -18px;
  font-size: 82px;
  font-weight: 900;
  opacity: .06;
}
.formula-card small {
  display: block;
  margin-bottom: 6px;
  color: #b9e8a5;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}
.formula {
  font-size: clamp(18px, 3.5vw, 24px);
  font-weight: 900;
  line-height: 1.5;
  word-break: break-word;
}
.example-card {
  padding: 14px 16px;
  border-radius: 15px;
  background: #fff8df;
  border: 1px solid #f4e6b5;
  font-size: 12px;
  line-height: 1.7;
  color: #6d5313;
}
.example-card b { color: #4e3b07; }

.learn-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mini-scene {
  min-height: 220px;
  overflow: hidden;
  background: linear-gradient(180deg, #8fe4ff, #e5ffd4);
  position: relative;
}
.mini-scene svg { width: 100%; height: 100%; min-height: 220px; display: block; }
.mission { padding: 18px; }
.mission h3 { margin: 4px 0 12px; font-size: 18px; }
.mission-list {
  list-style: none;
  margin: 0 0 13px;
  padding: 0;
  display: grid;
  gap: 8px;
}
.mission-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
}
.mission-list span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 10px;
  font-weight: 900;
}
.mission-reward {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 10px;
  border-radius: 11px;
  background: #f8f5e8;
  font-size: 11px;
  font-weight: 800;
  color: #7b6425;
}

/* ---------- 答题 ---------- */
.quiz-shell { max-width: 760px; margin: 22px auto 0; }
.quiz-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.quiz-progress {
  flex: 1;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .58);
  border: 1px solid rgba(255, 255, 255, .8);
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(44, 69, 50, .08);
}
.quiz-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #a8ef7e, #5fc838);
  transition: width .35s ease;
}
.quiz-count {
  min-width: 44px;
  font-size: 12px;
  font-weight: 900;
  color: var(--ink-soft);
  text-align: right;
}
.quiz-card { padding: 20px; }
.quiz-guide {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 15px;
}
.quiz-avatar,
.quiz-avatar svg,
.quiz-avatar img {
  width: 54px;
  height: 70px;
  object-fit: contain;
  object-position: bottom;
  flex: 0 0 auto;
}
.quiz-guide .bubble {
  padding: 9px 12px;
  border-radius: 13px 13px 13px 4px;
  background: #f2ffe8;
  border: 1px solid #d9f3c8;
  color: var(--green-dark);
  font-size: 12px;
  line-height: 1.55;
  font-weight: 700;
}
.quiz-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.quiz-meta .muted { font-size: 10px; }
.quiz-card h2 {
  margin: 0 0 18px;
  font-size: clamp(19px, 3.4vw, 25px);
  line-height: 1.55;
  font-weight: 900;
}

.answer-area { display: grid; gap: 10px; }
.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.option-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 10px 12px;
  border: 2px solid #e3ecdb;
  border-radius: 15px;
  background: #fff;
  text-align: left;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 0 #e4eddd;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.option-btn:hover { border-color: #bde5a5; background: #fbfff6; }
.option-btn:active { transform: translateY(2px); box-shadow: none; }
.option-btn .letter {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #f1f7eb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.option-btn.correct {
  border-color: var(--green-deep);
  background: #eaffdd;
  box-shadow: 0 3px 0 #b7e39e;
}
.option-btn.correct .letter { background: var(--green); color: #173a0e; }
.option-btn.wrong {
  border-color: var(--red);
  background: var(--red-soft);
  box-shadow: 0 3px 0 #efc3bd;
  animation: shake .3s ease;
}
.option-btn.wrong .letter { background: var(--red); color: #fff; }
.option-btn.eliminated { opacity: .45; text-decoration: line-through; }
.option-btn[disabled] { cursor: default; }

.number-wrap {
  display: grid;
  gap: 10px;
}
.answer-display {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 64px;
  padding: 10px 16px;
  border: 2px solid #cfe6bf;
  border-radius: 15px;
  background: #fbfff6;
  box-shadow: inset 0 2px 5px rgba(54, 92, 37, .06);
}
.answer-display .value {
  flex: 1;
  font-size: 29px;
  font-weight: 900;
  letter-spacing: .02em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.answer-display .value.empty { color: #b9c8b1; font-size: 18px; letter-spacing: 0; }
.answer-display .unit {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}
.answer-display .caret {
  width: 2px;
  height: 30px;
  background: var(--green-deep);
  animation: blink 1s step-end infinite;
}
.keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-width: 360px;
}
.keypad button {
  min-height: 50px;
  border: 1px solid #e0ead8;
  border-radius: 12px;
  background: #fff;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 3px 0 #e4eddd;
}
.keypad button:hover { background: #f8fff2; }
.keypad button:active { transform: translateY(2px); box-shadow: none; }
.keypad .key-submit {
  grid-column: span 2;
  background: var(--green);
  color: #153a0b;
  border-color: #64c53d;
  box-shadow: 0 3px 0 var(--green-deep);
  font-size: 13px;
}
.keypad .key-submit:hover { background: #8ae861; }
.keypad .key-back { background: #fff5f3; color: #b34a43; }
.keypad .key-clear { font-size: 12px; color: var(--muted); }

.quiz-tools {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed #dfe9d6;
}
.hint-btn {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid #f0dda4;
  border-radius: 999px;
  background: #fff9e5;
  color: #826112;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}
.hint-btn:hover { background: #fff3c9; }
.hint-btn.used { opacity: .5; }
.hint-text {
  color: #826112;
  font-size: 12px;
  line-height: 1.6;
  padding-top: 5px;
}

.feedback {
  margin-top: 16px;
  padding: 14px;
  border-radius: 15px;
  border: 1px solid #c9eab6;
  background: #f0ffe6;
  animation: popIn .22s ease both;
}
.feedback.bad {
  border-color: #f0c5bf;
  background: #fff4f1;
}
.feedback-head { display: flex; align-items: flex-start; gap: 10px; }
.feedback-head > span { font-size: 24px; line-height: 1.2; }
.feedback-head b { font-size: 15px; display: block; margin-bottom: 2px; }
.feedback-head p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.feedback-explain {
  margin: 10px 0 14px;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.75;
}
.feedback .btn { min-height: 44px; }

/* ---------- 结算 ---------- */
.result-shell {
  max-width: 760px;
  margin: 22px auto 0;
  display: grid;
  gap: 14px;
}
.result-card {
  position: relative;
  overflow: hidden;
  padding: 26px 20px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, #fff5c9 0, transparent 42%),
    var(--panel);
}
.result-card h1 { margin: 8px 0 6px; font-size: clamp(28px, 5.5vw, 38px); }
.result-card .muted { font-size: 13px; line-height: 1.65; }
.result-stars {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-bottom: 8px;
  min-height: 58px;
  align-items: center;
}
.result-stars span {
  display: inline-block;
  font-size: 46px;
  line-height: 1;
  color: #e0d3ae;
  transform: scale(.7);
  animation: starPop .45s cubic-bezier(.2, 1.6, .4, 1) forwards;
}
.result-stars span.on { color: var(--gold); text-shadow: 0 3px 0 #c58b0e; }
.result-stars span:nth-child(2) { animation-delay: .12s; }
.result-stars span:nth-child(3) { animation-delay: .24s; }

.reward-big {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  margin: 12px 0 16px;
  padding: 9px 18px;
  border-radius: 999px;
  background: #eaffdd;
  border: 1px solid #c8ecb2;
  color: var(--green-dark);
}
.reward-big .reward-cube { font-size: 20px; }
.reward-big b { font-size: 28px; }
.reward-big span:last-child { font-size: 12px; font-weight: 800; }

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 430px;
  margin: 0 auto 18px;
}
.result-stats > div {
  padding: 10px 8px;
  border-radius: 12px;
  background: #f8fbf4;
  border: 1px solid #e8f0e1;
}
.result-stats b { display: block; font-size: 18px; }
.result-stats small { color: var(--muted); font-size: 10px; }
.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.result-actions .btn { min-height: 44px; padding: 0 15px; font-size: 12px; }

.review { padding: 18px; }
.review h3 { margin: 0 0 12px; font-size: 17px; }
.review-list { display: grid; gap: 10px; }
.review-item {
  padding: 12px 13px;
  border-radius: 13px;
  background: #fff8ef;
  border: 1px solid #f0e3ca;
}
.review-item .q { font-size: 12px; font-weight: 800; line-height: 1.55; margin-bottom: 5px; }
.review-item .a { font-size: 11px; color: var(--green-deep); font-weight: 800; }
.review-item .e { margin: 5px 0 0; font-size: 11px; color: var(--muted); line-height: 1.6; }

.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i {
  position: absolute;
  top: -20px;
  width: 8px;
  height: 12px;
  border-radius: 2px;
  animation: confettiFall 1.8s ease-in forwards;
}

/* ---------- 建造 ---------- */
.build-head { align-items: flex-start; }
.build-currency {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  flex: 0 0 auto;
}
.build-currency > span { font-size: 22px; }
.build-currency b { display: block; font-size: 20px; line-height: 1.1; }
.build-currency small { color: var(--muted); font-size: 10px; }
.build-currency .text-btn { margin-left: 6px; }

.build-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.build-stage {
  position: relative;
  min-height: 440px;
  height: 56vh;
  max-height: 620px;
  overflow: hidden;
  background:
    radial-gradient(circle at 72% 14%, #fff9c8 0 5%, transparent 18%),
    linear-gradient(180deg, #84d9f7 0%, #c9f4ff 56%, #ecffd8 100%);
}
.build-stage::before {
  content: "";
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: 0;
  height: 36%;
  background: radial-gradient(ellipse at 50% 100%, #b9e88f 0 58%, transparent 59%);
  opacity: .6;
}
.build-scene {
  position: absolute;
  inset: 0;
  z-index: 1;
  touch-action: manipulation;
}
.build-scene svg {
  width: 100%;
  height: 100%;
  display: block;
}
.build-hint {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 3;
  max-width: calc(100% - 90px);
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(20, 48, 32, .72);
  color: #fff;
  font-size: 10px;
  line-height: 1.5;
  backdrop-filter: blur(4px);
  pointer-events: none;
}
.build-level {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 253, 247, .9);
  border: 1px solid rgba(255, 255, 255, .9);
  color: var(--ink);
  font-size: 10px;
  font-weight: 900;
  box-shadow: 0 4px 12px rgba(26, 65, 39, .12);
}

.build-panel { padding: 14px; }
.build-tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 13px; }
.tool-btn {
  min-height: 44px;
  padding: 6px 4px;
  border: 1px solid #e0ead8;
  border-radius: 11px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 0 #e4eddd;
}
.tool-btn:active { transform: translateY(2px); box-shadow: none; }
.tool-btn.active {
  background: var(--green-soft);
  border-color: #b7dfa1;
  color: var(--green-dark);
  box-shadow: 0 3px 0 #b7dfa1;
}
.tool-btn[disabled] { opacity: .4; }
.build-panel h3 { margin: 0 0 9px; font-size: 15px; }

.palette {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 14px;
}
.block-swatch {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 7px 3px 6px;
  border: 2px solid transparent;
  border-radius: 11px;
  background: #f9fcf6;
  cursor: pointer;
  font-size: 9px;
  font-weight: 800;
  color: var(--muted);
  min-height: 70px;
}
.block-swatch:hover { background: #f2faec; }
.block-swatch.active {
  border-color: var(--green-deep);
  background: #efffe4;
  color: var(--green-dark);
  box-shadow: 0 0 0 3px rgba(120, 217, 79, .18);
}
.swatch-cube {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, .55);
  box-shadow: inset -6px -6px 0 rgba(0, 0, 0, .1), 0 3px 0 rgba(0, 0, 0, .12);
}
.block-swatch.locked { opacity: .5; }

.build-quests {
  border-top: 1px dashed #e1ead9;
  padding-top: 11px;
  margin-bottom: 9px;
}
.quest-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.4;
}
.quest-row .check {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  border-radius: 5px;
  background: #eef4e9;
  color: #9aaa95;
  font-size: 9px;
  font-weight: 900;
}
.quest-row.done { color: var(--green-deep); }
.quest-row.done .check { background: var(--green); color: #173a0e; }

/* ---------- 家长报告 ---------- */
.parent-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.report-hero {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background:
    radial-gradient(circle at 96% 0%, rgba(120, 217, 79, .18), transparent 34%),
    var(--panel);
}
.report-hero h2 { margin: 5px 0 6px; font-size: 22px; }
.report-hero p { margin: 0; font-size: 12px; line-height: 1.65; }
.report-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.report-metrics > div {
  padding: 10px;
  border-radius: 12px;
  background: #f7fbf3;
  border: 1px solid #e8f0e1;
  text-align: center;
}
.report-metrics b { display: block; font-size: 22px; }
.report-metrics small { color: var(--muted); font-size: 10px; }
.report-card { padding: 18px; }
.mastery-list { display: grid; gap: 10px; }
.mastery-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
}
.mastery-row .name { font-size: 11px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mastery-row .val { font-size: 10px; color: var(--muted); font-weight: 800; }
.mastery-bar {
  grid-column: span 2;
  height: 7px;
  border-radius: 999px;
  background: #edf3e8;
  overflow: hidden;
}
.mastery-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #9fe677, #5fc338);
}
.mastery-row.low .mastery-bar i { background: linear-gradient(90deg, #ffd36b, #f3a72c); }
.mastery-row.weak .mastery-bar i { background: linear-gradient(90deg, #ff9e95, #ea5b53); }

.mistake-list { display: grid; gap: 8px; }
.mistake-item {
  padding: 10px 11px;
  border-radius: 11px;
  background: #fff8f5;
  border: 1px solid #f4e2da;
}
.mistake-item .q { font-size: 11px; font-weight: 800; line-height: 1.5; }
.mistake-item .meta { margin-top: 4px; font-size: 10px; color: var(--muted); }
.mistake-item .meta b { color: var(--green-deep); }
.empty-state {
  padding: 18px 10px;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}
.parent-actions-card p { font-size: 12px; line-height: 1.65; }
.parent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.parent-actions .btn { min-height: 42px; padding: 0 14px; font-size: 11px; }

/* ---------- 底部导航 ---------- */
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: calc(10px + var(--safe-bottom));
  z-index: 45;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(520px, calc(100% - 24px));
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 22px;
  background: rgba(255, 253, 247, .9);
  box-shadow: 0 10px 30px rgba(36, 74, 49, .18);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.bottom-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 7px 4px;
  border: 0;
  border-radius: 15px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
.bottom-nav button span { font-size: 19px; line-height: 1.1; }
.bottom-nav button.active { background: var(--green-soft); color: var(--green-dark); }

/* ---------- 弹窗 / 提示 ---------- */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
}
.modal-root[hidden] { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 37, 25, .48);
  backdrop-filter: blur(5px);
}
.modal {
  position: relative;
  z-index: 1;
  width: min(500px, 100%);
  max-height: min(84vh, 760px);
  overflow: auto;
  padding: 22px;
  animation: modalIn .22s ease both;
}
.modal h2 { margin: 0 0 6px; font-size: 22px; }
.modal .muted { font-size: 12px; line-height: 1.65; }
.modal-close {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}
.modal-section { margin: 16px 0; }
.modal-section h3 { margin: 0 0 8px; font-size: 14px; }
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}
.modal-actions .btn { min-height: 44px; padding: 0 16px; font-size: 12px; }
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px dashed #e5eddf;
}
.setting-row:last-child { border-bottom: 0; }
.setting-row .label { font-size: 12px; font-weight: 800; }
.setting-row .desc { color: var(--muted); font-size: 10px; margin-top: 2px; }
.switch {
  position: relative;
  width: 50px;
  height: 28px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: #dbe6d4;
  cursor: pointer;
  transition: background .2s;
}
.switch::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,.18);
  transition: transform .2s;
}
.switch.on { background: var(--green); }
.switch.on::after { transform: translateX(22px); }

.char-options { display: flex; gap: 10px; }
.char-option {
  flex: 1;
  padding: 10px;
  border: 2px solid #e4ecde;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
}
.char-option.active { border-color: var(--green-deep); background: #f2ffe8; }
.char-option svg,
.char-option img { width: 48px; height: 62px; margin: 0 auto 4px; object-fit: contain; }
.char-option b { display: block; font-size: 12px; text-align: center; }
.char-option small { display: block; text-align: center; color: var(--muted); font-size: 9px; }

.asset-status {
  padding: 9px 10px;
  border-radius: 10px;
  background: #f7fbf3;
  border: 1px solid #e6efdf;
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--ink-soft);
  word-break: break-all;
}
.asset-status code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 10px;
  background: #edf5e7;
  padding: 1px 4px;
  border-radius: 4px;
}
.asset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}
.asset-actions .btn {
  min-height: 38px;
  padding: 0 11px;
  font-size: 10.5px;
  border-radius: 10px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(92px + var(--safe-bottom));
  z-index: 120;
  transform: translate(-50%, 20px);
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(26, 48, 33, .93);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.noscript {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #fffdf7;
  color: var(--ink);
  font-weight: 800;
}

/* ---------- SVG 场景 ---------- */
.scene-sky { pointer-events: none; }
.scene-hit {
  fill: rgba(255, 255, 255, .001);
  cursor: pointer;
}
.scene-hit:hover { fill: rgba(255, 255, 255, .2); }
.scene-hit.remove-hover:hover { fill: rgba(255, 100, 90, .28); }
.scene-grid-line { stroke: rgba(255, 255, 255, .22); stroke-width: 1; }
.scene-shadow { fill: rgba(28, 62, 30, .18); }
.scene-label {
  font-family: var(--font);
  font-size: 9px;
  font-weight: 800;
  fill: rgba(20, 48, 30, .55);
}
@keyframes idleBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
.scene-char {
  animation: idleBob 2.8s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center bottom;
}
.scene-char.guide { animation-delay: -1.2s; }

/* ---------- 动效 ---------- */
@keyframes cloudDrift {
  from { transform: translateX(0) scale(var(--s, 1)); }
  to { transform: translateX(calc(100vw + 420px)) scale(var(--s, 1)); }
}
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(12deg); }
  50% { transform: translateY(-15px) rotate(18deg); }
}
@keyframes screenIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(.96) translateY(5px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes starPop {
  to { transform: scale(1); }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
@keyframes confettiFall {
  to { transform: translateY(420px) rotate(720deg); opacity: .2; }
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- 响应式 ---------- */
@media (min-width: 560px) {
  #player-name { display: inline; }
  .app { width: min(1240px, calc(100% - 36px)); }
  .hero-content { padding: 38px 36px; }
  .quiz-card { padding: 26px; }
}

@media (min-width: 760px) {
  .map-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-scene svg { transform: translateX(14%) scale(1.02); }
  .home-side {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
  }
  .home-side .daily { height: auto; }
  .stat-grid { gap: 10px; }
  .learn-layout { grid-template-columns: minmax(0, 1fr) 310px; align-items: start; }
  .learn-side { position: sticky; top: 92px; }
  .result-stats { gap: 12px; }
  .parent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-hero { grid-column: span 2; flex-direction: row; align-items: center; justify-content: space-between; }
  .report-hero > div:first-child { flex: 1; }
  .report-metrics { min-width: 300px; }
  .build-layout { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
  .build-stage { height: 62vh; }
  .build-panel { position: sticky; top: 92px; }
}

@media (min-width: 1040px) {
  .home-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .home-side { display: flex; flex-direction: column; }
}

@media (min-width: 900px) {
  .hero-scene svg { transform: translateX(18%) scale(1.04); }
  .desktop-nav { display: flex; }
  .bottom-nav { display: none; }
  .app { padding-bottom: 36px; }
  .hero { min-height: 500px; }
  .hero-content { min-height: 500px; }
  .hero-guide { right: 30px; bottom: 24px; }
  .guide-avatar, .guide-avatar svg, .guide-avatar img { width: 108px; height: 144px; }
  .map-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .unit-strip { grid-auto-flow: initial; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; }
  .toast { bottom: 32px; }
  .build-stage { height: 66vh; max-height: 680px; }
}

@media (max-width: 420px) {
  .brand-text small { display: none; }
  .brand-text b { font-size: 14px; }
  .brand-cube { width: 36px; height: 36px; }
  .icon-btn { width: 38px; height: 38px; }
  .player-chip { padding: 4px; }
  .hero-content { padding: 28px 20px; }
  .hero h1 { font-size: 36px; }
  .hero-desc { font-size: 13px; }
  .hero-badges { display: none; }
  .hero-guide { max-width: 46%; right: 8px; bottom: 8px; }
  .hero-guide .bubble { font-size: 10px; padding: 7px 9px; }
  .guide-avatar, .guide-avatar svg, .guide-avatar img { width: 62px; height: 84px; }
  .choice-grid { grid-template-columns: 1fr; }
  .option-btn { min-height: 54px; }
  .build-stage { min-height: 360px; height: 46vh; }
  .build-currency .text-btn { display: none; }
  .screen-head { gap: 10px; }
  .head-progress { min-width: 92px; padding: 10px 12px; }
  .head-progress b { font-size: 18px; }
  .result-stars span { font-size: 40px; }
}

@media (max-width: 360px) {
  .app { width: calc(100% - 16px); }
  .topbar { top: 6px; margin-top: 6px; padding: 7px 8px; }
  .brand-text b { font-size: 13px; }
  .card { border-radius: 18px; }
  .hero h1 { font-size: 32px; }
}

/* 减少动态效果 */
body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
  scroll-behavior: auto !important;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
