* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --bg: #eef4ff; --card: #fff; --ink: #1f2937; --sub: #6b7280; --pri: #2563eb; --ok: #16a34a; --bad: #dc2626;
  --r: 18px; --shadow: 0 4px 16px rgba(30, 58, 138, .10);
}
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; }
body { min-height: 100vh; padding-bottom: env(safe-area-inset-bottom); }
button { font: inherit; cursor: pointer; border: 0; touch-action: manipulation; }
input, select { font: inherit; }
.hidden { display: none !important; }

/* 顶栏 */
#topbar { position: sticky; top: 0; z-index: 20; background: linear-gradient(90deg, #1e3a8a, #2563eb); color: #fff;
  padding: calc(env(safe-area-inset-top) + 8px) 16px 8px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#topbar:empty { display: none; }
.brand { font-weight: 700; font-size: 18px; margin-right: auto; display: flex; align-items: center; gap: 8px; }
.brand small { font-weight: 400; opacity: .85; font-size: 13px; }
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav button { background: rgba(255,255,255,.15); color: #fff; padding: 8px 14px; border-radius: 999px; min-height: 40px; }
.nav button.on { background: #fff; color: #1e3a8a; font-weight: 700; }
.timer { background: #fbbf24; color: #78350f; font-weight: 700; padding: 6px 14px; border-radius: 999px; min-height: 40px;
  display: flex; align-items: center; gap: 6px; }
.timer.low { background: #f87171; color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .7; } }

main { max-width: 1100px; margin: 0 auto; padding: 18px 16px 110px; }
h1 { font-size: 26px; margin: 8px 0 14px; }
h2 { font-size: 21px; margin: 22px 0 10px; }
h3 { margin: 0 0 6px; font-size: 18px; }
.sub { color: var(--sub); font-size: 15px; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.center { text-align: center; }

.btn { background: var(--pri); color: #fff; padding: 12px 22px; border-radius: 14px; font-weight: 700; min-height: 50px;
  box-shadow: 0 3px 0 rgba(0,0,0,.15); transition: transform .08s; }
.btn:active { transform: translateY(2px); box-shadow: none; }
.btn.big { font-size: 20px; padding: 16px 30px; min-height: 60px; }
.btn.ghost { background: #fff; color: var(--pri); border: 2px solid #c7d7fb; box-shadow: none; }
.btn.ok { background: var(--ok); }
.btn.warn { background: #f59e0b; }
.btn.danger { background: var(--bad); }
.btn:disabled { opacity: .45; }
.speak { background: #e0e7ff; color: #3730a3; border-radius: 999px; padding: 6px 14px; min-height: 40px; font-size: 15px; }

/* 注册 */
.welcome { text-align: center; padding: 30px 10px; }
.welcome .logo { font-size: 72px; }
.profiles { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin: 24px 0; }
.pf { background: #fff; border-radius: 20px; box-shadow: var(--shadow); padding: 18px; width: 150px; }
.pf .av { font-size: 52px; }
.pf b { display: block; }
.steps { display: flex; gap: 6px; justify-content: center; margin-bottom: 16px; }
.steps i { width: 36px; height: 6px; border-radius: 3px; background: #c7d2fe; }
.steps i.on { background: var(--pri); }
.field { margin: 14px 0; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; }
.field input, .field select { width: 100%; padding: 12px 14px; border-radius: 12px; border: 2px solid #c7d2fe; font-size: 18px; background: #fff; }
.avatars { display: flex; flex-wrap: wrap; gap: 8px; }
.avatars button { font-size: 34px; width: 60px; height: 60px; border-radius: 16px; background: #f1f5f9; }
.avatars button.on { background: #dbeafe; outline: 3px solid var(--pri); }
.agebox { background: #fef3c7; border-radius: 14px; padding: 12px 16px; margin-top: 10px; }
.pick { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.pick button { background: #fff; border: 3px solid #e5e7eb; border-radius: 16px; padding: 14px 8px; min-height: 96px; }
.pick button .ic { font-size: 34px; display: block; }
.pick button.on { border-color: var(--pri); background: #eff6ff; }

/* 首页 */
.hello { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.hello .av { font-size: 56px; }
.ladder { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.ladder span { padding: 4px 10px; border-radius: 8px; font-size: 13px; background: #e5e7eb; color: #6b7280; }
.ladder span.on { color: #fff; font-weight: 700; }
.rec { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.rec .card { cursor: pointer; border-left: 8px solid; display: flex; flex-direction: column; gap: 4px; }
.rec .why { font-size: 13px; color: var(--sub); }
.tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; color: #fff; font-weight: 700; }
.island { cursor: pointer; text-align: center; position: relative; overflow: hidden; }
.island .ic { font-size: 46px; }
.bar { height: 10px; background: #e5e7eb; border-radius: 5px; overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; border-radius: 5px; }

/* 领域路径 */
.path { display: flex; flex-direction: column; gap: 16px; }
.lvrow { background: #fff; border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); border-left: 8px solid; }
.lvrow.mine { outline: 3px dashed #fbbf24; }
.nodes { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.node { background: #f8fafc; border: 3px solid #e2e8f0; border-radius: 16px; padding: 10px 14px; min-width: 180px; min-height: 64px;
  display: flex; gap: 10px; align-items: center; text-align: left; flex: 1 1 200px; }
.node .ic { font-size: 30px; }
.node.done { border-color: #86efac; background: #f0fdf4; }
.node.open { border-color: #93c5fd; background: #eff6ff; }
.node.next { border-color: #f59e0b; background: #fffbeb; animation: glow 1.6s infinite; }
.node.locked { opacity: .5; }
@keyframes glow { 50% { box-shadow: 0 0 0 6px rgba(245, 158, 11, .2); } }
.books { font-size: 14px; color: var(--sub); }

/* 全景 */
.pano { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pano table { border-collapse: separate; border-spacing: 6px; min-width: 900px; width: 100%; }
.pano th { font-size: 14px; padding: 6px; }
.pano th.lv { text-align: left; white-space: nowrap; border-radius: 10px; color: #fff; }
.pano td { background: #fff; border-radius: 12px; padding: 6px; vertical-align: top; }
.pano td.mine { outline: 3px dashed #fbbf24; }
.dot { display: block; width: 100%; margin: 3px 0; padding: 6px; border-radius: 10px; font-size: 13px; text-align: left; background: #f1f5f9; min-height: 36px; }
.dot.done { background: #dcfce7; }
.dot.open { background: #dbeafe; }
.dot.locked { opacity: .45; }

/* 学习卡片 */
.lesson { max-width: 760px; margin: 0 auto; }
.lcard { min-height: 280px; display: flex; flex-direction: column; justify-content: center; font-size: 21px; line-height: 1.8; padding: 28px; }
.lcard .big { font-size: 64px; text-align: center; }
.prog { display: flex; gap: 6px; margin: 12px 0; }
.prog i { flex: 1; height: 8px; border-radius: 4px; background: #dbeafe; }
.prog i.on { background: var(--pri); }
.navrow { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; }
.keys { margin: 10px 0 0; padding-left: 0; list-style: none; }
.keys li { padding: 8px 12px; margin: 6px 0; background: #f0f9ff; border-radius: 10px; }
.keys li::before { content: "✅ "; }

/* 测验 */
.q { font-size: 22px; font-weight: 700; margin: 10px 0 16px; }
.opts { display: grid; gap: 12px; }
.opt { background: #fff; border: 3px solid #dbeafe; border-radius: 16px; padding: 16px; font-size: 19px; text-align: left; min-height: 60px; }
.opt.right { border-color: var(--ok); background: #dcfce7; }
.opt.wrong { border-color: var(--bad); background: #fee2e2; }
.exp { margin-top: 14px; padding: 12px 16px; border-radius: 12px; background: #fefce8; }
.stars { font-size: 44px; letter-spacing: 6px; }

/* 总结 */
.sumtopic { border-left: 8px solid; margin-bottom: 12px; }
.fav { cursor: pointer; }
.fav.on { background: #fde68a !important; }
.fav.on::before { content: "⭐ " !important; }

/* 家长 */
table.list { width: 100%; border-collapse: collapse; font-size: 15px; }
table.list td, table.list th { padding: 8px; border-bottom: 1px solid #e5e7eb; text-align: left; }

/* 弹窗 */
.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal .card { max-width: 480px; width: 100%; text-align: center; }

@media (max-width: 600px) {
  body { font-size: 16px; }
  .lcard { font-size: 19px; padding: 20px; }
  .brand small { display: none; }
}

/* ===== 插图 ===== */
.illus { width: 100%; height: auto; display: block; border-radius: 16px; }
.lcard .illus { max-height: 300px; }

/* ===== 小游戏 ===== */
.game .sub { margin: 6px 0 12px; }
.chipbtn { background: #fff; border: 2px solid var(--c); color: var(--c); border-radius: 999px; padding: 6px 14px; min-height: 40px; font-size: 15px; }
.chipbtn.on { background: var(--c); color: #fff; font-weight: 700; }
.gcard { cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.gcard.glock { opacity: .5; }
.gst { font-size: 15px; color: #b45309; }

/* 排序 */
.olist { display: flex; flex-direction: column; gap: 10px; }
.ocard { background: #fff; border: 3px solid #dbeafe; border-radius: 14px; padding: 12px 14px; font-size: 18px; min-height: 54px;
  display: flex; align-items: center; gap: 12px; cursor: grab; user-select: none; touch-action: none; transition: background .15s, border-color .15s; }
.ocard .onum { background: #2563eb; color: #fff; border-radius: 50%; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; flex: none; }
.ocard.sel { border-color: #f59e0b; background: #fffbeb; }
.ocard.dragging { z-index: 5; position: relative; box-shadow: 0 8px 24px rgba(0,0,0,.18); cursor: grabbing; transition: none; }
.ocard.right { border-color: var(--ok); background: #dcfce7; }
.ocard.wrong { border-color: var(--bad); background: #fee2e2; }

/* 配对 */
.mgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mgrid > div { display: flex; flex-direction: column; gap: 10px; }
.mc { background: #fff; border: 3px solid #e0e7ff; border-radius: 14px; padding: 12px; font-size: 17px; min-height: 56px; }
.mc.sel { border-color: #f59e0b; background: #fffbeb; }
.mc.ok { border-color: var(--ok); background: #dcfce7; opacity: .7; }
.mc.bad { border-color: var(--bad); background: #fee2e2; animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* 分类 */
.bin-q { min-height: 90px; display: flex; justify-content: center; align-items: center; }
.bcard { background: #fff; border: 3px solid #a5b4fc; border-radius: 16px; padding: 16px 28px; font-size: 24px; font-weight: 700; box-shadow: var(--shadow); animation: pop .25s; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.bins { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-top: 14px; }
.bin { background: #f1f5f9; border: 3px dashed #94a3b8; border-radius: 18px; padding: 14px 10px; font-size: 19px; font-weight: 700; min-height: 130px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bin-in { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; font-weight: 400; }
.chip { background: #dcfce7; border-radius: 8px; padding: 2px 8px; font-size: 13px; }
.chip.miss { background: #fef3c7; }
.bin.flash-ok { background: #bbf7d0; border-color: var(--ok); }
.bin.flash-bad { background: #fecaca; border-color: var(--bad); }

/* 快问快答 */
.tfq { background: #fff; border-radius: 18px; padding: 28px 20px; font-size: 24px; font-weight: 700; text-align: center; box-shadow: var(--shadow); min-height: 120px; display: flex; align-items: center; justify-content: center; }
.tfrow { justify-content: center; margin: 16px 0; }
.tfb { min-width: 140px; }

/* 找一找 */
.pickq { font-size: 22px; text-align: center; margin-bottom: 10px; }
.pickwrap { position: relative; }
.spot { position: absolute; transform: translate(-50%, -50%); width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,.35);
  border: 3px dashed #fff; box-shadow: 0 0 0 2px rgba(15,23,42,.5); font-size: 12px; font-weight: 700; color: #0f172a; padding: 0; }
.spot:hover { background: rgba(255,255,255,.6); }
.spot.found { background: #22c55e; border: 3px solid #fff; color: #fff; width: auto; min-width: 48px; padding: 0 8px; border-radius: 24px; }
.spot.hinted { background: #f59e0b; }
.spot.nope { background: #ef4444; animation: shake .3s; }

.gwin { margin-top: 16px; }

/* 彩带 */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 10px; height: 16px; border-radius: 3px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); } }

@media (max-width: 600px) {
  .mc { font-size: 15px; padding: 10px 6px; }
  .tfq { font-size: 20px; }
  .spot { width: 38px; height: 38px; }
}

/* ===== 语言切换 ===== */
#langbar { position: fixed; left: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 60; display: flex; gap: 4px;
  background: #fff; border-radius: 999px; padding: 4px; box-shadow: 0 4px 16px rgba(15,23,42,.18); }
#langbar button { min-width: 44px; min-height: 40px; border-radius: 999px; background: transparent; color: #334155; font-weight: 700; font-size: 15px; padding: 0 10px; }
#langbar button.on { background: #2563eb; color: #fff; }
#langbar button.bi.on { background: #16a34a; }
.bi2 { display: block; font-size: .78em; color: #475569; margin-top: 4px; line-height: 1.5; font-weight: 400; }
.opt .bi2, .q .bi2 { font-size: .75em; }
h2 .bi2 { font-size: .6em; }
body.lang-en { word-break: normal; overflow-wrap: anywhere; }
body.lang-en .node, body.lang-en .dot { hyphens: auto; }
@media print { #langbar { display: none; } }

/* 页面底部留出语言条的位置，避免遮挡按钮 */
body { padding-bottom: 70px; }
@media (min-width: 1300px) { body { padding-bottom: 0; } }

/* ===== 探索世界（3D） ===== */
.explore { margin: -6px -8px 0; }
.wtabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.wtab { background: #fff; border: 3px solid transparent; border-radius: 16px; padding: 8px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; box-shadow: var(--shadow); }
.wtab span { font-size: 30px; }
.wtab small { color: var(--sub); font-size: 12px; }
.wtab.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, #fff); }
.stage { position: relative; height: calc(100vh - 230px); min-height: 420px; border-radius: 22px; overflow: hidden; background: #020617; box-shadow: var(--shadow); }
#stage3d { width: 100%; height: 100%; display: block; cursor: grab; }
.stage-hint { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); background: rgba(15,23,42,.6); color: #e2e8f0;
  padding: 6px 14px; border-radius: 999px; font-size: 13px; pointer-events: none; white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis; }
.zoom { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 8px; }
.zoom button { width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.9); font-size: 24px; font-weight: 700; color: #1e293b; }
.panel { position: absolute; right: 12px; top: 12px; bottom: 12px; width: min(420px, calc(100% - 24px)); background: rgba(255,255,255,.97);
  border-radius: 18px; padding: 16px; overflow-y: auto; box-shadow: 0 10px 40px rgba(0,0,0,.35); animation: slidein .25s; }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }
.pclose { position: sticky; top: 0; float: right; width: 40px; height: 40px; border-radius: 50%; background: #f1f5f9; font-size: 18px; z-index: 2; }
.plv { margin: 12px 0; padding: 8px; border-radius: 14px; }
.plv.mine { background: #fffbeb; outline: 2px dashed #fbbf24; }
.pnodes { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.pnode { display: flex; gap: 10px; align-items: center; text-align: left; background: #f8fafc; border: 2px solid #e2e8f0; border-radius: 14px; padding: 8px 10px; min-height: 56px; }
.pnode .ic { font-size: 28px; }
.pnode small { color: var(--sub); }
.pnode.done { border-color: #86efac; background: #f0fdf4; }
.pnode.open, .pnode.review { border-color: #93c5fd; background: #eff6ff; }
.pnode.locked { opacity: .5; }
/* 首页四个世界入口 */
.wgate { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.gate { border-radius: 20px; padding: 18px 10px; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 150px;
  background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--c) 60%, #fff), var(--c)); box-shadow: 0 6px 18px rgba(0,0,0,.18); transition: transform .15s; }
.gate:hover { transform: translateY(-3px) scale(1.02); }
.gate .gi { font-size: 48px; }
.gate small { opacity: .9; font-size: 13px; line-height: 1.4; }
@media (max-width: 700px) {
  .wtabs, .wgate { grid-template-columns: repeat(2, 1fr); }
  .stage { height: calc(100vh - 300px); }
  .panel { top: auto; height: 62%; width: calc(100% - 24px); }
}

/* ===== 搜索 ===== */
.searchbar { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 999px; padding: 6px 18px; box-shadow: var(--shadow); margin: 14px 0; cursor: text; border: 2px solid #dbeafe; }
.searchbar span { font-size: 20px; }
.searchbar input { flex: 1; border: 0; outline: 0; font-size: 18px; padding: 8px 0; background: transparent; min-width: 0; cursor: inherit; }
.searchbar.big { padding: 10px 22px; border-color: #93c5fd; }
.searchbar.big input { font-size: 22px; }
.slist { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.sres { display: block; width: 100%; cursor: pointer; text-align: left; }
.sres:hover { outline: 2px solid #93c5fd; }
mark { background: #fde68a; border-radius: 3px; padding: 0 2px; }

/* ===== 缩放穿越 / 小镇 ===== */
.wtabs { grid-template-columns: repeat(5, 1fr); }
.wgate { grid-template-columns: repeat(5, 1fr); }
.zoomstage { background: #000; }
#zc, #tc { width: 100%; height: 100%; display: block; }
.zinfo { position: absolute; left: 16px; top: 52px; color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,.6); pointer-events: none; }
#zName { font-size: 26px; font-weight: 800; }
#zSize { font-size: 15px; opacity: .9; }
.zruler { position: absolute; right: 70px; top: 50px; bottom: 70px; width: 34px; border-radius: 17px; background: rgba(255,255,255,.12); }
.zruler button { position: absolute; left: 50%; transform: translate(-50%, -50%); width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.85); font-size: 15px; padding: 0; }
.zruler i { position: absolute; left: -6px; right: -6px; height: 4px; background: #fde047; border-radius: 2px; transform: translateY(-50%); box-shadow: 0 0 8px #fde047; }
.zgo { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); background: #16a34a; white-space: nowrap; }
.zauto { position: absolute; left: 16px; bottom: 18px; }
.townstage { background: #e0f2fe; }
#tc { cursor: pointer; }
.tpop { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); background: #fff; border-radius: 16px; padding: 12px 18px; text-align: center; box-shadow: 0 8px 30px rgba(0,0,0,.25); animation: pop .2s; max-width: 90%; }
.tpop .btn { margin-top: 8px; }
.towngo { width: 100%; margin-bottom: 10px; font-size: 18px; }
@media (max-width: 800px) { .wtabs, .wgate { grid-template-columns: repeat(3, 1fr); } .zruler { right: 66px; } }

/* ===== 建筑内部 ===== */
.room { position: relative; margin: -6px -8px 0; border-radius: 22px; overflow: hidden; background: var(--wall); box-shadow: var(--shadow); min-height: calc(100vh - 140px); }
.roomhead { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: rgba(255,255,255,.6); flex-wrap: wrap; }
.roomhead h1 { margin: 0; font-size: 26px; flex: 1; }
.roomwall { padding: 10px 18px 30px; background-image: repeating-linear-gradient(90deg, rgba(0,0,0,.025) 0 2px, transparent 2px 80px); }
.roomfloor { height: 40px; background: repeating-linear-gradient(90deg, var(--floor) 0 90px, color-mix(in srgb, var(--floor) 85%, #000) 90px 92px); }
.deco { display: flex; justify-content: space-around; font-size: 40px; padding: 6px 0 12px; opacity: .85; }
.shelves { display: flex; flex-direction: column; gap: 22px; }
.shelf { position: relative; padding: 0 10px; }
.shelf.mine { background: rgba(253,230,138,.35); border-radius: 14px; padding-top: 6px; outline: 3px dashed #f59e0b; }
.shelf-label { display: inline-block; background: #475569; color: #fff; font-weight: 700; font-size: 14px; padding: 3px 12px; border-radius: 8px 8px 0 0; }
.shelf-row { display: flex; gap: 8px; align-items: flex-end; row-gap: 14px; flex-wrap: wrap; min-height: 120px; padding: 8px 6px 0; }
.shelf-board { height: 14px; background: linear-gradient(#a16207, #78350f); border-radius: 3px; box-shadow: 0 6px 10px rgba(0,0,0,.2); }
.it { position: relative; background: none; padding: 0; transition: transform .15s; }
.it:hover { transform: translateY(-8px); }
.it.locked { opacity: .45; filter: grayscale(.6); }
.it i { position: absolute; top: -8px; right: -6px; font-style: normal; font-size: 13px; border-radius: 50%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; color: #fff; }
.it i.ok { background: #16a34a; } .it i.rv { background: #f59e0b; } .it i.lk { background: transparent; font-size: 14px; }
.it em { font-style: normal; }
/* 书 */
.book .spine { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 46px; height: 150px; padding: 10px 4px; border-radius: 4px 4px 2px 2px;
  background: linear-gradient(90deg, hsl(var(--h) 55% 38%), hsl(var(--h) 60% 52%) 30%, hsl(var(--h) 55% 42%)); color: #fff; font-size: 22px; box-shadow: inset -3px 0 0 rgba(0,0,0,.2), 2px 0 3px rgba(0,0,0,.2); }
.book .spine em { writing-mode: vertical-rl; font-size: 13px; font-weight: 700; overflow: hidden; height: 100px; width: 1.3em; line-height: 1.25; white-space: nowrap; text-overflow: ellipsis; letter-spacing: 1px; }
body.lang-en .book .spine em { font-size: 11px; letter-spacing: 0; }
/* 画像 / 画框 */
.portrait, .frame { width: 110px; display: flex; flex-direction: column; align-items: center; gap: 4px; align-self: flex-start; }
.pframe { width: 88px; height: 104px; border: 7px solid #b45309; border-radius: 50% / 45%; background: radial-gradient(circle at 50% 35%, #fef3c7, #fde68a); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 3px #fbbf24, 0 6px 12px rgba(0,0,0,.25); }
.pface { font-size: 44px; }
.portrait em, .frame em, .flask em, .leaf em, .case em { font-size: 13px; font-weight: 700; text-align: center; line-height: 1.25; }
.portrait small { font-size: 11px; color: var(--sub); }
.frame .canvas { width: 96px; height: 76px; border: 8px solid #1f2937; outline: 3px solid #d97706; background: linear-gradient(135deg, hsl(var(--h) 70% 80%), hsl(calc(var(--h) + 60) 70% 70%)); display: flex; align-items: center; justify-content: center; font-size: 34px; box-shadow: 0 6px 12px rgba(0,0,0,.25); }
/* 烧瓶 */
.flask { width: 90px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.flask .jar { position: relative; width: 60px; height: 76px; border: 3px solid #94a3b8; border-top: 0; border-radius: 0 0 26px 26px; background: rgba(255,255,255,.6); overflow: hidden; }
.flask .jar::before { content: ""; position: absolute; top: -3px; left: 16px; width: 22px; height: 6px; background: #94a3b8; }
.flask .liq { position: absolute; left: 0; right: 0; bottom: 0; height: 55%; background: hsl(var(--h) 75% 60% / .8); }
.flask .fi { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 28px; }
/* 叶子 */
.leaf { width: 96px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.leaf .lf { width: 70px; height: 70px; background: radial-gradient(circle at 30% 30%, #bbf7d0, #22c55e); border-radius: 0 70% 0 70%; display: flex; align-items: center; justify-content: center; font-size: 30px; box-shadow: 0 4px 10px rgba(0,0,0,.2); }
/* 展柜 */
.case { width: 100px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.case .glass { width: 80px; height: 80px; border-radius: 10px; background: linear-gradient(160deg, rgba(255,255,255,.95), color-mix(in srgb, var(--c) 25%, #fff)); border: 3px solid var(--c); display: flex; align-items: center; justify-content: center; font-size: 36px; box-shadow: 0 6px 12px rgba(0,0,0,.2); }
/* 翻开的书 */
.bookview { position: fixed; inset: 0; background: rgba(15,23,42,.6); z-index: 55; display: flex; align-items: center; justify-content: center; padding: 16px; }
.openbook { position: relative; display: grid; grid-template-columns: 1fr 1fr; max-width: 980px; width: 100%; max-height: 90vh; overflow-y: auto; background: #fffdf5; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.4); animation: bookopen .35s; }
@keyframes bookopen { from { transform: perspective(900px) rotateY(-25deg) scale(.85); opacity: 0; } }
.openbook .page { padding: 22px; }
.openbook .page.left { border-right: 2px solid #e7e5e4; box-shadow: inset -12px 0 18px -14px rgba(0,0,0,.25); }
.openbook .pclose { position: absolute; right: 10px; top: 10px; float: none; }
@media (max-width: 700px) { .openbook { grid-template-columns: 1fr; } .openbook .page.left { border-right: 0; } }
/* 互动装置 */
.toybar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.toybtn { display: flex; flex-direction: column; align-items: center; gap: 2px; background: #fff; border: 3px solid #e2e8f0; border-radius: 16px; padding: 10px 14px; font-size: 30px; min-width: 110px; box-shadow: var(--shadow); }
.toybtn b { font-size: 14px; }
.toybtn.on { border-color: #16a34a; background: #f0fdf4; }
.toystage { background: #fff; border-radius: 18px; padding: 14px; margin-bottom: 20px; box-shadow: var(--shadow); }
.toyhead { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.toyhead b { font-size: 20px; }
.toysvg { width: 100%; max-height: 320px; display: block; border-radius: 14px; }
.toyctl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0; font-weight: 700; }
.toyctl input[type=range] { flex: 1; min-width: 180px; height: 34px; accent-color: #2563eb; }
.toyfact { background: #fefce8; border-radius: 12px; padding: 10px 14px; min-height: 20px; }
.piano { display: flex; gap: 4px; justify-content: center; padding: 10px; background: #1f2937; border-radius: 14px; }
.key { flex: 1; max-width: 70px; height: 180px; background: linear-gradient(#fff, #e5e7eb); border-radius: 0 0 10px 10px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding-bottom: 10px; font-weight: 700; box-shadow: inset 0 -6px 0 #d1d5db; touch-action: none; }
.key small { color: #9ca3af; }
.key.down { background: linear-gradient(#fde68a, #fbbf24); transform: translateY(3px); box-shadow: none; }
.paint { width: 64px; height: 64px; border-radius: 50%; color: #1f2937; font-weight: 700; box-shadow: 0 4px 10px rgba(0,0,0,.2); border: 3px solid #fff; }
.pal { display: flex; align-items: center; gap: 20px; padding: 16px; background: #fef3c7; border-radius: 50% 40% 50% 45%; }
.blob { width: 140px; height: 110px; border-radius: 50% 45% 55% 40%; transition: background .4s; box-shadow: inset 0 -8px 0 rgba(0,0,0,.1); }
#mt { font-size: 20px; font-weight: 700; }
.chalk { background: #14532d; color: #f0fdf4; border: 10px solid #92400e; border-radius: 10px; padding: 20px; font-family: "Comic Sans MS", "Kaiti SC", sans-serif; }
.chalk #bq, .chalk #rq, .chalk #tq { font-size: 34px; text-align: center; margin-bottom: 14px; }
.chalk #tq { font-size: 22px; }
.chalk input { font-size: 26px; width: 160px; padding: 8px; border-radius: 10px; border: 0; text-align: center; }
.chalk .row { justify-content: center; }
.chalk .btn.ghost { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.4); }
.chalk #bs, .chalk #rs, .chalk #tr { text-align: center; margin-top: 12px; font-size: 17px; }
.magnet { display: flex; align-items: center; gap: 30px; padding: 20px; background: #f1f5f9; border-radius: 16px; }
.mg { font-size: 80px; transform: rotate(-90deg); }
.mitems { display: flex; flex-wrap: wrap; gap: 10px; flex: 1; }
.mit { display: flex; flex-direction: column; align-items: center; font-size: 34px; background: #fff; border-radius: 14px; padding: 8px 10px; transition: transform .5s cubic-bezier(.5,-0.3,.6,1.4); }
.mit small { font-size: 12px; }
.mit.pulled { transform: translateX(-60px) scale(.8); opacity: .6; }
.mit.shake { animation: shake .3s; }
.hellos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.hellobtn { background: linear-gradient(135deg, #e0f2fe, #fef3c7); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.hellobtn b { font-size: 22px; }
.bits { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.bit { display: flex; flex-direction: column; align-items: center; background: #1e293b; color: #94a3b8; border-radius: 12px; padding: 8px; width: 62px; font-size: 26px; filter: grayscale(1) brightness(.6); }
.bit.on { filter: none; color: #fde047; background: #334155; box-shadow: 0 0 20px rgba(253,224,71,.5); }
.bit b { font-size: 20px; }
.beat { transform-origin: 150px 100px; animation: beat 1s infinite; }
@keyframes beat { 15% { transform: scale(1.15); } 30% { transform: scale(1); } }

/* ===== 游戏趣味层 ===== */
.ghint { display: flex; align-items: center; gap: 12px; margin: 22px 0 10px; }
.ghint .sub { margin: 0; flex: 1; }
.mascot { position: relative; width: 70px; height: 70px; flex: none; }
.m-body { width: 70px; height: 70px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff7ed, #fed7aa); display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,.15); position: relative; }
.m-face { font-size: 44px; line-height: 1; }
.m-hat { position: absolute; top: -18px; left: 18px; font-size: 26px; transform: rotate(-12deg); }
.m-bubble { position: absolute; left: 76px; top: 10px; background: #fff; border: 2px solid #fdba74; border-radius: 14px; padding: 6px 12px; font-weight: 700; white-space: nowrap; opacity: 0; transform: scale(.6) translateX(-10px); transition: .2s; pointer-events: none; z-index: 5; box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.m-bubble::before { content: ""; position: absolute; left: -9px; top: 12px; border: 7px solid transparent; border-right-color: #fdba74; }
.m-bubble.show { opacity: 1; transform: none; }
.mascot.bob .m-body { animation: mbob 2.4s ease-in-out infinite; }
@keyframes mbob { 50% { transform: translateY(-5px); } }
.mascot.go.jump .m-body { animation: mjump .6s; }
@keyframes mjump { 30% { transform: translateY(-26px) scale(1.1); } 60% { transform: translateY(0) scale(.95, 1.05); } }
.mascot.go.spin .m-body { animation: mspin .7s; }
@keyframes mspin { to { transform: rotate(360deg) scale(1.1); } }
.mascot.go.shake .m-body { animation: shake .4s 2; }
.mascot.go.tilt .m-body { animation: mtilt 1.2s; }
@keyframes mtilt { 30%, 70% { transform: rotate(-14deg); } }
.mascot.go.dance .m-body { animation: mdance .5s 4; }
@keyframes mdance { 25% { transform: rotate(-15deg) translateY(-8px); } 75% { transform: rotate(15deg) translateY(-8px); } }
.floaty { position: absolute; transform: translate(-50%, 0); font-size: 26px; font-weight: 900; pointer-events: none; z-index: 95; animation: floatup 1s forwards; text-shadow: 0 2px 0 #fff; }
.floaty.good { color: #16a34a; } .floaty.bad { color: #dc2626; }
@keyframes floatup { to { transform: translate(-50%, -70px) scale(1.3); opacity: 0; } }
.particle { position: absolute; font-size: 22px; pointer-events: none; z-index: 95; transform: translate(-50%, -50%); animation: burst .8s ease-out forwards; }
@keyframes burst { to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.4) rotate(180deg); opacity: 0; } }
.shakeit { animation: shake .35s; }
.combobar { position: relative; height: 14px; background: #e5e7eb; border-radius: 7px; overflow: visible; margin: 4px 0 12px; }
.cb-fill { height: 100%; width: 0; border-radius: 7px; background: linear-gradient(90deg, #fde047, #f97316); transition: width .3s; }
.cb-fill.hot { background: linear-gradient(90deg, #f97316, #dc2626, #f97316); background-size: 200%; animation: hot 0.8s linear infinite; box-shadow: 0 0 12px #f97316; }
@keyframes hot { to { background-position: 200% 0; } }
#cbTxt { position: absolute; right: 0; top: -26px; font-weight: 900; font-size: 20px; color: #ea580c; }
.rtrack { position: relative; height: 40px; margin: 0 0 12px; }
.rpath { position: absolute; left: 0; right: 0; top: 18px; height: 4px; background: repeating-linear-gradient(90deg, #cbd5e1 0 10px, transparent 10px 18px); }
.rgoal { position: absolute; right: 0; top: 2px; font-size: 26px; }
.rship { position: absolute; left: 0; top: 0; font-size: 30px; transition: left .5s cubic-bezier(.3,1.4,.6,1); transform: rotate(45deg); }
.trophy { margin: 4px 0; }
.tcup { font-size: 80px; animation: cupin .7s cubic-bezier(.3,1.6,.5,1); }
@keyframes cupin { from { transform: scale(0) rotate(-30deg); } }
.tstars span { font-size: 44px; display: inline-block; opacity: .2; filter: grayscale(1); animation: stardrop .5s backwards; }
.tstars span.on { opacity: 1; filter: none; }
@keyframes stardrop { from { transform: translateY(-60px) scale(2); opacity: 0; } }
.t3 .tcup { animation: cupin .7s cubic-bezier(.3,1.6,.5,1), cupshine 1.5s 0.7s infinite; }
@keyframes cupshine { 50% { filter: drop-shadow(0 0 16px #fde047); transform: scale(1.06); } }
.ocard .thumb { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(0,0,0,.3); }
.ocard.right { animation: popok .3s; }
@keyframes popok { 50% { transform: scale(1.04); } }
.bcard.flying { position: fixed; z-index: 90; margin: 0; transition: transform .45s cubic-bezier(.5,0,.7,1), opacity .45s; pointer-events: none; }
.tfq.flipin { animation: flipin .4s; }
@keyframes flipin { from { transform: perspective(600px) rotateX(80deg); opacity: 0; } }
/* 照片 */
.photo { margin: 0; position: relative; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 16px; transition: filter .15s; }
.photo figcaption { position: absolute; right: 8px; bottom: 6px; font-size: 11px; color: #fff; background: rgba(0,0,0,.45); padding: 1px 8px; border-radius: 8px; }
.pq-wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) 1fr; gap: 16px; align-items: start; }
.pq-img .photo { aspect-ratio: 1; background: #0f172a; border-radius: 18px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.pq-opts { display: grid; gap: 10px; }
#pqInfo { grid-column: 1 / -1; }
@media (max-width: 700px) { .pq-wrap { grid-template-columns: 1fr; } }
/* 气球 */
.popq { text-align: center; font-size: 26px; font-weight: 800; background: #fff; border-radius: 16px; padding: 12px; box-shadow: var(--shadow); margin-bottom: 10px; }
.popsky { position: relative; height: 420px; border-radius: 20px; overflow: hidden; background: linear-gradient(#7dd3fc, #e0f2fe 70%, #bbf7d0); }
.popsky::after { content: "☁️      ☁️"; position: absolute; top: 30px; left: 0; right: 0; font-size: 50px; opacity: .8; animation: clouds 30s linear infinite; pointer-events: none; white-space: pre; }
@keyframes clouds { from { transform: translateX(-30%); } to { transform: translateX(100%); } }
.hearts { position: absolute; right: 12px; top: 10px; font-size: 24px; z-index: 3; }
.balloon { position: absolute; left: 0; top: 0; width: 104px; height: 124px; padding: 0; background: none; z-index: 2; will-change: transform; }
.balloon span { position: absolute; inset: 0 0 24px; border-radius: 50% 50% 48% 48%; background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.75) 0 10%, var(--c) 34%); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 17px; text-shadow: 0 1px 3px rgba(0,0,0,.4); padding: 6px; line-height: 1.2; box-shadow: inset -6px -8px 0 rgba(0,0,0,.12); }
.balloon::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 2px; height: 26px; background: #64748b; }
.balloon::before { content: ""; position: absolute; left: calc(50% - 6px); bottom: 22px; border: 6px solid transparent; border-bottom-color: var(--c); }
.balloon.pop span { animation: popb .3s forwards; }
.balloon.pop::after, .balloon.pop::before { display: none; }
@keyframes popb { 50% { transform: scale(1.35); } 100% { transform: scale(0); opacity: 0; } }
.balloon.reveal span { outline: 4px solid #fde047; }
/* 记忆翻牌 */
.memgrid { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 10px; }
.mcard { position: relative; aspect-ratio: 4 / 3; padding: 0; border-radius: 16px; background: repeating-linear-gradient(45deg, #6366f1 0 12px, #818cf8 12px 24px); box-shadow: 0 4px 10px rgba(0,0,0,.2); transition: transform .15s; }
.mcard span { position: absolute; inset: 0; border-radius: 16px; display: flex; align-items: center; justify-content: center; padding: 8px; text-align: center; font-weight: 700; font-size: 18px; }
.mcard .mfront { color: #fff; font-size: 34px; }
.mcard .mback { background: #fff; border: 3px solid #c7d2fe; display: none; }
.mcard.flip { animation: mflip .3s; }
.mcard.flip .mfront { display: none; }
.mcard.flip .mback { display: flex; }
@keyframes mflip { 0% { transform: scaleX(1); } 50% { transform: scaleX(0); } 100% { transform: scaleX(1); } }
.mcard.done .mback { border-color: #22c55e; background: #f0fdf4; }
.mcard.done { animation: popok .4s; box-shadow: 0 0 0 3px #86efac; }
@media (max-width: 600px) { .memgrid { --n: 3 !important; } .mcard span { font-size: 15px; } }

.mcard .mback.big { font-size: 64px; }

/* ===== 照片 ===== */
.phero { position: relative; border-radius: 16px; overflow: hidden; background: #0f172a; aspect-ratio: 16 / 9; max-height: 340px; cursor: pointer; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.phslide { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity .6s; }
.phslide.on { opacity: 1; }
.phslide::before { content: ''; position: absolute; inset: -20px; background: var(--bg) center / cover; filter: blur(18px) brightness(.75); opacity: 0; }
.phslide.fit::before { opacity: 1; }
.phslide.fit img { position: relative; object-fit: contain; animation: none; }
.phslide img { width: 100%; height: 100%; object-fit: cover; animation: kenburns 9s ease-in-out infinite alternate; }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.08) translate(-1%, -1%); } }
.phslide figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 14px 10px; background: linear-gradient(transparent, rgba(0,0,0,.7)); color: #fff; display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.phslide figcaption b { font-size: 18px; }
.phslide figcaption small { font-size: 11px; opacity: .8; text-align: right; }
.phdots { position: absolute; top: 10px; right: 12px; display: flex; gap: 5px; }
.phdots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.5); }
.phdots i.on { background: #fff; }
.illus2 { margin-bottom: 10px; }
.illus2 .illus { max-height: 220px; }
.rthumb { width: 54px; height: 54px; border-radius: 12px; object-fit: cover; flex: none; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.rthumb.sm { width: 40px; height: 40px; border-radius: 10px; vertical-align: middle; }
.pframe.hasimg { padding: 0; overflow: hidden; background: #fef3c7; }
.pframe.hasimg img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; filter: sepia(.15); }
.canvas.hasimg, .glass.hasimg { padding: 0; overflow: hidden; }
.canvas.hasimg img, .glass.hasimg img { width: 100%; height: 100%; object-fit: cover; }
.glass.hasimg img { border-radius: 7px; }
.bthumb { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; border: 2px solid rgba(255,255,255,.7); flex: none; }
.bthumb img { width: 100%; height: 100%; object-fit: cover; }
.mcard .mback.ph { padding: 0; overflow: hidden; }
.mcard .mback.ph img { width: 100%; height: 100%; object-fit: cover; border-radius: 13px; }
.credits td { font-size: 13px; vertical-align: top; }
.credits img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
.credits a { color: #2563eb; word-break: break-all; }
.gate.phgate { background: linear-gradient(rgba(0,0,0,.15), color-mix(in srgb, var(--c) 85%, transparent)), var(--bg) center / cover; text-shadow: 0 2px 6px rgba(0,0,0,.6); }
.gate.phgate .gi { filter: drop-shadow(0 2px 4px rgba(0,0,0,.5)); }
.island { padding-top: 0; overflow: hidden; }
.iphoto { height: 96px; margin: 0 -18px 10px; background-size: cover; background-position: center; position: relative; }
.iphoto span { position: absolute; left: 12px; bottom: -18px; font-size: 34px; background: #fff; border-radius: 50%; width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.island b { display: block; margin-top: 14px; }
.pwall { margin-top: 12px; }
.pwrow { display: flex; gap: 10px; overflow-x: auto; padding: 8px 2px; }
.pwi { flex: none; width: 110px; background: #fff; border-radius: 12px; padding: 4px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; }
.pwi img { width: 100%; height: 80px; object-fit: cover; border-radius: 9px; }
.pwi small { font-size: 12px; font-weight: 700; }
#zPow { font-size: 22px; font-weight: 800; opacity: .9; margin-top: 2px; font-variant-numeric: tabular-nums; }
#zName.zin { animation: zin .5s; }
@keyframes zin { from { transform: translateY(8px); opacity: 0; } }

/* ===== 时间公路 ===== */
.roadstage { background: #1e293b; }
#rc { width: 100%; height: 100%; display: block; cursor: pointer; }
.dash { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; background: rgba(15,23,42,.75); padding: 8px 12px; border-radius: 18px; backdrop-filter: blur(4px); }
.dbtn { width: 54px; height: 54px; border-radius: 50%; background: #334155; color: #fff; font-size: 24px; touch-action: none; }
.dbtn:active { background: #2563eb; }
.speedo { color: #fde047; text-align: center; min-width: 70px; }
.speedo b { display: block; font-size: 28px; font-variant-numeric: tabular-nums; line-height: 1; }
.speedo small { font-size: 11px; color: #cbd5e1; }
.dash .btn { white-space: nowrap; }
.roadmini { position: absolute; left: 16px; right: 16px; top: 50px; height: 34px; display: flex; justify-content: space-between; align-items: center; padding: 0 6px; }
.roadmini::before { content: ""; position: absolute; left: 10px; right: 10px; top: 50%; height: 4px; background: rgba(255,255,255,.35); border-radius: 2px; }
.roadmini i { position: relative; font-style: normal; font-size: 18px; width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.85); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.roadmini span { position: absolute; top: -18px; font-size: 26px; transform: translateX(-50%) scaleX(-1); transition: left .1s linear; margin-left: 21px; pointer-events: none; }
@media (max-width: 700px) { .dash { gap: 6px; padding: 6px; } .dbtn { width: 46px; height: 46px; } .dash .btn { font-size: 14px; padding: 8px 10px; } }

/* ===== iPad / 平板适配 ===== */
/* 1. 用动态视口高度（Safari 地址栏、分屏时不再被截断） */
@supports (height: 100dvh) {
  body { min-height: 100dvh; }
  .stage { height: calc(100dvh - 230px); }
  .room { min-height: calc(100dvh - 140px); }
  @media (max-width: 700px) { .stage { height: calc(100dvh - 300px); } }
}
/* 2. 触屏：去掉“悬停”残留效果、长按弹出菜单和误选文字 */
@media (hover: none) {
  .spot:hover { background: inherit; }
  .gate:hover, .it:hover { transform: none; }
  .sres:hover { outline: 0; }
  .gate:active { transform: scale(.97); }
  .it:active { transform: translateY(-8px); }
}
canvas, img, .gate, .wtab, .nav button, .btn, .spine, .it { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
canvas { touch-action: none; }
html, body { overscroll-behavior-y: none; }
/* 3. 刘海 / 圆角屏左右安全区 */
main { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
/* 4. 横屏矮屏幕（iPad mini / 11" 横放）：世界切换标签压成一行，把高度让给 3D 画面 */
@media (max-height: 860px) and (min-width: 900px) {
  .wtabs { gap: 6px; margin-bottom: 8px; }
  .wtab { flex-direction: row; justify-content: center; gap: 8px; padding: 6px; }
  .wtab span { font-size: 22px; }
  .wtab small { display: none; }
  .stage { height: calc(100vh - 200px); min-height: 380px; }
  @supports (height: 100dvh) { .stage { height: calc(100dvh - 200px); } }
}
/* 竖屏：画面高度按实际剩余空间算（顶栏两行 + 标签） */
@media (orientation: portrait) and (min-width: 701px) {
  .stage { height: calc(100vh - 290px); }
  @supports (height: 100dvh) { .stage { height: calc(100dvh - 290px); } }
}
/* 5. 欢迎页在大屏上垂直居中 */
.welcome { min-height: calc(100vh - 160px); display: flex; flex-direction: column; justify-content: center; align-items: center; }
.welcome > * { max-width: 760px; }
/* 6. 语言条：触屏上收起为一个 🌐 按钮，点开再选，不再挡住画面按钮 */
#langbar .lgtog { display: none; }
@media (hover: none) {
  #langbar.fold .lgtog { display: inline-block; font-size: 20px; }
  #langbar.fold button:not(.lgtog) { display: none; }
}
/* 小镇上方多一行“回到卫星视角”，画面相应减矮，避免超出屏幕 */
.stage.townstage { height: calc(100vh - 290px); }
@media (max-height: 860px) and (min-width: 900px) { .stage.townstage { height: calc(100vh - 250px); } }
@media (orientation: portrait) and (min-width: 701px) { .stage.townstage { height: calc(100vh - 350px); } }
@supports (height: 100dvh) {
  .stage.townstage { height: calc(100dvh - 290px); }
  @media (max-height: 860px) and (min-width: 900px) { .stage.townstage { height: calc(100dvh - 250px); } }
  @media (orientation: portrait) and (min-width: 701px) { .stage.townstage { height: calc(100dvh - 350px); } }
}

/* 头像修改 */
.avbtn { position: relative; background: rgba(255,255,255,.18); border-radius: 50%; width: 40px; height: 40px; font-size: 24px; padding: 0; line-height: 40px; }
.avbtn i { position: absolute; right: -4px; bottom: -4px; font-size: 12px; font-style: normal; background: #fff; border-radius: 50%; width: 18px; height: 18px; line-height: 18px; }
.mecard { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.mecard .bigav { font-size: 56px; width: 80px; height: 80px; border-radius: 50%; background: #eef2ff; display: grid; place-items: center; }
#modal .avatars button { width: 54px; height: 54px; font-size: 30px; }
