/* CTX Aero · 苍穹 — 飞行模拟界面 */
:root {
  --ink: #e8f3f9;
  --muted: #8fa9b8;
  --dim: #5f7683;
  --cyan: #5fd0e8;
  --amber: #ffcf5c;
  --green: #5fe0a0;
  --red: #ff6b5a;
  --panel: rgba(8, 20, 28, 0.74);
  --panel-2: rgba(10, 25, 34, 0.9);
  --line: rgba(95, 208, 232, 0.18);
  --line-2: rgba(95, 208, 232, 0.35);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --mono: "SF Mono", "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
  --sans: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: #050b10;
  color: var(--ink);
  font-family: var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; color: inherit; }
button:disabled { cursor: not-allowed; filter: grayscale(.55); opacity: .58; transform: none !important; }
.hidden { display: none !important; }
[hidden] { display: none !important; }

#app { position: fixed; inset: 0; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#vignette {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 52%, rgba(2, 7, 10, 0.55) 100%);
}
#app.cockpit-view #vignette {
  background: radial-gradient(ellipse at center, transparent 70%, rgba(2, 7, 10, 0.2) 100%);
}

/* 座舱视野的玻璃包边贴合实际可视视口，而不是用三维黑框模拟浏览器边框。 */
.cockpit-glass-edge {
  --glass-edge: clamp(6px, 0.62vw, 12px);
  position: absolute;
  inset:
    max(0px, env(safe-area-inset-top))
    max(0px, env(safe-area-inset-right))
    max(0px, env(safe-area-inset-bottom))
    max(0px, env(safe-area-inset-left));
  z-index: 0;
  border-radius: clamp(8px, 1vw, 16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s ease;
  box-shadow:
    inset 0 0 0 1px rgba(198, 239, 249, .16),
    inset 0 0 24px rgba(3, 9, 14, .46);
}
.cockpit-glass-edge::before,
.cockpit-glass-edge::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}
.cockpit-glass-edge::before {
  padding: var(--glass-edge);
  background:
    linear-gradient(90deg, rgba(174, 228, 241, .18), rgba(123, 185, 206, .035) 24%, transparent 50%, rgba(123, 185, 206, .035) 76%, rgba(174, 228, 241, .16)),
    rgba(6, 18, 25, .06);
  -webkit-backdrop-filter: blur(14px) saturate(138%);
  backdrop-filter: blur(14px) saturate(138%);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
}
.cockpit-glass-edge::after {
  box-shadow:
    inset 0 0 0 1px rgba(209, 243, 250, .1),
    inset 0 0 0 calc(var(--glass-edge) * .42) rgba(126, 194, 214, .035);
}
#hud.cockpit-view .cockpit-glass-edge { opacity: 1; }

/* ---------------- 载入 ---------------- */
#loading {
  position: absolute; inset: 0; z-index: 90;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; background: radial-gradient(circle at 50% 40%, #0d2230, #03080c 70%);
  transition: opacity .5s;
}
#loading.hidden { display: none; }
.spinner {
  width: 46px; height: 46px; border-radius: 50%;
  border: 2px solid rgba(95, 208, 232, 0.16);
  border-top-color: var(--cyan);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-family: var(--mono); font-size: 12px; letter-spacing: .28em; color: var(--muted); text-transform: uppercase; }

/* ---------------- 通用 ---------------- */
.logo { display: flex; align-items: center; gap: 12px; }
.logo-mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(140deg, rgba(95, 208, 232, .95), rgba(31, 84, 140, .85));
  display: grid; place-items: center; color: #04121a;
  box-shadow: 0 8px 24px rgba(95, 208, 232, .28);
}
.logo-mark svg { width: 23px; height: 23px; }
.logo-text strong { display: block; font-size: 15px; letter-spacing: .12em; }
.logo-text span { display: block; font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: .22em; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 11px; cursor: pointer;
  border: 1px solid rgba(140, 190, 210, 0.22);
  background: rgba(12, 30, 40, 0.72);
  font-size: 13px; font-weight: 600; letter-spacing: .02em;
  transition: border-color .18s, background .18s, transform .18s;
}
.button:hover { border-color: var(--line-2); background: rgba(18, 42, 55, 0.85); transform: translateY(-1px); }
.button.primary {
  border: none; color: #04121a;
  background: linear-gradient(120deg, #7fe3f5, #46b9d4 55%, #2c8db5);
  box-shadow: 0 10px 30px rgba(64, 178, 208, .3);
}
.button.primary:hover { filter: brightness(1.06); }
.button.ghost { background: transparent; }
.button.wide { width: 100%; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px; border-radius: 7px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .04em;
  border: 1px solid rgba(120, 170, 190, .2);
  background: rgba(8, 20, 28, .6); color: var(--muted);
}
.chip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--dim); }
.chip.ok { color: var(--green); border-color: rgba(95, 224, 160, .3); }
.chip.ok::before { background: var(--green); box-shadow: 0 0 8px var(--green); }
.chip.warn { color: var(--amber); border-color: rgba(255, 207, 92, .35); }
.chip.warn::before { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.chip.off { color: var(--dim); }
.chip.lock { color: var(--red); border-color: rgba(255, 107, 90, .4); }
.chip.lock::before { background: var(--red); box-shadow: 0 0 10px var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------------- 机库菜单 ---------------- */
#menu {
  position: absolute; inset: 0; z-index: 40;
  display: flex; flex-direction: column;
  background:
    linear-gradient(90deg, rgba(3, 9, 13, .92) 0%, rgba(3, 9, 13, .78) 38%, rgba(3, 9, 13, .28) 72%, rgba(3, 9, 13, .55) 100%),
    radial-gradient(circle at 78% 30%, rgba(95, 208, 232, .08), transparent 55%);
  overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
#menu::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(95, 208, 232, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(95, 208, 232, .045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 30% 40%, black, transparent 78%);
}
.menu-head {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 34px; border-bottom: 1px solid rgba(95, 208, 232, .1);
}
.menu-head .head-actions { display: flex; align-items: center; gap: 10px; }
.menu-head a { color: var(--muted); text-decoration: none; font-size: 12px; letter-spacing: .04em; }
.menu-head a:hover { color: var(--ink); }

.menu-body {
  position: relative; z-index: 2; flex: 1; min-height: 0;
  display: grid; grid-template-columns: minmax(0, 1fr) 372px;
  gap: 30px; padding: 26px 34px 18px;
}
.hangar { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: .3em;
  color: var(--cyan); text-transform: uppercase;
}
.hangar h1 {
  margin-top: 10px; font-size: clamp(30px, 3.4vw, 46px); line-height: 1.05;
  letter-spacing: -.01em; font-weight: 700;
}
.hangar h1 em {
  font-style: normal;
  background: linear-gradient(100deg, #9beaf7, #4ec3dd 45%, #d9f6ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hangar .lede { margin-top: 12px; max-width: 640px; color: var(--muted); font-size: 13.5px; line-height: 1.75; }
.hangar .lede b { color: var(--ink); font-weight: 600; }

.cat-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 14px; }
.tab {
  height: 32px; padding: 0 14px; border-radius: 8px; cursor: pointer;
  border: 1px solid rgba(120, 170, 190, .18);
  background: rgba(9, 22, 30, .6); color: var(--muted);
  font-size: 12.5px; letter-spacing: .03em;
  transition: all .18s;
}
.tab:hover { color: var(--ink); border-color: var(--line-2); }
.tab.active { color: #04121a; background: var(--cyan); border-color: var(--cyan); font-weight: 700; }

.plane-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  grid-auto-rows: max-content; align-content: start;
  gap: 12px; overflow-y: auto; padding: 2px 6px 12px 2px; flex: 1; min-height: 0;
  scrollbar-width: thin; scrollbar-color: rgba(95, 208, 232, .3) transparent;
}
.plane-grid::-webkit-scrollbar { width: 6px; }
.plane-grid::-webkit-scrollbar-thumb { background: rgba(95, 208, 232, .25); border-radius: 9px; }

.plane-card {
  position: relative; text-align: left; cursor: pointer;
  min-height: 128px;
  padding: 13px 14px 12px; border-radius: 13px;
  border: 1px solid rgba(120, 170, 190, .16);
  background: linear-gradient(160deg, rgba(12, 28, 38, .88), rgba(7, 17, 24, .82));
  overflow: hidden; transition: border-color .18s, transform .18s, box-shadow .18s;
}
.plane-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 85% 0%, color-mix(in srgb, var(--accent, #4ec3dd) 22%, transparent), transparent 60%);
  opacity: 0; transition: opacity .2s;
}
.plane-card:hover { transform: translateY(-2px); border-color: rgba(95, 208, 232, .38); }
.plane-card:hover::after { opacity: 1; }
.plane-card.selected {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px rgba(95, 208, 232, .35), 0 14px 34px rgba(0, 0, 0, .35);
}
.plane-art { display: flex; align-items: center; justify-content: space-between; height: 42px; }
.plane-art svg { width: 92px; height: 40px; fill: var(--accent, #7fd8ea); opacity: .92; }
.plane-code { font-family: var(--mono); font-size: 10px; color: var(--dim); letter-spacing: .1em; }
.plane-meta strong { display: block; font-size: 14px; font-weight: 650; letter-spacing: .01em; }
.plane-meta small { display: block; margin-top: 2px; font-family: var(--mono); font-size: 10px; color: var(--dim); }
.plane-spec {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 3px 9px; margin-top: 10px;
  font-family: var(--mono); font-size: 10.5px; color: var(--muted);
  border-top: 1px solid rgba(120, 170, 190, .12); padding-top: 8px;
}

/* 详情面板 */
.detail {
  position: relative; align-self: start;
  display: flex; flex-direction: column;
  /* 按视口夹住卡片高度，窗口再矮也能把内容滚起来、按钮始终可见 */
  max-height: calc(100vh - 190px);
  max-height: calc(100dvh - 190px);
  min-height: 0;
  border-radius: 18px; border: 1px solid var(--line);
  background: linear-gradient(170deg, rgba(11, 26, 36, .92), rgba(5, 13, 18, .9));
  box-shadow: var(--shadow); padding: 22px; overflow: hidden;
}
/* 面板内部滚动：机型信息/航线再长也能滑到「START FLIGHT」 */
.detail-scroll {
  min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch; touch-action: pan-y;
  padding-right: 4px; margin-right: -4px;
  scrollbar-width: thin; scrollbar-color: rgba(95, 208, 232, .3) transparent;
}
.detail-scroll::-webkit-scrollbar { width: 6px; }
.detail-scroll::-webkit-scrollbar-thumb { background: rgba(95, 208, 232, .25); border-radius: 9px; }
.detail::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--cyan), transparent 75%);
}
.detail-top { display: flex; justify-content: space-between; align-items: center; }
.detail-cat { font-family: var(--mono); font-size: 10px; letter-spacing: .18em; color: var(--cyan); text-transform: uppercase; }
.detail h2 { margin-top: 12px; font-size: 25px; letter-spacing: -.01em; }
.detail-en { margin-top: 4px; font-family: var(--mono); font-size: 11px; color: var(--dim); letter-spacing: .04em; }
.detail-maker {
  margin-top: 7px; font-size: 11.5px; color: var(--cyan); line-height: 1.45;
}
.detail p { margin-top: 14px; color: var(--muted); font-size: 12.8px; line-height: 1.7; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.detail-tags span {
  font-family: var(--mono); font-size: 10px; letter-spacing: .04em;
  padding: 4px 8px; border-radius: 6px;
  color: #a9dcea; background: rgba(95, 208, 232, .09);
  border: 1px solid rgba(95, 208, 232, .18);
}
.detail-tags span.hot { color: var(--amber); background: rgba(255, 207, 92, .08); border-color: rgba(255, 207, 92, .25); }
.livery-picker {
  margin-top: 14px; padding: 10px; border-radius: 10px;
  border: 1px solid rgba(120, 180, 205, .14); background: rgba(4, 12, 17, .34);
}
.livery-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  color: var(--dim); font-family: var(--mono); font-size: 9px; letter-spacing: .12em;
}
.livery-head strong { color: var(--ink); font-size: 9px; font-weight: 600; letter-spacing: .03em; }
.livery-choices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.livery-swatch {
  position: relative; width: 42px; height: 28px; padding: 0; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .22); border-radius: 7px;
  background: var(--body, #eee); overflow: hidden;
}
.livery-swatch::before {
  content: ''; position: absolute; left: 0; right: 0; top: 58%; height: 22%;
  background: var(--accent, #246); transform: skewX(-18deg) scaleX(1.2);
}
.livery-swatch::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 20%;
  background: var(--belly, #bbb);
}
.livery-swatch:hover { border-color: var(--cyan); }
.livery-swatch.selected {
  border-color: var(--amber); box-shadow: 0 0 0 2px rgba(255, 207, 92, .18), 0 0 12px rgba(255, 207, 92, .16);
}
.livery-swatch:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.spec-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px;
}
.spec {
  padding: 9px 11px; border-radius: 9px;
  background: rgba(95, 208, 232, .045); border: 1px solid rgba(120, 170, 190, .1);
}
.spec small { display: block; font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; color: var(--dim); }
.spec strong {
  display: block; margin-top: 3px; font-family: var(--mono); font-size: 12px; color: var(--ink);
  font-weight: 600; line-height: 1.35; overflow-wrap: anywhere;
}
.param-note {
  margin-top: 14px !important; padding: 10px 11px; border-radius: 9px;
  border: 1px solid rgba(255, 207, 92, .18); background: rgba(255, 207, 92, .045);
  color: var(--muted) !important; font-size: 10.5px !important; line-height: 1.65 !important;
}
#btnStart {
  flex: 0 0 auto;
  margin-top: 14px; height: 50px; border-radius: 12px; width: 100%;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px;
  padding-left: 20px; text-align: left;
  border: none; cursor: pointer; color: #04121a;
  background: linear-gradient(115deg, #9ceefb, #4ec3dd 52%, #2b8fb3);
  box-shadow: 0 14px 34px rgba(64, 178, 208, .28);
}
#btnStart span { font-size: 14px; font-weight: 700; }
#btnStart small { font-family: var(--mono); font-size: 9.5px; letter-spacing: .22em; opacity: .7; text-transform: uppercase; }
#btnStart:hover { filter: brightness(1.05); }

#groundPrompt {
  position: absolute; z-index: 35; left: 50%; top: 68px; transform: translateX(-50%);
  width: min(500px, calc(100vw - 28px)); padding: 10px 13px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; align-items: center;
  border-radius: 14px; border: 1px solid rgba(255, 207, 92, .34);
  background: linear-gradient(145deg, rgba(14, 29, 37, .96), rgba(5, 14, 20, .94));
  box-shadow: 0 16px 44px rgba(0, 0, 0, .46);
  pointer-events: auto;
  opacity: 1; transition: opacity .22s ease, transform .22s ease;
}
#groundPrompt.fade-out { opacity: 0; transform: translate(-50%, -8px); pointer-events: none; }
#groundPrompt small {
  grid-column: 1; font-family: var(--mono); font-size: 9.5px; letter-spacing: .2em;
  color: var(--amber); text-transform: uppercase;
}
#groundPrompt strong {
  grid-column: 1; font-size: 13px; line-height: 1.55; color: var(--ink); font-weight: 600;
}
#groundPrompt button { grid-column: 2; grid-row: 1 / span 2; min-width: 116px; }

.menu-foot {
  position: relative; z-index: 2;
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding: 12px 34px 16px; font-family: var(--mono); font-size: 10.5px;
  color: var(--dim); border-top: 1px solid rgba(95, 208, 232, .08); letter-spacing: .04em;
}
.menu-foot b { color: var(--muted); font-weight: 600; }

/* ---------------- HUD ---------------- */
#hud { position: absolute; inset: 0; z-index: 20; pointer-events: none; }
.hud-top {
  position: absolute; left: 0; right: 0; top: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px;
}
.hud-brand {
  font-family: var(--mono); font-size: 11px; letter-spacing: .26em; color: rgba(232, 243, 249, .72);
  padding: 7px 11px; border-radius: 8px; background: rgba(4, 12, 17, .45);
  border: 1px solid rgba(95, 208, 232, .16);
}
.hud-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.hud-actions { display: flex; gap: 8px; pointer-events: auto; }
.voice-hud-btn { width: auto; min-width: 52px; padding: 0 10px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; cursor: pointer;
  border: 1px solid rgba(140, 190, 210, .22);
  background: rgba(5, 14, 20, .62); color: var(--muted);
  display: grid; place-items: center; font-family: var(--mono); font-size: 11px;
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); }

/* 自动飞行 MCP：所有按键均接入飞机状态，不做纯装饰按钮 */
.flight-deck {
  position: absolute; top: 62px; left: 50%; transform: translateX(-50%);
  width: min(780px, calc(100% - 32px)); z-index: 21; pointer-events: auto;
  padding: 9px 11px 10px; border-radius: 13px;
  border: 1px solid rgba(95, 208, 232, .28);
  background: linear-gradient(180deg, rgba(10, 25, 34, .9), rgba(4, 12, 17, .88));
  box-shadow: 0 14px 38px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255, 255, 255, .04);
  backdrop-filter: blur(18px) saturate(1.15);
}
#hud.ground-active .flight-deck { display: none; }
.flight-deck-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 7px; font-family: var(--mono); font-size: 10px; letter-spacing: .16em;
  color: var(--dim);
}
.flight-deck-head strong { color: var(--cyan); font-size: 9px; font-weight: 700; }
.flight-deck-targets {
  display: grid; grid-template-columns: 1.15fr repeat(4, minmax(0, 1fr)); gap: 6px;
}
.fd-module {
  min-width: 0; padding: 6px; border-radius: 9px;
  border: 1px solid rgba(120, 180, 205, .14); background: rgba(255, 255, 255, .025);
}
.fd-power { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.fd-key, .fd-mode, .fd-system, .fd-selector button {
  min-height: 28px; border-radius: 6px; cursor: pointer;
  border: 1px solid rgba(140, 190, 210, .24);
  background: rgba(7, 18, 25, .78); color: var(--muted);
  font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .045em;
  transition: color .12s ease, border-color .12s ease, background .12s ease, box-shadow .12s ease;
}
.fd-key:hover, .fd-mode:hover, .fd-system:hover, .fd-selector button:hover {
  color: var(--ink); border-color: rgba(95, 208, 232, .52);
}
.fd-key.active, .fd-mode.active, .fd-system.active {
  color: #071016; border-color: #7ce4c0;
  background: #7ce4c0; box-shadow: 0 0 15px rgba(124, 228, 192, .22);
}
.fd-key.warn, .fd-system.warn { color: #1b1200; border-color: var(--amber); background: var(--amber); }
.fd-mode { width: 100%; min-height: 25px; }
.fd-selector {
  display: grid; grid-template-columns: 25px minmax(0, 1fr) 25px; align-items: center;
  gap: 2px; margin-top: 4px;
}
.fd-selector button { min-height: 24px; padding: 0; font-size: 14px; line-height: 1; }
.fd-selector output {
  min-width: 0; padding: 3px 2px; color: #eaf8ff; text-align: center;
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  border-radius: 4px; background: rgba(0, 0, 0, .34);
  font-variant-numeric: tabular-nums;
}
.fd-label {
  display: block; margin: 1px 0 5px; color: var(--dim);
  font-family: var(--mono); font-size: 9px; letter-spacing: .12em;
}
.flight-deck-systems {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 7px;
  padding-top: 7px; border-top: 1px solid rgba(120, 180, 205, .12);
}
.flight-deck-systems .fd-label { margin: 0 2px 0 0; white-space: nowrap; }
.fd-system { min-height: 25px; padding: 0 10px; }
.fd-brake.active, .fd-brake:active {
  color: #2b1006; border-color: #ff9d6b; background: #ff9d6b;
}
#fdReverse.active {
  color: #2b1006; border-color: #ffcf5c; background: #ffcf5c;
  box-shadow: 0 0 14px rgba(255, 207, 92, .22);
}
#fdConfig {
  flex: 1 1 260px; min-width: 0; margin-left: auto; color: var(--muted);
  font-family: var(--mono); font-size: 9.5px; text-align: right;
  white-space: normal; overflow-wrap: anywhere;
}

/* 驾驶舱中央台：只在座舱视角显示。仪表显示仍是实际飞行数据。 */
.cockpit-deck { display: none; }
#hud.cockpit-view .cockpit-deck {
  display: grid; grid-template-rows: auto 1fr;
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  min-height: 184px; padding: 10px 24px 12px; pointer-events: auto;
  border-top: 1px solid rgba(95, 208, 232, .16);
  background:
    radial-gradient(90% 80% at 50% 0%, rgba(38, 61, 72, .55), transparent 68%),
    linear-gradient(180deg, rgba(9, 18, 24, .86), rgba(2, 7, 10, .97));
  box-shadow: 0 -18px 50px rgba(0, 0, 0, .42);
}
.cockpit-3d-hint {
  display: none; position: absolute; left: 50%; bottom: 118px; transform: translateX(-50%);
  z-index: 5; padding: 6px 10px; border-radius: 7px; pointer-events: none;
  color: rgba(210, 232, 240, .68); background: rgba(3, 10, 14, .54);
  border: 1px solid rgba(95, 208, 232, .14); backdrop-filter: blur(8px);
  font-family: var(--mono); font-size: 9px; letter-spacing: .08em; white-space: nowrap;
}
#hud.cockpit-view .cockpit-3d-hint { display: block; }
#hud.cockpit-view .pfd-wrap,
#hud.cockpit-view .nd-wrap { display: none; }
#hud.cockpit-view .readouts { display: none; }
#hud.cockpit-view .route-panel { display: none; }
#hud.cockpit-view .flight-deck { display: none; }
#hud.cockpit-view .cockpit-deck { display: none; }
#hud.ground-active .cockpit-deck { display: none; }
.ck-deck-top {
  min-height: 34px; display: flex; align-items: center; gap: 14px;
  padding-bottom: 8px; border-bottom: 1px solid rgba(120, 180, 205, .12);
}
.ck-panel-title {
  color: var(--dim); font-family: var(--mono); font-size: 10px;
  letter-spacing: .13em; white-space: nowrap;
}
.ck-switches, .ck-system-grid { display: flex; flex-wrap: wrap; gap: 5px; }
.ck-switch {
  min-height: 25px; padding: 0 9px; border-radius: 5px; cursor: pointer;
  color: var(--muted); border: 1px solid rgba(140, 190, 210, .22);
  background: linear-gradient(180deg, rgba(31, 43, 51, .9), rgba(8, 14, 18, .95));
  font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .045em;
}
.ck-switch:hover { color: var(--ink); border-color: rgba(95, 208, 232, .5); }
.ck-switch.active {
  color: #061116; border-color: #7ce4c0;
  background: linear-gradient(180deg, #92f0ce, #55bfa0);
  box-shadow: 0 0 12px rgba(124, 228, 192, .2);
}
.ck-switch.warn { color: #1a1000; border-color: var(--amber); background: var(--amber); }
.ck-hold.active { color: #2a1005; border-color: #ff9d6b; background: #ff9d6b; }
#ckReverse.active {
  color: #2a1005; border-color: #ffcf5c; background: #ffcf5c;
  box-shadow: 0 0 12px rgba(255, 207, 92, .2);
}
#ckStatus {
  margin-left: auto; color: var(--cyan); font-family: var(--mono);
  font-size: 9px; letter-spacing: .06em; white-space: nowrap;
}
.ck-deck-main {
  display: grid; grid-template-columns: 250px minmax(300px, 1fr) 270px;
  align-items: stretch; gap: 18px; padding-top: 10px;
}
.throttle-console {
  display: grid; grid-template-rows: auto 1fr; min-height: 118px; padding: 10px 12px;
  border-radius: 10px; border: 1px solid rgba(140, 190, 210, .16);
  background: rgba(3, 9, 13, .62);
}
.throttle-heading { display: flex; justify-content: space-between; align-items: center; }
.throttle-heading span, .ck-gauges small { color: var(--dim); font-family: var(--mono); font-size: 9px; letter-spacing: .1em; }
#ckThrottleValue { color: var(--amber); font-family: var(--mono); font-size: 12px; font-weight: 700; }
.throttle-rail-wrap { display: grid; grid-template-columns: 30px 1fr; gap: 6px; margin-top: 7px; min-height: 90px; }
.throttle-scale { display: flex; flex-direction: column; justify-content: space-between; padding: 2px 0; color: var(--dim); font-family: var(--mono); font-size: 7px; }
.throttle-rail {
  position: relative; display: flex; align-items: flex-end; justify-content: space-around; gap: 8px;
  min-height: 90px; padding: 0 9px 5px; border-radius: 7px;
  border: 1px solid rgba(120, 180, 205, .16);
  background:
    linear-gradient(90deg, transparent 49%, rgba(120, 180, 205, .16) 50%, transparent 51%),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, .04) 0 1px, transparent 1px 16px),
    rgba(0, 0, 0, .38);
  touch-action: none;
}
.throttle-lever {
  position: relative; flex: 1 1 28px; max-width: 46px; height: 72px;
  border-radius: 3px; background: linear-gradient(90deg, rgba(20, 30, 37, .2), rgba(85, 101, 111, .45), rgba(18, 26, 32, .25));
  box-shadow: inset 0 -12px 18px rgba(0, 0, 0, .35);
}
.throttle-lever::before {
  content: ''; position: absolute; left: 50%; top: 2px; bottom: 2px; width: 2px;
  transform: translateX(-50%); background: rgba(185, 214, 226, .35);
}
.throttle-handle {
  position: absolute; left: 50%; bottom: calc(var(--thr, 0) * 100%);
  width: 34px; height: 18px; padding: 0; transform: translate(-50%, 50%);
  border-radius: 5px 5px 7px 7px; cursor: ns-resize; touch-action: none;
  border: 1px solid rgba(220, 230, 235, .54);
  background: linear-gradient(180deg, #c7d0d5, #4d5a61 48%, #161e23 52%, #2f393f);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .32);
}
.throttle-handle::after {
  content: ''; position: absolute; inset: 5px 7px auto; height: 2px;
  background: rgba(255, 255, 255, .42); border-radius: 2px;
}
.pedestal-center {
  min-width: 0; display: grid; grid-template-rows: auto auto 1fr; gap: 8px;
  padding: 10px 12px; border-radius: 10px;
  border: 1px solid rgba(140, 190, 210, .14); background: rgba(3, 9, 13, .54);
}
.ck-system-grid { align-content: start; }
.ck-gauges {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; align-self: end;
}
.ck-gauges div {
  min-width: 0; padding: 6px 7px; border-radius: 6px;
  border: 1px solid rgba(120, 180, 205, .12); background: rgba(0, 0, 0, .28);
}
.ck-gauges small { display: block; }
.ck-gauges strong {
  display: block; margin-top: 3px; color: #dff8ff; font-family: var(--mono);
  font-size: 10px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.pfd-wrap { position: absolute; left: 18px; bottom: 18px; width: 400px; max-width: 42vw; }
.pfd-wrap canvas { width: 100%; height: auto; display: block; }
.nd-wrap {
  position: absolute; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px;
  align-items: flex-end;
}
.nd-wrap canvas { width: 300px; max-width: 30vw; height: auto; display: block; }
.eng-panel {
  width: 300px; max-width: 30vw; padding: 9px 12px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--panel);
  display: grid; gap: 6px;
}
.eng-row { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 10px; color: var(--muted); }
.eng-bar { flex: 1; height: 6px; border-radius: 4px; background: rgba(95, 208, 232, .1); overflow: hidden; }
.eng-bar i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, #49b6d0, #8ce9f8); transition: width .1s linear; }
.readouts {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: flex; gap: 4px; padding: 8px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel);
  backdrop-filter: blur(14px);
}
.readout { padding: 0 12px; text-align: center; border-right: 1px solid rgba(120, 170, 190, .12); }
.readout:last-child { border-right: none; }
.readout small { display: block; font-family: var(--mono); font-size: 9px; letter-spacing: .14em; color: var(--dim); }
.readout strong { display: block; margin-top: 3px; font-family: var(--mono); font-size: 13px; color: var(--ink); }
.readout strong.amber { color: var(--amber); }
.readout strong.cyan { color: var(--cyan); }

/* 左下角航线卡 */
.route-panel {
  position: absolute; left: 18px; bottom: 430px; width: 400px; max-width: 42vw;
  padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(11, 26, 36, .9), rgba(5, 13, 18, .82));
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .38);
}
.route-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.route-title small { display: block; font-family: var(--mono); font-size: 9px; letter-spacing: .18em; color: var(--dim); }
.route-title strong { display: block; margin-top: 3px; font-size: 15px; letter-spacing: .01em; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route-brg { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 48px; }
#routeArrow {
  display: block; font-style: normal; font-size: 17px; line-height: 1;
  color: var(--cyan); transform-origin: 50% 50%;
  transition: transform .1s linear;
  text-shadow: 0 0 9px rgba(95, 208, 232, .85);
}
#routeBrg { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.route-dest { margin-top: 7px; display: flex; align-items: baseline; gap: 8px; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.route-dest b { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: var(--cyan); }
.route-dest span { overflow: hidden; text-overflow: ellipsis; }
.route-track { position: relative; height: 22px; margin-top: 6px; }
.rt-line { position: absolute; left: 4px; right: 4px; top: 50%; height: 1px; background: linear-gradient(90deg, rgba(95, 208, 232, .55), rgba(95, 208, 232, .16)); }
.rt-dot { position: absolute; top: 50%; width: 7px; height: 7px; border-radius: 50%; transform: translateY(-50%); background: rgba(95, 208, 232, .45); }
.rt-dot.from { left: 1px; }
.rt-dot.to { right: 1px; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.rt-plane {
  position: absolute; top: 50%; left: 50%; width: 0; height: 0; display: block;
  transform: translate(-50%, -50%);
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-bottom: 9px solid var(--amber);
  filter: drop-shadow(0 0 5px rgba(255, 207, 92, .85));
  transition: left .12s linear;
}
.route-meta { margin-top: 7px; display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.route-meta #routeDist { color: var(--ink); font-weight: 600; }
.route-meta .chip { margin-left: auto; }
.chip.live { color: var(--cyan); border-color: rgba(95, 208, 232, .42); }
.chip.live::before { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); animation: pulse 1.4s infinite; }

/* 航线入口：机库内一条窄栏，点击弹出选择窗，不挤占机型网格 */
.route-bar {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
  width: 100%; margin: 0 0 12px; padding: 8px 12px; border-radius: 11px;
  border: 1px solid var(--line); background: rgba(9, 22, 30, .62);
  color: var(--ink); text-align: left; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.route-bar:hover { border-color: var(--line-2); background: rgba(95, 208, 232, .08); }
.rb-tag {
  flex: none; padding: 3px 6px; border-radius: 5px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em;
  color: #04121a; background: var(--cyan);
}
.rb-main { min-width: 0; }
.rb-main b {
  display: block; font-size: 12px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rb-main small {
  display: block; margin-top: 1px; font-family: var(--mono); font-size: 9.5px; color: var(--dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rb-change { margin-left: auto; flex: none; font-family: var(--mono); font-size: 10.5px; color: var(--cyan); }

/* 航线选择弹窗：地图两次点击选择起降机场 */
.route-modal-card {
  width: min(820px, 96vw); max-height: 90vh; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: rgba(95, 208, 232, .35) rgba(3, 10, 14, .45);
}
.route-modal-card::-webkit-scrollbar,
.route-list::-webkit-scrollbar { width: 6px; height: 6px; }
.route-modal-card::-webkit-scrollbar-track,
.route-list::-webkit-scrollbar-track { background: rgba(3, 10, 14, .45); border-radius: 8px; }
.route-modal-card::-webkit-scrollbar-thumb,
.route-list::-webkit-scrollbar-thumb {
  background: rgba(95, 208, 232, .32); border-radius: 8px;
}
.route-map-shell {
  position: relative; margin-top: 15px; border-radius: 14px; overflow: hidden;
  border: 1px solid rgba(95, 208, 232, .24);
  background: #071923;
  box-shadow: inset 0 0 35px rgba(0, 0, 0, .35);
}
#routeMap {
  display: block; width: 100%; height: auto; aspect-ratio: 760 / 430;
  cursor: crosshair; touch-action: manipulation;
}
.route-map-legend {
  position: absolute; left: 12px; top: 12px; display: flex; align-items: center; gap: 9px;
  padding: 6px 9px; border-radius: 8px; pointer-events: none;
  background: rgba(3, 12, 17, .72); border: 1px solid rgba(120, 180, 205, .16);
  color: var(--dim); font-family: var(--mono); font-size: 9px;
}
.route-map-legend span { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.route-map-legend span::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan);
}
.route-map-legend .legend-end::before { background: var(--amber); }
.route-map-legend i { font-style: normal; padding-left: 3px; border-left: 1px solid rgba(120, 180, 205, .16); }
.route-pick-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch; gap: 9px; margin-top: 10px;
}
.route-pick-box {
  min-width: 0; padding: 9px 11px; border-radius: 9px;
  border: 1px solid rgba(120, 170, 190, .14); background: rgba(95, 208, 232, .04);
}
.route-pick-box small {
  display: block; color: var(--dim); font-family: var(--mono);
  font-size: 8.5px; letter-spacing: .13em;
}
.route-pick-box strong {
  display: block; margin-top: 3px; font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.route-pick-arrow { display: grid; place-items: center; color: var(--amber); font-size: 20px; }
.route-plan-estimate {
  display: flex; align-items: center; flex-wrap: wrap; gap: 7px 14px;
  margin-top: 9px; padding: 9px 11px; border-radius: 9px;
  border: 1px solid rgba(255, 207, 92, .18); background: rgba(255, 207, 92, .045);
  color: var(--muted); font-family: var(--mono); font-size: 10px; line-height: 1.5;
}
.route-plan-estimate strong { color: var(--amber); font-size: 13px; }
.route-plan-estimate small { margin-left: auto; color: var(--dim); }
.route-list-heading {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 16px; color: var(--muted); font-size: 11px; font-weight: 600;
}
.route-list-heading small { color: var(--dim); font-family: var(--mono); font-size: 9px; }
.route-list {
  margin-top: 8px; display: grid; gap: 8px; max-height: 220px; overflow-y: auto; padding-right: 3px;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
}
.route-option {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 11px; border-radius: 9px; cursor: pointer; text-align: left;
  color: var(--ink); background: rgba(95, 208, 232, .04);
  border: 1px solid rgba(120, 170, 190, .13);
  transition: background .15s, border-color .15s;
}
.route-option:hover { background: rgba(95, 208, 232, .08); border-color: var(--line-2); }
.route-option.selected { background: rgba(95, 208, 232, .13); border-color: rgba(95, 208, 232, .55); box-shadow: inset 0 0 0 1px rgba(95, 208, 232, .16); }
.ro-main b { display: block; font-size: 12px; font-weight: 600; letter-spacing: .01em; white-space: nowrap; }
.ro-main small { display: block; margin-top: 1px; font-size: 10px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ro-side { text-align: right; flex: none; }
.ro-side em { display: block; font-style: normal; font-family: var(--mono); font-size: 10.5px; color: var(--cyan); }
.ro-side i { display: block; margin-top: 2px; font-family: var(--mono); font-size: 9px; font-style: normal; color: var(--dim); }

#toast {
  position: absolute; left: 50%; bottom: 108px; transform: translate(-50%, 10px);
  padding: 9px 16px; border-radius: 9px; opacity: 0; pointer-events: none;
  background: rgba(5, 14, 20, .82); border: 1px solid var(--line-2);
  color: var(--ink); font-size: 12.5px; letter-spacing: .02em;
  transition: opacity .2s, transform .2s; white-space: nowrap;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 触屏 */
.touch-ui { display: none; }
@media (hover: none) and (pointer: coarse) {
  .touch-ui { display: block; position: absolute; inset: 0; z-index: 8; pointer-events: none; }
  .stick {
    position: absolute; left: 24px; bottom: 120px; width: 132px; height: 132px;
    border-radius: 50%; border: 1px solid rgba(95, 208, 232, .3);
    background: rgba(8, 20, 28, .45); pointer-events: auto;
  }
  .stick-knob {
    position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px;
    border-radius: 50%; background: rgba(95, 208, 232, .55);
    box-shadow: 0 0 20px rgba(95, 208, 232, .35); transition: transform .06s;
  }
  .touch-btns { position: absolute; right: 18px; bottom: 220px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; pointer-events: auto; }
  .touch-btns button {
    width: 62px; height: 40px; border-radius: 10px; font-size: 11px;
    background: rgba(8, 20, 28, .62); border: 1px solid rgba(120, 170, 190, .25); color: var(--ink);
  }
  #hud.cockpit-view .cockpit-deck { max-height: 210px; }
  #hud.cockpit-view .cockpit-3d-hint { display: none; }
  #hud.cockpit-view .stick { bottom: 224px; }
  #hud.cockpit-view .touch-btns { bottom: 326px; }
  .pfd-wrap { display: none; }
  .route-panel { display: none; }
  .nd-wrap { display: none; }
  .readouts { bottom: auto; top: 58px; padding: 6px 8px; }
  .readout { padding: 0 7px; }
  .readout:nth-child(n+5) { display: none; }
  #groundPrompt { top: 104px; bottom: auto; width: min(360px, calc(100vw - 24px)); padding: 9px 11px; grid-template-columns: minmax(0, 1fr); }
  #groundPrompt button { grid-column: 1; grid-row: auto; width: 100%; margin-top: 5px; }
  #hud.ground-active .route-panel { display: none; }
  #toast { bottom: 286px; }
}

/* 精确指针设备使用场景内的三维仪表台，触屏保留下方的大按钮作为无障碍备用。 */
@media (hover: hover) and (pointer: fine) {
  #hud.cockpit-view .cockpit-deck { display: none; }
  #hud.cockpit-view .pfd-wrap,
  #hud.cockpit-view .nd-wrap,
  #hud.cockpit-view .route-panel { display: none; }
}

/* 桌面座舱只保留机头前方的三维操纵台和顶部紧凑 MCP。
 * 浏览器有时无法正确上报 hover/pointer 能力，宽屏下仍强制隐藏底部大面板。 */
@media (min-width: 900px) {
  #hud.cockpit-view .cockpit-deck { display: none; }
}

/* ---------------- 弹窗 ---------------- */
.modal {
  position: absolute; inset: 0; z-index: 60; display: grid; place-items: center;
  background: rgba(2, 8, 12, .62); backdrop-filter: blur(6px);
}
.modal-card {
  width: min(480px, 92vw); border-radius: 18px; padding: 26px;
  border: 1px solid var(--line-2);
  background: linear-gradient(170deg, rgba(13, 30, 40, .96), rgba(5, 13, 18, .96));
  box-shadow: var(--shadow);
}
.modal-card .eyebrow { color: var(--amber); }
.modal-card h2 { margin-top: 10px; font-size: 23px; }
.modal-card p { margin-top: 10px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.modal-actions { display: flex; gap: 9px; margin-top: 20px; }
.modal-actions .button { flex: 1; }
.modal-actions .button.primary { flex: 1.3; }

#crashStats { margin-top: 12px; font-family: var(--mono); font-size: 11px; color: var(--dim); line-height: 1.8; }

.landing-card { width: min(420px, 92vw); }

/* ---------------- 飞行完成证书 ---------------- */
.complete-card {
  width: min(470px, 92vw); position: relative; overflow: hidden;
  border: 1px solid rgba(255, 207, 92, .45);
  background:
    radial-gradient(120% 90% at 50% -20%, rgba(255, 207, 92, .16), transparent 62%),
    linear-gradient(170deg, rgba(20, 32, 30, .98), rgba(6, 14, 18, .98));
  box-shadow: 0 26px 70px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 207, 92, .12);
  text-align: center;
}
.complete-card::before {
  content: ''; position: absolute; inset: 10px; border-radius: 12px;
  border: 1px dashed rgba(255, 207, 92, .28); pointer-events: none;
}
.complete-seal {
  width: 74px; height: 74px; margin: 0 auto 14px; border-radius: 50%;
  display: grid; place-items: center; font-size: 30px; color: #241a02;
  background: linear-gradient(145deg, #ffe9a3, #e0b23c 65%, #b98d1f);
  box-shadow: 0 10px 28px rgba(224, 178, 60, .32), inset 0 -2px 6px rgba(0, 0, 0, .25);
}
.complete-card .eyebrow { display: block; color: var(--amber); letter-spacing: .3em; }
.complete-card h2 { margin-top: 8px; font-size: 25px; letter-spacing: .02em; }
.complete-route {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin-top: 12px; font-family: var(--mono); font-size: 20px; font-weight: 700; color: var(--cyan);
}
.complete-route i { font-style: normal; color: var(--amber); font-size: 16px; }
.complete-cert {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px;
  text-align: left;
}
.complete-cert div {
  padding: 10px 11px; border-radius: 9px;
  background: rgba(255, 207, 92, .05);
  border: 1px solid rgba(255, 207, 92, .14);
}
.complete-cert small { display: block; font-family: var(--mono); font-size: 9px; letter-spacing: .1em; color: var(--dim); }
.complete-cert strong { display: block; margin-top: 4px; font-family: var(--mono); font-size: 14px; color: var(--ink); }
.complete-note { margin-top: 16px !important; font-size: 11.5px !important; color: var(--dim) !important; letter-spacing: .04em; }

.grade-row { display: flex; align-items: center; gap: 20px; margin-top: 6px; }
.grade {
  width: 92px; height: 92px; border-radius: 20px; display: grid; place-items: center;
  font-size: 46px; font-weight: 800; letter-spacing: -.02em;
  color: #04121a; background: linear-gradient(140deg, #f8e9a8, var(--amber));
  box-shadow: 0 12px 34px rgba(255, 207, 92, .24);
}
.grade-meta strong { display: block; font-family: var(--mono); font-size: 18px; }
.grade-meta small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.land-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 16px; }
.land-stats div { padding: 9px; border-radius: 8px; background: rgba(95, 208, 232, .05); border: 1px solid rgba(120, 170, 190, .1); text-align: center; }
.land-stats small { display: block; font-family: var(--mono); font-size: 9px; color: var(--dim); letter-spacing: .1em; }
.land-stats strong { display: block; margin-top: 3px; font-family: var(--mono); font-size: 12px; }

.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; margin-top: 16px; }
.help-grid div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid rgba(120, 170, 190, .1); font-size: 12px; color: var(--muted); }
.help-grid b { font-family: var(--mono); font-size: 10.5px; color: var(--cyan); font-weight: 600; letter-spacing: .04em; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1100px) {
  .menu-body { grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; padding: 20px 24px; }
  .plane-grid { grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); }
  .flight-deck { width: min(720px, calc(100% - 20px)); }
  .flight-deck-targets { grid-template-columns: 1.1fr repeat(3, minmax(0, 1fr)); }
  .ck-deck-main { grid-template-columns: 220px minmax(250px, 1fr) 220px; gap: 10px; }
  .ck-gauges { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  #menu { overflow-y: auto; }
  .menu-body { display: flex; flex-direction: column; gap: 18px; flex: 1 0 auto; }
  .detail { order: -1; position: static; max-height: none; }
  .detail-scroll { overflow: visible; padding-right: 0; margin-right: 0; }
  .detail #detailDesc { display: none; }
  .plane-grid { max-height: none; overflow: visible; }
  .hangar h1 { font-size: 30px; }
  .menu-head { flex-wrap: wrap; row-gap: 10px; padding: 16px 20px; }
  .menu-head .head-actions { flex-wrap: wrap; row-gap: 8px; }
  .button, .menu-head a { white-space: nowrap; flex: 0 0 auto; }
  .logo-text span { display: none; }
  .menu-foot { padding: 12px 20px; }
  .hud-chips { display: none; }
  .pfd-wrap { width: 240px; left: 10px; bottom: 10px; }
  .route-panel { left: 10px; bottom: 258px; width: 240px; padding: 10px 11px; }
  .route-title strong { font-size: 12.5px; }
  .route-dest { display: none; }
  .route-meta { font-size: 9.5px; gap: 6px; }
  .route-meta .chip { display: none; }
  .nd-wrap { right: 10px; bottom: 10px; }
  .nd-wrap canvas { width: 190px; max-width: 34vw; }
  .eng-panel { width: 190px; }
  .readouts { bottom: 8px; }
  .readout:nth-child(n+6) { display: none; }
  .help-grid { grid-template-columns: 1fr; }
  .flight-deck { top: 58px; }
  .flight-deck-targets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cockpit-deck { padding: 8px 12px; }
  .ck-deck-main { grid-template-columns: 190px minmax(220px, 1fr); }
  .ck-gauges { display: none; }
}
@media (max-width: 720px) {
  .nd-wrap, .eng-panel { display: none; }
  .pfd-wrap { width: 176px; }
  .route-panel { display: none; }
  .hud-top { flex-wrap: wrap; gap: 6px; }
  .flight-deck { max-height: 42vh; overflow-y: auto; }
  .flight-deck-targets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flight-deck-systems { flex-wrap: wrap; }
  #fdConfig { width: 100%; margin-left: 0; }
  .ck-deck-top { flex-wrap: wrap; }
  #ckStatus { width: 100%; margin-left: 0; }
  .ck-deck-main { grid-template-columns: 1fr; gap: 7px; }
  .throttle-console { min-height: 108px; }
  .pedestal-center { padding: 8px; }
  .ck-gauges { display: grid; }
}
@media (max-width: 560px) {
  .menu-head .head-actions a { display: none; }
  .detail h2 { font-size: 21px; }
  .spec-grid { grid-template-columns: 1fr 1fr; }
  .plane-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .plane-card { padding: 10px; }
  .plane-art svg { width: 64px; height: 30px; }
  .plane-meta strong { font-size: 12.5px; }
  .plane-spec { font-size: 9px; }
  .pfd-wrap { display: none; }
  .nd-wrap { display: none; }
  .readouts { left: 10px; right: 10px; transform: none; justify-content: space-between; }
  #toast { bottom: 86px; font-size: 11.5px; white-space: normal; text-align: center; max-width: 86vw; }
  #groundPrompt { top: 300px; bottom: auto; }
  .flight-deck { top: 50px; padding: 7px; }
  .fd-power { grid-column: 1 / -1; }
  .cockpit-deck { min-height: 190px; max-height: 45vh; overflow-y: auto; }
  .ck-system-grid { justify-content: center; }
  .ck-gauges { display: none; }
  .route-map-legend i { display: none; }
  .route-pick-row { grid-template-columns: 1fr; }
  .route-pick-arrow { transform: rotate(90deg); height: 16px; }
  .route-plan-estimate small { width: 100%; margin-left: 0; }
  .route-modal-card { padding: 18px 14px; }
  .route-list { grid-template-columns: 1fr; max-height: 190px; }
}
/* 矮窗口：整页可滚动，机型网格不被压扁 */
@media (min-width: 861px) and (max-height: 700px) {
  .menu-body { flex: 0 0 auto; align-items: start; }
  .plane-grid { flex: 0 0 auto; max-height: 44vh; }
  .detail { max-height: none; }
}
@media (min-width: 861px) and (max-height: 760px) {
  .flight-deck { transform: translateX(-50%) scale(.92); transform-origin: top center; }
  .route-panel { display: none; }
}

/* 触屏设备保留精简航线卡，避免飞行时完全失去目的地方位与自动着陆状态 */
@media (hover: none) and (pointer: coarse) {
  .readouts { top: 252px; }
  #groundPrompt { top: 300px; }
  .route-panel {
    display: block; left: auto; right: 12px; top: 300px; bottom: auto;
    width: 218px; max-width: 54vw; padding: 8px 10px;
  }
  .route-panel .route-dest,
  .route-panel .route-track { display: none; }
  .route-panel .route-title strong { font-size: 11.5px; }
  .route-panel .route-meta { margin-top: 4px; flex-wrap: wrap; }
  .route-panel .route-meta .chip { display: inline-flex; }
}
