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

body {
  background: #0a0a0f;
  overflow: hidden;
  font-family: "Segoe UI", sans-serif;
  color: #fff;
}

#canvas-container {
  width: 100vw;
  height: 100vh;
  position: relative;
}

canvas {
  display: block;
}

/* ── 加载遮罩 ── */
#loading-overlay {
  position: fixed;
  inset: 0;
  background: #0a0a0f;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: opacity 0.6s ease;
}

#loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-title {
  font-size: 1.4rem;
  letter-spacing: 0.2em;
  color: #a0c4ff;
  margin-bottom: 32px;
  text-transform: uppercase;
}

.progress-bar-wrap {
  width: 280px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4facfe, #00f2fe);
  border-radius: 2px;
  transition: width 0.2s ease;
}

.progress-text {
  margin-top: 12px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.05em;
}

/* ── 底部操作提示 ── */
#hud {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 20px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 40px;
  padding: 10px 24px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.5);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease 0.8s;
}

#hud.visible {
  opacity: 1;
}

.hud-item span {
  color: rgba(255, 255, 255, 0.85);
}

/* ── 自动旋转按钮 ── */
#btn-autorotate {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.7);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 0.2s, color 0.2s;
  letter-spacing: 0.06em;
}

#btn-autorotate:hover {
  background: rgba(79, 172, 254, 0.25);
  color: #fff;
}

#btn-autorotate.active {
  background: rgba(79, 172, 254, 0.35);
  border-color: #4facfe;
  color: #4facfe;
}

/* ── 重置视角按钮 ── */
#btn-reset {
  position: fixed;
  top: 20px;
  right: 140px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.7);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 0.2s, color 0.2s;
  letter-spacing: 0.06em;
}

#btn-reset:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

@media (max-width: 720px) {
  #hud {
    width: calc(100vw - 32px);
    border-radius: 24px;
    padding: 12px 18px;
    gap: 10px;
    flex-direction: column;
    bottom: 16px;
  }

  #btn-reset {
    right: 126px;
  }
}
