:root {
  --bg: #04060b;
  --text: #e8ecf4;
  --dim: #93a0b8;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #7dd3fc;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  overflow: hidden;
}

#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}

#scene:active { cursor: grabbing; }

.labels {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.label {
  position: absolute;
  left: 0;
  top: 0;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(205, 224, 248, 0.78);
  white-space: nowrap;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.95);
  will-change: transform;
}

.hud { position: fixed; z-index: 3; }

.head {
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  pointer-events: none;
}

.back {
  pointer-events: auto;
  color: var(--dim);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 12, 20, 0.55);
  backdrop-filter: blur(10px);
}

.back:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.24); }

.title { text-align: right; }
.title h1 { margin: 0; font-size: 22px; letter-spacing: 0.34em; font-weight: 600; }
.title p { margin: 4px 0 0; font-size: 10px; letter-spacing: 0.3em; color: var(--dim); }

.panel {
  z-index: 4;
  top: 92px;
  right: 24px;
  width: 340px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(9, 13, 22, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.panel-head h2 { margin: 0; font-size: 14px; letter-spacing: 0.1em; font-weight: 600; }

.live {
  font-size: 9px;
  letter-spacing: 0.22em;
  color: #6ee7b7;
  border: 1px solid rgba(110, 231, 183, 0.35);
  border-radius: 999px;
  padding: 2px 8px;
}

#earth {
  width: 100%;
  height: auto;
  border-radius: 50%;
  display: block;
  filter: drop-shadow(0 0 28px rgba(96, 165, 250, 0.35));
}

.caption { margin: 10px 0 12px; font-size: 11px; color: var(--dim); text-align: center; letter-spacing: 0.06em; }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 0; }
.facts div { border-top: 1px solid var(--line); padding-top: 7px; }
.facts dt { font-size: 10px; color: var(--dim); letter-spacing: 0.08em; }
.facts dd { margin: 2px 0 0; font-size: 12px; }

.note { margin: 14px 0 0; font-size: 11px; color: var(--dim); border-top: 1px solid var(--line); padding-top: 10px; }

.enter-earth {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 12px;
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(125, 211, 252, 0.35);
  background: rgba(125, 211, 252, 0.1);
  color: var(--accent);
  font-size: 12px;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.enter-earth:hover { background: rgba(125, 211, 252, 0.18); border-color: rgba(125, 211, 252, 0.6); }

.dock {
  left: 24px;
  bottom: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(9, 13, 22, 0.72);
  backdrop-filter: blur(14px);
  font-size: 12px;
  color: var(--dim);
}

.dock-item { display: flex; align-items: center; gap: 8px; }

#speed {
  width: 120px;
  accent-color: var(--accent);
}

.chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12px;
  cursor: pointer;
}

.chip:hover { border-color: rgba(255, 255, 255, 0.26); }

.legend { opacity: 0.75; }

.portrait {
  display: block;
  width: 148px;
  height: 148px;
  margin: 2px auto 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #33507a, #0a1020);
  box-shadow: 0 0 34px rgba(96, 165, 250, 0.22), inset 0 0 24px rgba(0, 0, 0, 0.5);
}

.gallery {
  left: 24px;
  right: 24px;
  bottom: 92px;
  display: flex;
  gap: 10px;
  padding: 10px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(7, 11, 19, 0.62);
  backdrop-filter: blur(12px);
  scrollbar-width: thin;
}

.planet-card {
  flex: 0 0 auto;
  width: 84px;
  padding: 8px 6px 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.planet-card:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }

.planet-card.active {
  color: var(--text);
  border-color: rgba(125, 211, 252, 0.5);
  background: rgba(125, 211, 252, 0.08);
}

.planet-card img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #0a1020;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

.planet-card span { font-size: 11px; letter-spacing: 0.06em; }

.planet-card em { font-style: normal; font-size: 9px; color: var(--dim); opacity: 0.8; }

.tip {
  position: fixed;
  z-index: 5;
  pointer-events: none;
  transform: translate(-50%, -140%);
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(9, 13, 22, 0.92);
  font-size: 12px;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .panel { top: auto; bottom: 84px; right: 14px; left: 14px; width: auto; display: grid; grid-template-columns: 120px 1fr; gap: 10px 14px; align-items: center; }
  .panel-head, .caption { grid-column: 1 / -1; }
  #earth { width: 120px; }
  .facts { grid-template-columns: 1fr; gap: 4px; }
  .note { display: none; }
  .dock { left: 14px; right: 14px; bottom: 16px; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
  .legend { display: none; }
  .gallery { left: 14px; right: 14px; bottom: 92px; }
  .portrait { width: 110px; height: 110px; }
}

#earthDive{position:fixed;inset:0;z-index:900;background:#03060c;opacity:0;pointer-events:none;transition:opacity 1.15s ease;overflow:hidden}
#earthDive.on{opacity:1;pointer-events:auto}
#earthDive iframe{width:100%;height:100%;border:0;display:block;transform:scale(1.06);transition:transform 1.4s cubic-bezier(.22,.61,.36,1)}
#earthDive.on iframe{transform:scale(1)}
#earthBack{position:absolute;left:24px;top:22px;z-index:2;padding:8px 14px;border-radius:999px;border:1px solid rgba(150,180,220,.28);background:rgba(10,18,32,.55);color:#dbe8ff;font-size:12.5px;letter-spacing:.08em;cursor:pointer;backdrop-filter:blur(8px)}
#earthBack:hover{border-color:rgba(190,220,255,.6)}
#scene{transition:opacity 1s ease}
