:root {
  --deep: #04243e;
  --deep2: #063a5e;
  --ink: #e8f6ff;
  --muted: #9fc3d8;
  --gold: #ffd166;
  --teal: #2ec4b6;
  --coral: #ff6b6b;
  --glass: rgba(6, 32, 52, 0.72);
  --glass2: rgba(10, 46, 74, 0.62);
  --line: rgba(150, 210, 240, 0.18);
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  background: #02121f;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

button { font-family: inherit; }

#app { position: relative; width: 100vw; height: 100vh; }

.screen {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.screen.hidden { display: none; }
.screen canvas {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  max-width: 100%; max-height: 100%;
}

/* ---------- 标题 ---------- */
#screen-title {
  background: radial-gradient(120% 90% at 50% 10%, #0b5a86 0%, #04243e 55%, #01101d 100%);
}
.title-ui {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 28px;
  text-align: center;
  animation: rise 1s ease both;
}
.logo-badge { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.logo {
  font-size: clamp(42px, 8vw, 84px);
  font-weight: 900;
  letter-spacing: 8px;
  background: linear-gradient(180deg, #d9fbff 0%, #7fe3ff 45%, #1aa7d8 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  text-shadow: 0 8px 30px rgba(30, 180, 230, 0.35);
}
.logo-sub {
  font-size: 15px; letter-spacing: 7px; color: var(--muted); font-weight: 600;
}
.logo-tag {
  margin-top: 8px; font-size: 14px; color: var(--gold);
  letter-spacing: 4px; background: rgba(255, 209, 102, 0.08);
  border: 1px solid rgba(255, 209, 102, 0.25);
  padding: 6px 18px; border-radius: 999px;
}
.title-buttons { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.title-hint {
  color: var(--muted); font-size: 13px; line-height: 1.9;
  background: var(--glass); border: 1px solid var(--line);
  padding: 14px 26px; border-radius: var(--radius);
  backdrop-filter: blur(8px);
}

/* ---------- 通用按钮 ---------- */
.btn {
  border: none; cursor: pointer;
  padding: 10px 22px; border-radius: 12px;
  font-size: 15px; font-weight: 700; color: #06202e;
  background: linear-gradient(180deg, #8fe7ff, #39b6e8);
  box-shadow: 0 4px 0 rgba(8, 60, 90, 0.9), 0 10px 22px rgba(0, 30, 55, 0.45);
  transition: transform 0.08s ease, filter 0.15s ease, opacity 0.15s ease;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(8, 60, 90, 0.9); }
.btn:disabled { opacity: 0.42; cursor: not-allowed; transform: none; }
.btn-lg { font-size: 18px; padding: 14px 36px; border-radius: 14px; }
.btn-sm { font-size: 12.5px; padding: 7px 14px; border-radius: 9px; }
.btn-ghost {
  background: rgba(140, 215, 245, 0.12); color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none; backdrop-filter: blur(6px);
}
.btn-gold { background: linear-gradient(180deg, #ffe29a, #ffc53d); }
.btn-danger { background: linear-gradient(180deg, #ff9d8a, #ef5a4e); }

/* ---------- 港口 ---------- */
#screen-harbor {
  background: linear-gradient(180deg, #ffd9a0 0%, #ffb877 18%, #ff9e63 32%, #1a6f9c 46%, #063c61 60%, #021c33 100%);
}
#screen-dive { background: linear-gradient(180deg, #0b4c78 0%, #063a5e 45%, #021c33 100%); }
.harbor-ui {
  position: relative; z-index: 2;
  display: flex; flex-direction: column;
  width: min(1180px, 96vw); height: 96vh; margin: 2vh auto;
  gap: 12px;
}
.harbor-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--glass); border: 1px solid var(--line);
  padding: 12px 18px; border-radius: var(--radius);
  backdrop-filter: blur(10px);
}
.harbor-title { font-size: 20px; font-weight: 800; letter-spacing: 3px; }
.stat-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font-size: 13px; color: var(--muted);
  background: rgba(0, 0, 0, 0.22); border: 1px solid var(--line);
  padding: 5px 12px; border-radius: 999px;
}
.chip b { color: var(--ink); }
.chip-money b { color: var(--gold); }

.harbor-body {
  flex: 1; display: grid; grid-template-columns: 1fr 1.15fr;
  gap: 12px; min-height: 0;
}
.panel {
  background: var(--glass); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
  backdrop-filter: blur(10px);
  display: flex; flex-direction: column; min-height: 0;
}
.panel h2 {
  font-size: 16px; letter-spacing: 2px; margin-bottom: 10px;
  display: flex; align-items: baseline; gap: 10px;
}
.shop-sub { font-size: 11px; color: var(--muted); font-weight: 400; letter-spacing: 0; }

.catch-list {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px;
  padding-right: 4px;
}
.catch-item {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line);
  border-radius: 12px; padding: 7px 10px;
}
.catch-item img, .catch-item canvas { width: 42px; height: 42px; object-fit: contain; }
.catch-item .ci-name { font-size: 14px; font-weight: 700; }
.catch-item .ci-sub { font-size: 11.5px; color: var(--muted); }
.catch-item .ci-val { margin-left: auto; font-size: 14px; font-weight: 800; color: var(--gold); }
.catch-item .ci-btn { margin-left: 8px; }
.catch-empty { color: var(--muted); font-size: 13px; text-align: center; padding: 30px 0; }

.catch-foot {
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px;
  font-size: 13.5px; color: var(--muted);
}
.catch-foot b { color: var(--ink); font-size: 15px; }

.shop-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 4px; }
.shop-item {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line);
  border-radius: 12px; padding: 8px 12px;
}
.shop-item .si-icon { width: 52px; height: 52px; flex: none; }
.shop-item .si-info { flex: 1; min-width: 0; }
.shop-item .si-name { font-size: 14.5px; font-weight: 800; }
.shop-item .si-desc { font-size: 11.5px; color: var(--muted); line-height: 1.45; margin-top: 2px; }
.pips { display: flex; gap: 3px; margin-top: 4px; }
.pip { width: 18px; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.14); }
.pip.on { background: linear-gradient(90deg, #6fe3ff, #2ec4b6); }
.shop-item .si-price { text-align: right; font-size: 13px; }
.shop-item .si-price b { color: var(--gold); font-size: 16px; }
.shop-item .si-buy { min-width: 74px; }
.shop-item.maxed { opacity: 0.75; }
.shop-item .si-max { color: var(--teal); font-weight: 800; font-size: 13px; }

.harbor-foot {
  display: flex; align-items: center; gap: 12px;
  background: var(--glass); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 18px;
  backdrop-filter: blur(10px);
}
.harbor-msg { flex: 1; font-size: 13.5px; color: var(--muted); }

.mp-bar {
  display: flex; align-items: center; gap: 10px;
  background: rgba(4, 34, 58, 0.6); border: 1px solid rgba(150, 210, 240, 0.22);
  border-radius: var(--radius); padding: 10px 16px;
  backdrop-filter: blur(8px);
}
.mp-input {
  width: 110px; padding: 7px 12px; border-radius: 9px;
  border: 1px solid var(--line); background: rgba(0, 0, 0, 0.25);
  color: var(--ink); font-size: 15px; font-weight: 800; letter-spacing: 3px;
  text-transform: uppercase; outline: none; text-align: center;
}
.mp-input:focus { border-color: rgba(110, 220, 255, 0.6); }
.mp-status { flex: 1; font-size: 12.5px; color: var(--muted); }

/* ---------- 潜水 HUD ---------- */
.dive-hud {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 14px 18px;
}
.dive-top { display: flex; align-items: center; justify-content: space-between; }
.dive-info { display: flex; align-items: center; gap: 10px; }
.bag-chip {
  font-size: 13px; color: var(--ink);
  background: var(--glass); border: 1px solid var(--line);
  padding: 8px 14px; border-radius: 999px;
  backdrop-filter: blur(8px);
}
.dive-hud button { pointer-events: auto; }
.dive-bottom { display: flex; justify-content: center; }
.dive-hint {
  font-size: 12.5px; color: rgba(232, 246, 255, 0.85);
  background: rgba(3, 22, 38, 0.55); border: 1px solid var(--line);
  padding: 8px 18px; border-radius: 999px; backdrop-filter: blur(6px);
}

/* 教程 */
.tutorial {
  position: absolute; inset: 0; z-index: 6;
  display: flex; align-items: center; justify-content: center;
  background: rgba(2, 16, 30, 0.55); backdrop-filter: blur(4px);
}
.tutorial.hidden { display: none; }
.tutorial-card {
  width: min(620px, 92vw);
  background: linear-gradient(180deg, rgba(12, 48, 76, 0.96), rgba(5, 28, 48, 0.96));
  border: 1px solid var(--line); border-radius: 20px;
  padding: 28px 32px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  animation: pop 0.35s ease both;
}
.tutorial-card h2 { font-size: 22px; letter-spacing: 3px; margin-bottom: 16px; color: var(--gold); }
.tutorial-card ul { list-style: none; display: flex; flex-direction: column; gap: 12px; font-size: 14.5px; line-height: 1.65; }
.tutorial-card li { padding-left: 22px; position: relative; color: #d7eefc; }
.tutorial-card li::before {
  content: "▸"; position: absolute; left: 0; color: var(--teal); font-weight: 800;
}
.tutorial-card .btn { margin-top: 20px; width: 100%; }

/* 结算弹窗 */
.modal {
  position: absolute; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  background: rgba(2, 14, 26, 0.6); backdrop-filter: blur(5px);
}
.modal.hidden { display: none; }
.modal-card {
  width: min(460px, 92vw);
  background: linear-gradient(180deg, rgba(12, 48, 76, 0.98), rgba(5, 28, 48, 0.98));
  border: 1px solid var(--line); border-radius: 20px;
  padding: 26px 30px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  animation: pop 0.3s ease both;
}
.modal-card h2 { font-size: 20px; letter-spacing: 2px; margin-bottom: 14px; }
.modal-body { font-size: 14px; line-height: 1.75; color: #d7eefc; }
.modal-body .row { display: flex; justify-content: space-between; padding: 3px 0; }
.modal-body .row.total { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 10px; font-weight: 800; color: var(--gold); font-size: 16px; }
.modal-card .btn { margin-top: 18px; width: 100%; }

/* 滚动条 */
.catch-list::-webkit-scrollbar, .shop-list::-webkit-scrollbar { width: 6px; }
.catch-list::-webkit-scrollbar-thumb, .shop-list::-webkit-scrollbar-thumb {
  background: rgba(150, 210, 240, 0.25); border-radius: 3px;
}

@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }

@media (max-width: 900px) {
  .harbor-body { grid-template-columns: 1fr; }
  .harbor-ui { height: 97vh; }
  .stat-chips { display: none; }
}
