:root {
  --bg: #070a0e;
  --panel: rgba(11, 16, 22, 0.84);
  --panel-2: rgba(22, 30, 39, 0.92);
  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.2);
  --text: #eef3f7;
  --muted: #8d9aa7;
  --amber: #ffa23a;
  --amber-2: #ff6b2c;
  --cyan: #6fd6e8;
  --good: #7be3a2;
  --danger: #ff5f5f;
  --ui: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  --num: "Bahnschrift", "DIN Alternate", "Arial Narrow", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--ui); user-select: none; }
#app { position: relative; width: 100vw; height: 100vh; }
#scene { display: block; width: 100%; height: 100%; }
.hidden { display: none !important; }

/* ---------- 画面氛围 ---------- */
.fx-vignette { position: absolute; inset: 0; pointer-events: none; z-index: 2; background: radial-gradient(ellipse at 50% 46%, transparent 42%, rgba(0,0,0,0.30) 78%, rgba(0,0,0,0.62) 100%); }
.fx-grain { position: absolute; inset: 0; pointer-events: none; z-index: 3; opacity: 0.055; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.fx-scanline { position: absolute; inset: 0; pointer-events: none; z-index: 4; opacity: 0.12; background: repeating-linear-gradient(180deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 4px); }

.overlay { position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(4, 7, 11, 0.82); backdrop-filter: blur(14px); }

kbd { font-family: var(--num); font-size: 10px; font-weight: 700; letter-spacing: 1px; padding: 3px 7px; border-radius: 4px; border: 1px solid var(--line-strong); background: rgba(255,255,255,0.07); color: #dce6ee; box-shadow: inset 0 -2px 0 rgba(0,0,0,0.35); }

/* ---------- 加载 ---------- */
.loader { text-align: center; }
.loader-ring { position: relative; width: 74px; height: 74px; margin: 0 auto 26px; }
.loader-ring i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--amber); animation: spin 1.1s linear infinite; }
.loader-ring i:nth-child(2) { inset: 9px; border-top-color: var(--cyan); animation-duration: 1.6s; animation-direction: reverse; }
.loader-ring i:nth-child(3) { inset: 19px; border-top-color: rgba(255,255,255,0.45); animation-duration: 0.7s; }
@keyframes spin { to { transform: rotate(360deg); } }
.loader-title { font-size: 22px; letter-spacing: 8px; font-weight: 700; }
.loader-sub { margin-top: 10px; color: var(--muted); font-size: 12px; letter-spacing: 2px; }
.loader-bar { margin: 22px auto 0; width: 260px; height: 3px; background: rgba(255,255,255,0.1); overflow: hidden; }
.loader-bar span { display: block; height: 100%; width: 38%; background: linear-gradient(90deg, transparent, var(--amber), transparent); animation: sweep 1.4s ease-in-out infinite; }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

/* ---------- 标题画面 ---------- */
.title-screen { background: radial-gradient(circle at 50% 38%, rgba(20,28,38,0.72), rgba(3,5,8,0.96) 72%); overflow: hidden; }
.title-deco { position: absolute; width: 520px; height: 520px; border: 1px solid rgba(255,162,58,0.14); border-radius: 50%; pointer-events: none; }
.title-deco-a { top: -240px; right: -160px; }
.title-deco-b { bottom: -300px; left: -180px; border-color: rgba(111,214,232,0.12); }
.title-deco::after { content: ""; position: absolute; inset: 38px; border: 1px dashed rgba(255,255,255,0.06); border-radius: 50%; }
.title-wrap { position: relative; width: min(760px, 92vw); padding: 26px 0; animation: titleIn 0.6s ease both; }
@keyframes titleIn { from { opacity: 0; transform: translateY(16px); } }
.eyebrow { font-family: var(--num); font-size: 11px; letter-spacing: 3px; color: #9fb0c0; display: flex; align-items: center; gap: 10px; }
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 12px var(--amber); }
.eyebrow .ver { margin-left: auto; color: var(--amber); border: 1px solid rgba(255,162,58,0.35); padding: 2px 8px; border-radius: 3px; }
.logo-group { display: flex; align-items: center; gap: 20px; margin: 20px 0 8px; }
.logo-mark { width: 82px; height: 82px; display: grid; place-items: center; font-size: 44px; font-weight: 800; color: #1e1204; background: linear-gradient(135deg, #ffc46b, var(--amber-2)); clip-path: polygon(16% 0, 100% 0, 100% 84%, 84% 100%, 0 100%, 0 16%); box-shadow: 0 16px 46px rgba(255,107,44,0.28); }
.logo-text h1 { margin: 0; font-size: 58px; letter-spacing: 16px; line-height: 1; font-weight: 800; text-shadow: 0 0 40px rgba(255,162,58,0.22); }
.logo-sub { font-family: var(--num); font-size: 13px; letter-spacing: 9px; color: var(--amber); margin-top: 8px; }
.tagline { color: #aebcc9; font-size: 14px; line-height: 1.9; letter-spacing: 1px; margin: 16px 0 26px; }
.section-label { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; font-size: 12px; letter-spacing: 4px; color: #c8d3dd; }
.section-label i { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-strong), transparent); }

.noui-toggle { display: flex; align-items: center; gap: 12px; cursor: pointer; margin: -4px 0 18px; padding: 10px 14px; border: 1px solid var(--line); background: rgba(255,255,255,0.035); }
.noui-toggle input { display: none; }
.noui-toggle .switch { position: relative; width: 38px; height: 20px; flex: 0 0 38px; border-radius: 20px; background: rgba(255,255,255,0.13); transition: 0.2s; }
.noui-toggle .switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #9aa8b4; transition: 0.2s; }
.noui-toggle input:checked + .switch { background: rgba(255,162,58,0.45); }
.noui-toggle input:checked + .switch::after { left: 21px; background: var(--amber); }
.noui-label b { display: block; font-size: 12px; letter-spacing: 2px; }
.noui-label small { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; }
body.noui #hud { display: none !important; }

.mode-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 22px; }
.mode-card { position: relative; text-align: left; cursor: pointer; font-family: var(--ui); color: var(--text); padding: 18px 20px 16px 78px; min-height: 138px; background: linear-gradient(150deg, rgba(30,40,51,0.8), rgba(12,17,23,0.86)); border: 1px solid var(--line); clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px)); transition: 0.2s ease; }
.mode-card::before { content: ""; position: absolute; left: 0; top: 0; width: 3px; height: 100%; background: transparent; transition: 0.2s; }
.mode-card:hover { transform: translateY(-3px); border-color: rgba(255,162,58,0.45); }
.mode-card.selected { border-color: rgba(255,162,58,0.65); background: linear-gradient(150deg, rgba(72,48,25,0.72), rgba(20,18,15,0.9)); box-shadow: inset 0 0 40px rgba(255,162,58,0.08); }
.mode-card.selected::before { background: var(--amber); box-shadow: 0 0 16px var(--amber); }
.mode-top { display: flex; justify-content: space-between; font-family: var(--num); font-size: 10px; letter-spacing: 2px; color: #7f8e9c; }
.mode-tag { color: var(--amber); border: 1px solid rgba(255,162,58,0.4); padding: 2px 7px; border-radius: 3px; }
.mode-tag.alt { color: var(--cyan); border-color: rgba(111,214,232,0.4); }
.mode-icon { position: absolute; left: 18px; top: 46px; width: 46px; height: 46px; display: grid; place-items: center; font-size: 22px; border: 1px solid var(--line-strong); background: rgba(255,255,255,0.05); }
.mode-card.selected .mode-icon { border-color: var(--amber); color: var(--amber); }
.mode-card strong { display: block; font-size: 19px; letter-spacing: 3px; margin: 14px 0 6px; }
.mode-card small { display: block; color: #93a2ae; font-size: 11.5px; line-height: 1.6; }
.mode-meta { display: flex; gap: 16px; margin-top: 12px; font-family: var(--num); font-size: 10.5px; color: #6f7e8c; letter-spacing: 1px; }

.btn-main { position: relative; width: 100%; cursor: pointer; font-family: var(--ui); border: 0; padding: 17px 24px; color: #211305; background: linear-gradient(100deg, var(--amber), var(--amber-2)); clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px)); transition: 0.18s; box-shadow: 0 12px 40px rgba(255,107,44,0.2); }
.btn-main:hover { filter: brightness(1.1); transform: translateY(-2px); }
.btn-main-text { font-size: 17px; font-weight: 800; letter-spacing: 6px; }
.btn-main-en { margin-left: 14px; font-family: var(--num); font-size: 10px; letter-spacing: 3px; opacity: 0.65; }
.btn-arrow { position: absolute; right: 22px; top: 50%; transform: translateY(-50%); font-size: 20px; }
.btn-main.small { padding: 12px 20px; }
.btn-main.small .btn-main-text { font-size: 14px; letter-spacing: 3px; }
.btn-ghost { cursor: pointer; font-family: var(--ui); font-size: 13px; letter-spacing: 1px; color: #c9d5df; background: rgba(255,255,255,0.05); border: 1px solid var(--line-strong); padding: 11px 18px; transition: 0.18s; }
.btn-ghost:hover { background: rgba(255,255,255,0.11); color: #fff; }
.btn-ghost.small { padding: 8px 12px; font-size: 11px; }

.control-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 14px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.control-grid div { display: flex; align-items: center; gap: 8px; font-size: 11px; color: #8b99a6; }
.control-grid kbd { min-width: 34px; text-align: center; }

/* ---------- HUD 框架 ---------- */
#hud { position: absolute; inset: 0; z-index: 10; pointer-events: none; }
.hud-corner { position: absolute; width: 26px; height: 26px; border-color: rgba(255,162,58,0.5); border-style: solid; }
.hud-corner.tl { left: 10px; top: 10px; border-width: 2px 0 0 2px; }
.hud-corner.tr { right: 10px; top: 10px; border-width: 2px 2px 0 0; }
.hud-corner.bl { left: 10px; bottom: 10px; border-width: 0 0 2px 2px; }
.hud-corner.br { right: 10px; bottom: 10px; border-width: 0 2px 2px 0; }

.hud-panel { position: absolute; background: linear-gradient(150deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); backdrop-filter: blur(12px); clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px)); box-shadow: 0 16px 46px rgba(0,0,0,0.38); }
.panel-tab { position: absolute; top: -1px; left: 0; padding: 4px 14px 5px 12px; background: linear-gradient(90deg, rgba(255,162,58,0.9), rgba(255,107,44,0.62)); color: #1a0e02; font-family: var(--num); font-size: 9px; font-weight: 800; letter-spacing: 2px; clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }
.panel-tab.mini { font-size: 8px; padding: 3px 10px; background: rgba(111,214,232,0.75); }

/* 准星 */
.crosshair { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; transform: translate(-50%, -50%); transition: transform 0.15s; }
.crosshair.hot { transform: translate(-50%, -50%) scale(1.18); }
.ch-line { position: absolute; background: rgba(255,255,255,0.78); box-shadow: 0 0 4px rgba(0,0,0,0.6); }
.ch-t, .ch-b { width: 2px; height: 7px; left: 16px; }
.ch-t { top: 0; } .ch-b { bottom: 0; }
.ch-l, .ch-r { height: 2px; width: 7px; top: 16px; }
.ch-l { left: 0; } .ch-r { right: 0; }
.ch-dot { position: absolute; left: 16px; top: 16px; width: 2px; height: 2px; background: var(--amber); }

/* 任务面板 */
.objective { left: 26px; top: 26px; width: 300px; padding: 26px 18px 14px; }
.objective-head { display: flex; justify-content: space-between; align-items: flex-end; }
.objective-kicker { font-size: 10px; letter-spacing: 3px; color: var(--amber); }
.objective-title { font-size: 21px; font-weight: 800; letter-spacing: 3px; margin-top: 3px; }
.objective-progress { font-family: var(--num); display: flex; align-items: baseline; gap: 2px; }
.objective-progress span { font-size: 26px; font-weight: 800; color: var(--amber); }
.objective-progress small { font-size: 11px; color: var(--muted); }
.objective-bar { height: 3px; background: rgba(255,255,255,0.09); margin: 10px 0 14px; }
.objective-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--amber), var(--amber-2)); box-shadow: 0 0 10px rgba(255,162,58,0.5); transition: width 0.35s ease; }
.step-list { display: flex; flex-direction: column; gap: 2px; }
.step { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #768593; padding: 5px 6px; border-left: 2px solid transparent; transition: 0.2s; }
.step .dot { width: 17px; height: 17px; flex: 0 0 17px; border: 1px solid rgba(255,255,255,0.22); border-radius: 2px; display: grid; place-items: center; font-family: var(--num); font-size: 9px; }
.step.done { color: #86998b; }
.step.done .dot { background: rgba(123,227,162,0.18); border-color: var(--good); color: var(--good); }
.step.active { color: #fff; background: linear-gradient(90deg, rgba(255,162,58,0.14), transparent); border-left-color: var(--amber); font-weight: 600; }
.step.active .dot { border-color: var(--amber); color: var(--amber); box-shadow: 0 0 12px rgba(255,162,58,0.25); animation: pulse 1.6s ease infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 3px rgba(255,162,58,0.1); } }
.objective-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 11px; color: #c1cdd8; line-height: 1.5; }
.pulse-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--amber); flex: 0 0 5px; animation: blink 1.3s ease infinite; }
@keyframes blink { 50% { opacity: 0.2; } }

.hud-top-center { position: absolute; top: 26px; left: 50%; transform: translateX(-50%); }
.dish-tag { display: flex; align-items: center; gap: 10px; padding: 8px 18px; background: rgba(8,12,17,0.7); border: 1px solid var(--line); font-size: 11px; letter-spacing: 2px; color: #c9d5df; clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }
.dish-tag-icon { color: var(--amber); font-size: 9px; }

/* 状态面板 */
.telemetry { right: 26px; top: 26px; width: 268px; padding: 26px 16px 14px; }
.telemetry-body { display: flex; gap: 14px; align-items: center; }
.gauge { position: relative; width: 96px; height: 96px; flex: 0 0 96px; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge circle { fill: none; stroke-width: 7; }
.gauge-track { stroke: rgba(255,255,255,0.09); }
.gauge-value { stroke: url(#heatGrad); stroke: var(--amber); stroke-linecap: round; stroke-dasharray: 238.8; stroke-dashoffset: 238.8; transition: stroke-dashoffset 0.15s linear, stroke 0.3s; filter: drop-shadow(0 0 6px rgba(255,162,58,0.5)); }
.gauge-center { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--num); }
.gauge-center strong { font-size: 27px; font-weight: 800; }
.gauge-center small { font-size: 10px; color: var(--muted); margin-left: 1px; align-self: center; padding-top: 10px; }
.gauge-caption { position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%); font-size: 10px; letter-spacing: 2px; color: var(--muted); }
.telemetry-side { flex: 1; }
.stat-line { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,0.06); font-size: 11px; }
.stat-k { color: var(--muted); letter-spacing: 1px; }
.stat-v { font-family: var(--num); font-size: 12px; font-weight: 700; color: #e8eff5; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flame-bars { display: flex; gap: 3px; margin-top: 10px; }
.flame-bars i { flex: 1; height: 4px; background: rgba(255,255,255,0.1); transform: skewX(-20deg); }
.flame-bars i.on { background: var(--amber); box-shadow: 0 0 8px rgba(255,162,58,0.6); }

/* 食材栏 */
.inventory { left: 26px; bottom: 122px; padding: 22px 12px 10px; }
.inventory-grid { display: flex; gap: 8px; }
.inv-slot { position: relative; width: 56px; height: 62px; background: rgba(255,255,255,0.04); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.inv-slot.empty { opacity: 0.38; }
.inv-slot.has { border-color: rgba(255,162,58,0.5); background: rgba(255,162,58,0.08); }
.inv-icon { font-size: 15px; font-weight: 700; color: var(--amber); }
.inv-slot b { font-family: var(--num); font-size: 14px; }
.inv-slot small { font-size: 9px; color: var(--muted); }

/* 提示 / 警告 */
.prompt { position: absolute; left: 50%; top: calc(50% + 48px); transform: translateX(-50%); padding: 10px 18px; background: rgba(6,10,14,0.86); border: 1px solid var(--line-strong); font-size: 12.5px; letter-spacing: 1px; white-space: nowrap; clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); box-shadow: 0 8px 30px rgba(0,0,0,0.5); }
.prompt b { color: #1a0e02; background: var(--amber); padding: 2px 6px; border-radius: 3px; font-family: var(--num); font-size: 11px; }
.toast { position: absolute; left: 50%; top: 19%; transform: translateX(-50%); padding: 12px 24px; background: rgba(8,13,18,0.9); border: 1px solid var(--line-strong); border-left: 3px solid var(--amber); font-size: 13px; letter-spacing: 1px; animation: toastIn 0.24s ease; box-shadow: 0 12px 36px rgba(0,0,0,0.5); }
.toast.good { border-left-color: var(--good); color: var(--good); }
.toast.bad { border-left-color: var(--danger); color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -10px); } }
.warning { position: absolute; left: 50%; top: 13%; transform: translateX(-50%); padding: 10px 22px; background: rgba(60,10,10,0.82); border: 1px solid var(--danger); color: #ff9c9c; font-size: 13px; letter-spacing: 2px; animation: warn 0.9s ease infinite alternate; }
@keyframes warn { to { box-shadow: 0 0 28px rgba(255,95,95,0.45); } }
.action-hint { position: absolute; left: 50%; bottom: 134px; transform: translateX(-50%); font-family: var(--num); font-size: 11px; letter-spacing: 3px; color: var(--cyan); }

/* 工具栏 */
.toolbar { position: absolute; left: 50%; bottom: 52px; transform: translateX(-50%); display: flex; gap: 8px; padding: 8px; background: rgba(8,12,17,0.8); border: 1px solid var(--line); backdrop-filter: blur(10px); clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px); }
.tool-slot { position: relative; width: 68px; height: 62px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: rgba(255,255,255,0.035); border: 1px solid transparent; transition: 0.16s; }
.tool-slot kbd { position: absolute; top: 3px; left: 4px; font-size: 8px; padding: 1px 4px; }
.tool-ico { font-size: 19px; filter: grayscale(0.5); }
.tool-name { font-size: 10px; color: var(--muted); }
.tool-slot.active { border-color: var(--amber); background: rgba(255,162,58,0.13); }
.tool-slot.active .tool-ico { filter: none; }
.tool-slot.active .tool-name { color: var(--amber); }
.hint-bar { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; gap: 16px; font-size: 10px; color: #778795; }
.hint-bar kbd { font-size: 9px; padding: 2px 5px; }

/* ---------- 暂停 / 结算 ---------- */
.dialog-screen { background: rgba(4,7,11,0.72); }
.dialog { width: min(390px, 92vw); padding: 30px; text-align: center; background: linear-gradient(160deg, rgba(28,37,47,0.96), rgba(9,13,18,0.97)); border: 1px solid var(--line-strong); clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px)); }
.dialog-tag { font-family: var(--num); font-size: 10px; letter-spacing: 5px; color: var(--amber); }
.dialog h2 { margin: 10px 0 6px; font-size: 28px; letter-spacing: 8px; }
.dialog p { color: var(--muted); font-size: 12px; margin: 0 0 22px; }
.dialog button { width: 100%; margin-top: 10px; }

.result-screen { background: radial-gradient(circle at 50% 40%, rgba(26,34,44,0.9), rgba(3,5,8,0.97)); }
.result-card { width: min(640px, 93vw); padding: 30px 34px; background: linear-gradient(155deg, rgba(28,37,47,0.96), rgba(9,13,18,0.98)); border: 1px solid var(--line-strong); clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px)); box-shadow: 0 26px 80px rgba(0,0,0,0.6); }
.result-tag { font-family: var(--num); font-size: 10px; letter-spacing: 5px; color: var(--amber); }
.result-title { font-size: 30px; font-weight: 800; letter-spacing: 8px; margin-top: 6px; }
.result-main { display: flex; gap: 26px; align-items: center; margin: 22px 0 18px; }
.grade-wrap { flex: 0 0 150px; text-align: center; }
.grade { font-family: var(--num); font-size: 92px; font-weight: 800; line-height: 0.95; color: var(--amber); text-shadow: 0 0 40px rgba(255,162,58,0.35); }
.stars { font-size: 20px; letter-spacing: 4px; color: var(--amber); margin-top: 6px; }
.score-list { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.score-row { display: flex; align-items: center; gap: 10px; font-size: 11px; }
.score-row .k { width: 34px; color: var(--muted); }
.score-row .bar { flex: 1; height: 6px; background: rgba(255,255,255,0.08); }
.score-row .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--amber-2), var(--amber)); transition: width 0.8s cubic-bezier(.2,.8,.2,1); }
.score-row .v { width: 28px; text-align: right; font-family: var(--num); font-size: 14px; font-weight: 700; color: var(--amber); }
.result-comment { font-size: 12.5px; line-height: 1.8; color: #b9c6d2; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.name-row { text-align: left; margin-top: 16px; }
.name-row label { display: block; font-size: 11px; letter-spacing: 2px; color: var(--muted); margin-bottom: 8px; }
.name-input-row { display: flex; gap: 8px; }
.name-row input { flex: 1; padding: 10px 12px; border-radius: 0; border: 1px solid var(--line-strong); background: rgba(255,255,255,0.05); color: var(--text); font-family: var(--ui); font-size: 13px; outline: none; }
.name-row input:focus { border-color: var(--amber); }
.suggest { margin-top: 8px; font-size: 10px; color: var(--muted); }
.suggest span { display: inline-block; margin: 3px 6px 0 0; padding: 4px 9px; border: 1px solid var(--line); background: rgba(255,255,255,0.04); cursor: pointer; }
.suggest span:hover { border-color: var(--amber); color: var(--amber); }
.achievement { margin-top: 14px; padding: 11px 14px; border-left: 3px solid var(--amber); background: rgba(255,162,58,0.09); font-size: 12px; color: #ffd39a; }
.result-actions { display: flex; gap: 10px; margin-top: 18px; }
.result-actions .btn-main { flex: 1; }
.result-actions .btn-ghost { flex: 0 0 38%; }

@media (max-width: 820px) {
  .objective { width: 240px; left: 12px; top: 12px; padding: 22px 12px 10px; }
  .telemetry { width: 210px; right: 12px; top: 12px; padding: 22px 10px 10px; }
  .gauge { width: 74px; height: 74px; flex-basis: 74px; }
  .inventory { left: 12px; bottom: 110px; }
  .hud-top-center { display: none; }
  .control-grid { grid-template-columns: repeat(2,1fr); }
  .logo-text h1 { font-size: 42px; }
  .result-main { flex-direction: column; }
}

/* ---------- 菜谱选择 ---------- */
.title-screen { overflow-y: auto; align-items: flex-start; }
.title-wrap { margin: auto; }
.recipe-picker { margin: 0 0 18px; }
.recipe-picker .section-label { margin-bottom: 10px; }
.recipe-picker .section-label em { font-style: normal; font-size: 10px; letter-spacing: 2px; color: var(--muted); }
.recipe-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.recipe-card {
  display: flex; align-items: center; gap: 9px; text-align: left; cursor: pointer;
  padding: 9px 10px; min-height: 54px; color: var(--text); font-family: var(--ui);
  background: linear-gradient(150deg, rgba(26,34,44,0.78), rgba(10,14,19,0.86));
  border: 1px solid var(--line); transition: 0.18s ease;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 0 100%);
}
.recipe-card:hover { border-color: rgba(255,162,58,0.45); transform: translateY(-2px); }
.recipe-card.selected { border-color: rgba(255,162,58,0.7); background: linear-gradient(150deg, rgba(70,46,24,0.72), rgba(18,16,13,0.9)); box-shadow: inset 0 0 22px rgba(255,162,58,0.10); }
.rc-icon {
  flex: none; width: 26px; height: 26px; display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 4px;
  font-size: 12px; font-weight: 700; color: #cfdae4;
}
.recipe-card.selected .rc-icon { border-color: var(--amber); color: var(--amber); }
.rc-body { flex: 1; min-width: 0; }
.rc-body b { display: block; font-size: 12.5px; letter-spacing: 1px; white-space: nowrap; }
.rc-body small { display: block; font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-diff { flex: none; font-size: 9px; letter-spacing: -1px; color: rgba(255,162,58,0.75); }
.recipe-card.done { border-color: rgba(123,227,162,0.35); }
.recipe-card.done .rc-icon { border-color: rgba(123,227,162,0.55); color: var(--good); }
.recipe-card.done .rc-body b::after { content: " ✓"; color: var(--good); font-size: 11px; }

.inv-empty { grid-column: 1 / -1; font-size: 11px; color: var(--muted); letter-spacing: 2px; padding: 6px 2px; }

@media (max-height: 900px) {
  .title-wrap { padding: 8px 0; }
  .logo-mark { width: 62px; height: 62px; font-size: 34px; }
  .logo-text h1 { font-size: 46px; letter-spacing: 12px; }
  .logo-sub { font-size: 11px; margin-top: 4px; }
  .logo-group { margin: 12px 0 4px; gap: 16px; }
  .tagline { margin: 8px 0 16px; font-size: 13px; line-height: 1.7; }
  .section-label { margin-bottom: 8px; }
  .mode-card { min-height: 112px; padding: 14px 18px 12px 70px; }
  .mode-icon { top: 40px; width: 40px; height: 40px; font-size: 19px; }
  .mode-card strong { font-size: 17px; margin: 10px 0 4px; }
  .mode-meta { margin-top: 8px; }
  .mode-cards { margin-bottom: 14px; gap: 12px; }
  .recipe-picker { margin-bottom: 12px; }
  .recipe-card { min-height: 46px; padding: 7px 9px; }
  .noui-toggle { padding: 8px 12px; margin: 0 0 12px; }
  .btn-main { padding: 14px 22px; }
  .control-grid { margin-top: 14px; padding-top: 12px; gap: 7px 12px; }
}

/* ---------- 画面设置 ---------- */
.options-row { display: flex; align-items: stretch; gap: 10px; margin: 0 0 12px; }
.options-row .noui-toggle { flex: 1; margin: 0; }
.gear-btn {
  flex: none; width: 46px; cursor: pointer; font-size: 17px; color: #c9d5df;
  background: rgba(255,255,255,0.04); border: 1px solid var(--line);
  transition: 0.18s;
}
.gear-btn:hover { color: var(--amber); border-color: rgba(255,162,58,0.5); background: rgba(255,162,58,0.08); }

.settings-dialog { width: min(520px, 92vw); }
.title-screen { transition: opacity 0.25s ease; }
.title-screen.dimmed { opacity: 0.12; }
.settings-note { color: var(--muted); font-size: 12px; margin: -6px 0 16px; }
.preset-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 16px; }
.preset {
  cursor: pointer; font-family: var(--ui); color: var(--text); padding: 10px 6px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--line); transition: 0.16s;
  font-size: 13px; letter-spacing: 2px;
}
.preset small { display: block; font-size: 9px; letter-spacing: 0; color: var(--muted); margin-top: 4px; }
.preset:hover { border-color: rgba(255,162,58,0.45); }
.preset.selected { border-color: var(--amber); color: var(--amber); background: rgba(255,162,58,0.1); }
.preset.selected small { color: rgba(255,162,58,0.75); }

.settings-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.setting-row {
  display: flex; align-items: center; gap: 14px; padding: 10px 2px; text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.06); font-size: 12.5px; color: #c8d3dd;
}
.setting-row .sr-k { flex: 1; letter-spacing: 1px; }
.setting-row select {
  font-family: var(--ui); font-size: 12px; color: var(--text); background: rgba(255,255,255,0.06);
  border: 1px solid var(--line-strong); padding: 5px 8px; outline: none;
}
.setting-row input[type="range"] { width: 150px; accent-color: var(--amber); }
.setting-row b { width: 52px; text-align: right; font-family: var(--num); font-size: 11px; color: var(--amber); }
.switch-row { position: relative; }
.switch-row input { display: none; }
.mini-switch {
  position: relative; width: 38px; height: 20px; border-radius: 20px;
  background: rgba(255,255,255,0.13); transition: 0.2s; flex: none;
}
.mini-switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px;
  border-radius: 50%; background: #9aa8b4; transition: 0.2s;
}
.switch-row input:checked + .mini-switch { background: rgba(255,162,58,0.45); }
.switch-row input:checked + .mini-switch::after { left: 21px; background: var(--amber); }
.settings-foot {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--num); font-size: 11px; letter-spacing: 1px; color: var(--muted);
  margin-bottom: 14px;
}
#fps-readout { color: var(--good); }

/* ---------- 触屏操作层 ---------- */
.sr-tip { font-size: 9.5px; color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.touch-ui { position: absolute; inset: 0; z-index: 14; pointer-events: none; touch-action: none; }
.stick-base {
  position: absolute; left: 18px; bottom: 20px; width: 112px; height: 112px;
  border-radius: 50%; border: 1px solid rgba(255,255,255,0.18);
  background: radial-gradient(circle at 50% 50%, rgba(12,18,24,0.5), rgba(12,18,24,0.2));
  backdrop-filter: blur(6px); pointer-events: auto; touch-action: none;
  display: grid; place-items: center;
}
.stick-knob {
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid rgba(255,162,58,0.65);
  background: radial-gradient(circle at 40% 35%, rgba(255,196,120,0.5), rgba(255,140,40,0.18));
  box-shadow: 0 0 18px rgba(255,162,58,0.25);
}
.touch-btns {
  position: absolute; right: 14px; bottom: 20px;
  display: grid; grid-template-columns: repeat(2, 58px); gap: 9px;
  pointer-events: none;
}
.tbtn {
  pointer-events: auto; width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center; gap: 1px; padding: 0;
  font-family: var(--num); font-size: 15px; font-weight: 700; letter-spacing: 1px;
  color: var(--text); background: rgba(10,15,21,0.6);
  border: 1px solid rgba(255,255,255,0.2); backdrop-filter: blur(6px);
  -webkit-tap-highlight-color: transparent; touch-action: none;
}
.tbtn small { font-family: var(--ui); font-size: 8px; font-weight: 400; letter-spacing: 1px; color: var(--muted); }
.tbtn:active { background: rgba(255,162,58,0.26); border-color: rgba(255,162,58,0.8); }
.tbtn.primary { border-color: rgba(255,162,58,0.55); color: var(--amber); }
.tbtn.ghost { font-size: 11px; color: var(--muted); }

/* 触屏设备上的 HUD 重排：信息只留当前一步，操作区让到屏幕下半部 */
body.touch-device .hint-bar,
body.touch-device .toolbar { display: none; }

body.touch-device .objective { left: 8px; top: 8px; width: 202px; padding: 20px 10px 8px; }
body.touch-device .objective-kicker { font-size: 8.5px; letter-spacing: 2px; }
body.touch-device .objective-title { font-size: 15px; letter-spacing: 2px; margin-top: 2px; }
body.touch-device .objective-progress span { font-size: 18px; }
body.touch-device .objective-progress small { font-size: 9px; }
body.touch-device .objective-bar { margin: 7px 0 9px; }
body.touch-device .step-list { gap: 0; }
body.touch-device .step { font-size: 11px; padding: 4px 4px; gap: 7px; }
body.touch-device .step:not(.active) { display: none; }
body.touch-device .objective-foot { font-size: 10px; margin-top: 8px; padding-top: 7px; line-height: 1.4; }

body.touch-device .telemetry { right: 8px; top: 8px; width: 132px; padding: 20px 8px 8px; }
body.touch-device .telemetry-body { gap: 8px; }
body.touch-device .gauge { width: 54px; height: 54px; flex-basis: 54px; }
body.touch-device .gauge-center strong { font-size: 16px; }
body.touch-device .gauge-center small { font-size: 8px; padding-top: 5px; }
body.touch-device .gauge-caption { font-size: 8px; bottom: -4px; letter-spacing: 1px; }
body.touch-device .stat-line { font-size: 9px; padding: 3px 0; }
body.touch-device .stat-v { font-size: 9.5px; max-width: 62px; }
body.touch-device .flame-bars { margin-top: 6px; }

body.touch-device .inventory { left: auto; right: 8px; top: 132px; bottom: auto; width: 132px; padding: 18px 8px 20px; }
body.touch-device .inventory-grid { flex-wrap: wrap; gap: 5px; }
body.touch-device .inv-slot { width: 36px; height: 44px; gap: 1px; }
body.touch-device .inv-icon { font-size: 11px; }
body.touch-device .inv-slot b { font-size: 11px; }
body.touch-device .inv-slot small { font-size: 7.5px; line-height: 1.1; }
body.touch-device .inv-empty { font-size: 9px; padding: 2px; }

body.touch-device .prompt { top: auto; bottom: 152px; font-size: 11.5px; max-width: 92vw; white-space: normal; text-align: center; line-height: 1.5; }
body.touch-device .action-hint { bottom: 196px; font-size: 10px; }
body.touch-device .toast { top: 46%; font-size: 12px; }
body.touch-device .warning { top: 40%; font-size: 11px; }
body.touch-device .hud-top-center { display: none; }
body.touch-device .fx-scanline { opacity: 0.07; }

/* 横屏手机：高度更紧张，进一步压扁面板 */
@media (max-height: 500px) {
  body.touch-device .objective { width: 186px; padding: 18px 9px 6px; }
  body.touch-device .step-list { display: none; }
  body.touch-device .objective-foot { margin-top: 6px; }
  body.touch-device .telemetry { width: 124px; padding: 18px 7px 6px; }
  body.touch-device .inventory { top: 108px; }
  body.touch-device .prompt { bottom: 128px; }
  body.touch-device .stick-base { width: 96px; height: 96px; }
  body.touch-device .tbtn { width: 52px; height: 52px; font-size: 13px; }
  body.touch-device .touch-btns { grid-template-columns: repeat(2, 52px); }
}

/* 触屏设备的按键说明 */
.touch-only { display: none; }
body.touch-device .control-grid:not(.touch-only) { display: none; }
body.touch-device .control-grid.touch-only { display: grid; }
body.touch-device .mode-meta span:last-child { display: none; }

/* 窄屏（手机竖屏）标题页：模式卡与菜谱卡改两列/单列 */
@media (max-width: 620px) {
  .title-wrap { width: 94vw; padding: 14px 0 24px; }
  .mode-cards { grid-template-columns: 1fr; gap: 10px; }
  .mode-card { min-height: 96px; padding: 12px 14px 10px 64px; }
  .mode-icon { top: 34px; width: 36px; height: 36px; font-size: 17px; }
  .mode-card strong { font-size: 16px; margin: 8px 0 3px; }
  .recipe-grid { grid-template-columns: repeat(2, 1fr); }
  .rc-body b { font-size: 12px; }
  .logo-text h1 { font-size: 38px; letter-spacing: 8px; }
  .logo-mark { width: 54px; height: 54px; font-size: 28px; }
  .tagline { font-size: 12px; margin: 6px 0 12px; }
  .control-grid { gap: 6px 10px; }
  .options-row { flex-wrap: wrap; gap: 8px; }
  .noui-toggle { flex: 1 1 auto; }
  .settings-dialog { width: 92vw; }
  .preset-row { grid-template-columns: repeat(3, 1fr); }
  .setting-row input[type="range"] { width: 100px; }
}
body.touch-device .hud-panel { backdrop-filter: blur(8px); }
