/* public/css/app.css —— 《穿越·等量代换》全站样式（横屏 16:9 为主） */

/* ============ 1. 基础与设计令牌 ============ */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --gold: #f5c451;
  --gold-dim: #b8873a;
  --teal: #2dd4bf;
  --teal-deep: #0d9488;
  --rose: #f472b6;
  --field: #84cc16;
  --sugar: #7dd3fc;
  --ink: #eaf0fb;
  --ink-dim: #9fb0cc;
  --panel: rgba(17, 24, 43, 0.74);
  --panel-solid: #141c31;
  --line: rgba(255, 255, 255, 0.12);
  --radius: 16px;
  --ok: #34d399;
  --bad: #f87171;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", system-ui, sans-serif;
}

html, body {
  margin: 0; padding: 0; height: 100%;
  background: #070b16;
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body {
  overflow: hidden;
  background:
    radial-gradient(1200px 700px at 18% -10%, rgba(45, 212, 191, .16), transparent 60%),
    radial-gradient(900px 600px at 88% 8%, rgba(245, 196, 81, .13), transparent 62%),
    radial-gradient(800px 800px at 50% 120%, rgba(244, 114, 182, .10), transparent 60%),
    #070b16;
}

button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }
[hidden] { display: none !important; }

/* 胶片质感 + 暗角，营造短剧氛围 */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 900;
  background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0, 0, 0, .55) 100%);
  mix-blend-mode: multiply;
}

/* ============ 2. 页面骨架 ============ */
.app { display: flex; flex-direction: column; height: 100dvh; }

.topbar {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 15, 28, .92), rgba(10, 15, 28, .55));
  z-index: 30;
}
.brand { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.brand b { font-size: 17px; letter-spacing: .5px; }
.brand span { font-size: 12px; color: var(--ink-dim); }

.navchips { display: flex; gap: 6px; overflow-x: auto; flex: 1 1 auto; scrollbar-width: none; }
.navchips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
  color: var(--ink-dim);
  border-radius: 999px;
  padding: 5px 11px; font-size: 12.5px; white-space: nowrap;
  transition: all .18s ease;
}
.chip:hover { color: var(--ink); border-color: rgba(255, 255, 255, .3); }
.chip.on {
  color: #06201d; font-weight: 700;
  background: linear-gradient(180deg, var(--teal), var(--teal-deep));
  border-color: transparent;
  box-shadow: 0 0 0 3px rgba(45, 212, 191, .18);
}
.top-actions { display: flex; align-items: center; gap: 8px; }
.clock {
  font-variant-numeric: tabular-nums; font-size: 13px; color: var(--ink-dim);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px;
}
.btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .05);
  color: var(--ink);
  border-radius: 10px; padding: 7px 13px; font-size: 13px;
  transition: all .18s ease;
}
.btn:hover { background: rgba(255, 255, 255, .12); }
.btn.primary {
  background: linear-gradient(180deg, var(--teal), var(--teal-deep));
  color: #06201d; font-weight: 700; border-color: transparent;
}
.btn.gold {
  background: linear-gradient(180deg, #ffdc85, var(--gold-dim));
  color: #2a1c02; font-weight: 700; border-color: transparent;
}
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.sm { padding: 5px 10px; font-size: 12px; }

.main { flex: 1 1 auto; display: grid; grid-template-columns: 1.05fr 1fr; min-height: 0; position: relative; }
.main.single { display: flex; flex-direction: column; }

/* ============ 3. 剧情舞台（左） ============ */
.scene-wrap { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; border-right: 1px solid var(--line); }
.main.single .scene-wrap { border-right: none; }
.scene-art { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(70% 70% at 50% 40%, #101a33, #070b16 78%); }
.scene-art svg { width: 100%; height: 100%; max-width: 100%; max-height: 100%; display: block; }
.scene-overlay {
  position: absolute; left: 0; right: 0; top: 0; padding: 16px 20px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  pointer-events: none;
}
.kicker-badge {
  font-size: 13px; letter-spacing: 2px; font-weight: 700;
  color: #06201d; background: linear-gradient(180deg, var(--gold), var(--gold-dim));
  padding: 5px 13px; border-radius: 999px;
  box-shadow: 0 6px 18px rgba(245, 196, 81, .3);
}
.weather { font-size: 12px; color: rgba(255, 255, 255, .6); }

.dialogue {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px 20px 18px;
  background: linear-gradient(180deg, transparent, rgba(4, 8, 18, .88) 45%);
  display: flex; flex-direction: column; gap: 8px;
}
.dline {
  font-size: clamp(15px, 1.55vw, 21px); line-height: 1.5;
  color: #fff; text-shadow: 0 2px 10px rgba(0, 0, 0, .8);
  border-left: 3px solid rgba(45, 212, 191, .7); padding-left: 12px;
  animation: lineIn .45s cubic-bezier(.2, .9, .3, 1) backwards;
}
.dline.l0 { border-left-color: var(--gold); }
.dline .who { color: var(--teal); font-weight: 700; }
@keyframes lineIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ============ 4. 字幕条（短剧大字幕） ============ */
.subbar {
  flex: 0 0 auto;
  min-height: 62px;
  display: flex; align-items: center; gap: 14px;
  padding: 8px 16px;
  border-top: 1px solid var(--line);
  background: linear-gradient(0deg, rgba(6, 10, 20, .96), rgba(6, 10, 20, .62));
  z-index: 25;
}
.subbar .cap {
  flex: 1 1 auto; font-size: clamp(15px, 1.5vw, 20px); font-weight: 600;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .9);
}
.subbar .cap em { color: var(--gold); font-style: normal; }
.subbar .side { display: flex; align-items: center; gap: 8px; }

/* ============ 5. 天平 ============ */
.stage-wrap { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.stage-head { flex: 0 0 auto; padding: 12px 18px 4px; }
.stage-head h2 { margin: 0 0 4px; font-size: clamp(15px, 1.35vw, 19px); }
.stage-head p { margin: 0; font-size: 12.5px; color: var(--ink-dim); }

.scale-area { position: relative; flex: 1 1 auto; min-height: 0; padding: 4px 14px 0; }
.scale {
  position: relative; height: 100%;
  --panw: clamp(112px, 13vw, 190px);
  --a: 0deg;
}
.pillar {
  position: absolute; left: 50%; top: 20%; bottom: 3%;
  width: 16px; margin-left: -8px; border-radius: 8px;
  background: linear-gradient(90deg, #2a3450, #56658a 40%, #2a3450);
  box-shadow: 0 0 24px rgba(45, 212, 191, .12);
}
.pivot {
  position: absolute; left: 50%; top: 20%; width: 34px; height: 34px;
  margin: -17px 0 0 -17px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe6a8, var(--gold-dim) 70%, #6b4f18);
  box-shadow: 0 0 20px rgba(245, 196, 81, .45);
}
.base {
  position: absolute; left: 50%; bottom: 0; width: 46%; height: 14px;
  transform: translateX(-50%); border-radius: 8px;
  background: linear-gradient(90deg, transparent, #3b476b 20%, #6b7aa1 50%, #3b476b 80%, transparent);
}

.beam {
  position: absolute; left: 16%; right: 16%; top: 20%; height: 13px;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffe6a8, var(--gold) 45%, #8a6a24);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .5);
  transform-origin: 50% 50%;
  transform: rotate(var(--a));
  transition: transform .5s cubic-bezier(.34, 1.4, .64, 1);
}
.beam.balanced { box-shadow: 0 0 0 3px rgba(52, 211, 153, .35), 0 4px 22px rgba(52, 211, 153, .5); }

.arm { position: absolute; top: 6px; width: 0; }
.arm.left { left: 0; }
.arm.right { right: 0; }
.hang {
  position: absolute; top: 0; left: 0;
  width: var(--panw); margin-left: calc(var(--panw) / -2);
  display: flex; flex-direction: column; align-items: center;
  transform-origin: top center; transform: rotate(calc(-1 * var(--a)));
  transition: transform .5s cubic-bezier(.34, 1.4, .64, 1);
}
.string { width: 2px; height: 30px; background: linear-gradient(180deg, #9aa7c2, rgba(154, 167, 194, .2)); }
.pansum, .panlabel { font-size: 11.5px; color: var(--ink-dim); letter-spacing: 1px; margin-top: 4px; white-space: nowrap; }
.pansum { color: var(--gold); font-variant-numeric: tabular-nums; margin-top: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; width: 100%; }

.pan {
  width: 100%;
  min-height: 62px;
  border-radius: 6px 6px 46% 46% / 6px 6px 22px 22px;
  background: linear-gradient(180deg, rgba(120, 140, 180, .55), rgba(40, 52, 82, .85));
  border: 1px solid rgba(255, 255, 255, .22);
  border-top: 3px solid rgba(255, 255, 255, .35);
  padding: 8px 8px 12px;
  display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; align-content: flex-start;
  position: relative;
  transition: background .25s ease, box-shadow .25s ease;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .45);
}
.pan.hover { box-shadow: 0 0 0 4px rgba(45, 212, 191, .35), 0 10px 26px rgba(0, 0, 0, .45); }
.pan .empty { font-size: 11.5px; color: rgba(255, 255, 255, .35); padding-top: 16px; }
.status { font-size: 12.5px; color: var(--ink-dim); }
.status.warn { color: var(--bad); }

.itemchip {
  width: clamp(26px, 2.5vw, 34px); height: clamp(26px, 2.5vw, 34px);
  border-radius: 9px; display: grid; place-items: center;
  font-size: clamp(12px, 1.1vw, 15px); font-weight: 800;
  color: #08111f; user-select: none; cursor: pointer;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .18), 0 2px 6px rgba(0, 0, 0, .35);
  animation: pop .28s cubic-bezier(.2, 1.5, .5, 1);
}
.itemchip:hover { transform: translateY(-2px); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.itemchip[data-k="liuli"] { background: linear-gradient(160deg, #7ff0e0, #14b8a6); }
.itemchip[data-k="gold"]  { background: linear-gradient(160deg, #ffe08a, #d99a1c); }
.itemchip[data-k="zhai"]  { background: linear-gradient(160deg, #ffb3d6, #d94f8a); }
.itemchip[data-k="sugar"] { background: linear-gradient(160deg, #d6f2ff, #7dc4e8); }
.itemchip[data-k="field"] { background: linear-gradient(160deg, #d7f39a, #6aa81a); }

.pan .plate-glow {
  position: absolute; inset: -6px; border-radius: 8px 8px 50% 50% / 8px 8px 26px 26px;
  border: 2px solid var(--ok); opacity: 0; transition: opacity .3s ease; pointer-events: none;
}
.pan.balanced .plate-glow { opacity: .9; animation: glowPulse 1.6s ease-in-out infinite; }
@keyframes glowPulse { 0%, 100% { box-shadow: 0 0 12px rgba(52, 211, 153, .5); } 50% { box-shadow: 0 0 26px rgba(52, 211, 153, .95); } }

/* 物品架 */
.shelf {
  flex: 0 0 auto; padding: 26px 14px 12px;
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
}
.shelfcard {
  width: clamp(58px, 6.4vw, 84px);
  padding: 7px 4px 6px; border-radius: 13px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .03));
  text-align: center; user-select: none; touch-action: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.shelfcard:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0, 0, 0, .45); }
.shelfcard.picked { transform: scale(.94); opacity: .7; }
.shelfcard .g {
  width: clamp(28px, 3vw, 38px); height: clamp(28px, 3vw, 38px); margin: 0 auto 4px;
  border-radius: 10px; display: grid; place-items: center;
  font-weight: 800; color: #08111f; font-size: clamp(13px, 1.2vw, 16px);
}
.shelfcard .n { font-size: 12.5px; font-weight: 600; }
.shelfcard .p { font-size: 10.5px; color: var(--ink-dim); }
.shelfcard[data-k="liuli"] .g { background: linear-gradient(160deg, #7ff0e0, #14b8a6); }
.shelfcard[data-k="gold"] .g  { background: linear-gradient(160deg, #ffe08a, #d99a1c); }
.shelfcard[data-k="zhai"] .g  { background: linear-gradient(160deg, #ffb3d6, #d94f8a); }
.shelfcard[data-k="sugar"] .g { background: linear-gradient(160deg, #d6f2ff, #7dc4e8); }
.shelfcard[data-k="field"] .g { background: linear-gradient(160deg, #d7f39a, #6aa81a); }

/* 拖拽幽灵 */
.ghost {
  position: fixed; z-index: 950; pointer-events: none;
  transform: translate(-50%, -50%) scale(1.15);
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .6));
  display: grid; place-items: center; border-radius: 10px;
  font-weight: 800; color: #08111f;
}

/* 等式揭示条 */
.eqbar {
  flex: 0 0 auto; margin: 0 14px 8px; padding: 9px 14px;
  border-radius: 12px; border: 1px dashed rgba(245, 196, 81, .5);
  background: rgba(245, 196, 81, .07);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: clamp(13px, 1.25vw, 17px);
}
.eqbar .lv { color: var(--gold); font-weight: 800; }
.eqbar .arrow { color: var(--teal); }

/* ============ 6. 奖励 / 弹窗 ============ */
.overlay {
  position: fixed; inset: 0; z-index: 800;
  display: grid; place-items: center;
  background: radial-gradient(60% 60% at 50% 45%, rgba(245, 196, 81, .18), rgba(4, 7, 15, .88) 70%);
  backdrop-filter: blur(3px);
  animation: fadeIn .3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.reward-card {
  min-width: min(520px, 86vw); padding: 30px 38px; border-radius: 22px; text-align: center;
  background: linear-gradient(180deg, #1c2743, #121a2e);
  border: 1px solid rgba(245, 196, 81, .45);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .7), 0 0 0 8px rgba(245, 196, 81, .07);
  animation: riseIn .5s cubic-bezier(.2, 1.2, .4, 1);
}
@keyframes riseIn { from { transform: translateY(26px) scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
.reward-card .sys { font-size: 12.5px; letter-spacing: 3px; color: var(--teal); }
.reward-card .ric {
  width: 92px; height: 92px; margin: 14px auto 10px; border-radius: 24px; display: grid; place-items: center;
  font-size: 40px; font-weight: 800; color: #2a1c02;
  background: linear-gradient(160deg, #ffe9ad, var(--gold), #c8912a);
  box-shadow: 0 0 42px rgba(245, 196, 81, .55);
  animation: pop .5s cubic-bezier(.2, 1.6, .5, 1);
}
.reward-card h3 { margin: 6px 0 6px; font-size: clamp(20px, 2.2vw, 30px); color: var(--gold); }
.reward-card p { margin: 4px 0 0; color: var(--ink-dim); font-size: 14px; }
.reward-card .sub { font-size: 12.5px; margin-top: 8px; }

/* ============ 7. 看板 ============ */
.board-wrap { flex: 1 1 auto; min-height: 0; padding: 10px 18px 14px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.board-stats { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.stat {
  border: 1px solid var(--line); border-radius: 14px; padding: 8px 16px;
  background: var(--panel); display: flex; align-items: baseline; gap: 8px;
}
.stat b { font-size: 24px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--ink-dim); }
.stat.ok b { color: var(--ok); }
.stat.progress-bar { flex: 1 1 220px; min-width: 180px; display: block; }
.bar { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--teal), var(--ok)); transition: width .5s ease; }

.board-grid {
  flex: 1 1 auto; min-height: 0; overflow: auto;
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  align-content: start;
}
.scard {
  border: 1px solid var(--line); border-radius: 12px; padding: 9px 11px;
  background: var(--panel); animation: pop .3s ease;
}
.scard .nm { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.scard .nm b { font-size: 15px; }
.scard .badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.scard.done { border-color: rgba(52, 211, 153, .55); background: rgba(52, 211, 153, .12); }
.scard.done .badge { background: var(--ok); color: #04231a; font-weight: 700; }
.scard.doing .badge { background: rgba(125, 211, 252, .2); color: var(--sugar); }
.scard .meta { margin-top: 6px; font-size: 11.5px; color: var(--ink-dim); display: flex; gap: 8px; white-space: nowrap; overflow: hidden; }
.empty-hint { color: var(--ink-dim); font-size: 14px; padding: 18px 4px; }

/* ============ 8. 板书总结 ============ */
.board-black {
  flex: 1 1 auto; min-height: 0; overflow: auto; padding: 16px 22px;
  margin: 10px 18px 14px; border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(24, 45, 40, .96), rgba(16, 32, 29, .96));
  border: 10px solid #6b4a26;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, .55), 0 18px 40px rgba(0, 0, 0, .5);
  display: flex; flex-direction: column; justify-content: center; gap: 18px;
}
.bline { font-size: clamp(16px, 1.6vw, 23px); line-height: 2.1; color: #eafff7; }
.slot {
  display: inline-grid; place-items: center; vertical-align: middle;
  min-width: 78px; height: 42px; padding: 0 10px; margin: 0 4px;
  border-bottom: 3px solid rgba(255, 255, 255, .5);
  color: var(--gold); font-weight: 700; font-size: 1.02em;
  transition: all .2s ease;
}
.slot.hover { background: rgba(45, 212, 191, .18); border-bottom-color: var(--teal); }
.slot.filled { border-bottom-color: transparent; }
.slot.right { color: var(--ok); }
.slot.wrong { animation: shake .4s ease; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }

.tilepool { display: flex; flex: 0 0 auto; align-items: center; flex-wrap: wrap; gap: 9px; margin: 0 18px 14px; }
.tile {
  padding: 9px 16px; border-radius: 11px; font-size: clamp(14px, 1.3vw, 18px); font-weight: 700;
  border: 1px solid rgba(245, 196, 81, .5);
  background: linear-gradient(180deg, rgba(245, 196, 81, .2), rgba(245, 196, 81, .08));
  color: #ffe6a8; user-select: none; touch-action: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .35);
}
.tile:hover { transform: translateY(-2px); }
.tile.used { opacity: .25; }

/* ============ 9. 空白页 / 进场页（学生端） ============ */
.play-shell { display: flex; flex-direction: column; height: 100dvh; }
.play-main { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.play-head {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 16px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 15, 28, .94), rgba(10, 15, 28, .5));
}
.play-head .who { font-size: 14px; }
.play-head .who b { color: var(--teal); }
.play-head .timer { font-variant-numeric: tabular-nums; color: var(--ink-dim); font-size: 13px; }
.progressdots { display: flex; gap: 6px; }
.pdot { width: 26px; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .16); }
.pdot.on { background: var(--teal); }
.pdot.cur { background: var(--gold); box-shadow: 0 0 10px rgba(245, 196, 81, .7); }

.center-card {
  margin: auto; max-width: 620px; width: min(92vw, 620px);
  padding: 26px 30px; border-radius: 20px;
  background: var(--panel-solid); border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6); text-align: center;
}
.center-card h1 { margin: 0 0 8px; font-size: clamp(20px, 2.2vw, 28px); }
.center-card h1 em { color: var(--gold); font-style: normal; }
.center-card p { color: var(--ink-dim); font-size: 14px; line-height: 1.7; }
.center-card ul { text-align: left; color: var(--ink-dim); font-size: 13.5px; line-height: 1.9; margin: 10px 0 4px; }
.name-input {
  width: 100%; padding: 14px 16px; margin: 14px 0 8px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .06);
  color: var(--ink); font-size: 18px; text-align: center;
}
.name-input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(45, 212, 191, .2); }
.err-text { color: var(--bad); font-size: 13px; min-height: 18px; }
.hintbar {
  flex: 0 0 auto; padding: 8px 16px; display: flex; gap: 10px; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--line); background: rgba(6, 10, 20, .7);
  font-size: clamp(13px, 1.3vw, 16px);
}
.hintbar .ask { font-weight: 600; }
.hintbar .hint { color: var(--ink-dim); font-size: 12.5px; }

/* 二维码 */
.qrbox { display: flex; align-items: center; gap: 14px; justify-content: center; margin-top: 10px; }
.qrbox img, .qrbox svg { width: 168px; height: 168px; background: #fff; border-radius: 10px; padding: 6px; }
.qrbox .u { font-size: 12.5px; color: var(--ink-dim); word-break: break-all; text-align: left; }
.qrbox .u b { color: var(--gold); display: block; font-size: 15px; margin-bottom: 4px; }

/* 撒花 */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 850; overflow: hidden; }
.confetti i {
  position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px;
  animation: fall linear forwards;
}
@keyframes fall {
  from { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  to { transform: translateY(105vh) rotate(720deg); opacity: .2; }
}

/* ============ 10. 低矮屏幕（手机横屏 390~520px 高）压缩排版 ============ */
@media (max-height: 560px) {
  .center-card { padding: 12px 18px; border-radius: 16px; }
  .center-card h1 { font-size: 17px; margin-bottom: 4px; }
  .center-card p { font-size: 12.5px; line-height: 1.5; margin: 4px 0; }
  .center-card ul { font-size: 12px; line-height: 1.55; margin: 6px 0 2px; }
  .name-input { padding: 9px 12px; font-size: 15px; margin: 8px 0 4px; }
  .err-text { min-height: 14px; font-size: 12px; }
  .center-card .hide-short { display: none; }
  .center-card .big-btn { padding: 9px !important; font-size: 15px !important; }
  .center-card .ric { width: 60px !important; height: 60px !important; font-size: 26px !important; margin: 6px auto !important; }

  /* 学生端手机横屏：让天平有足够高度（否则会被挤成 0 高看不见） */
  .play-main .stage-head { display: none; }
  .shelf { padding: 12px 8px 4px; gap: 6px; }
  .shelfcard { width: 56px; padding: 5px 3px 4px; border-radius: 10px; }
  .shelfcard .g { width: 24px; height: 24px; font-size: 12px; margin-bottom: 2px; border-radius: 7px; }
  .shelfcard .n { font-size: 11px; }
  .shelfcard .p { font-size: 9.5px; }
  .string { height: 18px; }
  .pan { min-height: 46px; padding: 6px 6px 8px; }
  .itemchip { width: 24px; height: 24px; font-size: 11px; border-radius: 7px; }
  .pansum, .panlabel { font-size: 10px; margin-top: 2px; }
  .hintbar { padding: 6px 10px; }
  .hintbar .ask { font-size: 13.5px; }
  .hintbar .hint { font-size: 11.5px; }
  .status { font-size: 11.5px; }
  .play-head { padding: 6px 12px; }
  .brand b { font-size: 15px; }
}

/* ============ 11. 竖屏提示（横屏为主） ============ */
.rotate-hint { display: none; }
@media (orientation: portrait) and (max-width: 900px) {
  .app > *, .play-shell > * { visibility: hidden; }
  .rotate-hint {
    display: grid; place-items: center; position: fixed; inset: 0; z-index: 999; visibility: visible;
    background: #070b16; text-align: center; padding: 30px;
  }
  .rotate-hint div { font-size: 18px; line-height: 1.9; }
  .rotate-hint .ico { font-size: 46px; animation: rot 2.4s ease-in-out infinite; }
  @keyframes rot { 0%, 40% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }
}

/* 窄屏 / 手机横屏：压缩留白 */
@media (max-height: 520px) {
  .subbar { min-height: 50px; padding: 6px 12px; }
  .shelf { padding: 20px 10px 8px; }
  .pan { min-height: 50px; }
  .topbar { padding: 6px 10px; }
  .brand span { display: none; }
}
@media (max-width: 900px) {
  .main { grid-template-columns: 1fr; grid-template-rows: 1fr 1.15fr; }
  .scene-wrap { border-right: none; border-bottom: 1px solid var(--line); }
}

/* 调试：数据属性驱动的点击热区统一去掉系统高亮 */
* { -webkit-tap-highlight-color: transparent; }
