/* style.css — 深海吞噬 · 黄铜潜水舷窗机台
 *
 * 排版红线（AGENTS.md §4 / 策划案 §4）：
 *   ① 拒绝“四角散落浮动按钮”：系统控制项全部收进舷窗顶部的窄黄铜状态条。
 *   ② 拒绝“右侧 SaaS 卡片堆”：所有 HUD 焊进舷窗框本身（左深度计 / 右贝壳心数 / 底罗盘 + 成长管）。
 *   ③ 拒绝“死白死黑大平铺”：整屏是沉浸式海水环境 —— 三段式渐变 + 斜射光柱 + 上浮气泡 +
 *      景深暗角，洋面是青绿，越深越蓝，但永远不做全屏暗蓝。
 *   ④ 桌面端舷窗居中（上限 1100px），左右与底部边缘不放任何操作按钮，为未来侧栏 / 通栏留白。
 *   ⑤ 移动端底部预留 ≥68px 安全缓冲，绝不让任何按钮贴底。
 *   ⑥ 所有动效在 prefers-reduced-motion 下瞬移降级。
 */

:root {
  --brass-hi: #ffe7ae;
  --brass-1: #f3cf87;
  --brass-2: #d2a047;
  --brass-3: #a2732b;
  --brass-4: #6b4715;
  --brass-ink: #3d2708;
  --coral: #ff8a5c;
  --coral-deep: #e2614f;
  --honey: #ffd98a;
  --teal: #6fe3d0;
  --teal-mid: #2f9fae;
  --blue-mid: #1d7198;
  --blue-deep: #0c4368;
  --woam: #fff4dd;
  --ink: #2b1b06;
  --glass: rgba(255, 246, 222, 0.9);
  --shell-empty: #7d6a4c;
  --shadow-key: 0 6px 0 rgba(0, 0, 0, 0.22), 0 12px 22px rgba(0, 0, 0, 0.24);
  --font-arcade: "Bahnschrift", "DIN Alternate", "Impact", "Haettenschweiler", "Arial Narrow", sans-serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--woam);
  background:
    radial-gradient(120% 80% at 50% -10%, #9ff3e2 0%, rgba(159, 243, 226, 0) 55%),
    linear-gradient(180deg, #56cfd4 0%, #2ea3bb 22%, #1a6f9e 52%, #104a78 74%, #0b2f52 100%);
  overflow-x: hidden;
}

/* ---------- 舷窗外的海：光柱 / 气泡 / 景深 ---------- */
.sea {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.sea::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(115% 85% at 50% 45%, rgba(0, 0, 0, 0) 42%, rgba(4, 30, 56, 0.55) 100%);
}

.shaft {
  position: absolute;
  top: -26vh;
  height: 150vh;
  background: linear-gradient(180deg, rgba(255, 250, 224, 0.42), rgba(255, 250, 224, 0.06) 62%, rgba(255, 250, 224, 0));
  filter: blur(14px);
  animation: sway 15s ease-in-out infinite alternate;
}

.shaft-a {
  left: 12%;
  width: 15vw;
  transform: rotate(9deg);
  animation-duration: 17s;
}

.shaft-b {
  left: 47%;
  width: 9vw;
  transform: rotate(-6deg);
  opacity: 0.7;
  animation-duration: 21s;
  animation-delay: -5s;
}

.shaft-c {
  left: 76%;
  width: 18vw;
  transform: rotate(12deg);
  opacity: 0.55;
  animation-duration: 25s;
  animation-delay: -11s;
}

@keyframes sway {
  from {
    transform: rotate(6deg) translateX(-2vw);
  }
  to {
    transform: rotate(-5deg) translateX(2vw);
  }
}

.bubbles {
  position: absolute;
  inset: 0;
}

.bubbles i {
  position: absolute;
  left: var(--x);
  bottom: -8vh;
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fff, rgba(255, 255, 255, 0.34) 55%, rgba(255, 255, 255, 0.06) 100%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  animation: float-up var(--t) linear infinite;
  animation-delay: var(--d);
  opacity: 0.75;
}

@keyframes float-up {
  0% {
    transform: translate3d(0, 0, 0) scale(0.7);
    opacity: 0;
  }
  12% {
    opacity: 0.8;
  }
  50% {
    transform: translate3d(2.4vw, -52vh, 0) scale(1);
  }
  92% {
    opacity: 0.6;
  }
  100% {
    transform: translate3d(-1.6vw, -108vh, 0) scale(1.1);
    opacity: 0;
  }
}

/* ---------- 机台与舷窗框体 ---------- */
.cabinet {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  /* 桌面端：左右与底部都留出安全留白，绝不贴边放按钮 */
  padding: 26px 44px 116px;
}

.porthole {
  position: relative;
  width: min(1100px, 100%);
  padding: 10px;
  border-radius: 30px;
  background:
    linear-gradient(180deg, var(--brass-hi) 0%, var(--brass-1) 18%, var(--brass-2) 52%, var(--brass-3) 82%, var(--brass-4) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.55) inset,
    0 -2px 0 rgba(61, 39, 8, 0.45) inset,
    0 22px 48px rgba(3, 26, 48, 0.5),
    0 60px 110px rgba(2, 18, 34, 0.42);
}

/* 铜框四角的铆钉 */
.porthole::before,
.porthole::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  height: 9px;
  background-image: radial-gradient(circle, var(--brass-hi) 0 38%, var(--brass-4) 42% 100%);
  background-size: 100% 100%;
  pointer-events: none;
}

.porthole::before {
  top: 3px;
  background-image: radial-gradient(circle at 4px 50%, var(--brass-hi) 0 2px, var(--brass-3) 2.5px, rgba(0, 0, 0, 0) 3px);
  background-size: 34px 9px;
  background-repeat: repeat-x;
}

.porthole::after {
  bottom: 3px;
  background-image: radial-gradient(circle at 4px 50%, var(--brass-hi) 0 2px, var(--brass-3) 2.5px, rgba(0, 0, 0, 0) 3px);
  background-size: 34px 9px;
  background-repeat: repeat-x;
}

/* ---------- 顶部窄黄铜状态条 ---------- */
.brass-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 10px;
}

.brass-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--brass-ink);
  text-decoration: none;
  background: linear-gradient(180deg, var(--brass-hi), var(--brass-2));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 -2px 0 rgba(61, 39, 8, 0.3) inset,
    0 2px 0 var(--brass-4);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.brass-link:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.brass-link:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 -1px 0 rgba(61, 39, 8, 0.3) inset, 0 0 0 var(--brass-4);
}

/* 刻着海域名与关号的铜牌 */
.brass-plate {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  padding: 5px 16px;
  border-radius: 9px;
  overflow: hidden;
  white-space: nowrap;
  background: linear-gradient(180deg, rgba(61, 39, 8, 0.72), rgba(61, 39, 8, 0.52));
  box-shadow:
    0 2px 5px rgba(0, 0, 0, 0.35) inset,
    0 1px 0 rgba(255, 231, 174, 0.32);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
}

.plate-zone {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--brass-1);
  text-transform: uppercase;
}

.plate-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 6px var(--coral);
}

.plate-level {
  font-family: var(--font-arcade);
  font-size: 19px;
  letter-spacing: 0.06em;
  color: var(--brass-hi);
}

.plate-name {
  font-size: 13px;
  color: rgba(255, 244, 221, 0.82);
  overflow: hidden;
  text-overflow: ellipsis;
}

.brass-tools {
  flex: 0 0 auto;
  display: flex;
  gap: 7px;
}

.knob {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  font-family: var(--font-arcade);
  font-size: 14px;
  font-weight: 700;
  color: var(--brass-ink);
  cursor: pointer;
  background: linear-gradient(180deg, var(--brass-hi) 0%, var(--brass-1) 42%, var(--brass-2) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 -2px 0 rgba(61, 39, 8, 0.28) inset,
    0 2px 0 var(--brass-4),
    0 4px 9px rgba(0, 0, 0, 0.28);
  transition: transform 0.1s ease, filter 0.1s ease;
}

.knob-wide {
  width: 44px;
  border-radius: 17px;
  font-size: 12px;
}

.knob:hover {
  transform: translateY(-2px);
  filter: brightness(1.07);
}

.knob:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 0 0 var(--brass-4), 0 1px 2px rgba(0, 0, 0, 0.3);
}

.knob[aria-pressed="false"] {
  color: rgba(61, 39, 8, 0.6);
  background: linear-gradient(180deg, var(--brass-2), var(--brass-3));
}

/* ---------- 舷窗内的海域 ---------- */
.viewport {
  position: relative;
  aspect-ratio: 3 / 2;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(180deg, #7fe6dc 0%, #35a9c2 26%, #1c6f9c 58%, #0d3f66 100%);
  box-shadow:
    0 0 0 3px rgba(61, 39, 8, 0.5),
    0 0 0 6px var(--brass-2),
    0 18px 40px rgba(2, 20, 38, 0.55) inset,
    0 0 60px rgba(8, 40, 70, 0.5);
  touch-action: none;
}

.sea-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

/* 舷窗玻璃的反光 */
.viewport::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(118deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.05) 22%, rgba(255, 255, 255, 0) 45%),
    radial-gradient(130% 100% at 50% 50%, rgba(0, 0, 0, 0) 58%, rgba(3, 24, 44, 0.45) 100%);
}

/* ---------- 焊在框上的仪表 ---------- */
.gauge {
  position: absolute;
  z-index: 3;
  pointer-events: none;
}

.gauge-dial {
  top: 12px;
  left: 14px;
  width: 86px;
}

.dial-face {
  display: block;
  width: 86px;
  height: 86px;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4));
}

.dial-rim {
  fill: rgba(61, 39, 8, 0.42);
  stroke: var(--brass-1);
  stroke-width: 3;
}

.dial-inner {
  fill: rgba(8, 40, 66, 0.5);
  stroke: rgba(255, 231, 174, 0.45);
  stroke-width: 1;
}

.dial-track {
  fill: rgba(255, 217, 138, 0.18);
}

.dial-ticks line {
  stroke: rgba(255, 231, 174, 0.7);
  stroke-width: 2;
  stroke-linecap: round;
}

.dial-needle {
  stroke: var(--coral);
  stroke-width: 2.6;
  stroke-linecap: round;
  transform-box: view-box;
  transform-origin: 50px 50px;
  transition: transform 0.35s cubic-bezier(0.22, 1.2, 0.36, 1);
  filter: drop-shadow(0 0 4px rgba(255, 138, 92, 0.9));
}

.dial-pin {
  fill: var(--brass-hi);
  stroke: var(--brass-4);
  stroke-width: 1.4;
}

.dial-read {
  margin: -4px 0 0;
  text-align: center;
  font-family: var(--font-arcade);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.dial-read b {
  display: block;
  font-size: 15px;
  letter-spacing: 0.05em;
  color: var(--brass-hi);
}

.dial-read span {
  display: block;
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: rgba(255, 244, 221, 0.78);
}

.gauge-hearts {
  top: 14px;
  right: 16px;
  display: flex;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(61, 39, 8, 0.5), rgba(61, 39, 8, 0.3));
  box-shadow: 0 1px 0 rgba(255, 231, 174, 0.28) inset;
}

.shell {
  width: 28px;
  height: 24px;
  display: block;
  background:
    repeating-conic-gradient(from 198deg at 50% 98%, rgba(80, 40, 6, 0.18) 0 3.2deg, rgba(255, 255, 255, 0) 3.2deg 11deg),
    radial-gradient(circle at 50% 96%, #fff8e6 0%, #ffc86e 46%, #e08539 100%);
  clip-path: polygon(50% 100%, 5% 62%, 2% 42%, 11% 21%, 27% 7%, 50% 2%, 73% 7%, 89% 21%, 98% 42%, 95% 62%);
  transition: filter 0.2s ease, opacity 0.2s ease;
}

.shell:not(.is-full) {
  filter: grayscale(0.85) brightness(0.55);
  opacity: 0.5;
}

.shell.is-full {
  filter: drop-shadow(0 0 6px rgba(255, 200, 110, 0.85));
}

/* 第 4 海域：框右侧的压强玻璃管 */
.gauge-pressure {
  right: 14px;
  top: 62px;
  width: 46px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 7px 5px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(61, 39, 8, 0.5), rgba(61, 39, 8, 0.32));
  box-shadow: 0 1px 0 rgba(255, 231, 174, 0.28) inset;
}

.pressure-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--brass-1);
}

.pressure-tube {
  position: relative;
  width: 16px;
  height: 96px;
  border-radius: 9px;
  overflow: hidden;
  background: rgba(4, 26, 46, 0.7);
  box-shadow: 0 0 0 2px rgba(255, 231, 174, 0.42) inset;
}

.pressure-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0%;
  background: linear-gradient(180deg, #ff9a5c, #ffd98a);
  transition: height 0.14s linear;
}

.gauge-pressure.is-full .pressure-fill {
  background: linear-gradient(180deg, #ff5c5c, #ffb056);
  animation: pulse-warn 0.7s ease-in-out infinite alternate;
}

@keyframes pulse-warn {
  from {
    filter: brightness(1);
  }
  to {
    filter: brightness(1.5);
  }
}

/* 框底正中：狂暴罗盘 + 发光成长玻璃管 */
.gauge-desk {
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  width: min(600px, calc(100% - 190px));
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 14px 8px 10px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(61, 39, 8, 0.58), rgba(61, 39, 8, 0.38));
  box-shadow:
    0 1px 0 rgba(255, 231, 174, 0.32) inset,
    0 8px 20px rgba(0, 0, 0, 0.3);
}

.compass {
  position: relative;
  flex: 0 0 auto;
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
}

.compass-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform-origin: 50% 50%;
  transition: transform 0.5s cubic-bezier(0.2, 1.3, 0.4, 1);
}

.compass-rim {
  fill: rgba(8, 34, 56, 0.6);
  stroke: var(--brass-1);
  stroke-width: 3;
}

.compass-inner {
  fill: rgba(255, 217, 138, 0.1);
  stroke: rgba(255, 231, 174, 0.4);
  stroke-width: 1;
}

.compass-star {
  fill: rgba(255, 217, 138, 0.28);
  stroke: rgba(255, 231, 174, 0.5);
  stroke-width: 1;
}

.compass-mult {
  position: relative;
  font-family: var(--font-arcade);
  font-size: 19px;
  color: var(--brass-hi);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.compass-combo {
  position: absolute;
  bottom: -3px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  white-space: nowrap;
  color: rgba(255, 244, 221, 0.8);
}

.compass[data-level="1"] .compass-star {
  fill: rgba(255, 154, 92, 0.5);
}

.compass[data-level="2"] .compass-star {
  fill: rgba(255, 92, 92, 0.62);
}

.compass[data-level="2"] .compass-mult {
  color: #ffe27a;
  animation: bump 0.34s ease-out;
}

.compass.is-hit {
  animation: bump 0.24s ease-out;
}

@keyframes bump {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.22);
  }
  100% {
    transform: scale(1);
  }
}

.compass.is-hit {
  animation-name: bump;
}

.glass-tube {
  flex: 1 1 auto;
  min-width: 0;
}

.tube-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
}

.tube-tier {
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--brass-hi);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tube-quota {
  font-family: var(--font-arcade);
  font-size: 12px;
  color: var(--teal);
  white-space: nowrap;
}

.tube-rail {
  position: relative;
  height: 13px;
  border-radius: 7px;
  overflow: hidden;
  background: rgba(4, 26, 46, 0.72);
  box-shadow: 0 0 0 2px rgba(255, 231, 174, 0.38) inset, 0 2px 5px rgba(0, 0, 0, 0.4) inset;
}

.tube-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  border-radius: 6px;
  background: linear-gradient(90deg, #5ce0b0, #9ef27a 55%, #ffe27a);
  box-shadow: 0 0 10px rgba(158, 242, 122, 0.8);
  transition: width 0.16s linear;
}

.tube-shine {
  position: absolute;
  left: 0;
  right: 0;
  top: 1px;
  height: 4px;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.06));
}

.tube-marks {
  display: flex;
  justify-content: space-between;
  margin-top: 3px;
  padding: 0 2px;
  font-size: 9px;
  color: rgba(255, 244, 221, 0.45);
}

/* 吞噬狂热横幅 */
.frenzy-banner {
  position: absolute;
  top: 14%;
  left: 50%;
  z-index: 4;
  margin: 0;
  transform: translateX(-50%) scale(0.86);
  padding: 6px 22px;
  border-radius: 10px;
  font-family: var(--font-arcade);
  font-size: clamp(20px, 3.4vw, 38px);
  letter-spacing: 0.14em;
  color: #fff8e6;
  text-shadow: 0 2px 0 #b23a1e, 0 0 22px rgba(255, 138, 92, 0.9);
  background: linear-gradient(180deg, rgba(255, 138, 92, 0.42), rgba(226, 97, 79, 0.18));
  box-shadow: 0 0 0 2px rgba(255, 231, 174, 0.5) inset;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.frenzy-banner.is-on {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* 提示气泡 */
.toasts {
  position: absolute;
  left: 12px;
  bottom: 84px;
  z-index: 4;
  display: flex;
  flex-direction: column-reverse;
  gap: 5px;
  pointer-events: none;
  max-width: 56%;
}

.toast {
  align-self: flex-start;
  padding: 5px 11px;
  border-radius: 9px;
  font-size: 12px;
  color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 248, 230, 0.95), rgba(255, 231, 174, 0.88));
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.28);
  animation: toast-in 0.22s ease-out;
}

.toast.is-out {
  animation: toast-out 0.3s ease-in forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(-14px);
  }
}

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

.hint {
  position: absolute;
  left: 50%;
  bottom: 4px;
  z-index: 4;
  margin: 0;
  transform: translateX(-50%);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: rgba(255, 244, 221, 0.62);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  white-space: nowrap;
}

/* ---------- 覆盖面板 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(120% 90% at 50% 40%, rgba(6, 40, 68, 0.52), rgba(3, 18, 34, 0.86));
  backdrop-filter: blur(3px);
}

.overlay[hidden] {
  display: none;
}

.panel {
  width: min(560px, 100%);
  max-height: min(86vh, 760px);
  overflow-y: auto;
  padding: 24px 26px;
  border-radius: 24px;
  text-align: center;
  background: linear-gradient(180deg, #fff6e2 0%, #ffe6bc 62%, #f4d29a 100%);
  box-shadow:
    0 0 0 4px var(--brass-2),
    0 0 0 8px var(--brass-4),
    0 26px 60px rgba(2, 16, 30, 0.6);
  color: var(--ink);
}

.panel[hidden] {
  display: none;
}

.panel-kicker {
  margin: 0 0 4px;
  font-family: var(--font-arcade);
  font-size: 12px;
  letter-spacing: 0.34em;
  color: var(--coral-deep);
}

.panel-title {
  margin: 0 0 10px;
  font-family: var(--font-arcade);
  font-size: clamp(26px, 4.2vw, 38px);
  letter-spacing: 0.06em;
  color: #8c3f16;
  text-shadow: 0 1px 0 #fff8e6;
}

.panel-lede {
  margin: 0 auto 16px;
  max-width: 42ch;
  font-size: 14px;
  line-height: 1.68;
  color: #5a3d1b;
}

.panel-meta {
  margin: 0 0 14px;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: #8c6a3a;
}

.panel-hint {
  margin: 14px 0 0;
  font-size: 11.5px;
  color: #9a7a4c;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
}

.key {
  padding: 11px 20px;
  border: 0;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  color: var(--brass-ink);
  cursor: pointer;
  background: linear-gradient(180deg, var(--brass-hi), var(--brass-2));
  box-shadow: 0 3px 0 var(--brass-4), 0 8px 16px rgba(0, 0, 0, 0.2);
  transition: transform 0.1s ease, filter 0.1s ease;
}

.key:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.key:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--brass-4), 0 2px 6px rgba(0, 0, 0, 0.2);
}

.key-primary {
  color: #fff8e6;
  background: linear-gradient(180deg, #ff9a5c, #e2614f);
  box-shadow: 0 3px 0 #9c3a26, 0 8px 18px rgba(226, 97, 79, 0.4);
}

.key-quiet {
  font-weight: 600;
  color: #8c6a3a;
  background: linear-gradient(180deg, #f3e6cd, #e3cfa8);
  box-shadow: 0 3px 0 #b79a6a;
}

/* 清空存档的“二次点击确认”态：按钮自己变红，3 秒内不点就恢复 */
.key.is-armed {
  color: #fff4f0;
  background: linear-gradient(180deg, #e2614f, #b93a2c);
  box-shadow: 0 3px 0 #7c2418, 0 0 0 3px rgba(226, 97, 79, 0.28);
  animation: armed-pulse 0.9s ease-in-out infinite;
}

@keyframes armed-pulse {
  0%,
  100% {
    box-shadow: 0 3px 0 #7c2418, 0 0 0 3px rgba(226, 97, 79, 0.28);
  }
  50% {
    box-shadow: 0 3px 0 #7c2418, 0 0 0 8px rgba(226, 97, 79, 0.12);
  }
}

.key:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  filter: grayscale(0.4);
}

/* 关卡表 */
.zones {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 0 18px;
  text-align: left;
}

.zone-card {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 0 0 2px rgba(162, 115, 43, 0.32);
}

.zone-card.is-locked {
  opacity: 0.62;
}

.zone-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.zone-name {
  font-size: 15px;
  font-weight: 700;
  color: #7a3c12;
}

.zone-pearls {
  font-family: var(--font-arcade);
  font-size: 12px;
  color: #a2732b;
}

.zone-blurb {
  margin: 0 0 9px;
  font-size: 11.5px;
  line-height: 1.6;
  color: #7d6339;
}

.zone-lock {
  margin: 0;
  font-size: 11.5px;
  color: #a1834f;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 7px;
}

.level-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 8px 9px;
  border: 0;
  border-radius: 11px;
  text-align: left;
  cursor: pointer;
  color: #4a3210;
  background: linear-gradient(180deg, #fffaf0, #f2e0bd);
  box-shadow: 0 2px 0 rgba(162, 115, 43, 0.5);
  transition: transform 0.1s ease, filter 0.1s ease;
}

.level-cell:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
}

.level-cell:active {
  transform: translateY(1px);
}

.level-cell.is-current {
  box-shadow: 0 0 0 2px var(--coral-deep), 0 2px 0 rgba(162, 115, 43, 0.5);
}

.level-cell .cell-id {
  font-family: var(--font-arcade);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: #a2732b;
}

.level-cell .cell-name {
  font-size: 11.5px;
  line-height: 1.35;
}

.level-cell .cell-pearls {
  display: flex;
  gap: 3px;
}

.level-cell .pip {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(122, 96, 58, 0.25);
}

.level-cell .pip.is-on {
  background: radial-gradient(circle at 35% 30%, #fff, #ffc86e 45%, #e08539);
  box-shadow: 0 0 5px rgba(224, 133, 57, 0.7);
}

/* 结算珍珠托盘 */
.pearl-tray {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 0 0 16px;
}

.pearl-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 118px;
}

.pearl-orbit {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(122, 96, 58, 0.14);
  box-shadow: 0 0 0 2px rgba(162, 115, 43, 0.34) inset;
}

.pearl-slot.is-on .pearl-orbit {
  background: radial-gradient(circle at 34% 28%, #fff, #ffe9bd 26%, #ffc86e 58%, #dd8b3c 100%);
  box-shadow: 0 0 0 2px var(--brass-2), 0 0 18px rgba(255, 200, 110, 0.8);
}

.pearl-core {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(122, 96, 58, 0.3);
}

.pearl-slot.is-on .pearl-core {
  background: rgba(255, 255, 255, 0.7);
}

.pearl-caption {
  font-size: 10.5px;
  line-height: 1.4;
  color: #7d6339;
}

.tally {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
  margin: 0 0 18px;
}

.tally-cell {
  padding: 8px 6px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 0 2px rgba(162, 115, 43, 0.24);
}

.tally-cell dt {
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: #8c6a3a;
}

.tally-cell dd {
  margin: 3px 0 0;
  font-family: var(--font-arcade);
  font-size: 17px;
  color: #7a3c12;
}

/* 玩法说明 */
.help-list {
  margin: 0 0 18px;
  padding: 0 0 0 18px;
  text-align: left;
  font-size: 13px;
  line-height: 1.72;
  color: #5a3d1b;
}

.help-list li {
  margin-bottom: 8px;
}

.help-list li::marker {
  color: var(--coral-deep);
  font-family: var(--font-arcade);
}

.abyss-best {
  margin: 0 0 16px;
  font-family: var(--font-arcade);
  font-size: 14px;
  letter-spacing: 0.06em;
  color: #8c6a3a;
}

.noscript {
  position: relative;
  z-index: 30;
  margin: 0;
  padding: 22px;
  text-align: center;
  font-size: 15px;
  background: #fff6e2;
  color: var(--ink);
}

/* ---------- 平板 / 窄桌面 ---------- */
@media (max-width: 900px) {
  .cabinet {
    padding: 18px 20px 100px;
  }

  .brass-plate {
    padding: 5px 10px;
  }

  .plate-name {
    display: none;
  }
}

/* ---------- 移动端：舷窗竖向撑满，仪表压缩，底部留出广告安全区 ---------- */
@media (max-width: 768px) {
  .cabinet {
    /* 底部安全缓冲：绝不让任何操作按钮或 HUD 贴底 */
    padding: 12px 10px max(68px, calc(16px + env(safe-area-inset-bottom)));
  }

  .porthole {
    padding: 7px;
    border-radius: 22px;
  }

  .brass-bar {
    flex-wrap: wrap;
    gap: 7px;
    padding: 2px 4px 8px;
  }

  .brass-link {
    padding: 6px 10px;
    font-size: 12px;
  }

  .brass-plate {
    order: 3;
    flex-basis: 100%;
    justify-content: center;
    padding: 4px 10px;
  }

  .brass-tools {
    margin-left: auto;
  }

  .knob {
    width: 31px;
    height: 31px;
    font-size: 13px;
  }

  .knob-wide {
    width: 40px;
  }

  .viewport {
    aspect-ratio: 3 / 4;
    border-radius: 15px;
  }

  .gauge-dial {
    top: 8px;
    left: 9px;
    width: 62px;
  }

  .dial-face {
    width: 62px;
    height: 62px;
  }

  .dial-read {
    margin-top: -2px;
  }

  .dial-read b {
    font-size: 12px;
  }

  .dial-read span {
    font-size: 9px;
    letter-spacing: 0.1em;
  }

  .gauge-hearts {
    top: 9px;
    right: 10px;
    padding: 5px 7px;
    gap: 4px;
  }

  .shell {
    width: 23px;
    height: 20px;
  }

  .gauge-pressure {
    right: 9px;
    top: 50px;
    width: 40px;
    padding: 6px 4px;
  }

  .pressure-tube {
    height: 72px;
  }

  .gauge-desk {
    width: calc(100% - 16px);
    bottom: 8px;
    padding: 7px 10px 7px 8px;
    gap: 10px;
  }

  .compass {
    width: 50px;
    height: 50px;
  }

  .compass-mult {
    font-size: 15px;
  }

  .tube-tier {
    font-size: 11px;
  }

  .toasts {
    bottom: 74px;
    max-width: 74%;
  }

  .hint {
    display: none;
  }

  .panel {
    padding: 20px 18px;
    border-radius: 20px;
  }

  .level-grid {
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  }

  .pearl-slot {
    width: 92px;
  }
}

/* ---------- 小屏手机（390px 视口兜底）---------- */
@media (max-width: 390px) {
  .shell {
    width: 20px;
    height: 18px;
  }

  .knob {
    width: 29px;
    height: 29px;
    font-size: 12px;
  }

  .knob-wide {
    width: 37px;
  }

  .panel {
    padding: 16px 14px;
  }

  .pearl-slot {
    width: 78px;
  }
}

/* ---------- 动效降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  .shaft,
  .bubbles i,
  .key.is-armed,
  .gauge-pressure.is-full .pressure-fill {
    animation: none !important;
  }

  .bubbles i {
    opacity: 0.4;
  }

  .dial-needle,
  .compass-face,
  .tube-fill,
  .pressure-fill,
  .frenzy-banner,
  .toast {
    transition: none !important;
    animation: none !important;
  }

  .compass.is-hit,
  .compass[data-level="2"] .compass-mult {
    animation: none !important;
  }

  .brass-link:hover,
  .knob:hover,
  .key:hover {
    transform: none;
  }
}
