/* ============ 《超越深空》网页原型 - 像素风格样式 ============ */
:root {
  --bg-deep: #05060f;
  --bg-space: #0b0e1a;
  --panel: #131a2e;
  --panel-2: #1a2340;
  --border: #2a3352;
  --border-hi: #4a5a8a;
  --ink: #e8eaf2;
  --ink-dim: #8a93b5;
  --accent: #ffb74d;
  --accent-dark: #a05a12;
  --good: #6ee7a0;
  --bad: #ff6b6b;
  --t-white: #d7dde8;
  --t-blue: #4fc3f7;
  --t-purple: #b388ff;
  --t-orange: #ffb74d;
  --t-red: #ff5252;
  --gold: #ffd700;
  --pixel-font: 'Press Start 2P', 'Courier New', monospace;
  --ui-font: 'Courier New', 'Microsoft YaHei', 'PingFang SC', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; }
body {
  background: var(--bg-deep);
  font-family: var(--ui-font);
  color: var(--ink);
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
}

/* ---- 星空背景（纯CSS像素星层） ---- */
body::before, body::after {
  content: '';
  position: fixed;
  inset: -200px;
  pointer-events: none;
  z-index: 0;
  image-rendering: pixelated;
}
body::before {
  background-image:
    radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,.7) 50%, transparent 51%),
    radial-gradient(2px 2px at 70% 60%, rgba(255,255,255,.5) 50%, transparent 51%),
    radial-gradient(2px 2px at 40% 80%, rgba(180,200,255,.6) 50%, transparent 51%),
    radial-gradient(2px 2px at 85% 15%, rgba(255,220,180,.6) 50%, transparent 51%),
    radial-gradient(2px 2px at 55% 45%, rgba(255,255,255,.4) 50%, transparent 51%);
  background-size: 340px 340px, 430px 430px, 380px 380px, 460px 460px, 520px 520px;
  animation: starDrift 120s linear infinite;
}
body::after {
  background-image:
    radial-gradient(3px 3px at 10% 70%, rgba(255,255,255,.9) 50%, transparent 51%),
    radial-gradient(3px 3px at 60% 20%, rgba(170,190,255,.8) 50%, transparent 51%),
    radial-gradient(3px 3px at 90% 85%, rgba(255,200,150,.8) 50%, transparent 51%);
  background-size: 640px 640px;
  animation: starDrift 220s linear infinite reverse;
}
@keyframes starDrift {
  from { transform: translate3d(0,0,0); }
  to { transform: translate3d(-340px, 120px, 0); }
}

#game {
  position: fixed; inset: 0;
  z-index: 1;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
#game.hidden { display: none; }

#fx-layer { position: fixed; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
#hud { position: fixed; inset: 0; z-index: 6; pointer-events: none; }
#hud > * { pointer-events: auto; }
#overlay {
  position: fixed; inset: 0; z-index: 7;
  overflow-y: auto;
  display: flex; align-items: flex-start; justify-content: center;
  background: rgba(5,6,15,.55);
}
/* 画布场景时遮罩必须整体隐藏，否则空遮罩会挡住所有点击 */
#overlay.hidden, #overlay:empty { display: none; }
#modal-root { position: fixed; inset: 0; z-index: 9; pointer-events: none; }
#modal-root > * { pointer-events: auto; }

/* ---------- 通用面板与按钮 ---------- */
.panel {
  background: var(--panel);
  border: 3px solid var(--border);
  box-shadow: 0 0 0 3px #05060f, 0 8px 0 rgba(0,0,0,.45), inset 0 0 0 2px #0a0e1c;
  position: relative;
}
.panel::before, .panel::after {
  content: ''; position: absolute; width: 10px; height: 10px; pointer-events: none;
}
.panel::before { top: -3px; left: -3px; border-top: 6px solid var(--accent); border-left: 6px solid var(--accent); }
.panel::after { bottom: -3px; right: -3px; border-bottom: 6px solid var(--accent); border-right: 6px solid var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--ui-font); font-size: 15px; font-weight: bold;
  color: var(--ink);
  background: var(--panel-2);
  border: 3px solid var(--border-hi);
  padding: 10px 18px;
  cursor: pointer;
  box-shadow: 0 4px 0 #05060f;
  transition: transform .04s, box-shadow .04s, background .1s;
  text-shadow: 1px 1px 0 #05060f;
}
.btn:hover { background: #243055; border-color: #5f70a5; }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 #05060f; }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn.primary { background: #7a4a12; border-color: var(--accent); color: #fff3dd; }
.btn.primary:hover { background: #965c16; }
.btn.danger { background: #5a1f1f; border-color: #b04a4a; color: #ffd9d9; }
.btn.good { background: #14422a; border-color: #3fae6e; color: #d9ffe9; }
.btn.small { padding: 5px 10px; font-size: 13px; border-width: 2px; box-shadow: 0 3px 0 #05060f; }
.btn.big { font-size: 18px; padding: 14px 28px; font-family: var(--pixel-font); }

.title-pixel {
  font-family: var(--pixel-font);
  color: var(--accent);
  text-shadow: 3px 3px 0 #7a2a0a, 6px 6px 0 rgba(0,0,0,.6);
  letter-spacing: 2px;
}

/* ---------- HUD ---------- */
.hud-shipinfo {
  position: absolute; top: 14px; left: 14px;
  padding: 10px 14px; min-width: 220px;
  font-size: 14px;
}
.hud-shipinfo .ship-name { font-weight: bold; color: var(--accent); font-size: 15px; margin-bottom: 6px; }
.bar-row { display: flex; align-items: center; gap: 6px; margin: 4px 0; font-size: 13px; }
.bar-label { width: 34px; color: var(--ink-dim); }
.bar {
  flex: 1; height: 12px; background: #0a0e1c;
  border: 2px solid var(--border); position: relative; overflow: hidden;
}
.bar > i {
  display: block; height: 100%;
  transition: width .15s;
  background: linear-gradient(180deg, #8affc1, #2fbf71);
}
.bar.hp > i { background: linear-gradient(180deg, #ffb3a7, #e0492f); }
.bar.shield > i { background: linear-gradient(180deg, #a8e6ff, #2f9fce); }
.bar-text { position: absolute; inset: 0; text-align: center; font-size: 10px; line-height: 12px; color: #fff; text-shadow: 1px 1px 0 #000; }

.hud-topright {
  position: absolute; top: 14px; right: 14px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
}
.hud-credits {
  padding: 8px 12px; font-size: 15px; color: var(--gold);
  text-shadow: 1px 1px 0 #000;
}
.hud-gear-btn {
  width: 40px; height: 40px; font-size: 20px; line-height: 1;
  background: var(--panel); border: 3px solid var(--border-hi);
  color: var(--ink); cursor: pointer;
}
.hud-gear-btn:hover { border-color: var(--accent); }

.hud-hint {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  padding: 8px 14px; font-size: 13px; color: var(--ink-dim);
  background: rgba(19,26,46,.8); border: 2px solid var(--border);
  text-align: center; pointer-events: none;
}

/* ---------- 背包（中下） ---------- */
.backpack-wrap {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.backpack-grid {
  display: grid; gap: 4px; padding: 8px;
  background: var(--panel); border: 3px solid var(--border);
  box-shadow: 0 0 0 3px #05060f;
  grid-template-columns: repeat(7, 44px);
}
.backpack-grid.cols5 { grid-template-columns: repeat(5, 44px); }
.backpack-grid.cols6 { grid-template-columns: repeat(6, 44px); }
.bp-slot {
  width: 44px; height: 44px;
  background: #0a0e1c;
  border: 2px solid var(--border);
  position: relative; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.bp-slot:hover { border-color: var(--ink-dim); }
.bp-slot.empty { border-style: dashed; opacity: .5; }
.bp-slot canvas { image-rendering: pixelated; }
.bp-slot .bp-count { position: absolute; right: 2px; bottom: 0; font-size: 10px; color: var(--ink); text-shadow: 1px 1px 0 #000; }
.bp-slot .bp-disc { position: absolute; inset: 0; background: rgba(255,60,60,.25); display: none; }
.bp-slot.discarding .bp-disc { display: block; }
.t-white { box-shadow: inset 0 0 0 2px rgba(215,221,232,.4), 0 0 6px rgba(215,221,232,.15); }
.t-green  { box-shadow: inset 0 0 0 2px rgba(110,231,160,.55), 0 0 8px rgba(110,231,160,.3); }
.t-blue   { box-shadow: inset 0 0 0 2px rgba(79,195,247,.65), 0 0 8px rgba(79,195,247,.35); }
.t-purple { box-shadow: inset 0 0 0 2px rgba(179,136,255,.75), 0 0 10px rgba(179,136,255,.45); }
.t-orange { box-shadow: inset 0 0 0 2px rgba(255,183,77,.85), 0 0 12px rgba(255,183,77,.55); }
.t-red    { box-shadow: inset 0 0 0 2px rgba(255,82,82,.95), 0 0 14px rgba(255,82,82,.7); animation: redPulse 1.2s infinite; }
@keyframes redPulse { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.35); } }
.backpack-tip { font-size: 12px; color: var(--ink-dim); }

/* ---------- 格子系统背包（V1.2） ---------- */
.bp-cap-row { display: flex; align-items: center; gap: 8px; width: 100%; }
.bp-cap-label { font-size: 12px; color: var(--ink-dim); white-space: nowrap; }
.bp-cap-bar { flex: 1; height: 8px; background: #0a0e1c; border: 2px solid var(--border); overflow: hidden; }
.bp-cap-bar > i { display: block; height: 100%; background: linear-gradient(90deg, #2f9fce, #6ee7a0); transition: width .2s; }
.bp-sort { padding: 3px 8px; font-size: 12px; }
.pocket-row { display: flex; align-items: center; gap: 8px; }
.pocket-label { font-size: 12px; color: var(--accent); white-space: nowrap; }
.pocket-slots { display: flex; gap: 4px; }
.pocket-slot {
  width: 40px; height: 40px; background: #0a0e1c;
  border: 2px dashed #2a3352; position: relative;
}
.bag-grid-wrap { position: relative; }
.bag-grid {
  display: grid; position: relative;
  background: #0a0e1c; border: 3px solid var(--border);
  box-shadow: 0 0 0 3px #05060f;
}
.bag-cell { border: 1px solid #1a2340; background: rgba(19,26,46,.5); }
.bag-item {
  position: absolute; z-index: 2; cursor: grab;
  background: #131a2e; border: 2px solid var(--border-hi);
  display: flex; align-items: center; justify-content: center;
  image-rendering: pixelated;
}
.bag-item.multi { border-style: outset; }
.bag-item.discarding { background: rgba(255,60,60,.35); }
.bag-item canvas { image-rendering: pixelated; }
.bag-uv {
  position: absolute; right: 1px; bottom: 0;
  font-size: 9px; color: #6ee7a0; text-shadow: 1px 1px 0 #000;
  pointer-events: none;
}
.drag-ghost { position: fixed; z-index: 30; pointer-events: none; opacity: .85; }

/* 安全箱（左下） */
.secure-wrap {
  position: absolute; left: 14px; bottom: 14px;
  display: flex; flex-direction: column; gap: 4px;
  background: var(--panel); border: 3px solid var(--border-hi);
  box-shadow: 0 0 0 3px #05060f, 0 0 12px rgba(79,195,247,.25);
  padding: 8px;
}
.secure-title { font-size: 12px; color: var(--good); font-weight: bold; }
.secure-note { font-size: 10px; color: var(--ink-dim); }
.secure-grid { display: grid; position: relative; background: #0a0e1c; border: 2px solid var(--border); }

/* ---------- 搜索鉴定（V2.1 非阻塞面板） ---------- */
.search-panel {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  width: 520px; max-width: 92vw;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px;
  background: var(--panel);
  border: 3px solid var(--border-hi);
  box-shadow: 0 0 0 3px #05060f, 0 8px 0 rgba(0,0,0,.45);
}
.sp-head { text-align: center; }
.sp-head .sb-title { font-size: 16px; color: var(--accent); font-weight: bold; }
.sp-head .sb-sub { font-size: 11px; color: var(--ink-dim); margin-top: 2px; }
.sp-sizes { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; min-height: 44px; }
.sp-size {
  position: relative; width: 34px; height: 34px;
  background: #0a0e1c; border: 2px dashed #2a3352;
  display: flex; align-items: center; justify-content: center;
  overflow: visible;
}
.sp-size.multi { border-style: solid; }
.sp-size::after {
  content: ''; position: absolute; left: 0; bottom: 0; width: 100%;
  height: calc(var(--scan, 0) * 100%);
  background: rgba(255,183,77,.22);
  pointer-events: none;
}
.sp-size.revealed { border-style: solid; animation: itemPop .35s steps(3) both; }
.sp-size.revealed canvas { image-rendering: pixelated; }
.sp-size .sp-q { color: #8a93b5; font-size: 14px; font-weight: bold; }
.sp-size.sb-red { animation: redZoom 0.9s ease-out both; }
@keyframes redZoom {
  0% { transform: scale(1); }
  40% { transform: scale(1.8) rotate(180deg); }
  100% { transform: scale(1) rotate(360deg); }
}
.sp-btns { display: flex; gap: 8px; justify-content: center; }
.search-spark {
  position: absolute; width: 4px; height: 4px; z-index: 3;
  pointer-events: none;
  animation: sparkFly .5s ease-out both;
}
@keyframes sparkFly {
  0% { transform: translate(0,0) scale(1); opacity: 1; }
  100% { transform: translate(var(--sx, 0px), var(--sy, 0px)) scale(.2); opacity: 0; }
}

.extract-small { transform: scale(.72); transform-origin: bottom right; }
.extract-small .extract-core { font-size: 12px; }
.cruise-end-btn {
  position: absolute; left: 14px; bottom: 14px;
  font-size: 13px; padding: 8px 12px;
}

/* ---------- 货舱（船坞） ---------- */
.cargo-boxes { display: flex; flex-direction: column; gap: 10px; }
.cargo-box { background: #0f1628; border: 2px solid var(--border); padding: 8px; }
.cargo-box-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.cargo-box-head span { color: var(--ink-dim); font-size: 12px; }
.cargo-box-inner { position: relative; background: rgba(10,14,28,.7); border: 1px solid #1a2340; width: 100%; }
.cargo-item { cursor: pointer; }

/* ---------- 撤离按钮（右下，长按3秒） ---------- */
.extract-wrap {
  position: absolute; right: 18px; bottom: 18px;
  width: 92px; height: 92px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.extract-wrap svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.extract-ring-bg { fill: none; stroke: #1a2340; stroke-width: 7; }
.extract-ring { fill: none; stroke: var(--good); stroke-width: 7; stroke-linecap: butt; }
.extract-core {
  width: 66px; height: 66px; border-radius: 50%;
  background: #1a2340; border: 3px solid #3fae6e;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 14px; color: #d9ffe9; font-weight: bold;
  box-shadow: 0 0 0 4px #05060f, 0 0 14px rgba(63,174,110,.35);
}
.extract-core small { font-size: 10px; color: var(--ink-dim); }
.extract-wrap.holding .extract-core { border-color: var(--gold); background: #3a2a10; }

/* ---------- 搜索开箱弹窗 ---------- */
.modal-back {
  position: fixed; inset: 0;
  background: rgba(3,4,10,.82);
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
}
.search-box { width: 560px; max-width: 94vw; padding: 18px; text-align: center; }
.search-box .sb-title { font-size: 17px; color: var(--accent); font-weight: bold; margin-bottom: 4px; }
.search-box .sb-sub { font-size: 13px; color: var(--ink-dim); margin-bottom: 14px; }
.search-ring-wrap { position: relative; width: 150px; height: 150px; margin: 0 auto 10px; }
.search-ring-wrap svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.search-ring-bg { fill: none; stroke: #1a2340; stroke-width: 8; }
.search-ring-fg { fill: none; stroke: var(--accent); stroke-width: 8; }
.search-sweep {
  position: absolute; inset: 6px; border-radius: 50%;
  border: 4px dashed rgba(255,183,77,.5);
  animation: sweepSpin 1.2s linear infinite;
  display: none;
}
.searching .search-sweep { display: block; }
@keyframes sweepSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.search-btn {
  width: 120px; height: 120px; border-radius: 50%;
  position: absolute; left: 15px; top: 15px;
  background: #3a2a10; border: 4px solid var(--accent);
  color: #ffe9c4; font-size: 16px; font-weight: bold; cursor: pointer;
  font-family: var(--ui-font);
  box-shadow: 0 0 18px rgba(255,183,77,.4);
}
.search-btn:hover { background: #4d3814; }
.search-btn:active { transform: scale(.96); }
.searching .search-btn { background: #7a4a12; }
.sb-items { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; min-height: 54px; margin: 8px 0; }
.sb-item {
  width: 48px; height: 48px; background: #0a0e1c; border: 2px solid var(--border);
  position: relative; animation: itemPop .35s steps(3) both;
}
@keyframes itemPop { 0% { transform: scale(0) rotate(-12deg); opacity: 0; } 70% { transform: scale(1.15); } 100% { transform: scale(1); opacity: 1; } }
.sb-item canvas { image-rendering: pixelated; }
.sb-status { font-size: 13px; color: var(--ink-dim); min-height: 20px; }
.sb-status .hint { color: var(--ink); }
.sb-close { margin-top: 8px; }

/* ---------- 品质闪光 ---------- */
.flash-veil { position: fixed; inset: 0; pointer-events: none; z-index: 8; }
.flash-p { animation: flashP .5s ease-out both; background: radial-gradient(ellipse at center, transparent 55%, rgba(179,136,255,.85)); }
.flash-o { animation: flashO .7s ease-out both; background: radial-gradient(ellipse at center, transparent 50%, rgba(255,183,77,.95)); }
.flash-r { animation: flashR .9s ease-out both; background: radial-gradient(ellipse at center, rgba(255,215,0,.5) 30%, transparent 60%); }
@keyframes flashP { from { opacity: 1; } to { opacity: 0; } }
@keyframes flashO { from { opacity: 1; } to { opacity: 0; } }
@keyframes flashR { 0% { opacity: 1; } 30% { opacity: .7; } 45% { opacity: 1; } 100% { opacity: 0; } }

.gold-star {
  position: absolute; pointer-events: none; z-index: 8;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
  animation: starFly .9s ease-out both;
}
@keyframes starFly {
  0% { transform: translate(0,0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(.2) rotate(180deg); opacity: 0; }
}

/* ---------- Toast ---------- */
.toast-stack { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 12; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast {
  background: rgba(19,26,46,.95); border: 2px solid var(--border-hi);
  padding: 8px 16px; font-size: 14px; color: var(--ink);
  box-shadow: 0 4px 0 rgba(0,0,0,.4);
  animation: toastIn .25s steps(4) both;
}
.toast.gold { border-color: var(--gold); color: var(--gold); }
.toast.red { border-color: var(--bad); color: #ffb3a7; }
@keyframes toastIn { from { transform: translateY(-12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- 工具提示 ---------- */
.tooltip {
  position: fixed; z-index: 20; pointer-events: none;
  background: rgba(10,14,28,.97); border: 2px solid var(--border-hi);
  padding: 8px 10px; max-width: 260px; font-size: 13px; line-height: 1.5;
  box-shadow: 0 4px 0 rgba(0,0,0,.4);
}
.tooltip .tt-name { font-weight: bold; }
.tooltip .tt-desc { color: var(--ink-dim); }

/* ---------- DOM 屏幕通用 ---------- */
.screen { width: 100%; min-height: 100vh; padding: 24px; display: flex; justify-content: center; }
.screen-inner { width: 980px; max-width: 96vw; display: flex; flex-direction: column; gap: 16px; }
.screen-title { text-align: center; margin: 8px 0 2px; }

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.grow { flex: 1; min-width: 0; }

/* 主菜单 */
.menu-box { margin: 4vh auto 0; width: 640px; max-width: 94vw; padding: 30px; text-align: center; display: flex; flex-direction: column; gap: 18px; }
.menu-logo { font-size: 44px; line-height: 1.2; }
.menu-sub { color: var(--ink-dim); font-size: 14px; letter-spacing: 6px; }
.menu-ships { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.ship-card {
  width: 150px; padding: 12px; text-align: center; cursor: pointer;
  background: var(--panel-2); border: 3px solid var(--border);
}
.ship-card:hover { border-color: var(--border-hi); }
.ship-card.sel { border-color: var(--accent); box-shadow: 0 0 12px rgba(255,183,77,.4); }
.ship-card.locked { opacity: .45; cursor: not-allowed; }
.ship-card .sc-name { font-weight: bold; color: var(--accent); font-size: 14px; margin-top: 8px; }
.ship-card .sc-desc { font-size: 12px; color: var(--ink-dim); margin-top: 6px; line-height: 1.5; }
.ship-card .sc-lock { font-size: 11px; color: var(--bad); margin-top: 6px; }
.meta-line { font-size: 13px; color: var(--ink-dim); }

/* 战备配装 */
.loadout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lo-section { padding: 12px; }
.lo-section h3 { color: var(--accent); font-size: 15px; margin-bottom: 10px; }
.lo-opts { display: flex; flex-direction: column; gap: 6px; }
.lo-opt {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 10px; border: 2px solid var(--border); cursor: pointer;
  background: var(--panel-2); font-size: 13px;
}
.lo-opt:hover { border-color: var(--border-hi); }
.lo-opt.sel { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.lo-opt .lo-name { font-weight: bold; }
.lo-opt .lo-desc { color: var(--ink-dim); font-size: 12px; }
.lo-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 2px; }
.lo-summary { font-size: 13px; color: var(--ink-dim); line-height: 1.6; }

/* 船坞 */
.shipyard-top { display: flex; gap: 14px; align-items: stretch; }
.sy-preview { padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 300px; }
.sy-preview canvas { image-rendering: pixelated; }
.sy-stats { font-size: 13px; line-height: 1.9; width: 100%; }
.sy-stats b { color: var(--accent); }
.sy-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; flex: 1; }
.slot-card { padding: 10px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.slot-card .sl-name { color: var(--accent); font-weight: bold; }
.slot-card .sl-mod { color: var(--ink); }
.slot-card .sl-empty { color: var(--ink-dim); font-style: italic; }
.sy-list { max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding-right: 4px; }
.sy-row {
  display: flex; align-items: center; gap: 8px; padding: 5px 8px;
  background: var(--panel-2); border: 2px solid var(--border); font-size: 13px;
}
.sy-row canvas { image-rendering: pixelated; }
.sy-row .sy-name { flex: 1; }
.sy-row .sy-val { color: var(--gold); width: 70px; text-align: right; }
.sy-tabbar { display: flex; gap: 8px; }
.sy-tab { flex: 1; text-align: center; }

/* 模态 */
.modal-panel { width: 480px; max-width: 94vw; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.modal-title { font-size: 17px; color: var(--accent); font-weight: bold; text-align: center; }
.modal-body { font-size: 14px; line-height: 1.7; color: var(--ink); text-align: center; }
.modal-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* 死亡/胜利 */
.ending-box { margin: 5vh auto 0; width: 600px; max-width: 94vw; padding: 28px; text-align: center; display: flex; flex-direction: column; gap: 14px; }
.ending-big { font-size: 30px; }
.ending-sub { color: var(--ink-dim); font-size: 14px; line-height: 1.8; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; text-align: left; font-size: 14px; }
.stat-grid > div { background: var(--panel-2); border: 2px solid var(--border); padding: 8px 12px; display: flex; justify-content: space-between; }
.stat-grid b { color: var(--accent); }

/* 帮助 */
.help-box { width: 640px; max-width: 94vw; padding: 20px; font-size: 14px; line-height: 1.9; }
.help-box h3 { color: var(--accent); margin: 10px 0 4px; font-size: 15px; }
.help-box kbd { background: #0a0e1c; border: 2px solid var(--border-hi); padding: 1px 7px; font-family: var(--ui-font); color: var(--gold); }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #0a0e1c; }
::-webkit-scrollbar-thumb { background: #2a3352; border: 2px solid #0a0e1c; }
