/* Aurora Quest — 8-bit 像素风格。
   设计语言：深空 CRT 底 + 霓虹调色板（青/琥珀/品红/绿），
   全部硬直角 + 双层像素描边 + 硬阴影；扫描线保留 CRT 氛围。
   单主题（像素游戏刻意只有夜屏一种世界观）。 */

:root {
  color-scheme: dark;
  --bg: #060b18;
  --panel: #0b1428;
  --panel-deep: #070d1d;
  --ink: #04070e;
  --line: rgba(140, 197, 255, 0.28);
  --text: #edf7ff;
  --muted: #9fb4cb;
  --cyan: #66e8ff;
  --cyan-strong: #b8fbff;
  --amber: #ffc85e;
  --magenta: #ff6f91;
  --green: #8ff3a5;
  --danger: #ff7587;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
    system-ui, sans-serif;
  --max: 920px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at 24% 12%, rgba(102, 232, 255, 0.13), transparent 30%),
    radial-gradient(circle at 78% 85%, rgba(255, 111, 145, 0.1), transparent 28%),
    linear-gradient(180deg, #050814 0%, #081223 52%, #04070e 100%);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--sans);
  background: transparent;
  overflow-x: hidden;
}

/* CRT 扫描线 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.03),
    rgba(255, 255, 255, 0.03) 1px,
    transparent 1px,
    transparent 4px
  );
  mix-blend-mode: screen;
  z-index: 0;
}

a {
  color: var(--cyan);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  color: var(--cyan-strong);
  text-decoration: underline;
}

button {
  font: inherit;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible {
  outline: 2px dashed var(--cyan);
  outline-offset: 2px;
}

kbd {
  font-family: var(--mono);
  font-size: 0.82em;
  padding: 1px 5px;
  background: var(--panel-deep);
  border: 1px solid var(--line);
  box-shadow: 0 2px 0 var(--ink);
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(var(--max), calc(100vw - 24px));
  margin: 0 auto;
  padding: 20px 0 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---- 像素面板与按钮 ------------------------------------------------------ */

.pixel-panel {
  background: var(--panel);
  border: 3px solid var(--line);
  box-shadow:
    0 0 0 3px var(--ink),
    8px 8px 0 rgba(0, 0, 0, 0.45);
}

.pixel-btn {
  font-family: var(--mono);
  font-size: 0.88rem;
  color: var(--text);
  padding: 9px 14px;
  background: var(--panel-deep);
  border: 2px solid var(--line);
  box-shadow: 0 3px 0 var(--ink);
  transition: transform 80ms ease, box-shadow 80ms ease;
}

.pixel-btn:hover:not(:disabled) {
  border-color: var(--cyan);
  color: var(--cyan-strong);
}

.pixel-btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 0 0 var(--ink);
}

.pixel-btn.primary {
  background: rgba(102, 232, 255, 0.14);
  border-color: var(--cyan);
}

.pixel-btn.ghost {
  opacity: 0.85;
}

.pixel-btn:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.panel-title {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.22em;
  color: var(--amber);
  text-transform: uppercase;
  text-shadow: 2px 2px 0 var(--ink);
}

/* ---- 顶部 HUD ------------------------------------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 18px;
  padding: 12px 16px;
}

.logo {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.18em;
  color: var(--cyan);
  text-shadow: 3px 3px 0 var(--ink), 0 0 14px rgba(102, 232, 255, 0.5);
  white-space: nowrap;
}

.topbar-stats {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
}

.stat strong {
  color: var(--text);
  margin-left: 4px;
  font-variant-numeric: tabular-nums;
  text-shadow: 2px 2px 0 var(--ink);
}

.xp-meter {
  width: 120px;
  height: 12px;
  background: var(--panel-deep);
  border: 2px solid var(--line);
  padding: 2px;
}

.xp-meter-fill {
  width: 0%;
  height: 100%;
  background:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 6px,
      rgba(4, 7, 14, 0.55) 6px,
      rgba(4, 7, 14, 0.55) 8px
    ),
    linear-gradient(90deg, var(--cyan), var(--amber));
  transition: width 240ms steps(6);
}

.topbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---- 战斗屏 ---------------------------------------------------------------- */

.battle {
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.battle-head h1 {
  margin: 0;
  font-size: clamp(1.15rem, 3vw, 1.5rem);
  line-height: 1.3;
  text-shadow: 2px 2px 0 var(--ink);
  text-wrap: balance;
}

/* boss 展示台 */
.boss-zone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 18px 12px 14px;
  background:
    radial-gradient(ellipse at 50% 90%, rgba(102, 232, 255, 0.12), transparent 62%),
    var(--panel-deep);
  border: 2px solid var(--line);
}

#boss-canvas {
  width: clamp(96px, 18vw, 136px);
  height: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 6px 14px rgba(102, 232, 255, 0.25));
  animation: boss-bob 2.6s ease-in-out infinite alternate;
}

@keyframes boss-bob {
  from { transform: translateY(-3px); }
  to { transform: translateY(4px); }
}

/* 被命中：闪白 + 抖动（反馈窗口内播放，重渲染后消失） */
.boss-zone.hit #boss-canvas {
  animation: boss-hit 0.42s steps(2) both;
}

@keyframes boss-hit {
  0% { filter: brightness(3) drop-shadow(0 0 18px rgba(255, 255, 255, 0.9)); transform: translate(-4px, 0); }
  50% { filter: brightness(2.2); transform: translate(4px, -2px); }
  100% { filter: brightness(1); transform: translate(0, 0); }
}

/* 格挡（答错）：boss 得意地晃一下，红光一闪 */
.boss-zone.block #boss-canvas {
  animation: boss-block 0.5s steps(3) both;
}

@keyframes boss-block {
  0% { filter: drop-shadow(0 0 16px rgba(255, 117, 135, 0.9)); transform: scale(1.08); }
  100% { filter: none; transform: scale(1); }
}

/* 已击败：灰化倒下 */
.boss-zone.defeated #boss-canvas {
  filter: grayscale(1) brightness(0.55);
  transform: rotate(90deg) translateX(6px);
  animation: none;
}

.boss-zone.defeated .boss-name {
  color: var(--muted);
  text-decoration: line-through;
}

.boss-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 180px;
}

.boss-name {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--amber);
  text-shadow: 2px 2px 0 var(--ink);
}

.hp-bar {
  display: flex;
  gap: 3px;
}

.hp-cell {
  width: 15px;
  height: 15px;
  background: var(--panel);
  border: 2px solid rgba(140, 197, 255, 0.2);
}

.hp-cell.filled {
  background: linear-gradient(180deg, var(--green), #4fbf72);
  border-color: rgba(143, 243, 165, 0.6);
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.35);
}

.hp-bar.low .hp-cell.filled {
  background: linear-gradient(180deg, var(--danger), #c23a52);
  border-color: rgba(255, 117, 135, 0.6);
  animation: hp-blink 0.8s steps(2) infinite;
}

@keyframes hp-blink {
  50% { opacity: 0.55; }
}

/* 伤害飘字 */
.fx-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.fx-float {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-weight: 700;
  animation: fx-rise 0.9s steps(8) forwards;
}

.fx-float.dmg {
  color: var(--amber);
  font-size: 1.5rem;
  text-shadow: 3px 3px 0 var(--ink);
}

.fx-float.miss {
  color: var(--muted);
  font-size: 1.05rem;
  text-shadow: 2px 2px 0 var(--ink);
}

@keyframes fx-rise {
  from { opacity: 1; transform: translate(-50%, 0); }
  to { opacity: 0; transform: translate(-50%, -58px); }
}

/* RPG 对话框（章节剧情） */
.dialogue {
  padding: 12px 14px;
  background: var(--panel-deep);
  border: 2px solid var(--line);
  border-left: 6px solid var(--cyan);
  font-size: 0.93rem;
  line-height: 1.8;
  color: var(--text);
}

.dialogue p {
  margin: 0;
}

.dialogue p + p {
  margin-top: 8px;
}

/* 问题与选项 */
.question-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
}

.question h2 {
  margin: 8px 0 12px;
  font-size: clamp(1.02rem, 2.4vw, 1.3rem);
  line-height: 1.5;
}

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

.choices button {
  min-height: 56px;
  text-align: left;
  padding: 12px 12px 12px 14px;
  background: var(--panel-deep);
  color: var(--text);
  border: 2px solid var(--line);
  box-shadow: 0 3px 0 var(--ink);
  transition: transform 80ms ease, border-color 80ms ease, box-shadow 80ms ease;
}

.choices button:hover,
.choices button:focus-visible {
  border-color: var(--cyan);
}

.choices.suppress-hover button:hover,
.choices.suppress-hover button:focus-visible {
  border-color: var(--line);
  outline: 0;
}

.choices button:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 var(--ink);
}

.choice-key {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 10px;
  background: var(--panel);
  border: 2px solid var(--line);
  box-shadow: 0 2px 0 var(--ink);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1;
  vertical-align: middle;
}

.choices button:hover .choice-key,
.choices button:focus-visible .choice-key {
  color: var(--cyan-strong);
  border-color: var(--cyan);
}

.choices.suppress-hover button:hover .choice-key,
.choices.suppress-hover button:focus-visible .choice-key {
  color: var(--muted);
  border-color: var(--line);
}

/* 反馈锁定期间禁止再次点击 */
.choices.locked button {
  pointer-events: none;
}

.choices button.correct {
  background: rgba(143, 243, 165, 0.16);
  border-color: var(--green);
}

.choices button.correct .choice-key {
  color: var(--green);
  border-color: var(--green);
}

.choices button.wrong {
  background: rgba(255, 117, 135, 0.14);
  border-color: var(--danger);
  animation: choice-shake 320ms steps(4);
}

.choices button.wrong .choice-key {
  color: var(--danger);
  border-color: var(--danger);
}

@keyframes choice-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.choice-static {
  min-height: 56px;
  display: flex;
  align-items: center;
  padding: 12px 14px;
  background: var(--panel-deep);
  border: 2px solid var(--line);
  color: var(--text);
}

.choice-static.correct {
  border-color: var(--green);
  background: rgba(143, 243, 165, 0.14);
}

/* 战斗日志条 */
.log-strip {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.log-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.log-entry {
  padding: 7px 10px;
  background: var(--panel-deep);
  border: 1px solid rgba(140, 197, 255, 0.16);
  font-size: 0.85rem;
  line-height: 1.6;
}

.log-entry strong {
  color: var(--amber);
}

.hint-pill,
.source-note {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: rgba(159, 180, 203, 0.75);
}

/* ---- 冒险地图 + 战利品 ------------------------------------------------------ */

.belt {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 16px;
}

.map-panel,
.loot-panel {
  padding: 16px 18px 14px;
}

/* ---- 课程介绍：L01-L99 折叠目录 ------------------------------------------ */

.map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.map-viewport {
  margin-top: 8px;
  max-height: 430px;
  overflow: auto;
  border: 2px solid var(--line);
  background:
    radial-gradient(circle at 22% 6%, rgba(102, 232, 255, 0.07), transparent 30%),
    radial-gradient(circle at 80% 32%, rgba(255, 200, 94, 0.06), transparent 28%),
    var(--panel-deep);
}

.course-outline {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
}

.course-intro,
.course-phase {
  background: rgba(7, 13, 29, 0.82);
  border: 2px solid rgba(140, 197, 255, 0.2);
  box-shadow: 0 3px 0 var(--ink);
}

.course-intro {
  padding: 12px 14px;
}

.course-eyebrow {
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--cyan-strong);
  letter-spacing: 0;
}

.course-intro h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.course-copy {
  margin: 0;
  color: rgba(237, 247, 255, 0.84);
  font-size: 0.84rem;
  line-height: 1.75;
}

.course-thesis {
  margin: 10px 0 0;
  padding: 9px 10px;
  color: var(--amber);
  background: rgba(255, 200, 94, 0.07);
  border-left: 4px solid var(--amber);
  font-size: 0.82rem;
  line-height: 1.65;
}

.course-phase {
  overflow: hidden;
}

.course-phase[open] {
  border-color: rgba(102, 232, 255, 0.42);
}

.course-phase-summary {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) max-content;
  align-items: center;
  gap: 10px;
  padding: 10px 38px 10px 12px;
  cursor: pointer;
  list-style: none;
}

.course-phase-summary::-webkit-details-marker {
  display: none;
}

.course-phase-summary::after {
  content: "+";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  color: var(--cyan);
}

.course-phase[open] > .course-phase-summary::after {
  content: "−";
}

.course-phase-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: rgba(102, 232, 255, 0.12);
  border: 2px solid rgba(102, 232, 255, 0.38);
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.08);
}

.course-phase-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text);
}

.course-phase-meta {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
}

.course-phase-body {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.course-keyideas {
  padding: 9px 10px;
  background: rgba(102, 232, 255, 0.06);
  border: 1px solid rgba(102, 232, 255, 0.2);
}

.course-keyideas h4 {
  margin: 0 0 7px;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--cyan-strong);
}

.course-keyideas ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.course-keyideas li {
  padding: 4px 7px;
  color: rgba(237, 247, 255, 0.88);
  background: rgba(7, 13, 29, 0.62);
  border: 1px solid rgba(140, 197, 255, 0.18);
  font-size: 0.74rem;
  line-height: 1.45;
}

.course-lessons {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.78rem;
  line-height: 1.55;
}

.course-lessons th,
.course-lessons td {
  padding: 7px 8px;
  border: 1px solid rgba(140, 197, 255, 0.16);
  vertical-align: top;
}

.course-lessons th {
  color: var(--cyan-strong);
  background: rgba(102, 232, 255, 0.07);
  font-family: var(--mono);
  font-size: 0.7rem;
  text-align: left;
}

.course-lessons th:first-child,
.course-lessons .lesson-code {
  width: 76px;
}

.lesson-code {
  color: var(--amber);
  font-family: var(--mono);
  font-weight: 700;
}

.course-summary {
  padding-top: 2px;
  color: rgba(159, 180, 203, 0.9);
}

.map-caption {
  margin: 4px 0 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.6;
}

.loot-grid {
  display: grid;
  gap: 10px;
}

.loot-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--panel-deep);
  border: 2px solid rgba(140, 197, 255, 0.18);
}

.loot-icon {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-weight: 700;
  color: var(--amber);
  background: var(--panel);
  border: 2px solid var(--amber);
  box-shadow: 0 3px 0 var(--ink);
}

.loot-body h3 {
  margin: 0 0 2px;
  font-size: 0.92rem;
}

.loot-body p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ---- 页脚 ------------------------------------------------------------------ */

.footer {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.8;
  text-align: center;
}

.footer p {
  margin: 0;
}

/* ---- 响应式 ------------------------------------------------------------------ */

/* ---- 移动端分页 Tab 与「更多」页（桌面隐藏，见下方 media query） ---------- */

.mobile-tabs,
.more-panel {
  display: none;
}

.more-blurb {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.7;
  color: var(--muted);
}

.more-blurb strong {
  color: var(--amber);
}

.more-author {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  color: inherit;
  background: var(--panel-deep);
  border: 2px solid var(--line);
  text-decoration: none;
}

.more-author:hover,
.more-author:focus-visible {
  border-color: var(--cyan);
}

.more-avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-weight: 700;
  color: var(--ink);
  background: var(--amber);
  border: 2px solid var(--line);
  box-shadow: 0 3px 0 var(--ink);
}

.more-author-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.more-author-body small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
}

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

.more-links .pixel-btn {
  text-align: center;
  text-decoration: none;
  padding: 7px 5px;
  min-width: 0;
  font-size: 0.74rem;
  line-height: 1.25;
}

.more-note {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.8;
}

/* ---- 移动端：App 式固定视口 ----------------------------------------------
   目标：整页不滚屏——战斗独占一屏；地图/战利品/链接等次要信息由底部 Tab 分页。
   桌面布局完全不受影响。 */
@media (max-width: 760px) {
  html,
  body {
    height: 100%;
  }

  body {
    overflow: hidden; /* 页面本身永不滚动；兜底滚动只发生在面板内部 */
  }

  .page-shell {
    height: 100dvh;
    width: calc(100vw - 12px);
    padding: 6px 0 8px;
    gap: 8px;
    overflow: hidden;
  }

  /* 顶栏压缩：藏装饰 XP 条（数值仍在），按钮均分一行 */
  .topbar {
    padding: 8px 10px;
    gap: 6px 10px;
  }

  .logo {
    font-size: 0.88rem;
  }

  .xp-meter {
    display: none;
  }

  .topbar-stats {
    gap: 10px;
    font-size: 0.74rem;
  }

  .topbar-actions {
    width: 100%;
  }

  .topbar-actions .pixel-btn {
    flex: 1;
    padding: 7px 4px;
    font-size: 0.72rem;
  }

  /* 战斗屏占满剩余高度；各块收紧到一屏放得下，超长内容在块内滚动兜底 */
  .battle {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 10px 12px;
    gap: 9px;
  }

  .battle-head h1 {
    font-size: 1.02rem;
  }

  .boss-zone {
    gap: 12px;
    padding: 6px 8px;
  }

  #boss-canvas {
    width: 64px;
  }

  .boss-meta {
    min-width: 0;
  }

  .dialogue {
    font-size: 0.82rem;
    line-height: 1.65;
    padding: 8px 10px;
    max-height: 108px;
    overflow-y: auto;
  }

  .question h2 {
    font-size: 0.95rem;
    margin: 4px 0 8px;
  }

  .choices {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .choices button {
    min-height: 42px;
    padding: 8px 10px 8px 12px;
    font-size: 0.86rem;
  }

  .log-strip {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .log-list {
    max-height: 66px;
    overflow-y: auto;
  }

  .source-note {
    display: none; /* 次要信息：资料来源在「更多」页有等价入口 */
  }

  /* 分页规则：battle 屏隐藏次要区；map / loot / more 各自独占主区 */
  .belt,
  .footer {
    display: none;
  }

  body[data-tab="map"] .battle,
  body[data-tab="loot"] .battle,
  body[data-tab="more"] .battle {
    display: none;
  }

  body[data-tab="map"] .belt,
  body[data-tab="loot"] .belt {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
  }

  body[data-tab="map"] .loot-panel,
  body[data-tab="loot"] .map-panel {
    display: none;
  }

  /* 地图页：面板撑满一屏，地图视口占据剩余高度（缩放/平移都在视口内） */
  body[data-tab="map"] .map-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  body[data-tab="map"] .map-viewport {
    flex: 1;
    min-height: 0;
    max-height: none;
  }

  body[data-tab="loot"] .loot-panel {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
  }

  /* 更多页：独占一屏的关于/链接页（桌面用页脚，此面板仅移动端出现） */
  body[data-tab="more"] .more-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 10px 12px;
  }

  /* 底部 Tab 栏：像素手柄风，避开 iOS 手势条 */
  .mobile-tabs {
    display: flex;
    gap: 6px;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }

  .tab-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 5px 2px;
    font-family: var(--mono);
    font-size: 0.62rem;
    color: var(--muted);
    background: var(--panel-deep);
    border: 2px solid var(--line);
    cursor: pointer;
  }

  .tab-btn.active {
    color: var(--ink);
    background: var(--amber);
    border-color: var(--amber);
    font-weight: 700;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}
