:root { --c: #5ff2ff; --c2: #ffb347; --bg: rgba(4, 14, 24, .72); --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; color: #dff; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
button { font: inherit; color: var(--c); background: rgba(95, 242, 255, .08); border: 1px solid rgba(95, 242, 255, .5); padding: 8px 16px; cursor: pointer; letter-spacing: 1px; }
button:hover { background: rgba(95, 242, 255, .2); }
button.primary { background: var(--c); color: #001; font-weight: 700; }
input { font: 15px var(--mono); color: #fff; background: rgba(0, 0, 0, .5); border: 1px solid rgba(95, 242, 255, .5); padding: 10px 12px; width: 100%; outline: none; }

/* 启动页 */
#boot { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, #0b1e33 0%, #02050a 70%); z-index: 50; transition: opacity 1s; }
#boot.hide { opacity: 0; pointer-events: none; }
.boot-inner { width: min(640px, 92vw); text-align: center; position: relative; }
.boot-inner h1 { font-size: 64px; letter-spacing: 18px; margin: 0 0 8px; color: #fff; text-shadow: 0 0 30px var(--c); }
.boot-inner h1 small { display: block; font-size: 13px; letter-spacing: 6px; color: var(--c); font-weight: 400; margin-top: 6px; }
.lead { color: #9bc; line-height: 1.8; }
.addr-row { margin: 22px 0 12px; }
.btn-row { display: flex; gap: 10px; justify-content: center; }
#boot-msg { min-height: 22px; margin-top: 10px; color: var(--c2); font-size: 13px; }
#preview { font: 12px/1.7 var(--mono); color: #8ab; text-align: left; margin: 8px auto 0; max-width: 520px; white-space: pre-wrap; }
.keys { color: #567; font-size: 12px; margin-top: 26px; }
.ring { position: absolute; left: 50%; top: -150px; width: 220px; height: 220px; margin-left: -110px; border-radius: 50%; border: 10px solid rgba(95, 242, 255, .15); box-shadow: 0 0 60px rgba(95, 242, 255, .25) inset; animation: spin 30s linear infinite; z-index: -1; }
.ring2 { position: absolute; inset: 18px; border-radius: 50%; border: 2px dashed rgba(95, 242, 255, .35); animation: spin 12s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }

/* HUD */
#hud {
  --hud-margin: 16px; --hud-gap: 8px; --hud-surface: rgba(6, 18, 28, .86);
  --hud-line: #9ec3d45c; --hud-side: clamp(200px, 21vw, 300px);
  position: fixed; inset: 0; pointer-events: none; font-family: var(--mono); font-size: 12px;
  font-variant-numeric: tabular-nums; color: #e1f2fa; z-index: 10;
}
.panel { background: var(--bg); border-left: 2px solid var(--c); padding: 10px 12px; backdrop-filter: blur(4px); }
#hud .panel { background: var(--hud-surface); border-left-color: var(--hud-line); backdrop-filter: none; }
#hud .loc { position: absolute; left: var(--hud-margin); top: var(--hud-margin); max-width: min(280px, 29vw); line-height: 1.45; overflow-wrap: anywhere; }
#hud .loc:empty, #hud .flight:empty, #hud .health:empty { display: none; }
#hud .loc .t { color: #fff; font-size: 15px; font-family: -apple-system, "PingFang SC", sans-serif; }
#hud .loc .dim { color: #b6ccd9; font-size: 11px; }
#hud .flight { position: absolute; left: 50%; bottom: var(--hud-margin); transform: translateX(-50%); display: flex; gap: 16px; text-align: center; }
#hud .flight b { display: block; color: #fff; font-size: 18px; }
#hud .cross { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px; border: 1px solid rgba(95, 242, 255, .6); border-radius: 50%; }
#hud .cross::after { content: ""; position: absolute; left: 9px; top: 9px; width: 2px; height: 2px; background: var(--c); }
#hud .prompt { position: absolute; z-index: 2; left: 50%; top: calc(50% + 56px); transform: translateX(-50%); max-width: 60vw; text-align: center; color: #fff; background: var(--hud-surface); padding: 6px 14px; border: 1px solid var(--hud-line); display: none; }
#hud .hud-ground, #hud .hud-right {
  display: flex; flex-direction: column; gap: var(--hud-gap);
}
#hud .hud-ground { order: 2; align-self: flex-end; flex: none; width: min(204px, 100%); }
#hud .hud-ground:empty { display: none; }
#hud .hud-ground > .syspanel {
  padding: 9px 12px; border: 1px solid var(--hud-line); border-radius: 3px; background: var(--hud-surface);
  color: #e1f2fa; line-height: 1.5; overflow-wrap: anywhere;
}
#hud .panel-res { order: -1; }
#hud .panel-climate { order: 1; }
#hud .hud-right { position: absolute; top: var(--hud-margin); bottom: var(--hud-margin); right: var(--hud-margin); width: var(--hud-side); z-index: 2; }
#hud .panel-space-target { position: static !important; order: -1; overflow-wrap: anywhere; }
#hud .toasts { display: flex; flex-direction: column; gap: var(--hud-gap); min-height: 0; margin-bottom: auto; overflow: hidden; }
#hud .toast { flex: none; animation: tin .2s ease-out; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
#hud .toast.warn { order: -1; border-color: #ff847e; }
#hud .toast.gold { border-color: var(--c2); }
@keyframes tin { from { opacity: 0; } }
#hud .hud-markers { position: absolute; inset: 0; z-index: 1; }
#hud .marker { position: absolute; top: 0; left: 0; max-width: 200px; padding: 2px 6px; border-radius: 3px; text-align: center; color: #ffd18d; background: var(--hud-surface); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#hud .marker::after { content: "◆"; display: block; font-size: 9px; }
#hud .marker.gate { color: #adffff; } #hud .marker.ship { color: #fff; }
#hud .health { position: absolute; left: var(--hud-margin); bottom: var(--hud-margin); width: min(176px, 27vw); }
#hud .bar { height: 6px; background: rgba(255, 255, 255, .1); margin: 4px 0 8px; } #hud .bar i { display: block; height: 100%; background: var(--c); }
#hud .bar.j i { background: var(--c2); }
#hud .scanpulse { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px; border-radius: 50%; border: 2px solid var(--c); animation: pulse 1.2s ease-out forwards; }
@keyframes pulse { to { width: 120vmax; height: 120vmax; margin: -60vmax; opacity: 0; } }
#hud .flash { position: absolute; inset: 0; background: radial-gradient(transparent 40%, rgba(255, 40, 30, .45)); animation: fade 0.6s forwards; }
@keyframes fade { to { opacity: 0; } }

/* 模态窗口 */
.modal { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 5, 10, .6); z-index: 40; }
.modal .box { width: min(620px, 92vw); max-height: 84vh; overflow: auto; background: rgba(4, 14, 24, .94); border: 1px solid rgba(95, 242, 255, .4); padding: 20px 24px; font-family: var(--mono); font-size: 13px; line-height: 1.7; }
.modal h2 { margin: 0 0 12px; color: #fff; font: 600 20px -apple-system, "PingFang SC", sans-serif; letter-spacing: 2px; }
.modal .row { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.modal pre { white-space: pre-wrap; margin: 0; font: inherit; color: #bde; }
.modal .item { border-bottom: 1px solid rgba(95, 242, 255, .15); padding: 8px 0; }
.chevrons { display: flex; gap: 8px; justify-content: center; margin: 16px 0; }
.chevrons span { width: 26px; height: 26px; border: 1px solid #456; transform: rotate(45deg); transition: all .2s; }
.chevrons span.on { background: var(--c2); box-shadow: 0 0 14px var(--c2); border-color: var(--c2); }

/* v0.2 */
.compass { position: fixed; top: var(--hud-margin, 16px); left: 50%; transform: translateX(-50%); width: min(364px, 34vw); height: 34px; pointer-events: none;
  background: #06121cdb; border-bottom: 1px solid rgba(140,220,255,.35); }
.compass .cbar { position: relative; height: 22px; overflow: hidden; }
.compass .cbar span { position: absolute; top: 3px; transform: translateX(-50%); font-size: 12px; color: #bfe9ff; letter-spacing: 1px; }
.compass .cdeg { text-align: center; font-size: 10px; color: #b6ccd9; }
.syspanel { pointer-events: none; }
.bar.h i { background: #e55; } .bar.o i { background: #6cf; }
.menu-location { margin-top: 12px; }
.menu-location summary { cursor: pointer; color: #bcecf3; }
.menu-location div { overflow-wrap: anywhere; }

@media (max-height: 760px) {
  #hud > .panel-onboarding { top: calc(var(--hud-margin) + 34px + var(--hud-gap)) !important; }
}
@media (max-width: 760px) {
  #hud { --hud-side: min(210px, 29vw); }
  #hud .flight { gap: 8px; }
  #hud .flight b { font-size: 14px; }
  #hud .prompt { max-width: 42vw; }
}
