/* =========================================================
   园区一中 · 3D 校园地图
   UI 层样式。3D 场景与逻辑见 js/game.js，平面布局见 js/map-data.js。
   ========================================================= */

:root {
  --ink: #15352d;
  --ink-soft: #456055;
  --ink-faint: #728478;
  --paper: #f5efe2;
  --paper-bright: #fffaf0;
  --gold: #d7a84f;
  --gold-soft: #f0d59a;
  --coral: #cf755b;
  --moss: #6f8b6a;
  --line: rgba(21, 53, 45, 0.13);
  --line-strong: rgba(21, 53, 45, 0.23);
  --shadow-lg: 0 28px 70px rgba(6, 23, 17, 0.28);
  --shadow-md: 0 12px 34px rgba(6, 23, 17, 0.18);
  --font-display: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
  --font-ui: "Avenir Next", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--ink);
  background: #10271f;
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button {
  color: inherit;
  font: inherit;
}

button,
dialog {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

kbd {
  display: inline-flex;
  min-width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 1px solid rgba(21, 53, 45, 0.2);
  border-bottom-color: rgba(21, 53, 45, 0.33);
  border-radius: 5px;
  background: rgba(255, 252, 245, 0.68);
  color: var(--ink-soft);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.game-shell {
  position: fixed;
  inset: 0;
  isolation: isolate;
  min-width: 320px;
  background:
    radial-gradient(circle at 50% 38%, rgba(112, 148, 118, 0.34), transparent 62%),
    #10271f;
}

.scene-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  touch-action: none;
  cursor: grab;
  filter: saturate(1.18) contrast(1.045) brightness(1.0);
}

body.is-dragging .scene-canvas {
  cursor: grabbing;
}

.scene-vignette {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(8, 26, 20, 0.2), transparent 18%, transparent 72%, rgba(5, 20, 14, 0.26)),
    radial-gradient(ellipse at center, transparent 45%, rgba(5, 19, 13, 0.24) 100%);
}

.hud {
  position: absolute;
  z-index: 5;
  inset: 0;
  display: block;
  pointer-events: none;
}

.hud > * {
  pointer-events: auto;
}

/* ---------- 品牌与当前位置 ---------- */

.brand {
  position: absolute;
  z-index: 6;
  top: max(22px, env(safe-area-inset-top));
  left: max(26px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 64px;
  padding: 10px 17px;
  border: 1px solid rgba(255, 250, 240, 0.13);
  border-radius: 10px 22px 22px 10px;
  color: var(--paper-bright);
  background: rgba(16, 42, 34, 0.9);
  box-shadow: 0 14px 34px rgba(3, 18, 13, 0.24);
  backdrop-filter: blur(18px) saturate(1.1);
}

.brand-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.19em;
  line-height: 1.45;
  text-transform: uppercase;
}

.brand .eyebrow {
  color: rgba(245, 239, 226, 0.57);
  font-size: 8px;
  letter-spacing: 0.16em;
}

.brand h1 {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
  white-space: nowrap;
}

.brand-divider {
  width: 1px;
  height: 29px;
  margin-left: 3px;
  background: rgba(255, 250, 240, 0.16);
}

.location {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 61px;
  color: rgba(245, 239, 226, 0.82);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.location-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(215, 168, 79, 0.13);
  transition: transform 220ms var(--ease-out);
}

.location.is-changing .location-dot {
  transform: scale(1.45);
}

/* ---------- 探索进度 ---------- */

.explore-card {
  position: absolute;
  z-index: 4;
  top: max(102px, calc(env(safe-area-inset-top) + 80px));
  left: max(32px, env(safe-area-inset-left));
  width: 182px;
  padding: 10px 13px 11px;
  border: 1px solid rgba(255, 250, 240, 0.54);
  border-radius: 13px;
  background:
    linear-gradient(135deg, rgba(250, 246, 236, 0.94), rgba(243, 235, 220, 0.86));
  box-shadow: 0 10px 26px rgba(5, 22, 16, 0.15);
  backdrop-filter: blur(16px) saturate(1.06);
  transition:
    opacity 420ms var(--ease-out),
    transform 420ms var(--ease-out),
    border-color 300ms var(--ease-out),
    box-shadow 300ms var(--ease-out);
}

.explore-kicker {
  display: block;
  color: var(--ink-faint);
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.explore-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 3px;
}

.explore-value {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.explore-value strong {
  font-size: 22px;
  line-height: 1;
}

.explore-caption {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.explore-track {
  display: block;
  position: relative;
  height: 4px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(21, 53, 45, 0.12);
}

.explore-track i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c99644, #e0b964);
  box-shadow: 0 0 8px rgba(215, 168, 79, 0.5);
  transition: width 520ms var(--ease-out);
}

.explore-card.is-pulsing {
  animation: explore-pulse 900ms var(--ease-out);
}

.explore-card.is-complete {
  border-color: rgba(215, 168, 79, 0.72);
  box-shadow: 0 10px 30px rgba(171, 120, 35, 0.28);
}

@keyframes explore-pulse {
  0% { transform: scale(1); }
  22% { transform: scale(1.045); border-color: rgba(215, 168, 79, 0.9); }
  100% { transform: scale(1); }
}

.is-intro .explore-card {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

/* ---------- 工具按钮 ---------- */

.toolbar {
  position: absolute;
  z-index: 6;
  top: max(22px, env(safe-area-inset-top));
  right: max(26px, env(safe-area-inset-right));
  display: flex;
  gap: 7px;
  padding: 5px;
  border: 1px solid rgba(255, 250, 240, 0.55);
  border-radius: 15px;
  background: rgba(250, 246, 236, 0.88);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(18px) saturate(1.08);
}

.tool-button {
  display: inline-flex;
  height: 37px;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  border: 0;
  border-radius: 10px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition:
    color 180ms ease,
    background 180ms ease,
    transform 180ms var(--ease-out);
}

.tool-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

.tool-button:hover {
  color: var(--ink);
  background: rgba(21, 53, 45, 0.07);
}

.tool-button:active {
  transform: scale(0.96);
}

.tool-button[aria-pressed="true"] {
  color: var(--paper-bright);
  background: var(--ink);
  box-shadow: 0 4px 10px rgba(12, 38, 29, 0.2);
}

.tool-label {
  white-space: nowrap;
}

/* ---------- 全图模式提示 ---------- */

.view-banner {
  position: absolute;
  z-index: 4;
  top: max(27px, env(safe-area-inset-top));
  left: 50%;
  display: flex;
  height: 38px;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  border: 1px solid rgba(255, 250, 240, 0.2);
  border-radius: 999px;
  color: var(--paper);
  background: rgba(18, 46, 38, 0.9);
  box-shadow: 0 10px 24px rgba(5, 19, 14, 0.2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  transform: translateX(-50%);
  backdrop-filter: blur(14px);
  animation: banner-in 320ms var(--ease-out) both;
}

.view-banner-icon svg {
  display: block;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--gold);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.view-banner-hint {
  margin-left: 2px;
  color: rgba(245, 239, 226, 0.53);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.view-banner kbd {
  height: 17px;
  min-width: 17px;
  border-color: rgba(255, 250, 240, 0.18);
  background: rgba(255, 250, 240, 0.08);
  color: rgba(255, 250, 240, 0.8);
  box-shadow: none;
}

.is-intro .view-banner {
  display: none !important;
}

@keyframes banner-in {
  from {
    opacity: 0;
    transform: translate(-50%, -8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* ---------- 初次进入卡片 ---------- */

.welcome-card {
  position: absolute;
  top: max(112px, calc(50vh - 204px));
  left: max(36px, env(safe-area-inset-left));
  z-index: 6;
  width: min(378px, calc(100vw - 72px));
  padding: 26px 27px 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 250, 240, 0.74);
  border-radius: 8px 28px 28px 28px;
  background:
    linear-gradient(145deg, rgba(255, 253, 247, 0.975), rgba(243, 236, 222, 0.975)),
    var(--paper);
  box-shadow: var(--shadow-lg);
  transform-origin: 0 0;
  animation: welcome-in 780ms 120ms var(--ease-out) both;
}

.welcome-card::before {
  position: absolute;
  top: 0;
  left: 28px;
  width: 72px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--gold);
  content: "";
}

.welcome-card::after {
  position: absolute;
  right: -36px;
  bottom: -58px;
  width: 176px;
  height: 176px;
  border: 1px solid rgba(21, 53, 45, 0.08);
  border-radius: 50%;
  box-shadow:
    0 0 0 18px rgba(21, 53, 45, 0.025),
    0 0 0 42px rgba(21, 53, 45, 0.018);
  content: "";
  pointer-events: none;
}

.welcome-topline {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.prototype-badge {
  padding: 5px 8px;
  border: 1px solid rgba(21, 53, 45, 0.13);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.13em;
  white-space: nowrap;
}

.welcome-card h2 {
  position: relative;
  z-index: 1;
  max-width: 330px;
  margin: 15px 0 12px;
  font-family: var(--font-display);
  font-size: clamp(28px, 2.7vw, 34px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.38;
}

.welcome-copy {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.82;
}

.welcome-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 18px 0 17px;
  padding: 13px 0 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.welcome-stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 14px;
  border-right: 1px solid var(--line);
}

.welcome-stats > div:first-child {
  padding-left: 0;
}

.welcome-stats > div:last-child {
  border-right: 0;
}

.welcome-stats strong {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.welcome-stats span {
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.primary-button,
.secondary-button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  font-weight: 700;
  cursor: pointer;
}

.primary-button {
  width: 100%;
  height: 50px;
  gap: 12px;
  border-radius: 13px;
  color: var(--paper-bright);
  background: var(--ink);
  box-shadow: 0 8px 18px rgba(13, 43, 32, 0.16);
  font-size: 13px;
  letter-spacing: 0.09em;
  transition:
    transform 200ms var(--ease-out),
    background 200ms ease,
    box-shadow 200ms ease;
}

.primary-button:hover {
  background: #204b3e;
  box-shadow: 0 12px 25px rgba(13, 43, 32, 0.22);
  transform: translateY(-2px);
}

.primary-button:active {
  transform: translateY(0);
}

.primary-button-arrow {
  color: var(--gold-soft);
  font-size: 17px;
  font-weight: 400;
  transition: transform 200ms var(--ease-out);
}

.primary-button:hover .primary-button-arrow {
  transform: translateX(3px);
}

.welcome-hint {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 12px 0 0;
  color: var(--ink-faint);
  font-size: 9px;
  letter-spacing: 0.03em;
}

.welcome-hint span {
  opacity: 0.5;
}

.welcome-hint kbd {
  height: 17px;
  min-width: 17px;
  padding: 0 4px;
  border-color: var(--line);
  color: var(--ink-faint);
  background: rgba(21, 53, 45, 0.035);
  font-size: 8px;
  box-shadow: none;
}

.welcome-card.is-leaving {
  pointer-events: none;
  animation: welcome-out 480ms var(--ease-out) forwards;
}

@keyframes welcome-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes welcome-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translate(-12px, 10px) scale(0.98);
  }
}

/* ---------- 小地图 ---------- */

.minimap-card {
  position: absolute;
  right: max(26px, env(safe-area-inset-right));
  bottom: max(26px, env(safe-area-inset-bottom));
  z-index: 4;
  width: 232px;
  padding: 12px 12px 10px;
  border: 1px solid rgba(255, 250, 240, 0.56);
  border-radius: 17px;
  background: rgba(250, 246, 236, 0.91);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px) saturate(1.06);
}

.minimap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 9px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.minimap-north {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--ink-faint);
  font-family: var(--font-ui);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.minimap-north i {
  color: var(--coral);
  font-style: normal;
  font-size: 10px;
}

.minimap-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 384 / 220;
  height: auto;
  border-radius: 9px;
  background: #a9c393;
}

.minimap-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 2px 0;
  color: var(--ink-faint);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.minimap-footer > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.legend-player {
  background: var(--coral);
  box-shadow: 0 0 0 2px rgba(207, 117, 91, 0.18);
}

/* ---------- 操作栏 ---------- */

.controls-bar {
  position: absolute;
  z-index: 4;
  bottom: max(30px, env(safe-area-inset-bottom));
  left: max(32px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 9px 14px;
  border: 1px solid rgba(255, 250, 240, 0.5);
  border-radius: 12px;
  color: var(--ink-soft);
  background: rgba(250, 246, 236, 0.84);
  box-shadow: 0 8px 22px rgba(5, 22, 16, 0.12);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.03em;
  backdrop-filter: blur(14px);
  transition:
    opacity 400ms var(--ease-out),
    transform 400ms var(--ease-out);
}

.controls-bar > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

/* 飞行模式下的专属按键提示:默认隐藏,起飞后替换跳跃/疾跑/缩放提示 */
.controls-bar > span.controls-fly {
  display: none;
}

body.is-flying .controls-bar > span.controls-fly {
  display: inline-flex;
}

body.is-flying .controls-bar > span.controls-jump,
body.is-flying .controls-bar > span.controls-run,
body.is-flying .controls-bar > span.controls-zoom {
  display: none;
}

.controls-bar kbd {
  height: 17px;
  min-width: 17px;
  padding: 0 4px;
  font-size: 8px;
}

.is-intro .controls-bar {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

.is-intro .minimap-card,
.is-overview .minimap-card {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

.minimap-card {
  transition:
    opacity 500ms var(--ease-out),
    transform 500ms var(--ease-out);
}

/* ---------- 3D 世界标签 ---------- */

.world-labels {
  position: absolute;
  z-index: 2;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.world-label {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  min-height: 25px;
  padding: 5px 9px 5px 9px;
  border: 1px solid rgba(78, 72, 52, 0.16);
  border-radius: 7px;
  color: var(--ink);
  background: rgba(250, 246, 236, 0.93);
  box-shadow: 0 4px 14px rgba(6, 24, 16, 0.15);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.1;
  white-space: nowrap;
  opacity: 0;
  transform: translate3d(0, 0, 0);
  transition: opacity 180ms ease;
  will-change: transform;
  backdrop-filter: blur(5px);
}

.world-label::before {
  width: 3px;
  height: 15px;
  margin-right: 7px;
  border-radius: 3px;
  background: var(--gold);
  content: "";
}

.world-label.is-field {
  padding: 7px 11px;
  color: var(--ink);
  font-size: 12px;
}

.world-label.is-field::before {
  background: var(--coral);
}

.world-label.is-minor {
  min-height: 23px;
  padding: 5px 9px;
  color: #48695e;
  background: rgba(247, 242, 230, 0.84);
  font-size: 10px;
  box-shadow: 0 3px 10px rgba(6, 24, 16, 0.1);
}

.world-label.is-minor::before {
  display: none;
}

.world-label.is-dark {
  border-color: rgba(221, 195, 133, 0.22);
  color: #f7eedc;
  background: rgba(28, 47, 41, 0.93);
}

.world-label.is-dark::before {
  background: #d7b46b;
}

.world-label .label-en {
  margin-right: 7px;
  color: var(--ink-faint);
  font-family: var(--font-ui);
  font-size: 6.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.world-label.is-dark .label-en {
  color: rgba(238, 222, 184, 0.52);
}

.mode-play .world-label .label-en {
  display: none;
}

.mode-play .world-label {
  padding: 5px 8px;
  background: rgba(250, 246, 236, 0.84);
  font-size: 10.5px;
}

.mode-play .world-label.is-field {
  font-size: 12px;
}

.mode-play .world-label::before {
  height: 12px;
  margin-right: 6px;
}

/* ---------- 交互地点浮标 ---------- */

.poi-layer {
  position: absolute;
  z-index: 3;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.poi-marker {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  padding: 0;
  border: 1.5px solid rgba(255, 250, 238, 0.94);
  border-radius: 50%;
  color: #fffaf0;
  background: var(--marker-color, var(--gold));
  box-shadow:
    0 4px 12px rgba(4, 19, 12, 0.28),
    0 0 0 4px rgba(255, 250, 238, 0.16);
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transform: translate3d(0, 0, 0);
  transition:
    opacity 180ms ease,
    filter 180ms ease;
  will-change: transform;
}

.poi-marker::after {
  position: absolute;
  inset: -5px;
  border: 1px solid rgba(255, 247, 228, 0.3);
  border-radius: 50%;
  content: "";
  opacity: 0;
  transform: scale(0.85);
}

.poi-marker:hover {
  filter: brightness(1.08);
}

.poi-marker.is-current::after {
  opacity: 1;
  animation: marker-ring 1.8s var(--ease-out) infinite;
}

.poi-marker.is-locked {
  border-style: dashed;
  filter: saturate(0.9);
}

.poi-marker.is-visiting {
  box-shadow:
    0 4px 12px rgba(4, 19, 12, 0.28),
    0 0 0 4px rgba(241, 211, 137, 0.3);
}

@keyframes marker-ring {
  0% {
    opacity: 0.8;
    transform: scale(0.85);
  }
  70% {
    opacity: 0;
    transform: scale(1.6);
  }
  100% {
    opacity: 0;
    transform: scale(1.6);
  }
}

/* ---------- 互动提示 ---------- */

.interaction-prompt {
  position: absolute;
  z-index: 4;
  bottom: max(30px, env(safe-area-inset-bottom));
  left: 50%;
  display: flex;
  min-width: 242px;
  align-items: center;
  gap: 11px;
  padding: 9px 13px 9px 10px;
  border: 1px solid rgba(255, 250, 240, 0.2);
  border-radius: 13px;
  color: var(--paper-bright);
  background: rgba(18, 47, 37, 0.94);
  box-shadow: 0 15px 38px rgba(3, 17, 12, 0.28);
  text-align: left;
  cursor: pointer;
  transform: translateX(-50%);
  backdrop-filter: blur(16px) saturate(1.1);
  animation: prompt-in 300ms var(--ease-out) both;
}

.interaction-prompt:hover {
  background: #173e31;
}

.interaction-prompt kbd {
  height: 27px;
  min-width: 27px;
  padding: 0;
  border-color: rgba(255, 250, 240, 0.22);
  color: var(--ink);
  background: var(--gold-soft);
  font-size: 11px;
  box-shadow: none;
}

.interaction-icon {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border: 1px solid rgba(255, 250, 240, 0.15);
  border-radius: 50%;
  color: var(--gold-soft);
  background: rgba(255, 250, 240, 0.06);
  font-size: 10px;
}

.interaction-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.interaction-copy strong {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.interaction-copy small {
  overflow: hidden;
  color: rgba(245, 239, 226, 0.52);
  font-size: 9px;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.interaction-enter {
  color: rgba(245, 239, 226, 0.38);
  font-size: 14px;
}

@keyframes prompt-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* ---------- 轻提示 ---------- */

.toast-stack {
  position: absolute;
  z-index: 8;
  top: max(90px, calc(env(safe-area-inset-top) + 82px));
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  pointer-events: none;
  transform: translateX(-50%);
}

.toast {
  padding: 9px 14px;
  border: 1px solid rgba(255, 250, 240, 0.16);
  border-radius: 999px;
  color: var(--paper);
  background: rgba(18, 47, 37, 0.91);
  box-shadow: 0 8px 24px rgba(3, 17, 12, 0.18);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  backdrop-filter: blur(12px);
  animation: toast-in 260ms var(--ease-out) both;
}

.toast.is-leaving {
  animation: toast-out 220ms ease forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-5px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
}

/* ---------- 地点弹窗 ---------- */

.info-dialog {
  width: min(472px, calc(100vw - 36px));
  max-height: min(680px, calc(100dvh - 36px));
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 26px;
  color: var(--ink);
  background: transparent;
}

.info-dialog::backdrop {
  background: rgba(5, 18, 13, 0.52);
  backdrop-filter: blur(5px);
}

.info-dialog[open] .dialog-card {
  animation: dialog-in 340ms var(--ease-out) both;
}

.dialog-card {
  position: relative;
  max-height: min(680px, calc(100dvh - 36px));
  margin: 0;
  padding: 29px 30px 24px;
  overflow: auto;
  border: 1px solid rgba(255, 250, 240, 0.8);
  border-radius: 26px;
  background:
    radial-gradient(circle at 90% 8%, rgba(215, 168, 79, 0.1), transparent 28%),
    var(--paper-bright);
  box-shadow: var(--shadow-lg);
}

.dialog-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 28px;
}

.dialog-emblem {
  display: grid;
  width: 47px;
  height: 47px;
  flex: 0 0 47px;
  place-items: center;
  border: 1px solid rgba(21, 53, 45, 0.12);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(21, 53, 45, 0.055);
  font-family: var(--font-display);
  font-size: 17px;
}

.dialog-head h2 {
  margin: 3px 0 0;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.dialog-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-soft);
  background: transparent;
  font-size: 17px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  transition:
    background 160ms ease,
    color 160ms ease;
}

.dialog-close:hover {
  color: var(--ink);
  background: rgba(21, 53, 45, 0.07);
}

.dialog-description {
  margin: 22px 0 18px;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.9;
  white-space: pre-line;
}

.dialog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 25px;
}

.dialog-tag {
  padding: 5px 9px;
  border: 1px solid rgba(21, 53, 45, 0.1);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(21, 53, 45, 0.045);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.dialog-tag.is-locked {
  border-color: rgba(207, 117, 91, 0.24);
  color: #a65943;
  background: rgba(207, 117, 91, 0.07);
}

.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.dialog-note {
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.6;
}

.secondary-button {
  height: 37px;
  flex: 0 0 auto;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: transparent;
  font-size: 10px;
  letter-spacing: 0.05em;
  transition:
    background 160ms ease,
    border-color 160ms ease;
}

.secondary-button:hover {
  border-color: var(--line-strong);
  background: rgba(21, 53, 45, 0.055);
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ---------- 加载屏幕 ---------- */

.loading-screen {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--paper);
  background:
    radial-gradient(circle at 50% 40%, rgba(84, 121, 93, 0.38), transparent 44%),
    linear-gradient(145deg, #173a30, #0c2019 72%);
  transition:
    opacity 600ms var(--ease-out),
    visibility 600ms var(--ease-out);
}

.loading-screen.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.loading-eyebrow {
  margin: 0 0 8px;
  color: rgba(245, 239, 226, 0.45);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.loading-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.12em;
}

.loading-line {
  position: relative;
  width: 124px;
  height: 1px;
  margin-top: 23px;
  overflow: hidden;
  background: rgba(255, 250, 240, 0.12);
}

.loading-line::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  content: "";
  transform: translateX(-100%);
  animation: loading-sweep 1.7s ease-in-out infinite;
}

@keyframes loading-sweep {
  to {
    transform: translateX(100%);
  }
}

/* ---------- 致命错误 ---------- */

.fatal-error {
  position: fixed;
  z-index: 50;
  top: 50%;
  left: 50%;
  width: min(420px, calc(100vw - 32px));
  padding: 28px;
  border-radius: 20px;
  color: var(--ink);
  background: var(--paper-bright);
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, -50%);
}

.fatal-error h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 24px;
}

.fatal-error p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.8;
}

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

/* ---------- 地图风格选择 ---------- */

.map-style-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
}

.map-style-label {
  color: var(--ink-faint);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.14em;
  white-space: nowrap;
}

.map-style-tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(21, 53, 45, 0.045);
}

.map-style-tab {
  display: inline-flex;
  height: 25px;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  color: var(--ink-faint);
  background: transparent;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: pointer;
  transition:
    color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.map-style-tab:hover {
  color: var(--ink);
}

.map-style-tab[aria-pressed="true"] {
  color: var(--ink);
  background: rgba(255, 253, 247, 0.92);
  box-shadow: 0 2px 7px rgba(17, 42, 32, 0.1);
}

.style-dot {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.style-dot-campus {
  background: #6f9060;
  box-shadow: 0 0 0 2px rgba(111, 144, 96, 0.16);
}

.style-dot-wasteland {
  background: #b5784d;
  box-shadow: 0 0 0 2px rgba(181, 120, 77, 0.15);
}

/* ---------- 风格弹窗 ---------- */

.style-dialog {
  width: min(610px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 28px;
  color: var(--ink);
  background: transparent;
}

.style-dialog::backdrop {
  background: rgba(5, 18, 13, 0.58);
  backdrop-filter: blur(6px);
}

.style-dialog[open] .style-dialog-card {
  animation: dialog-in 340ms var(--ease-out) both;
}

.style-dialog-card {
  position: relative;
  max-height: calc(100dvh - 32px);
  margin: 0;
  padding: 30px;
  overflow: auto;
  border: 1px solid rgba(255, 250, 240, 0.82);
  border-radius: 28px;
  background:
    radial-gradient(circle at 88% 5%, rgba(215, 168, 79, 0.13), transparent 26%),
    var(--paper-bright);
  box-shadow: var(--shadow-lg);
}

.style-dialog-head {
  padding-right: 30px;
}

.style-dialog-head h2 {
  margin: 9px 0 7px;
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: -0.03em;
}

.style-dialog-head p:last-child {
  max-width: 470px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.75;
}

.style-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 22px;
}

.style-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  color: var(--ink);
  background: rgba(255, 252, 245, 0.6);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 180ms ease,
    transform 200ms var(--ease-out),
    box-shadow 200ms ease;
}

.style-card:hover {
  transform: translateY(-2px);
  border-color: rgba(21, 53, 45, 0.28);
  box-shadow: 0 14px 30px rgba(18, 43, 32, 0.12);
}

.style-card.is-active {
  border-color: rgba(21, 53, 45, 0.5);
  box-shadow: 0 0 0 2px rgba(21, 53, 45, 0.08);
}

.style-card-visual {
  position: relative;
  display: block;
  height: 140px;
  overflow: hidden;
  isolation: isolate;
}

.visual-campus {
  background:
    radial-gradient(circle at 75% 24%, rgba(255, 238, 180, 0.9), transparent 22%),
    linear-gradient(180deg, #88abc0 0%, #c7d8cb 54%, #7d9b64 55%, #5f7d4c 100%);
}

.visual-wasteland {
  background:
    radial-gradient(circle at 72% 24%, rgba(255, 166, 98, 0.7), transparent 19%),
    linear-gradient(180deg, #60503f 0%, #b18565 57%, #6f6144 58%, #4b3e2d 100%);
}

.style-card-visual .visual-sun {
  position: absolute;
  top: 22px;
  right: 36px;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: rgba(255, 244, 199, 0.84);
  box-shadow: 0 0 24px rgba(255, 230, 164, 0.62);
}

.visual-wasteland .visual-sun {
  background: rgba(255, 186, 125, 0.74);
  box-shadow: 0 0 32px rgba(255, 143, 86, 0.38);
}

.style-card-visual .visual-building {
  position: absolute;
  bottom: 28px;
  left: 34px;
  width: 128px;
  height: 62px;
  border-radius: 2px;
  background:
    repeating-linear-gradient(90deg, transparent 0 13px, rgba(247, 241, 221, 0.54) 13px 17px, transparent 17px 27px),
    linear-gradient(180deg, #d1c3a9, #a7967e);
  box-shadow: 0 8px 12px rgba(22, 35, 24, 0.16);
}

.visual-wasteland .visual-building {
  background:
    repeating-linear-gradient(90deg, transparent 0 13px, rgba(35, 30, 25, 0.55) 13px 17px, transparent 17px 27px),
    linear-gradient(180deg, #8c7865, #5b4d3f);
}

.style-card-visual .visual-tree {
  position: absolute;
  bottom: 25px;
  width: 18px;
  height: 55px;
  border-radius: 8px 8px 2px 2px;
  background: #584d35;
}

.style-card-visual .visual-tree::before {
  position: absolute;
  top: -27px;
  left: -21px;
  width: 60px;
  height: 45px;
  border-radius: 48% 52% 44% 56%;
  background: #4f724e;
  box-shadow:
    -9px 8px 0 -5px #61835b,
    12px 6px 0 -7px #3d5e3d;
  content: "";
}

.visual-wasteland .visual-tree {
  height: 43px;
  background: #40382e;
}

.visual-wasteland .visual-tree::before {
  top: -18px;
  left: -16px;
  width: 48px;
  height: 30px;
  background: #4d513b;
  box-shadow:
    -12px 4px 0 -8px #5c5942,
    8px 8px 0 -10px #3b4030;
}

.visual-tree-a {
  left: 178px;
}

.visual-tree-b {
  right: 42px;
  bottom: 22px;
  transform: scale(0.72);
  transform-origin: bottom center;
}

.style-card-visual .visual-crack {
  position: absolute;
  right: 75px;
  bottom: 29px;
  width: 2px;
  height: 49px;
  background: rgba(39, 28, 20, 0.65);
  transform: rotate(18deg);
  box-shadow:
    7px 13px 0 -0.4px rgba(39, 28, 20, 0.5),
    -8px 22px 0 -0.5px rgba(39, 28, 20, 0.47),
    4px 36px 0 -0.4px rgba(39, 28, 20, 0.42);
}

.style-card-body {
  position: relative;
  display: block;
  padding: 14px 15px 16px;
}

.style-card-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.style-card-top strong {
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: -0.02em;
}

.style-card-top em {
  color: var(--ink-faint);
  font-size: 7.5px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.style-card-copy {
  display: block;
  margin-top: 6px;
  padding-right: 17px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.65;
}

.style-card-check {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  color: transparent;
  background: transparent;
  font-size: 10px;
  font-weight: 800;
}

.style-card.is-active .style-card-check {
  color: var(--paper-bright);
  background: var(--ink);
}

.style-dialog-note {
  margin: 17px 0 0;
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.6;
}

/* ---------- 废土主题 ---------- */

body.theme-wasteland {
  --ink: #2e291f;
  --ink-soft: #655b49;
  --ink-faint: #90816b;
  --paper: #e3d8c2;
  --paper-bright: #f1e6d0;
  --gold: #c4884e;
  --gold-soft: #e7bf86;
  --coral: #b95e46;
  --moss: #6d7559;
  --line: rgba(55, 45, 31, 0.15);
  --line-strong: rgba(55, 45, 31, 0.27);
  --shadow-lg: 0 30px 72px rgba(10, 7, 4, 0.46);
  --shadow-md: 0 12px 34px rgba(10, 7, 4, 0.3);
}

body.theme-wasteland .game-shell {
  background:
    radial-gradient(circle at 50% 38%, rgba(132, 104, 72, 0.25), transparent 62%),
    #17130f;
}

body.theme-wasteland .scene-canvas {
  filter: saturate(0.86) sepia(0.075) contrast(1.065) brightness(1.04);
}

body.theme-wasteland .scene-vignette {
  background:
    linear-gradient(180deg, rgba(22, 16, 10, 0.42), transparent 18%, transparent 68%, rgba(13, 9, 5, 0.38)),
    radial-gradient(ellipse at center, transparent 38%, rgba(14, 9, 5, 0.42) 100%);
}

body.theme-wasteland .brand {
  border-color: rgba(236, 212, 174, 0.16);
  background: rgba(33, 28, 21, 0.9);
  box-shadow: 0 14px 34px rgba(6, 4, 2, 0.34);
}

body.theme-wasteland .location-dot {
  background: #d48a50;
  box-shadow: 0 0 0 5px rgba(212, 138, 80, 0.12);
}

body.theme-wasteland .toolbar {
  border-color: rgba(245, 225, 190, 0.25);
  background: rgba(44, 37, 27, 0.88);
}

body.theme-wasteland .tool-button {
  color: rgba(243, 229, 204, 0.74);
}

body.theme-wasteland .tool-button:hover {
  color: #fff4df;
  background: rgba(240, 218, 178, 0.1);
}

body.theme-wasteland .tool-button[aria-pressed="true"] {
  color: #241c13;
  background: #e2c08b;
}

body.theme-wasteland .welcome-card {
  border-color: rgba(238, 213, 177, 0.42);
  background:
    linear-gradient(145deg, rgba(242, 230, 209, 0.98), rgba(218, 203, 180, 0.98)),
    var(--paper);
  box-shadow: 0 30px 76px rgba(5, 4, 2, 0.52);
}

body.theme-wasteland .welcome-card::before {
  background: #b16a40;
}

body.theme-wasteland .welcome-card::after {
  border-color: rgba(93, 68, 42, 0.13);
  box-shadow:
    0 0 0 18px rgba(93, 68, 42, 0.04),
    0 0 0 42px rgba(93, 68, 42, 0.025);
}

body.theme-wasteland .primary-button {
  color: #f4e7cf;
  background: #3c3225;
}

body.theme-wasteland .primary-button:hover {
  background: #514332;
}

body.theme-wasteland .primary-button-arrow {
  color: #d9a66a;
}

body.theme-wasteland .prototype-badge {
  border-color: rgba(87, 66, 41, 0.22);
  color: #7a674e;
}

body.theme-wasteland .map-style-tabs {
  background: rgba(83, 66, 43, 0.07);
}

body.theme-wasteland .map-style-tab[aria-pressed="true"] {
  background: rgba(250, 242, 226, 0.9);
}

body.theme-wasteland .minimap-card,
body.theme-wasteland .explore-card {
  border-color: rgba(240, 219, 183, 0.2);
  background: rgba(42, 35, 25, 0.9);
  color: #f1e2c7;
}

body.theme-wasteland .minimap-header,
body.theme-wasteland .minimap-footer,
body.theme-wasteland .explore-kicker,
body.theme-wasteland .explore-caption {
  color: rgba(243, 226, 196, 0.64);
}

body.theme-wasteland .explore-value,
body.theme-wasteland .explore-value strong {
  color: #f4e7d0;
}

body.theme-wasteland .explore-track {
  background: rgba(239, 218, 183, 0.15);
}

body.theme-wasteland .explore-track i {
  background: #d39557;
}

body.theme-wasteland .controls-bar {
  border-color: rgba(239, 216, 176, 0.16);
  background: rgba(36, 30, 22, 0.88);
  color: rgba(243, 227, 199, 0.7);
}

body.theme-wasteland .controls-bar kbd {
  border-color: rgba(238, 215, 177, 0.18);
  color: rgba(246, 230, 203, 0.8);
  background: rgba(246, 226, 192, 0.07);
  box-shadow: none;
}

body.theme-wasteland .view-banner {
  color: #f1dfc1;
  background: rgba(39, 31, 21, 0.92);
}

body.theme-wasteland .loading-screen {
  background:
    radial-gradient(circle at 50% 40%, rgba(123, 88, 53, 0.45), transparent 56%),
    #17130e;
}

body.theme-wasteland .loading-line {
  background: linear-gradient(90deg, transparent, #bb7e4d, transparent);
}

body.theme-wasteland .style-dialog-card {
  background:
    radial-gradient(circle at 90% 6%, rgba(177, 106, 64, 0.14), transparent 28%),
    var(--paper-bright);
}

body.theme-wasteland .dialog-tag {
  border-color: rgba(79, 61, 39, 0.15);
  color: #6e5d46;
  background: rgba(83, 64, 42, 0.06);
}

body.theme-wasteland .interaction-prompt {
  border-color: rgba(239, 214, 174, 0.22);
  background: rgba(38, 31, 22, 0.92);
  color: #f3e5cc;
}

@media (max-height: 680px) and (min-width: 821px) {
  .welcome-card {
    top: 88px;
    padding: 21px 24px 18px;
  }

  .welcome-card h2 {
    margin: 10px 0 8px;
    font-size: 26px;
  }

  .welcome-copy {
    font-size: 11px;
    line-height: 1.7;
  }

  .welcome-stats {
    margin: 13px 0;
    padding: 10px 0;
  }

  .map-style-row {
    margin-bottom: 11px;
  }

  .primary-button {
    height: 45px;
  }

  .welcome-hint {
    margin-top: 9px;
  }
}

@media (max-width: 1120px) {
  .welcome-card {
    width: min(360px, calc(100vw - 56px));
    padding: 24px 26px 21px;
  }

  .welcome-card h2 {
    font-size: 29px;
  }

  .minimap-card {
    width: 200px;
  }

  .explore-card {
    width: 166px;
    top: 94px;
    left: max(26px, env(safe-area-inset-left));
  }

  .tool-label {
    display: none;
  }

  .tool-button {
    width: 37px;
    justify-content: center;
    padding: 0;
  }

  .view-banner {
    left: auto;
    right: max(26px, env(safe-area-inset-right));
    top: 78px;
    transform: none;
  }

  @keyframes banner-in {
    from {
      opacity: 0;
      transform: translateY(-8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

@media (max-width: 820px) {
  .style-dialog-card {
    padding: 24px 20px 20px;
  }

  .style-dialog-head h2 {
    font-size: 24px;
  }

  .style-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 17px;
  }

  .style-card {
    flex-direction: row;
  }

  .style-card-visual {
    width: 142px;
    height: auto;
    min-height: 108px;
    flex: 0 0 142px;
  }

  .style-card-body {
    flex: 1;
    padding: 14px 13px;
  }

  .visual-tree-a {
    left: 125px;
  }

  .brand {
    top: max(14px, env(safe-area-inset-top));
    left: max(14px, env(safe-area-inset-left));
    gap: 9px;
    min-height: 55px;
    padding: 8px 12px 8px 8px;
    border-radius: 8px 18px 18px 8px;
  }

  .explore-card {
    top: max(78px, calc(env(safe-area-inset-top) + 64px));
    left: max(14px, env(safe-area-inset-left));
    width: 142px;
    padding: 8px 10px 9px;
    border-radius: 11px;
  }

  .explore-kicker {
    font-size: 6.5px;
    letter-spacing: 0.16em;
  }

  .explore-value strong {
    font-size: 18px;
  }

  .explore-caption {
    font-size: 8px;
  }

  .brand h1 {
    font-size: 17px;
  }

  .brand .eyebrow {
    display: none;
  }

  .brand-divider {
    height: 23px;
    margin-left: 0;
  }

  .location {
    min-width: 0;
    font-size: 10px;
  }

  .toolbar {
    top: max(14px, env(safe-area-inset-top));
    right: max(14px, env(safe-area-inset-right));
    gap: 2px;
    padding: 4px;
    border-radius: 13px;
  }

  .tool-button {
    width: 33px;
    height: 33px;
    border-radius: 9px;
  }

  .tool-button svg {
    width: 14px;
    height: 14px;
  }

  .welcome-card {
    top: auto;
    bottom: max(22px, env(safe-area-inset-bottom));
    left: 50%;
    width: min(420px, calc(100vw - 28px));
    padding: 24px 24px 20px;
    transform: translateX(-50%);
  }

  .welcome-card.is-leaving {
    animation: welcome-out-mobile 420ms var(--ease-out) forwards;
  }

  .welcome-card h2 {
    margin-top: 13px;
    font-size: 27px;
  }

  .welcome-stats {
    margin: 15px 0;
    padding: 12px 0;
  }

  .minimap-card {
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
    width: 154px;
    padding: 9px;
    border-radius: 13px;
  }

  .minimap-header {
    padding-bottom: 6px;
    font-size: 9px;
  }

  .minimap-footer {
    display: none;
  }

  .controls-bar {
    bottom: max(14px, env(safe-area-inset-bottom));
    left: max(14px, env(safe-area-inset-left));
    flex-wrap: wrap;
    max-width: calc(100vw - 28px);
    gap: 6px 8px;
    padding: 7px 10px;
  }

  .controls-debug {
    display: none !important;
  }

  .interaction-prompt {
    bottom: max(14px, env(safe-area-inset-bottom));
    min-width: 220px;
  }

  .view-banner {
    display: none;
  }

  .world-label {
    font-size: 10.5px;
  }

  .world-label .label-en {
    display: none;
  }

  @keyframes welcome-in {
    from {
      opacity: 0;
      transform: translate(-50%, 18px) scale(0.985);
    }
    to {
      opacity: 1;
      transform: translate(-50%, 0) scale(1);
    }
  }

  @keyframes welcome-out-mobile {
    from {
      opacity: 1;
      transform: translate(-50%, 0) scale(1);
    }
    to {
      opacity: 0;
      transform: translate(-50%, 10px) scale(0.98);
    }
  }
}

@media (max-width: 560px) {
  .brand .location,
  .brand-divider {
    display: none;
  }

  .toolbar {
    gap: 0;
  }

  .toolbar #debug-button {
    display: none;
  }

  .style-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
  }

  .style-dialog-card {
    padding: 21px 15px 16px;
    border-radius: 22px;
  }

  .style-dialog-head {
    padding-right: 19px;
  }

  .style-dialog-head h2 {
    font-size: 21px;
  }

  .style-dialog-head p:last-child {
    font-size: 10.5px;
  }

  .style-grid {
    margin-top: 14px;
  }

  .style-card {
    flex-direction: column;
  }

  .style-card-visual {
    width: 100%;
    height: 94px;
    min-height: 0;
    flex: none;
  }

  .style-card-body {
    padding: 12px 13px 14px;
  }

  .style-card-top strong {
    font-size: 16px;
  }

  .style-card-copy {
    font-size: 9.5px;
  }

  .style-card-visual .visual-building {
    left: 24px;
    bottom: 21px;
    width: 108px;
    height: 50px;
  }

  .style-card-visual .visual-tree-a {
    left: 138px;
  }

  .map-style-row {
    margin-bottom: 12px;
  }

  .map-style-label {
    display: none;
  }

  .map-style-tabs {
    width: 100%;
  }

  .map-style-tab {
    flex: 1;
    justify-content: center;
  }

  .welcome-card {
    padding: 21px 20px 17px;
    border-radius: 7px 22px 22px 22px;
  }

  .welcome-card h2 {
    font-size: 24px;
  }

  .welcome-copy {
    display: -webkit-box;
    overflow: hidden;
    font-size: 11px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .welcome-stats {
    margin: 13px 0;
    padding: 10px 0;
  }

  .welcome-stats > div {
    padding: 0 10px;
  }

  .welcome-stats strong {
    font-size: 19px;
  }

  .primary-button {
    height: 46px;
  }

  .welcome-hint {
    display: none;
  }

  .minimap-card {
    display: none;
  }

  .controls-bar {
    display: none;
  }

  .toast-stack {
    top: max(78px, calc(env(safe-area-inset-top) + 68px));
  }

  .interaction-prompt {
    width: calc(100vw - 28px);
    min-width: 0;
  }

  .world-label.is-minor {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------------------------------------------
 * 触屏操作层（仅 (pointer: coarse) 设备显示）
 * ------------------------------------------- */

.touch-ui {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: none;
  pointer-events: none;
}

.touch-ui.is-hidden {
  display: none !important;
}

@media (pointer: coarse) {
  body:not(.is-intro):not(.is-overview) .touch-ui:not(.is-hidden) {
    display: block;
  }
}

.touch-stick {
  position: absolute;
  left: max(18px, env(safe-area-inset-left));
  bottom: calc(max(20px, env(safe-area-inset-bottom)) + 62px);
  width: 118px;
  height: 118px;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.touch-stick-base {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 250, 240, 0.55);
  background: radial-gradient(circle at 50% 44%, rgba(250, 246, 236, 0.52), rgba(250, 246, 236, 0.26) 62%, rgba(250, 246, 236, 0.12));
  box-shadow: 0 10px 24px rgba(5, 22, 16, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
}

.touch-stick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;
  border-radius: 50%;
  background: rgba(252, 248, 239, 0.92);
  border: 1.5px solid rgba(122, 112, 90, 0.32);
  box-shadow: 0 6px 14px rgba(5, 22, 16, 0.22);
  transform: translate3d(0, 0, 0);
  transition: transform 140ms var(--ease-out);
  pointer-events: none;
}

.touch-stick.is-active .touch-stick-knob {
  transition: none;
  background: rgba(255, 253, 246, 0.98);
}

.touch-actions {
  position: absolute;
  right: max(18px, env(safe-area-inset-right));
  bottom: calc(max(20px, env(safe-area-inset-bottom)) + 62px);
  display: grid;
  grid-template-columns: repeat(2, 60px);
  grid-auto-rows: 60px;
  gap: 10px;
  justify-items: end;
  align-items: end;
  pointer-events: none;
}

.touch-button {
  pointer-events: auto;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 250, 240, 0.6);
  background: rgba(250, 246, 236, 0.84);
  color: var(--ink-soft, #2b3a32);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 8px 18px rgba(5, 22, 16, 0.18);
  backdrop-filter: blur(10px);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  transition: transform 120ms var(--ease-out), background 160ms var(--ease-out);
}

.touch-button.is-accent {
  background: rgba(52, 104, 86, 0.92);
  color: #fdf9ef;
  border-color: rgba(255, 255, 255, 0.5);
}

.touch-button.is-pressed,
.touch-button:active {
  transform: scale(0.93);
  background: rgba(255, 253, 244, 0.96);
}

.touch-button.is-accent.is-pressed,
.touch-button.is-accent:active {
  background: rgba(64, 122, 100, 0.98);
}

.touch-button.is-hidden {
  display: none;
}

.touch-button:disabled {
  opacity: 0.35;
}

/* 触屏设备的操作提示文案 */
.controls-touch {
  display: none;
}

.welcome-hint-touch {
  display: none;
}

@media (pointer: coarse) {
  .controls-bar > span {
    display: none;
  }

  .controls-bar > span.controls-touch {
    display: inline-flex;
  }

  .welcome-hint {
    display: none;
  }

  .welcome-hint-touch {
    display: flex;
  }

  .touch-actions {
    grid-template-columns: repeat(2, 62px);
    grid-auto-rows: 62px;
  }
}

/* 触屏布局避让:互动提示抬到摇杆/按钮上方,小地图让位(可用「全图」代替) */
@media (pointer: coarse) {
  .interaction-prompt {
    bottom: calc(max(20px, env(safe-area-inset-bottom)) + 196px);
    min-width: 0;
    max-width: calc(100vw - 36px);
  }

  .minimap-card {
    display: none;
  }
}

@media (pointer: coarse) {
  .interaction-prompt kbd {
    display: none;
  }
}

/* 触屏横屏:控件缩小一档,给 3D 画面留出更多可视面积 */
@media (pointer: coarse) and (orientation: landscape) {
  .touch-stick {
    left: max(16px, env(safe-area-inset-left));
    bottom: calc(max(14px, env(safe-area-inset-bottom)) + 36px);
    width: 96px;
    height: 96px;
  }

  .touch-stick-knob {
    width: 44px;
    height: 44px;
    margin: -22px 0 0 -22px;
  }

  .touch-actions {
    right: max(16px, env(safe-area-inset-right));
    bottom: calc(max(14px, env(safe-area-inset-bottom)) + 36px);
    grid-template-columns: repeat(2, 52px);
    grid-auto-rows: 52px;
    gap: 8px;
  }

  .touch-button {
    width: 52px;
    height: 52px;
    font-size: 11px;
  }

  .interaction-prompt {
    bottom: calc(max(14px, env(safe-area-inset-bottom)) + 148px);
  }

  .controls-bar {
    bottom: max(10px, env(safe-area-inset-bottom));
    padding: 5px 9px;
  }
}

/* 矮屏(横屏手机 / 分屏):欢迎卡压缩并可纵向滚动,避免被裁掉 */
@media (max-height: 560px) {
  .welcome-card {
    top: 66px;
    max-height: calc(100vh - 92px);
    max-height: calc(100dvh - 92px);
    padding: 16px 18px 14px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .welcome-card h2 {
    margin: 8px 0 6px;
    font-size: 22px;
  }

  .welcome-copy {
    font-size: 10.5px;
    line-height: 1.6;
  }

  .welcome-stats {
    margin: 10px 0;
    padding: 8px 0;
  }

  .primary-button {
    height: 42px;
  }
}

/* 移动端避免下拉刷新 / 橡皮筋滚动干扰操作 */
html,
body {
  overscroll-behavior: none;
}

.touch-ui,
.touch-stick,
.touch-button {
  -webkit-touch-callout: none;
}
