/* HELIOS — 电影级 HUD */
:root {
  --amber: #ffb64d;
  --amber-soft: #e8b873;
  --ink: #e9e4d8;
  --ink-dim: #9a938a;
  --glass: rgba(10, 12, 18, 0.55);
  --glass-2: rgba(14, 16, 24, 0.72);
  --line: rgba(255, 182, 77, 0.16);
  --line-2: rgba(255, 255, 255, 0.08);
  --danger: #ff6d5a;
  --font: "Inter", "SF Pro Text", "PingFang SC", "Helvetica Neue", system-ui, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Menlo", monospace;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #04050a; }
body { font-family: var(--font); color: var(--ink); -webkit-font-smoothing: antialiased; user-select: none; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hidden { display: none !important; }
button, select { font-family: var(--font); cursor: pointer; }

/* ---------- 加载屏 ---------- */
.boot { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(120% 90% at 50% 60%, #0a0d18 0%, #04050a 70%); transition: opacity .9s ease; }
.boot.done { opacity: 0; pointer-events: none; }
.boot-core { position: relative; width: 120px; height: 120px; margin-bottom: 34px; }
.boot-sun { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; transform: translate(-50%,-50%);
  border-radius: 50%; background: radial-gradient(circle at 42% 40%, #fff3d6, #ffb64d 55%, #ff7a2f 100%);
  box-shadow: 0 0 24px 6px rgba(255,170,70,.55), 0 0 90px 30px rgba(255,140,50,.22); animation: pulse 2.4s ease-in-out infinite; }
.boot-ring { position: absolute; left: 50%; top: 50%; border: 1px solid rgba(255,182,115,.28); border-radius: 50%; transform: translate(-50%,-50%); }
.boot-ring::after { content:""; position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #ffd9a0;
  box-shadow: 0 0 8px 2px rgba(255,190,110,.7); top: -2.5px; left: 50%; margin-left: -2.5px; }
.r1 { width: 58px; height: 58px; animation: spin 3.2s linear infinite; }
.r2 { width: 88px; height: 88px; animation: spin 5.6s linear infinite reverse; border-color: rgba(255,182,115,.18); }
.r3 { width: 116px; height: 116px; animation: spin 8.8s linear infinite; border-color: rgba(255,182,115,.12); }
@keyframes spin { to { transform: translate(-50%,-50%) rotate(360deg); } }
@keyframes pulse { 0%,100% { transform: translate(-50%,-50%) scale(1); } 50% { transform: translate(-50%,-50%) scale(1.12); } }
.boot-title { font-size: 30px; letter-spacing: .55em; text-indent: .55em; font-weight: 300; color: #f4e8cf; }
.boot-sub { margin-top: 10px; font-size: 10px; letter-spacing: .42em; text-indent: .42em; color: var(--ink-dim); }
.boot-status { margin-top: 26px; font-size: 11px; color: var(--amber-soft); letter-spacing: .12em; font-family: var(--mono); }
.boot.error .boot-status { color: var(--danger); white-space: pre-wrap; max-width: 70vw; text-align: center; line-height: 1.8; }

/* ---------- 顶部 HUD ---------- */
.hud { position: fixed; top: 0; left: 0; right: 0; z-index: 40; display: flex; align-items: center; gap: 18px;
  padding: 12px 18px; padding-top: calc(12px + env(safe-area-inset-top));
  background: linear-gradient(180deg, rgba(4,5,10,.78), rgba(4,5,10,0)); pointer-events: none; }
.hud > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--amber);
  box-shadow: 0 0 12px 3px rgba(255,182,77,.5); }
.brand-name { font-size: 15px; letter-spacing: .3em; font-weight: 600; color: #f6ecd8; }
.brand-tag { font-size: 8.5px; letter-spacing: .3em; color: var(--ink-dim); margin-top: 2px; }
.clock { margin-left: 8px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--glass); backdrop-filter: blur(12px); }
.clock-date { font-size: 12.5px; font-family: var(--mono); color: #ffe9c9; letter-spacing: .05em; }
.clock-jd { font-size: 9.5px; font-family: var(--mono); color: var(--ink-dim); margin-top: 2px; }
.time-ctl { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--glass); backdrop-filter: blur(12px); }
.tbtn { width: 34px; height: 28px; border: none; border-radius: 7px; background: transparent; color: var(--ink);
  font-size: 12px; transition: background .15s, color .15s; }
.tbtn:hover { background: rgba(255,182,77,.14); color: var(--amber); }
.tbtn.active { background: rgba(255,182,77,.22); color: var(--amber); }
.speed-read { min-width: 86px; text-align: center; font-family: var(--mono); font-size: 10.5px; color: var(--amber-soft); }
.top-actions { margin-left: auto; display: flex; gap: 7px; align-items: center; }
.abtn, .sel { height: 30px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2);
  background: var(--glass); backdrop-filter: blur(12px); color: var(--ink-dim); font-size: 11.5px; letter-spacing: .04em;
  transition: color .15s, border-color .15s; }
.abtn:hover { color: var(--amber); border-color: var(--line); }
.abtn.on { color: var(--amber); border-color: rgba(255,182,77,.4); background: rgba(255,182,77,.08); }
.sel { appearance: none; -webkit-appearance: none; outline: none; }
.sel option { background: #10131c; color: var(--ink); }

/* ---------- 天体导航条 ---------- */
.bodybar { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 40; display: flex; gap: 4px; padding: 6px; border-radius: 14px; border: 1px solid var(--line-2);
  background: var(--glass-2); backdrop-filter: blur(16px); max-width: 96vw; overflow-x: auto; scrollbar-width: none; }
.bodybar::-webkit-scrollbar { display: none; }
.chip { padding: 7px 13px; border-radius: 9px; border: none; background: transparent; color: var(--ink-dim);
  font-size: 11.5px; letter-spacing: .06em; white-space: nowrap; transition: all .15s; }
.chip:hover { color: var(--ink); background: rgba(255,255,255,.06); }
.chip.active { color: #0a0c12; background: var(--amber); font-weight: 600; }
.chip .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }

/* ---------- 数据卡 ---------- */
.datacard { position: fixed; right: 18px; top: 76px; z-index: 40; width: 288px; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--glass-2); backdrop-filter: blur(16px);
  box-shadow: 0 18px 60px rgba(0,0,0,.5); }
.dc-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.dc-name { font-size: 20px; font-weight: 600; letter-spacing: .08em; color: #f8eed8; }
.dc-type { font-size: 9px; letter-spacing: .28em; color: var(--amber-soft); }
.dc-live { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 14px; padding: 10px 0; margin: 10px 0;
  border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.dl-v { font-family: var(--mono); font-size: 12.5px; color: var(--amber); }
.dl-k { font-size: 9px; letter-spacing: .18em; color: var(--ink-dim); margin-top: 2px; }
.dc-rows { display: flex; flex-direction: column; gap: 5px; }
.dc-row { display: flex; justify-content: space-between; font-size: 11px; }
.dc-row .k { color: var(--ink-dim); letter-spacing: .06em; }
.dc-row .v { font-family: var(--mono); color: #ded5c2; }
.dc-x { position: absolute; top: 10px; right: 12px; }

/* ---------- 参数面板 ---------- */
.panel { position: fixed; right: 18px; top: 76px; z-index: 45; width: 300px; max-height: calc(100vh - 150px);
  display: flex; flex-direction: column; border: 1px solid var(--line-2); border-radius: 14px;
  background: var(--glass-2); backdrop-filter: blur(18px); box-shadow: 0 18px 60px rgba(0,0,0,.5); }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 13px 16px;
  font-size: 11px; letter-spacing: .24em; color: var(--amber-soft); border-bottom: 1px solid var(--line-2); }
.panel-groups { overflow-y: auto; padding: 10px 16px 16px; scrollbar-width: thin; scrollbar-color: rgba(255,182,77,.3) transparent; }
.panel-groups::-webkit-scrollbar { width: 4px; }
.panel-groups::-webkit-scrollbar-thumb { background: rgba(255,182,77,.3); border-radius: 2px; }
.pg-title { margin: 12px 0 6px; font-size: 9.5px; letter-spacing: .3em; color: var(--ink-dim); }
.pg-title:first-child { margin-top: 4px; }
.prow { display: grid; grid-template-columns: 1fr 52px; gap: 8px; align-items: center; margin: 7px 0; }
.prow label { font-size: 11px; color: #cfc8ba; letter-spacing: .04em; display: flex; justify-content: space-between; }
.prow label em { font-style: normal; font-family: var(--mono); font-size: 9.5px; color: var(--amber-soft); opacity: .85; }
.prow input[type=range] { grid-column: 1 / 3; -webkit-appearance: none; appearance: none; width: 100%; height: 18px; background: transparent; }
.prow input[type=range]::-webkit-slider-runnable-track { height: 2px; border-radius: 1px; background: linear-gradient(90deg, rgba(255,182,77,.55), rgba(255,182,77,.14)); }
.prow input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 11px; height: 11px; margin-top: -4.5px;
  border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px rgba(255,182,77,.6); }
.prow input[type=range]::-moz-range-track { height: 2px; background: rgba(255,182,77,.3); }
.prow input[type=range]::-moz-range-thumb { width: 11px; height: 11px; border: none; border-radius: 50%; background: var(--amber); }
.pval { font-family: var(--mono); font-size: 10px; color: var(--amber); text-align: right; }
.psel { grid-column: 1 / 3; height: 26px; border-radius: 7px; border: 1px solid var(--line-2); background: #10131c;
  color: var(--ink); font-size: 11px; outline: none; }
.xbtn { border: none; background: transparent; color: var(--ink-dim); font-size: 13px; }
.xbtn:hover { color: var(--amber); }

/* ---------- 帮助 ---------- */
.help { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: rgba(2,3,7,.72); backdrop-filter: blur(8px); }
.help-card { width: min(620px, 92vw); padding: 26px 30px; border: 1px solid var(--line); border-radius: 16px;
  background: rgba(12,14,22,.9); box-shadow: 0 30px 100px rgba(0,0,0,.6); }
.help-title { font-size: 14px; letter-spacing: .3em; color: #f6ecd8; display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 22px; font-size: 11.5px; color: #b6af9f; line-height: 1.7; }
.help-grid b { color: var(--amber-soft); font-weight: 500; }
.help-foot { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line-2); font-size: 10px;
  color: var(--ink-dim); letter-spacing: .1em; line-height: 1.8; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 74px; transform: translateX(-50%) translateY(16px); z-index: 70;
  padding: 9px 20px; border-radius: 10px; border: 1px solid var(--line); background: var(--glass-2);
  backdrop-filter: blur(14px); font-size: 12px; color: #ffe9c9; letter-spacing: .08em;
  opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 调试徽标 ---------- */
.debug-tag { position: fixed; left: 18px; bottom: 18px; z-index: 40; padding: 6px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--glass-2); font-family: var(--mono); font-size: 10px;
  color: var(--amber); letter-spacing: .1em; }

/* ---------- 移动端 ---------- */
@media (max-width: 860px) {
  .hud { flex-wrap: wrap; gap: 8px; padding: 8px 10px; }
  .brand-tag, .clock-jd { display: none; }
  .clock { padding: 4px 10px; }
  .clock-date { font-size: 11px; }
  .speed-read { min-width: 64px; font-size: 9.5px; }
  .tbtn { width: 30px; height: 26px; }
  .abtn, .sel { height: 28px; padding: 0 9px; font-size: 10.5px; }
  .abtn .lbl { display: none; }
  .datacard { right: 10px; left: 10px; width: auto; top: auto; bottom: 68px; }
  .panel { right: 10px; left: 10px; width: auto; }
  .help-grid { grid-template-columns: 1fr; }
  .chip { padding: 7px 10px; font-size: 10.5px; }
}
@media (pointer: coarse) {
  .tbtn, .abtn { height: 34px; }
}
