/* ==========================================================
   早教盒子动画 · 《我会控笔啦》线条王国地图
   童话轻快风 · 移动端/平板自适应
   ========================================================== */

/* hidden 属性必须真正隐藏（否则会被后面的 display:flex 等规则覆盖） */
[hidden] { display: none !important; }

:root {
  --sky-1: #aee4ff;
  --sky-2: #d9f3ff;
  --cream: #fffdf5;
  --coral: #ff7a59;
  --coral-d: #f05a35;
  --sun: #ffd54f;
  --sun-d: #ffb300;
  --grass: #7ed957;
  --green: #58c265;
  --red: #ef5350;
  --ink: #4a3b32;
  --pink-soft: #ffe3d6;
  --font-fun: "ZCOOL KuaiLe", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: var(--font-fun);
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky-1), var(--sky-2));
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* ---------- 屏幕切换 ---------- */
.screen {
  display: none;
  min-height: 100vh;      /* 老版本 Safari 回退 */
  min-height: 100dvh;
  position: relative;
  overflow: hidden;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.screen.active { display: flex; flex-direction: column; animation: screenIn .45s ease; }
@keyframes screenIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- 背景云朵 ---------- */
.clouds { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.cloud {
  position: absolute; background: rgba(255,255,255,.75); border-radius: 999px;
  filter: blur(1px); animation: drift 26s linear infinite;
}
.cloud::before, .cloud::after {
  content: ""; position: absolute; background: inherit; border-radius: 50%;
}
.cloud.c1 { width: 140px; height: 44px; top: 8%; left: -160px; animation-duration: 34s; }
.cloud.c1::before { width: 60px; height: 60px; top: -26px; left: 22px; }
.cloud.c1::after  { width: 44px; height: 44px; top: -16px; left: 70px; }
.cloud.c2 { width: 100px; height: 34px; top: 22%; left: -140px; animation-duration: 46s; animation-delay: -18s; }
.cloud.c2::before { width: 44px; height: 44px; top: -20px; left: 16px; }
.cloud.c2::after  { width: 32px; height: 32px; top: -12px; left: 50px; }
.cloud.c3 { width: 120px; height: 38px; top: 60%; left: -160px; animation-duration: 40s; animation-delay: -8s; }
.cloud.c3::before { width: 52px; height: 52px; top: -22px; left: 20px; }
.cloud.c3::after  { width: 36px; height: 36px; top: -14px; left: 60px; }
@keyframes drift { to { transform: translateX(calc(100vw + 200px)); } }

/* ==========================================================
   首页
   ========================================================== */
#home { justify-content: flex-start; }
.home-head { text-align: center; padding: clamp(18px, 4vh, 40px) 16px 8px; position: relative; z-index: 1; }
.app-title { font-size: clamp(30px, 6vw, 52px); letter-spacing: 2px; }
.app-title span {
  display: inline-block;
  background: linear-gradient(180deg, #fff, #fff3c9);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 0 rgba(240, 90, 53, .85)) drop-shadow(0 5px 8px rgba(0,0,0,.12));
  animation: hop 2.4s ease-in-out infinite;
}
.app-title span:nth-child(2n) { animation-delay: .15s; }
.app-title span:nth-child(3n) { animation-delay: .3s; }
@keyframes hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.app-sub {
  margin-top: 6px; font-size: clamp(15px, 2.4vw, 20px); color: #5b7d92;
  text-shadow: 0 1px 0 #fff;
}

/* ---------- 绘本轮播（横向滑动 · 无缝循环 · 自动居中） ---------- */
.book-shelf {
  position: relative; z-index: 1;
  width: 100%;
  margin: clamp(8px, 2vh, 20px) auto 4px;
  display: flex;
  gap: clamp(16px, 3vw, 30px);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 20px calc(50% - min(37vw, 180px)) 12px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.book-shelf::-webkit-scrollbar { display: none; }
.book-shelf.no-smooth { scroll-behavior: auto; }   /* 循环跳回真身时关闭平滑 */
.book-card {
  border: none; background: none; cursor: pointer; font-family: inherit;
  flex: 0 0 min(74vw, 360px);
  scroll-snap-align: center;
  animation: cardIn .5s ease backwards;
  transition: transform .38s cubic-bezier(.22, .9, .3, 1.18), opacity .38s ease, filter .38s ease;
  transform: scale(.85);
  opacity: .5;
  filter: saturate(.7) brightness(.96);
}
.book-card.is-center { transform: scale(1); opacity: 1; filter: none; }
@keyframes cardIn { from { opacity: 0; transform: translateY(20px) scale(.94); } to { opacity: 1; } }

/* 轮播圆点指示器 */
.carousel-dots {
  position: relative; z-index: 1;
  display: flex; justify-content: center; align-items: center; gap: 9px;
  padding: 10px 0 2px;
}
.carousel-dots i {
  width: 10px; height: 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .8);
  box-shadow: 0 1px 3px rgba(58, 110, 140, .25);
  transition: width .3s ease, background .3s ease;
}
.carousel-dots i.on {
  width: 28px;
  background: linear-gradient(180deg, var(--sun), var(--sun-d));
}

/* ---------- 过场动画层（开局动画 / 回忆回放） ---------- */
.cut-layer { position: fixed; inset: 0; z-index: 100; background: #000; }
.cut-layer video { width: 100%; height: 100%; object-fit: contain; background: #000; }
/* 过场层的控制条与全屏按钮：复用城市动画的 .v-controls，浮在视频下方 */
.cut-layer .v-controls {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4;
}
.skip-cut-btn {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top)); right: 14px; z-index: 4;
  padding: 8px 20px; border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, .65);
  background: rgba(0, 0, 0, .45); color: #fff;
  font-size: 15px; font-family: inherit; cursor: pointer;
}
.skip-cut-btn:active { transform: scale(.95); }
.intro-prompt {
  position: absolute; inset: 0; z-index: 3;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 58%, rgba(0, 0, 0, .02), rgba(0, 0, 0, .5));
  cursor: pointer;
}
.ip-text {
  font-size: clamp(20px, 4vw, 30px); color: #fff; letter-spacing: 3px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .45);
  background: linear-gradient(180deg, #ff9a76, var(--coral-d));
  padding: 14px 36px; border-radius: 999px; border: 3px solid #fff;
  box-shadow: 0 6px 0 #c9431f, 0 12px 26px rgba(0, 0, 0, .4);
  animation: breath 1.6s ease-in-out infinite;
}
@keyframes breath { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }

.book-cover {
  position: relative; border-radius: 22px; overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #fff;
  box-shadow: 0 10px 0 rgba(255,255,255,.65), 0 16px 26px rgba(58,110,140,.22);
  border: 5px solid #fff;
  transition: transform .25s ease, box-shadow .25s ease;
}
.book-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.book-card.playable:hover .book-cover,
.book-card.playable:active .book-cover { transform: translateY(-6px) rotate(-1deg); box-shadow: 0 16px 0 rgba(255,255,255,.65), 0 22px 30px rgba(58,110,140,.28); }
.book-badge {
  position: absolute; right: 10px; bottom: 10px;
  background: linear-gradient(180deg, var(--sun), var(--sun-d));
  color: #6b4a00; font-size: clamp(13px, 1.6vw, 16px);
  padding: 6px 14px; border-radius: 999px;
  box-shadow: 0 3px 0 #d99400, 0 6px 10px rgba(0,0,0,.15);
  animation: wiggle 2.2s ease-in-out infinite;
}
@keyframes wiggle { 0%,100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg) scale(1.05); } }
.book-info { text-align: center; margin-top: 10px; }
.book-no { font-size: clamp(12px, 1.5vw, 14px); color: #6f93a8; }
.book-name { font-size: clamp(17px, 2.2vw, 22px); color: var(--ink); text-shadow: 0 1px 0 #fff; }
.book-card.locked .book-cover {
  background: linear-gradient(160deg, #e8eef2, #cfdbe3); border-color: rgba(255,255,255,.7);
}
.ph { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; }
.ph-2 { background: linear-gradient(160deg, #ffe0ec, #ffc7de); }
.ph-3 { background: linear-gradient(160deg, #e2f7d8, #c4ecc0); }
.ph-4 { background: linear-gradient(160deg, #fff3d1, #ffe2a8); }
.ph-5 { background: linear-gradient(160deg, #e3e8ff, #c9d4ff); }
.book-card.locked .ph-name {
  font-size: 44px; color: rgba(255,255,255,.95); text-shadow: 0 3px 6px rgba(0,0,0,.12);
}
.book-card.locked .lock {
  font-size: 22px; background: rgba(255,255,255,.85); border-radius: 50%;
  width: 44px; height: 44px; display: grid; place-items: center;
  box-shadow: 0 3px 8px rgba(0,0,0,.1);
}
.book-card.locked .book-name { color: #90a4b0; }
.book-card.locked:active .book-cover { transform: scale(.98); }

/* ==========================================================
   地图页
   ========================================================== */
#map { padding: 10px clamp(8px, 2vw, 24px) 16px; }
.map-head {
  position: relative; z-index: 5;
  width: min(1100px, 100%);
  margin: 0 auto 8px;
  display: flex; align-items: center; gap: 12px;
}
.map-title { flex: 1; min-width: 0; }
.map-title h2 { font-size: clamp(18px, 3vw, 26px); text-shadow: 0 2px 0 #fff, 0 4px 8px rgba(0,0,0,.08); }
.map-sub { font-size: clamp(11px, 1.6vw, 14px); color: #5b7d92; }
.head-right { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  font-family: inherit; font-size: clamp(18px, 2.6vw, 24px);
  width: clamp(42px, 6vw, 52px); height: clamp(42px, 6vw, 52px);
  border-radius: 50%; border: 3px solid #fff;
  background: linear-gradient(180deg, #ffffff, #eaf6fd);
  box-shadow: 0 4px 0 rgba(120,170,200,.45), 0 6px 12px rgba(58,110,140,.18);
  cursor: pointer; display: grid; place-items: center;
  transition: transform .15s ease;
}
.icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(120,170,200,.45); }

.progress-dots { display: flex; gap: 5px; background: rgba(255,255,255,.7); padding: 7px 10px; border-radius: 999px; box-shadow: 0 2px 6px rgba(58,110,140,.15); }
.pdot {
  width: clamp(12px, 1.8vw, 16px); height: clamp(12px, 1.8vw, 16px);
  border-radius: 50%; background: #cfdbe3; border: 2px solid #fff;
  transition: all .3s ease; font-size: 0;
}
.pdot.on { background: radial-gradient(circle at 35% 35%, #ffe082, var(--sun-d)); box-shadow: 0 0 8px rgba(255,193,7,.8); }

/* ---------- 地图舞台 ---------- */
.stage-wrap { position: relative; z-index: 1; width: min(1100px, 100%); margin: 0 auto; flex: 1; display: flex; align-items: center; justify-content: center; }
.stage {
  position: relative;
  width: 100%;                                             /* 回退 */
  width: min(100%, calc((100dvh - 110px) * 1080 / 764));   /* 现代浏览器：完整可见 */
  max-width: 1100px;
  aspect-ratio: 1080 / 764;
  border-radius: clamp(14px, 2.4vw, 26px); overflow: hidden;
  box-shadow: 0 0 0 6px rgba(255,255,255,.9), 0 18px 34px rgba(45,100,135,.28);
}
.stage .base { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* 点亮图层：用完整点亮图 + clip-path 圆形揭示 */
.reveal {
  position: absolute; inset: 0;
  background: url("../assets/img/map-lit.jpg") center / 100% 100% no-repeat;
  clip-path: ellipse(var(--rx) var(--ry) at var(--cx) var(--cy));
  -webkit-clip-path: ellipse(var(--rx) var(--ry) at var(--cx) var(--cy));
  opacity: 0; pointer-events: none;
  will-change: opacity, filter;
}
/* 微微亮起（下一个目标提示） */
.reveal.dim {
  opacity: .48;
  animation: breathe 2.2s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: .38; filter: brightness(1) drop-shadow(0 0 0 rgba(255,255,255,0)); }
  50%       { opacity: .72; filter: brightness(1.18) drop-shadow(0 0 14px rgba(255,255,255,.75)); }
}
/* 点亮瞬间：闪一下再亮起 */
.reveal.lit { animation: flickerOn .55s ease-out forwards; opacity: 1; }
@keyframes flickerOn {
  0%   { opacity: .45; filter: brightness(1.5); }
  25%  { opacity: 1;   filter: brightness(1.55) drop-shadow(0 0 20px rgba(255,255,255,.95)); }
  45%  { opacity: .3;  filter: brightness(1); }
  65%  { opacity: 1;   filter: brightness(1.35) drop-shadow(0 0 16px rgba(255,255,255,.85)); }
  100% { opacity: 1;   filter: brightness(1) drop-shadow(0 0 6px rgba(255,255,255,.4)); }
}
/* 全部点亮后：一闪一闪发光 */
.stage.all-done .reveal.lit {
  animation: twinkle 2.6s ease-in-out infinite;
  animation-delay: var(--td, 0s);
}
@keyframes twinkle {
  0%, 100% { filter: brightness(1) drop-shadow(0 0 2px rgba(255,255,255,.3)); }
  50%      { filter: brightness(1.22) drop-shadow(0 0 18px rgba(255,255,255,.9)); }
}

/* ---------- 点击热区 ---------- */
.spot {
  position: absolute; left: var(--cx); top: var(--cy);
  width: 24%; max-width: 200px; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%; border: none; background: transparent;
  cursor: pointer; padding: 0; z-index: 6;
}
.spot:focus-visible { outline: 3px dashed rgba(255,255,255,.9); outline-offset: -8px; }
/* 下一个目标：脉冲光环 + 跳动星星 */
.spot.next::after {
  content: ""; position: absolute; inset: 12%;
  border-radius: 50%; border: 4px solid rgba(255,255,255,.95);
  box-shadow: 0 0 18px rgba(255,255,255,.9), inset 0 0 14px rgba(255,255,255,.5);
  animation: ringPulse 1.6s ease-out infinite;
}
@keyframes ringPulse {
  0%   { transform: scale(.82); opacity: .95; }
  70%  { transform: scale(1.12); opacity: 0; }
  100% { transform: scale(1.12); opacity: 0; }
}
.spot.next::before {
  content: "⭐";
  position: absolute; top: -14%; left: 50%;
  transform: translateX(-50%);
  font-size: clamp(20px, 3.4vw, 32px);
  filter: drop-shadow(0 3px 4px rgba(0,0,0,.25));
  animation: starHop 1.2s ease-in-out infinite;
}
@keyframes starHop {
  0%, 100% { transform: translate(-50%, 0) scale(1); }
  50%      { transform: translate(-50%, -38%) scale(1.12); }
}
/* 已完成：不显示光环 */
.spot.done::after, .spot.done::before { content: none; }

/* ---------- 喝彩粒子 ---------- */
.cheer { position: absolute; left: var(--cx); top: var(--cy); z-index: 7; pointer-events: none; }
.cheer i {
  position: absolute; font-style: normal; font-size: 22px;
  animation: burst 1.15s ease-out forwards;
  animation-delay: var(--d, 0s);
  opacity: 0;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.2));
}
@keyframes burst {
  0%   { transform: translate(0, 0) scale(.4) rotate(0deg); opacity: 0; }
  12%  { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1.15) rotate(var(--rot)); opacity: 0; }
}

/* ==========================================================
   通用浮层
   ========================================================== */
.overlay {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.overlay[hidden] { display: none; }

/* ---------- 视频 ---------- */
.video-layer { background: rgba(20, 34, 48, .92); backdrop-filter: blur(4px); }
.video-box {
  position: relative; width: min(100%, 1080px);
  aspect-ratio: 16 / 9; max-height: 82vh; max-height: 82dvh;
  background: #000; border-radius: 18px; overflow: hidden;
  box-shadow: 0 0 0 5px rgba(255,255,255,.9), 0 24px 48px rgba(0,0,0,.5);
}
.video-box video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.video-loading {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  color: #fff; font-size: clamp(15px, 2vw, 19px); background: rgba(0,0,0,.55);
  transition: opacity .3s ease;
}
.video-loading.off { opacity: 0; pointer-events: none; }
.spinner {
  width: 52px; height: 52px; border-radius: 50%;
  border: 6px solid rgba(255,255,255,.25); border-top-color: var(--sun);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.stop-btn { position: absolute; top: 10px; right: 10px; z-index: 2; opacity: .9; }

/* ---------- 自定义播放控制条 ---------- */
.v-controls {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(15, 25, 38, .82));
}
.v-btn {
  font-family: inherit; color: #fff; font-size: 18px;
  width: 44px; height: 44px; flex: 0 0 44px;
  border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,.16);
  display: grid; place-items: center;
  transition: transform .15s ease, background .15s ease;
}
.v-btn:active { transform: scale(.9); background: rgba(255,255,255,.3); }
/* 进度条 */
.v-seek {
  position: relative; flex: 1; height: 28px;
  display: flex; align-items: center; cursor: pointer;
  touch-action: none;   /* 允许水平拖动手势 */
  user-select: none; -webkit-user-select: none;   /* 防止拖动时选中文字/控件 */
  -webkit-tap-highlight-color: transparent;
}
.v-seek-track {
  position: absolute; left: 0; right: 0; height: 8px; border-radius: 999px;
  background: rgba(255,255,255,.28);
}
.v-seek-fill {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  height: 8px; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, #ffd54f, #ff7a59);
  pointer-events: none;
}
.v-seek-handle {
  position: absolute; top: 50%; left: 0%;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 3px solid #ff7a59;
  /* 不用 transform 居中：用 margin 把中心拉到 left 位置，
     这样把手始终在 vSeek 范围内，0% 时左缘在 vSeek.left，
     点击把手永远落在 vSeek 上而不是旁边的按钮上 */
  margin-left: -9px; margin-top: -9px;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
  pointer-events: none; transition: transform .12s ease;
}
.v-seek.dragging .v-seek-handle { transform: scale(1.25); }
.v-time { color: #fff; font-size: clamp(12px, 1.8vw, 14px); white-space: nowrap; font-variant-numeric: tabular-nums; }
/* 伪全屏兜底（不支持 Fullscreen API 的环境） */
.video-box.pseudo-fs {
  position: fixed; inset: 0; width: 100vw; height: 100dvh;
  max-width: none; max-height: none; border-radius: 0; z-index: 9999;
}

/* ---------- 闯关完成 ---------- */
.done-layer { background: rgba(38, 62, 84, .55); backdrop-filter: blur(3px); }
.done-card {
  background: linear-gradient(180deg, #fffef8, #fff3dc);
  border: 5px solid #fff; border-radius: 30px;
  box-shadow: 0 14px 0 rgba(240, 150, 80,.35), 0 26px 50px rgba(0,0,0,.3);
  width: min(92%, 430px);
  padding: clamp(24px, 5vw, 38px) clamp(20px, 4vw, 32px);
  text-align: center;
  animation: cardPop .5s cubic-bezier(.34,1.56,.64,1);
}
@keyframes cardPop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.done-stars { font-size: clamp(30px, 6vw, 42px); display: flex; justify-content: center; gap: 8px; }
.done-stars span { display: inline-block; animation: starPop .55s cubic-bezier(.34,1.8,.64,1) backwards; }
.done-stars span:nth-child(2) { animation-delay: .14s; }
.done-stars span:nth-child(3) { animation-delay: .28s; }
@keyframes starPop { from { transform: scale(0) rotate(-90deg); } to { transform: scale(1) rotate(0); } }
.done-title { font-size: clamp(26px, 5vw, 34px); color: var(--coral-d); margin-top: 8px; text-shadow: 0 2px 0 #fff; }
.done-text { font-size: clamp(16px, 2.6vw, 20px); color: #7a6a5c; margin: 10px 0 22px; }
.done-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- 童话风按钮 ---------- */
.cute-btn {
  font-family: inherit; font-size: clamp(16px, 2.6vw, 20px);
  padding: 12px 24px; border-radius: 999px; border: 3px solid #fff;
  cursor: pointer; color: #fff; letter-spacing: 1px;
  text-shadow: 0 1px 2px rgba(0,0,0,.18);
  transition: transform .15s ease, filter .15s ease;
}
.cute-btn:active { transform: translateY(3px) scale(.98); filter: brightness(1.05); }
.cute-btn.coral { background: linear-gradient(180deg, #ff9a76, var(--coral-d)); box-shadow: 0 5px 0 #c9431f, 0 8px 14px rgba(0,0,0,.18); }
.cute-btn.yellow { background: linear-gradient(180deg, #ffdf6b, var(--sun-d)); color: #6b4a00; text-shadow: none; box-shadow: 0 5px 0 #d99400, 0 8px 14px rgba(0,0,0,.15); }
.cute-btn.green { background: linear-gradient(180deg, #8fdf8f, var(--green)); box-shadow: 0 5px 0 #3a9a46, 0 8px 14px rgba(0,0,0,.15); min-width: 110px; }
.cute-btn.red { background: linear-gradient(180deg, #ff8a80, var(--red)); box-shadow: 0 5px 0 #c62828, 0 8px 14px rgba(0,0,0,.15); min-width: 110px; }

/* ---------- 顺序提示 Toast（暖色童话气泡） ---------- */
.toast-mask { position: fixed; inset: 0; z-index: 70; }
.toast-bubble {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(165deg, #fff8ec, #ffedd3 60%, #ffe4c0);
  border: 3px solid #ffb964;
  border-radius: 26px;
  padding: 18px 26px;
  max-width: min(86vw, 420px);
  box-shadow: 0 10px 0 rgba(255, 169, 77, .35), 0 18px 36px rgba(120, 70, 20, .25);
  animation: toastIn .35s cubic-bezier(.34,1.56,.64,1);
}
@keyframes toastIn { from { transform: translate(-50%, -38%) scale(.7); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.toast-bubble::before {
  content: "☁"; position: absolute; top: -18px; left: -12px;
  font-size: 30px; color: #ffd9a8; transform: rotate(-12deg);
  filter: drop-shadow(0 2px 2px rgba(120,70,20,.2));
}
.toast-bubble::after {
  content: "🦋"; position: absolute; bottom: -16px; right: -10px;
  font-size: 24px; transform: rotate(10deg);
  filter: drop-shadow(0 2px 2px rgba(120,70,20,.2));
}
.toast-text { font-size: clamp(17px, 3vw, 22px); color: #9a5b1f; white-space: nowrap; }
.toast-deco { font-size: clamp(16px, 2.6vw, 20px); animation: wiggle 1.6s ease-in-out infinite; }
.toast-close {
  position: absolute; top: -14px; right: -14px;
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid #fff; background: linear-gradient(180deg, #ffb27a, #f07a3c);
  color: #fff; font-size: 17px; font-family: inherit; cursor: pointer;
  box-shadow: 0 3px 0 #c95a1e, 0 6px 10px rgba(0,0,0,.2);
  display: grid; place-items: center;
}
.toast-close:active { transform: translateY(2px); }

/* ---------- 重复修复确认框 ---------- */
.confirm-mask { background: rgba(38, 62, 84, .5); backdrop-filter: blur(3px); z-index: 65; }
.confirm-card {
  background: linear-gradient(180deg, #fffef8, #fff3dc);
  border: 5px solid #fff; border-radius: 28px;
  box-shadow: 0 12px 0 rgba(240, 150, 80, .35), 0 24px 46px rgba(0,0,0,.28);
  width: min(88%, 380px);
  padding: 28px 24px 24px; text-align: center;
  animation: cardPop .4s cubic-bezier(.34,1.56,.64,1);
}
.confirm-icon { font-size: 42px; margin-bottom: 8px; animation: wiggle 2s ease-in-out infinite; }
.confirm-text { font-size: clamp(17px, 2.8vw, 21px); color: #6b5a4c; margin-bottom: 20px; line-height: 1.5; }
.confirm-btns { display: flex; gap: 16px; justify-content: center; }

/* ---------- 全屏通关庆祝（温柔童话风） ---------- */
.final-layer {
  background: radial-gradient(circle at 50% 42%, rgba(255,244,214,.96), rgba(255,228,196,.94) 55%, rgba(255,206,170,.94));
  z-index: 80; flex-direction: column; cursor: pointer;
}
.final-card { text-align: center; animation: finalIn .8s ease; position: relative; z-index: 2; }
@keyframes finalIn { from { transform: scale(.8) translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.final-sparkles { font-size: clamp(26px, 5vw, 40px); letter-spacing: 12px; animation: wiggle 2.4s ease-in-out infinite; }
.final-title {
  font-size: clamp(34px, 7vw, 56px); color: var(--coral-d);
  text-shadow: 0 3px 0 #fff, 0 8px 14px rgba(200, 100, 40, .3);
  margin: 10px 0 6px;
}
.final-text { font-size: clamp(20px, 4vw, 30px); color: #8a6a3c; text-shadow: 0 2px 0 #fff; }
.final-text strong { color: var(--coral-d); }
.final-hint {
  margin-top: clamp(22px, 5vh, 40px);
  font-size: clamp(14px, 2.4vw, 18px); color: #b08a5a;
  opacity: 0; transition: opacity .6s ease;
  animation: breatheText 1.8s ease-in-out infinite;
}
.final-layer.can-close .final-hint { opacity: 1; }
@keyframes breatheText { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
/* 温柔彩带 */
.confetti-box { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.confetti-box i {
  position: absolute; top: -6vh; font-style: normal;
  animation: confettiFall linear infinite;
  opacity: .9;
}
@keyframes confettiFall {
  to { transform: translateY(112vh) rotate(720deg); }
}

/* ==========================================================
   响应式微调
   ========================================================== */
@media (max-width: 640px) {
  .map-head { flex-wrap: wrap; }
  .map-title { order: 2; width: 100%; text-align: center; flex-basis: 100%; }
  .map-head .icon-btn#btnBack { order: 0; }
  .head-right { order: 1; margin-left: auto; }
  .spot { width: 34%; }
  .toast-bubble { padding: 14px 18px; }
}
@media (max-height: 480px) and (orientation: landscape) {
  .map-head { margin-bottom: 4px; }
  .map-sub { display: none; }
}

/* ==========================================================
   学号登录 / 切换（保留绘本进度）
   ========================================================== */
.login-mask { z-index: 95; background: rgba(60, 40, 30, .45); backdrop-filter: blur(2px); }
.login-card {
  position: relative;
  background: linear-gradient(180deg, #fffef8, #fff3dc);
  border: 5px solid #fff; border-radius: 30px;
  box-shadow: 0 12px 0 rgba(240, 150, 80, .35), 0 24px 46px rgba(0, 0, 0, .28);
  width: min(90%, 400px); padding: 28px 26px 22px; text-align: center;
  animation: cardPop .4s cubic-bezier(.34, 1.56, .64, 1);
}
.login-close {
  position: absolute; top: 8px; right: 12px;
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid #ffd9a8; background: #fff; color: #b08a72;
  font-size: 20px; line-height: 1; cursor: pointer; font-family: inherit;
}
.login-close:active { transform: scale(.92); }
.login-deco { font-size: 44px; margin-bottom: 2px; animation: wiggle 2s ease-in-out infinite; }
.login-title { font-size: clamp(19px, 3.2vw, 24px); color: var(--ink); margin: 4px 0 6px; }
.login-tip { font-size: clamp(13px, 2.4vw, 15px); color: #8a7566; margin-bottom: 16px; }
.login-input {
  width: 100%; box-sizing: border-box; font-family: inherit;
  font-size: clamp(17px, 3vw, 20px); text-align: center; letter-spacing: 1px;
  padding: 13px 16px; border-radius: 18px;
  border: 3px solid #ffd9a8; background: #fff; color: var(--ink);
  outline: none; transition: border-color .2s ease, box-shadow .2s ease;
}
.login-input:focus { border-color: var(--coral); box-shadow: 0 0 0 4px rgba(255, 122, 89, .16); }
.login-input::placeholder { color: #c9b8a8; letter-spacing: 0; }
.login-err { color: var(--red); font-size: 14px; margin: 10px 0 0; }
.login-btn {
  margin-top: 18px; width: 100%; font-family: inherit;
  font-size: clamp(17px, 3vw, 21px); padding: 13px 24px;
  border-radius: 999px; border: 3px solid #fff; cursor: pointer;
  color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .18);
  background: linear-gradient(180deg, #ff9a76, var(--coral-d));
  box-shadow: 0 5px 0 #c9431f, 0 8px 14px rgba(0, 0, 0, .18);
  transition: transform .15s ease;
}
.login-btn:active { transform: translateY(3px) scale(.99); }
.login-foot { margin-top: 14px; }
.login-link {
  background: none; border: none; color: #a1887f; font-size: 13px;
  text-decoration: underline; cursor: pointer; font-family: inherit; padding: 4px;
}
.login-note { font-size: 12px; color: #a99a8c; margin-top: 8px; line-height: 1.5; }

/* ---------- 进入绘本时的进度提示（浮在地图上方） ---------- */
.map-progress-hint {
  position: absolute;
  top: 6px; left: 50%;
  z-index: 6;
  display: flex; align-items: center; gap: 6px;
  padding: 8px 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fffdf3, #ffe9c9);
  border: 2px solid #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .16);
  color: #7a5a3a;
  font-size: clamp(13px, 2.2vw, 16px); font-weight: 600;
  white-space: nowrap; pointer-events: none;
  transform: translateX(-50%);
  animation: hintDrop .5s cubic-bezier(.34, 1.56, .64, 1);
}
.map-progress-hint.fade { animation: hintFade .5s ease forwards; }
@keyframes hintDrop {
  from { opacity: 0; transform: translate(-50%, -16px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes hintFade {
  from { opacity: 1; transform: translate(-50%, 0); }
  to   { opacity: 0; transform: translate(-50%, -12px); }
}

/* ==========================================================
   加载反馈：转圈 + 进度条 + 实时百分比（避免加载期间黑屏干等）
   主播放器 #videoLoading 与过场层 #cutLoading 共用
   ========================================================== */
.load-bar {
  width: min(62%, 280px); height: 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .26);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .3);
  overflow: hidden;
}
.load-bar-fill {
  width: 0%; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #ffd54f, #ff7a59);
  transition: width .25s ease;
}
/* 还拿不到真实进度时：进度条来回扫动，避免僵在 0% 让人以为卡死 */
.load-bar.indeterminate .load-bar-fill {
  width: 38%;
  transition: none;
  animation: loadSlide 1.15s ease-in-out infinite;
}
@keyframes loadSlide {
  0%   { transform: translateX(-105%); }
  100% { transform: translateX(275%); }
}
.load-pct {
  font-size: clamp(13px, 2.2vw, 17px); color: #fff; letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .45);
}
/* 过场层的加载遮罩：层级低于跳过按钮与控制条，保证加载中仍可跳过/操作 */
.cut-loading { z-index: 3; }

/* 首页学号徽章 */
.user-badge {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 12px; padding: 6px 6px 6px 14px;
  background: rgba(255, 255, 255, .88); border: 2px solid #ffe0b2;
  border-radius: 999px; box-shadow: 0 3px 10px rgba(0, 0, 0, .08);
}
.ub-emoji { font-size: 16px; }
.ub-code {
  font-size: 14px; color: var(--ink); font-weight: 600;
  max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ub-btn {
  font-family: inherit; font-size: 13px; cursor: pointer;
  padding: 5px 14px; border-radius: 999px; border: none;
  color: #fff; background: linear-gradient(180deg, #ffb37b, var(--coral));
  box-shadow: 0 2px 0 #c9431f; transition: transform .12s ease;
}
.ub-btn:active { transform: translateY(2px); }
