/* ===========================================================
   平台跳跃闯关游戏 · 全局样式
   =========================================================== */
:root {
  --bg-0: #070b18;
  --bg-1: #0d1428;
  --bg-2: #131c38;
  --panel: rgba(255, 255, 255, 0.055);
  --panel-2: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.11);
  --border-2: rgba(255, 255, 255, 0.2);
  --text: #e8eeff;
  --muted: #93a1c0;
  --dim: #6b7a9c;
  --accent: #6366f1;
  --accent-2: #22d3ee;
  --good: #34d399;
  --bad: #fb5c7d;
  --warn: #fbbf24;
  --gold: #f5c451;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(3, 7, 18, .55);
  --ease: cubic-bezier(.22, .8, .3, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "HarmonyOS Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 600px at 12% -10%, rgba(99, 102, 241, .28), transparent 60%),
    radial-gradient(900px 520px at 92% 0%, rgba(34, 211, 238, .18), transparent 62%),
    radial-gradient(800px 700px at 50% 120%, rgba(168, 85, 247, .16), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0) 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .35;
  background-image: linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(1000px 700px at 50% 30%, #000 20%, transparent 85%);
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: .5px; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.24); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 布局 ---------- */
.wrap { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 0 22px 60px; }
.wrap-wide { max-width: 1560px; }
.nav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 18px;
  padding: 14px 22px;
  backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(10,15,30,.92), rgba(10,15,30,.55));
  border-bottom: 1px solid var(--border);
}
.nav .brand { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 17px; letter-spacing: .6px; }
.nav .brand .logo {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px rgba(99,102,241,.45);
  font-size: 17px;
}
.nav .spacer { flex: 1; }
.nav .links { display: flex; gap: 6px; align-items: center; }
.nav .links a {
  padding: 8px 14px; border-radius: 999px; color: var(--muted); font-size: 14px;
  transition: all .22s var(--ease);
}
.nav .links a:hover { color: var(--text); background: var(--panel-2); }
.nav .links a.on { color: #fff; background: linear-gradient(135deg, rgba(99,102,241,.9), rgba(34,211,238,.75)); box-shadow: 0 6px 16px rgba(99,102,241,.35); }

/* ---------- 卡片 ---------- */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.03));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.card.pad-sm { padding: 14px; }
.card-hover { transition: transform .28s var(--ease), border-color .28s var(--ease), box-shadow .28s var(--ease); }
.card-hover:hover { transform: translateY(-4px); border-color: var(--border-2); box-shadow: 0 24px 60px rgba(3,7,18,.6); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g-auto { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap-r { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

/* ---------- 文本 ---------- */
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.center { text-align: center; }
.sec-title { display: flex; align-items: center; gap: 10px; margin: 34px 0 16px; font-size: 18px; font-weight: 700; }
.sec-title::before { content: ""; width: 4px; height: 18px; border-radius: 4px; background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
.sec-title .sub { font-size: 13px; color: var(--dim); font-weight: 400; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--border); background: var(--panel); color: var(--text);
  font-size: 14px; font-weight: 600; letter-spacing: .3px;
  transition: transform .18s var(--ease), background .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease), opacity .2s;
  user-select: none; white-space: nowrap;
}
.btn:hover { background: var(--panel-2); border-color: var(--border-2); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.985); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary {
  border-color: transparent; color: #fff;
  background: linear-gradient(135deg, var(--accent), #8b5cf6 55%, var(--accent-2));
  box-shadow: 0 10px 26px rgba(99,102,241,.4);
}
.btn.primary:hover { box-shadow: 0 14px 34px rgba(99,102,241,.55); }
.btn.ghost { background: transparent; }
.btn.good { border-color: transparent; background: linear-gradient(135deg, #10b981, #34d399); color: #04231a; }
.btn.bad { border-color: transparent; background: linear-gradient(135deg, #f43f5e, #fb7185); color: #2b0410; }
.btn.warn { border-color: transparent; background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #2b1a02; }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn.xs { padding: 4px 9px; font-size: 12px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn.big { padding: 14px 30px; font-size: 16px; border-radius: 14px; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-size: 12.5px; color: var(--muted); letter-spacing: .3px; }
.input, .select, textarea.input {
  width: 100%; padding: 11px 13px; border-radius: 11px;
  background: rgba(7, 11, 24, .55); border: 1px solid var(--border);
  outline: none; transition: border-color .2s, box-shadow .2s, background .2s;
}
.input:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,.2); background: rgba(7,11,24,.75); }
.select { appearance: none; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.select option { background: #111a33; color: #e8eeff; }
.input[type=color] { padding: 3px; height: 40px; cursor: pointer; }
textarea.input { resize: vertical; min-height: 70px; }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 14px; }
.switch input { display: none; }
.switch .track {
  width: 44px; height: 24px; border-radius: 999px; background: rgba(255,255,255,.14);
  position: relative; transition: background .25s var(--ease); flex: none;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: transform .25s var(--ease); box-shadow: 0 2px 6px rgba(0,0,0,.35);
}
.switch input:checked + .track { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.switch input:checked + .track::after { transform: translateX(20px); }
.chk { display: flex; gap: 9px; align-items: flex-start; cursor: pointer; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.chk input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* ---------- 徽章 / 标签 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--muted);
}
.badge.good { color: #7ff0c4; background: rgba(52,211,153,.14); border-color: rgba(52,211,153,.32); }
.badge.bad { color: #ffb3c2; background: rgba(244,63,94,.14); border-color: rgba(244,63,94,.32); }
.badge.warn { color: #ffe08a; background: rgba(251,191,36,.14); border-color: rgba(251,191,36,.32); }
.badge.info { color: #b7c4ff; background: rgba(99,102,241,.16); border-color: rgba(99,102,241,.34); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 9px;
  background: var(--panel); border: 1px solid var(--border); font-size: 12.5px; color: var(--muted);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }

/* ---------- 统计数字 ---------- */
.stat {
  position: relative; overflow: hidden;
  padding: 18px 20px; border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255,255,255,.09), rgba(255,255,255,.025));
  border: 1px solid var(--border);
}
.stat::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,.35), transparent 70%);
}
.stat .k { font-size: 12.5px; color: var(--muted); letter-spacing: .4px; }
.stat .v { font-size: 30px; font-weight: 800; margin-top: 6px; letter-spacing: .5px; }
.stat .v small { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.stat .d { font-size: 12px; margin-top: 4px; color: var(--dim); }

/* ---------- 关卡卡片 ---------- */
.level-card {
  position: relative; overflow: hidden; cursor: pointer;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.02));
  transition: transform .28s var(--ease), border-color .28s var(--ease), box-shadow .28s var(--ease);
}
.level-card:hover { transform: translateY(-5px); border-color: var(--border-2); box-shadow: 0 22px 46px rgba(3,7,18,.55); }
.level-card .thumb {
  height: 132px; position: relative;
  background: linear-gradient(160deg, #1b2545, #0e1730);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.level-card .thumb canvas { width: 100%; height: 100%; display: block; }
.level-card .thumb .no { position: absolute; left: 12px; top: 12px; }
.level-card .body { padding: 14px 16px 16px; }
.level-card .tt { font-weight: 700; font-size: 15.5px; }
.level-card .ds { font-size: 12.5px; color: var(--dim); margin-top: 6px; min-height: 34px; line-height: 1.5; }
.level-card .meta { display: flex; gap: 10px; margin-top: 10px; font-size: 12px; color: var(--muted); }

/* ---------- 皮肤 ---------- */
.skin-card {
  border-radius: 14px; border: 1px solid var(--border); padding: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  display: flex; flex-direction: column; gap: 10px; align-items: center; text-align: center;
  transition: transform .26s var(--ease), border-color .26s var(--ease);
}
.skin-card:hover { transform: translateY(-4px); border-color: var(--border-2); }
.skin-card.on { border-color: rgba(34,211,238,.6); box-shadow: 0 0 0 2px rgba(34,211,238,.18) inset; }
.skin-card canvas { display: block; }
.skin-card .nm { font-weight: 700; font-size: 14px; }
.skin-card .pr { font-size: 12.5px; color: var(--gold); }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-weight: 600; font-size: 12.5px; letter-spacing: .4px; }
.table tbody tr { transition: background .18s; }
.table tbody tr:hover { background: rgba(255,255,255,.04); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px;
  background: rgba(4, 7, 16, .72); backdrop-filter: blur(6px);
  animation: fade .22s var(--ease);
}
.modal {
  width: min(560px, 100%); max-height: 88vh; overflow: auto;
  border-radius: 18px; border: 1px solid var(--border);
  background: linear-gradient(180deg, #16203c, #0c1226);
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  animation: pop .3s var(--ease);
}
.modal .hd { padding: 18px 22px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 16px; display: flex; justify-content: space-between; align-items: center; }
.modal .bd { padding: 20px 22px; display: grid; gap: 14px; }
.modal .ft { padding: 14px 22px 20px; display: flex; gap: 10px; justify-content: flex-end; }
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 8px 14px; font-size: 14px; align-items: baseline; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; word-break: break-all; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97) } to { opacity: 1; transform: none } }

/* ---------- Toast ---------- */
#toastBox { position: fixed; left: 50%; top: 22px; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  padding: 10px 18px; border-radius: 12px; font-size: 14px; font-weight: 600;
  background: rgba(16, 23, 46, .92); border: 1px solid var(--border);
  box-shadow: 0 14px 34px rgba(0,0,0,.45);
  animation: toastIn .3s var(--ease);
}
.toast.good { border-color: rgba(52,211,153,.45); color: #9df3d0; }
.toast.bad { border-color: rgba(244,63,94,.45); color: #ffc0cc; }
.toast.warn { border-color: rgba(251,191,36,.45); color: #ffe3a3; }
.toast.out { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) } to { opacity: 1; transform: none } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-12px) } }

/* ---------- 游戏页 ---------- */
.game-shell { position: relative; z-index: 1; padding: 18px 22px 40px; }
.stage-wrap {
  position: relative; max-width: 1180px; margin: 0 auto; border-radius: 20px; overflow: hidden;
  border: 1px solid var(--border); box-shadow: 0 30px 70px rgba(0,0,0,.55); background: #0a1024;
}
.stage-wrap canvas { display: block; width: 100%; height: auto; }
.hud {
  position: absolute; left: 0; right: 0; top: 0; padding: 14px 18px;
  display: flex; align-items: center; gap: 10px; pointer-events: none;
  background: linear-gradient(180deg, rgba(6,10,22,.78), transparent);
}
.hud .pill {
  pointer-events: auto; display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: rgba(10, 16, 34, .6); border: 1px solid var(--border); backdrop-filter: blur(8px);
}
.hud .pill .lb { color: var(--muted); font-weight: 600; font-size: 12px; }
.hud .pill.hot { color: #ffb3c2; border-color: rgba(244,63,94,.45); }
.overlay {
  position: absolute; inset: 0; display: grid; place-items: center; z-index: 12; padding: 16px;
  background: radial-gradient(700px 400px at 50% 40%, rgba(9,14,30,.72), rgba(4,7,16,.92));
  backdrop-filter: blur(4px); animation: fade .3s var(--ease); overflow: auto;
}
.overlay .panel {
  width: min(460px, 92%); max-height: 100%; overflow: auto; padding: 30px 30px 26px; border-radius: 20px; text-align: center;
  background: linear-gradient(180deg, rgba(24,33,62,.96), rgba(11,17,36,.96));
  border: 1px solid var(--border); box-shadow: 0 30px 70px rgba(0,0,0,.6);
  animation: pop .34s var(--ease);
}
.overlay h3 { font-size: 24px; margin-bottom: 8px; }
.overlay .desc { color: var(--muted); font-size: 14px; line-height: 1.7; }
.overlay .stats { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin: 18px 0 20px; }
.overlay .stats div { background: rgba(255,255,255,.05); border: 1px solid var(--border); border-radius: 12px; padding: 10px; }
.overlay .stats .k { font-size: 12px; color: var(--muted); }
.overlay .stats .v { font-size: 20px; font-weight: 800; margin-top: 3px; }
.overlay .acts { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* 手机 / 平板：开始 / 暂停 / 结算面板收缩，保证完整可见 */
@media (max-width: 820px) {
  .overlay { padding: 14px; }
  .overlay .panel { width: min(460px, 94%); padding: 22px 18px 18px; }
  .overlay h3 { font-size: 20px; margin-bottom: 6px; }
  .overlay .desc { font-size: 13px; line-height: 1.6; }
  .overlay .stats { gap: 8px; margin: 14px 0 16px; }
  .overlay .stats div { padding: 8px; }
  .overlay .stats .v { font-size: 17px; }
  .overlay .acts .btn { padding: 11px 18px; font-size: 14px; }
}
.keycap {
  display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 8px;
  border-radius: 8px; font-size: 12px; font-weight: 700;
  background: rgba(255,255,255,.09); border: 1px solid var(--border-2);
  box-shadow: 0 3px 0 rgba(0,0,0,.35);
}
/* ---------- 移动端 / 平板端 虚拟控制器 ---------- */
.touch-ui {
  display: none; position: absolute; left: 0; top: 0; right: 0; bottom: 0; z-index: 6;
  pointer-events: none;
}
body.dt-touch .touch-ui, body.show-pad .touch-ui { display: block; }
body.overlay-open .touch-ui { display: none !important; }
body.overlay-open .m-menu { display: none !important; }

/* 左侧浮动摇杆 */
.stick-zone {
  position: absolute; left: 0; bottom: 0; width: 46%; height: 64%;
  pointer-events: auto; touch-action: none; z-index: 6;
}
.stick-base {
  position: fixed; width: 116px; height: 116px; margin: -58px 0 0 -58px; border-radius: 50%;
  background: rgba(12,18,38,.30); border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(4px); opacity: 0; transform: scale(.82);
  transition: opacity .14s var(--ease), transform .14s var(--ease);
  display: grid; place-items: center; pointer-events: none;
}
.stick-base.on { opacity: 1; transform: scale(1); }
.stick-knob {
  width: 52px; height: 52px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #a5b4fc, #6366f1 70%);
  box-shadow: 0 8px 22px rgba(99,102,241,.5); will-change: transform;
}

/* 右侧动作按钮 */
.act-zone {
  position: absolute; right: 14px; bottom: 20px;
  display: flex; align-items: flex-end; gap: 14px; pointer-events: auto; z-index: 6;
}
.tbtn {
  border-radius: 50%; border: 1px solid rgba(255,255,255,.22); color: #fff; font-weight: 800;
  background: rgba(12,18,38,.5); backdrop-filter: blur(6px); touch-action: none; user-select: none;
  -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  display: grid; place-items: center; transition: transform .1s var(--ease), box-shadow .15s var(--ease);
}
.tbtn.jump {
  width: 92px; height: 92px; font-size: 22px;
  background: radial-gradient(circle at 35% 30%, rgba(52,211,153,.55), rgba(16,185,129,.30));
  border-color: rgba(52,211,153,.5); box-shadow: 0 10px 26px rgba(16,185,129,.32);
}
.tbtn.crouch { width: 64px; height: 64px; align-self: flex-end; margin-bottom: 6px; font-size: 16px; }
.tbtn.on { transform: scale(.9); }
.tbtn.jump.on { box-shadow: 0 6px 18px rgba(16,185,129,.6); }

/* 平板：控件更大、更易点 */
body.dt-tablet .tbtn.jump { width: 116px; height: 116px; font-size: 27px; }
body.dt-tablet .tbtn.crouch { width: 80px; height: 80px; font-size: 19px; }
body.dt-tablet .stick-base { width: 144px; height: 144px; margin: -72px 0 0 -72px; }
body.dt-tablet .stick-knob { width: 66px; height: 66px; }

/* 竖屏锁定（手机）：全屏旋转遮罩，转横屏后自动消失 */
.rotate-hint { display: none; }
body.rotate-lock .rotate-hint {
  display: grid; position: fixed; inset: 0; z-index: 90; place-items: center; text-align: center; padding: 30px;
  background: linear-gradient(180deg, rgba(6,10,22,.97), rgba(10,15,32,.97)); backdrop-filter: blur(8px); color: var(--muted);
}
.rotate-hint .rot-phone {
  width: 94px; height: 94px; margin: 0 auto 18px; border-radius: 22px; display: grid; place-items: center;
  border: 2px solid rgba(255,255,255,.28); box-shadow: 0 18px 44px rgba(3,7,18,.5);
  animation: rotPhone 2.2s ease-in-out infinite;
}
.rotate-hint .rot-phone svg { width: 46px; height: 46px; }
@keyframes rotPhone { 0%,100% { transform: rotate(-90deg) } 50% { transform: rotate(-76deg) } }
.rotate-hint p { font-size: 16px; line-height: 1.8; max-width: 300px; margin: 0 auto 20px; }
.rotate-go {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 26px; margin-bottom: 14px; border-radius: 999px;
  font-size: 16px; font-weight: 800; letter-spacing: .5px; cursor: pointer;
  color: #06122a; border: none;
  background: linear-gradient(180deg, #7fe0ff, #38bdf8);
  box-shadow: 0 12px 30px rgba(56,189,248,.45); transition: transform .12s var(--ease), box-shadow .12s var(--ease);
}
.rotate-go:active { transform: scale(.96); box-shadow: 0 6px 18px rgba(56,189,248,.4); }
.rotate-hint .keep { color: #7fa0ff; font-size: 13.5px; text-decoration: underline; }
body.no-rotate .rotate-hint { display: none !important; }

/* ---------- 编辑器 ---------- */
.ed-layout { position: relative; z-index: 1; display: grid; grid-template-columns: 214px 1fr 300px; gap: 14px; padding: 14px 16px 20px; height: calc(100vh - 60px); }
.ed-panel {
  border-radius: 14px; border: 1px solid var(--border); overflow: auto;
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.02));
}
.ed-panel .ph { padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .5px; position: sticky; top: 0; background: rgba(13,19,40,.92); backdrop-filter: blur(8px); z-index: 2; }
.ed-panel .pb { padding: 12px; display: grid; gap: 12px; }
.palette { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pal-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; cursor: pointer;
  border-radius: 11px; border: 1px solid transparent; background: var(--panel); font-size: 12px; color: var(--muted);
  transition: all .2s var(--ease);
}
.pal-item:hover { background: var(--panel-2); color: var(--text); transform: translateY(-2px); }
.pal-item.on { border-color: var(--accent); background: rgba(99,102,241,.18); color: #fff; }
.pal-item .ic { width: 26px; height: 26px; border-radius: 7px; }
.canvas-area { border-radius: 14px; border: 1px solid var(--border); overflow: hidden; position: relative; background: #0a1024; display: flex; flex-direction: column; }
.canvas-area canvas { display: block; flex: 1; min-height: 0; cursor: crosshair; }
.ed-canvas-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--border); background: rgba(10,15,32,.7); flex-wrap: wrap; }
.prop-row { display: grid; grid-template-columns: 78px 1fr; gap: 8px; align-items: center; font-size: 12.5px; }
.prop-row > span { color: var(--muted); }
.trigger-item { border: 1px solid var(--border); border-radius: 12px; padding: 10px; background: rgba(255,255,255,.03); }
.trigger-item.on { border-color: var(--accent); }
.act-item { display: flex; align-items: center; gap: 6px; padding: 7px 8px; border-radius: 9px; background: rgba(255,255,255,.04); border: 1px solid var(--border); font-size: 12px; }
.obj-list { display: grid; gap: 6px; max-height: 230px; overflow: auto; }
.obj-list .it { display: flex; align-items: center; gap: 8px; padding: 6px 9px; border-radius: 9px; background: rgba(255,255,255,.04); border: 1px solid transparent; cursor: pointer; font-size: 12.5px; }
.obj-list .it:hover { background: rgba(255,255,255,.08); }
.obj-list .it.on { border-color: var(--accent); background: rgba(99,102,241,.16); }
.obj-list .it .sw { width: 12px; height: 12px; border-radius: 4px; flex: none; }

/* ---------- 后台 ---------- */
.admin-login { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.admin-login .box { width: min(400px, 100%); }
.chart-box { position: relative; height: 260px; }
.chart-box canvas { width: 100%; height: 100%; display: block; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }

/* ---------- 空状态 ---------- */
.empty { padding: 46px 20px; text-align: center; color: var(--dim); font-size: 14px; }
.empty .big { font-size: 34px; opacity: .5; margin-bottom: 10px; }

/* ---------- AI 悬浮窗 ---------- */
.ai-win {
  position: fixed; right: 24px; bottom: 24px; width: 344px; z-index: 60;
  border-radius: 15px; border: 1px solid var(--border-2); overflow: hidden;
  background: linear-gradient(180deg, rgba(21,30,60,.97), rgba(10,15,32,.97));
  box-shadow: 0 26px 64px rgba(3,7,18,.62);
}
.ai-win.fold .ai-body { display: none; }
.ai-head {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: move;
  border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 700;
  user-select: none; background: linear-gradient(90deg, rgba(99,102,241,.22), rgba(34,211,238,.14));
}
.ai-head:active { cursor: grabbing; }
.ai-body { padding: 12px; display: grid; gap: 10px; max-height: min(62vh, 560px); overflow: auto; }
.ai-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-chip {
  padding: 4px 10px; border-radius: 999px; font-size: 12px; cursor: pointer;
  border: 1px solid var(--border); background: var(--panel); color: var(--muted);
  transition: all .2s var(--ease);
}
.ai-chip:hover { background: var(--panel-2); color: var(--text); }
.ai-chip.on { border-color: var(--accent); background: rgba(99,102,241,.22); color: #fff; }

/* ---------- 安装向导 ---------- */
.inst-wrap { position: relative; z-index: 1; max-width: 960px; margin: 0 auto; padding: 0 22px 70px; }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.step { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 13px; border: 1px solid var(--border); background: var(--panel); transition: all .3s var(--ease); }
.step .dot { width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; background: rgba(255,255,255,.08); color: var(--dim); transition: all .3s var(--ease); }
.step .tx { min-width: 0; }
.step .tx b { display: block; font-size: 13.5px; font-weight: 700; color: var(--muted); }
.step .tx span { font-size: 11.5px; color: var(--dim); }
.step.on { border-color: rgba(99,102,241,.6); background: rgba(99,102,241,.15); box-shadow: 0 10px 28px rgba(99,102,241,.18); }
.step.on .dot { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.step.on .tx b { color: #fff; }
.step.done .dot { background: linear-gradient(135deg, #10b981, #34d399); color: #04231a; }
.step.done .tx b { color: var(--good); }
.chk-list { display: grid; gap: 9px; }
.chk-item { display: flex; align-items: flex-start; gap: 11px; padding: 11px 13px; border-radius: 12px; background: rgba(255,255,255,.035); border: 1px solid var(--border); font-size: 13.5px; }
.chk-item .ico { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.chk-item.ok .ico { background: rgba(52,211,153,.18); color: var(--good); }
.chk-item.bad .ico { background: rgba(251,92,125,.18); color: var(--bad); }
.chk-item.warn .ico { background: rgba(251,191,36,.18); color: var(--warn); }
.chk-item .t b { font-weight: 700; }
.chk-item .t span { display: block; color: var(--dim); font-size: 12px; margin-top: 2px; line-height: 1.55; }
.term { background: #060a16; border: 1px solid var(--border); border-radius: 12px; padding: 13px 15px; font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; font-size: 12.5px; line-height: 1.85; color: #9fb4d8; max-height: 260px; overflow: auto; }
.term .ln { display: flex; gap: 8px; animation: riseIn .28s var(--ease) both; }
.term .ln i { color: #4b5b80; font-style: normal; flex: none; }
.term .ln.good { color: var(--good); }
.term .ln.bad { color: var(--bad); }
.term .ln.warn { color: var(--warn); }
.summary { display: grid; gap: 8px; font-size: 13.5px; }
.summary .sr { display: flex; gap: 12px; padding: 9px 12px; border-radius: 10px; background: rgba(255,255,255,.035); border: 1px solid var(--border); }
.summary .sr > span:first-child { width: 96px; flex: none; color: var(--dim); }
.summary .sr > span:last-child { word-break: break-all; }
.bar { height: 8px; border-radius: 8px; background: rgba(255,255,255,.08); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; border-radius: 8px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .45s var(--ease); }
.done-hero { text-align: center; padding: 14px 0 4px; }
.done-hero .ring { width: 78px; height: 78px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; background: radial-gradient(circle, rgba(52,211,153,.28), transparent 70%); border: 1px solid rgba(52,211,153,.45); animation: popIn .5s var(--ease) both; }
@keyframes popIn { from { opacity: 0; transform: scale(.6) } to { opacity: 1; transform: none } }
.pane { animation: riseIn .38s var(--ease) both; }
.alert { padding: 12px 14px; border-radius: 12px; font-size: 13px; line-height: 1.75; border: 1px solid; }
.alert.info { background: rgba(99,102,241,.12); border-color: rgba(99,102,241,.4); color: #c7d0ff; }
.alert.warn { background: rgba(251,191,36,.1); border-color: rgba(251,191,36,.35); color: #ffe4a8; }
.alert.bad { background: rgba(251,92,125,.1); border-color: rgba(251,92,125,.4); color: #ffc2ce; }

/* ---------- 动画 ---------- */
@keyframes floatY { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-8px) } }
@keyframes riseIn { from { opacity: 0; transform: translateY(18px) } to { opacity: 1; transform: none } }
.rise { animation: riseIn .5s var(--ease) both; }
.rise-1 { animation-delay: .05s } .rise-2 { animation-delay: .1s } .rise-3 { animation-delay: .15s } .rise-4 { animation-delay: .2s }
.float { animation: floatY 3.6s ease-in-out infinite; }
@keyframes shimmer { 0% { background-position: -200% 0 } 100% { background-position: 200% 0 } }
.shimmer {
  background: linear-gradient(90deg, rgba(255,255,255,.04) 25%, rgba(255,255,255,.12) 50%, rgba(255,255,255,.04) 75%);
  background-size: 200% 100%; animation: shimmer 1.6s linear infinite; border-radius: 10px;
}

@media (max-width: 1080px) {
  .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .ed-layout { grid-template-columns: 170px 1fr 260px; }
}
@media (max-width: 860px) {
  .g3 { grid-template-columns: repeat(1, minmax(0,1fr)); }
  .g2 { grid-template-columns: repeat(1, minmax(0,1fr)); }
  .ed-layout { grid-template-columns: 1fr; height: auto; }
  .ed-panel { max-height: 260px; }
  .nav .links a .kbx { display: none; }
  .nav .links a { padding: 8px 10px; font-size: 13px; }
}

/* ---------- 游玩页 移动端 / 平板端 自适应 ---------- */
@media (max-width: 760px) {
  .game-shell { padding: 10px 10px 28px; }
  .stage-wrap { border-radius: 14px; }
  .hud { padding: 10px 12px; gap: 7px; flex-wrap: wrap; }
  .hud .pill { padding: 5px 10px; font-size: 12px; }
  .hud .pill .lb { font-size: 11px; }
  .card { padding: 14px; margin-top: 12px !important; }
  .card .row.wrap-r { gap: 8px; }
  .chip { padding: 4px 9px; font-size: 11.5px; }
  .nav .brand { font-size: 15px; }
  .nav { padding: 11px 12px; gap: 8px; }
  .nav .links { gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
  .nav .links a { padding: 7px 9px; font-size: 12.5px; }
}
@media (max-width: 760px) and (orientation: landscape) {
  .hud { flex-wrap: nowrap; }
  .act-zone { right: 12px; bottom: 12px; gap: 10px; }
  .tbtn.jump { width: 76px; height: 76px; font-size: 19px; }
  .tbtn.crouch { width: 54px; height: 54px; font-size: 14px; }
}

/* ---------- 手机横屏：沉浸式全屏游玩 ---------- */
body.dt-touch .card { display: none; }                 /* 触屏不显示键盘提示 */
body.dt-touch.dt-landscape .nav { display: none; }    /* 沉浸：隐藏顶部导航 */
body.dt-touch.dt-landscape .game-shell { padding: 0; margin: 0; }
body.dt-touch.dt-landscape .stage-wrap {
  position: fixed; inset: 0; border-radius: 0; border: 0; overflow: hidden; z-index: 30;
}
body.dt-touch.dt-landscape .hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 8; flex-wrap: nowrap;
  padding: calc(8px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-left)) 8px;
  background: linear-gradient(180deg, rgba(6,10,22,.55), transparent); pointer-events: none;
}
body.dt-touch.dt-landscape .hud .pill { backdrop-filter: blur(4px); }
body.dt-touch.dt-landscape .act-zone {
  right: calc(16px + env(safe-area-inset-right)); bottom: calc(18px + env(safe-area-inset-bottom)); gap: 12px;
}
body.dt-touch.dt-landscape .stick-zone { bottom: env(safe-area-inset-bottom); height: 72%; }
body.dt-touch.dt-landscape .tbtn.jump { width: 84px; height: 84px; font-size: 20px; }
body.dt-touch.dt-landscape .tbtn.crouch { width: 58px; height: 58px; font-size: 14px; }

/* 横屏浮动菜单按钮（暂停 / 返回大厅），仅手机横屏显示 */
.m-menu {
  display: none; position: absolute; top: calc(10px + env(safe-area-inset-top)); right: calc(12px + env(safe-area-inset-right));
  z-index: 9; width: 42px; height: 42px; border-radius: 12px; font-size: 20px; line-height: 1;
  background: rgba(12,18,38,.55); border: 1px solid rgba(255,255,255,.2); color: #fff; backdrop-filter: blur(6px);
  align-items: center; justify-content: center; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
body.dt-touch.dt-landscape .m-menu { display: flex; }
.m-menu.on { background: rgba(99,102,241,.45); }
