/* ===== OrbitLive 克隆 · 全局样式 ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  color-scheme: dark;
}

html, body, #root { height: 100%; margin: 0; background: #010208; }

body {
  font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  color: #e2e8f0;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input { font: inherit; }
ul { list-style: none; }

*::-webkit-scrollbar { width: 6px; }
*::-webkit-scrollbar-thumb { background: #7dd3fc33; border-radius: 3px; }

/* 玻璃拟态 */
.glass {
  background: rgba(8, 15, 30, 0.549);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(125, 211, 252, 0.14);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.349);
}

.font-num, .tb-clock, .tb-speed, .g-count, .info-val {
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ===== 根布局 ===== */
#root { position: relative; height: 100vh; width: 100vw; overflow: hidden; background: #010208; }
.stage { position: absolute; inset: 0; }
#scene { display: block; height: 100%; width: 100%; touch-action: none; }
#label-host { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

/* 卫星标签 */
.sat-label {
  position: absolute; left: -100px; top: -100px;
  transform: translate(-50%, -150%);
  padding: 2px 7px; font-size: 10px; letter-spacing: 0.05em;
  color: #e2f3ff; background: rgba(8, 15, 30, 0.65);
  border: 1px solid rgba(125, 211, 252, 0.25); border-radius: 6px;
  white-space: nowrap; pointer-events: none;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: none; z-index: 15;
}
.sat-label--sel {
  color: #a5f3fc; border-color: rgba(103, 232, 249, 0.55);
  box-shadow: 0 0 14px rgba(103, 232, 249, 0.25);
}

/* ===== 加载屏 ===== */
.loading-overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #020409;
  transition: opacity 0.7s;
}
.loading-overlay.is-hidden { opacity: 0; pointer-events: none; }
.loading-bg { pointer-events: none; position: absolute; inset: 0; overflow: hidden; }
.loading-glow {
  position: absolute; left: 50%; top: 50%;
  height: 520px; width: 520px;
  transform: translate(-50%, -50%);
  border-radius: 9999px;
  background: rgba(6, 182, 212, 0.1);
  filter: blur(120px);
}
.loading-spinner-wrap {
  position: relative; margin-bottom: 24px;
  display: flex; height: 80px; width: 80px; align-items: center; justify-content: center;
}
.loading-spinner {
  position: absolute; inset: 0;
  border-radius: 9999px;
  border: 1px solid rgba(103, 232, 249, 0.2);
  border-top-color: rgba(103, 232, 249, 0.8);
  animation: spin 1.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-dot {
  height: 10px; width: 10px; border-radius: 9999px; background: #67e8f9;
  box-shadow: 0 0 18px 4px rgba(103, 232, 249, 0.7);
}
.loading-title { font-size: 24px; font-weight: 600; letter-spacing: 0.35em; color: #f1f5f9; }
.loading-sub { margin-top: 8px; font-size: 12px; letter-spacing: 0.3em; color: rgba(165, 243, 252, 0.6); }
.loading-bar { margin-top: 32px; height: 3px; width: 256px; overflow: hidden; border-radius: 9999px; background: #1e293b; }
.loading-bar-fill {
  height: 100%; width: 0%; border-radius: 9999px;
  background: linear-gradient(to right, #22d3ee, #0ea5e9);
  transition: width 0.3s;
}
.loading-label { margin-top: 12px; height: 16px; font-size: 12px; color: #94a3b8; }
.loading-foot {
  position: absolute; bottom: 32px; padding: 0 24px;
  text-align: center; font-size: 11px; line-height: 20px; color: #64748b;
}

/* ===== 顶部标题栏 ===== */
.hud-top {
  pointer-events: none;
  position: absolute; left: 0; right: 0; top: 0; z-index: 20;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 16px;
}
.hud-title-row { display: flex; align-items: center; gap: 12px; }
.hud-title { font-size: 18px; font-weight: 600; letter-spacing: 0.28em; color: #f1f5f9; }
.status-pill {
  display: none;
  border-radius: 9999px; padding: 4px 10px;
  font-size: 10px; letter-spacing: 0.05em;
}
.status-emerald { color: #6ee7b7; }
.status-amber { color: #fcd34d; }
.hud-sub { margin-top: 6px; font-size: 11px; letter-spacing: 0.05em; color: #94a3b8; }

/* ===== 搜索框 ===== */
.search-root { position: absolute; right: 16px; top: 16px; z-index: 30; width: 240px; }
.search-box { display: flex; align-items: center; gap: 8px; border-radius: 12px; padding: 8px 12px; }
.search-icon { height: 16px; width: 16px; flex-shrink: 0; color: rgba(103, 232, 249, 0.7); }
.search-input {
  width: 100%; background: transparent; font-size: 14px; color: #e2e8f0;
  outline: none; border: none;
}
.search-input::placeholder { color: #64748b; }
.search-clear { color: #64748b; }
.search-clear:hover { color: #cbd5e1; }
.search-list {
  margin-top: 8px; max-height: 288px; overflow: auto;
  border-radius: 12px; padding: 4px 0;
}
.search-item {
  display: flex; width: 100%; align-items: center; gap: 10px;
  padding: 8px 12px; text-align: left;
}
.search-item:hover { background: rgba(34, 211, 238, 0.1); }
.si-dot { height: 8px; width: 8px; flex-shrink: 0; border-radius: 9999px; }
.si-main { min-width: 0; flex: 1; }
.si-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: #e2e8f0; }
.si-meta { display: block; font-size: 10px; color: #64748b; }

/* ===== 星座分组面板 ===== */
.groups-root { position: absolute; right: 16px; top: 50%; z-index: 20; transform: translateY(-50%); }
.groups-panel { width: 176px; border-radius: 16px; padding: 10px; }
.groups-header {
  display: flex; width: 100%; align-items: center; justify-content: space-between;
  padding: 0 6px 4px; font-size: 11px; letter-spacing: 0.2em; color: #94a3b8;
}
.groups-caret { color: #64748b; }
.groups-list { display: flex; flex-direction: column; gap: 2px; }
.g-row {
  display: flex; width: 100%; align-items: center; gap: 8px;
  border-radius: 8px; padding: 6px; text-align: left;
  transition: background-color 0.15s;
}
.g-row:hover { background: rgba(34, 211, 238, 0.1); }
.g-row.is-off { opacity: 0.45; }
.g-dot { height: 8px; width: 8px; flex-shrink: 0; border-radius: 9999px; }
.g-label {
  min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12px; color: #cbd5e1;
}
.g-en { margin-left: 4px; font-size: 10px; color: #64748b; }
.g-count { font-size: 10px; color: #64748b; }

/* ===== 时间控制条 ===== */
.timebar-root { position: absolute; bottom: 16px; left: 50%; z-index: 20; transform: translateX(-50%); }
.timebar {
  display: flex; align-items: center; gap: 6px;
  border-radius: 16px; padding: 8px 12px;
}
.tb-now {
  border-radius: 8px; padding: 4px 8px; font-size: 11px; color: #cbd5e1;
  transition: background-color 0.15s, color 0.15s;
}
.tb-now:hover { background: rgba(34, 211, 238, 0.15); color: #a5f3fc; }
.tb-play {
  display: flex; height: 28px; width: 28px; align-items: center; justify-content: center;
  border-radius: 8px; background: rgba(34, 211, 238, 0.15); color: #a5f3fc;
  transition: background-color 0.15s;
  font-size: 11px;
}
.tb-play:hover { background: rgba(34, 211, 238, 0.25); }
.tb-divider { margin: 0 2px; height: 20px; width: 1px; background: rgba(71, 85, 105, 0.5); }
.tb-divider--sm { display: none; }
.tb-speed {
  border-radius: 8px; padding: 4px 8px; font-size: 11px; color: #94a3b8;
  transition: background-color 0.15s, color 0.15s;
}
.tb-speed:hover { background: rgba(34, 211, 238, 0.1); color: #e2e8f0; }
.tb-speed.is-active { background: rgba(34, 211, 238, 0.2); color: #a5f3fc; }
.tb-clock {
  display: none; min-width: 148px; text-align: center;
  font-size: 11px; letter-spacing: 0.05em; color: #cbd5e1;
}

/* ===== 选中卫星信息面板 ===== */
.info-panel {
  position: absolute; bottom: 80px; left: 16px; z-index: 20;
  width: 256px; border-radius: 16px; padding: 16px;
}
.info-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.info-head-main { min-width: 0; }
.info-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 14px; font-weight: 600; color: #f1f5f9;
}
.info-norad { margin-top: 2px; font-size: 10px; letter-spacing: 0.05em; color: #64748b; }
.info-head-side { display: flex; align-items: center; gap: 8px; }
.info-chip { border-radius: 9999px; padding: 2px 8px; font-size: 10px; white-space: nowrap; }
.info-close { color: #64748b; }
.info-close:hover { color: #e2e8f0; }
.info-rows { margin-top: 8px; }
.info-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 3px 0;
}
.info-row + .info-row { border-top: 1px solid rgba(51, 65, 85, 0.3); }
.info-key { font-size: 11px; color: #64748b; }
.info-val { font-size: 12px; color: #e2e8f0; }
.info-note { margin-top: 8px; font-size: 10px; line-height: 16px; color: #64748b; }

/* ===== 右下角脚注 ===== */
.hud-foot {
  pointer-events: none;
  position: absolute; bottom: 16px; right: 16px; z-index: 10;
  display: none; font-size: 10px; line-height: 16px; color: #475569;
}

/* ===== 响应式 ===== */
@media (min-width: 640px) {
  .status-pill { display: inline-block; }
  .tb-divider--sm { display: block; }
  .tb-clock { display: block; }
}
@media (min-width: 768px) {
  .hud-top { padding: 20px; }
  .hud-title { font-size: 20px; }
  .search-root { right: 20px; top: 20px; width: 288px; }
  .groups-root { right: 20px; }
  .groups-panel { width: 192px; }
  .timebar-root { bottom: 20px; }
  .timebar { gap: 8px; padding: 8px 16px; }
  .info-panel { bottom: 20px; left: 20px; width: 288px; }
  .hud-foot { display: block; }
}
