/* ============================================================
 * 全局样式：全屏画布 + 深空背景 + 半透明 UI 叠层
 * ========================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;            /* 禁止滚动条，画布铺满视口 */
  background: #000005;
  color: #e8eaf2;
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  user-select: none;           /* 拖动视角时避免选中文字 */
}

/* Three.js 生成的 canvas 作为最底层背景 */
canvas {
  display: block;
  position: fixed;
  inset: 0;
}

/* —— 加载提示 —— */
#loading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  letter-spacing: 2px;
  color: #9fb4ff;
  background: #000005;
  z-index: 100;
  transition: opacity 0.6s ease;
}
#loading.hidden {
  opacity: 0;
  pointer-events: none;
}

/* —— 顶部标题 —— */
#title {
  position: fixed;
  top: 22px;
  left: 28px;
  z-index: 10;
  pointer-events: none;        /* 不阻挡鼠标拖动 */
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}
#title h1 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 1px;
  background: linear-gradient(90deg, #ffd27a, #ff8a5b, #7ab8ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
#title p {
  margin-top: 6px;
  font-size: 13px;
  color: #8a93b0;
}

/* —— 操作提示 —— */
#instructions {
  position: fixed;
  top: 26px;
  right: 28px;
  z-index: 10;
  font-size: 13px;
  color: #aab2cc;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(12, 16, 32, 0.45);
  backdrop-filter: blur(6px);
}

/* —— 底部控制栏 —— */
#controls {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(12, 16, 32, 0.55);
  backdrop-filter: blur(8px);
}
#controls button {
  cursor: pointer;
  font-size: 13px;
  color: #e8eaf2;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  transition: background 0.2s, border-color 0.2s;
}
#controls button:hover {
  background: rgba(122, 184, 255, 0.18);
  border-color: rgba(122, 184, 255, 0.5);
}
#controls .speed {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #aab2cc;
}
#controls input[type="range"] {
  width: 120px;
  accent-color: #7ab8ff;
  cursor: pointer;
}
#speed-val {
  min-width: 38px;
  text-align: right;
  color: #e8eaf2;
}

/* —— 天体信息面板 —— */
#info-panel {
  position: fixed;
  top: 50%;
  right: 28px;
  transform: translateY(-50%);
  z-index: 20;
  width: 320px;
  max-width: calc(100vw - 56px);
  padding: 24px 24px 22px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(10, 14, 30, 0.82);
  backdrop-filter: blur(14px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
#info-panel.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(20px);
}
#info-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 28px;
  height: 28px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: #aab2cc;
  border: none;
  border-radius: 8px;
  background: transparent;
  transition: background 0.2s, color 0.2s;
}
#info-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
#info-name {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 1px;
}
#info-panel .subtitle {
  margin-top: 2px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #7f88a6;
  text-transform: uppercase;
  letter-spacing: 2px;
}
#info-stats {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
#info-stats td {
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: top;
}
#info-stats td:first-child {
  color: #8a93b0;
  white-space: nowrap;
  padding-right: 16px;
}
#info-stats td:last-child {
  text-align: right;
  color: #e8eaf2;
}
#info-desc {
  margin-top: 16px;
  font-size: 13.5px;
  line-height: 1.7;
  color: #c2c8de;
}

/* —— 小屏适配 —— */
@media (max-width: 640px) {
  #title h1 { font-size: 20px; }
  #instructions { display: none; }
  #info-panel { right: 50%; transform: translate(50%, -50%); }
  #info-panel.hidden { transform: translate(50%, -50%) translateY(20px); }
  #controls { gap: 8px; padding: 8px 10px; flex-wrap: wrap; justify-content: center; }
}
