/* ========== Spatial Page Mode ==========
   不滚动，点击切换section
   ======================================= */

body.spatial-mode {
  overflow: hidden;
}

body.spatial-mode .side-nav,
body.spatial-mode .side-nav-toggle,
body.spatial-mode .hud-bar,
body.spatial-mode footer,
body.spatial-mode .parallax-bg,
body.spatial-mode .toast-container {
  display: none !important;
}

/* 重置侧导航留下的 margin-left 偏移，使内容居中 */
body.spatial-mode .container,
body.spatial-mode .hero,
body.spatial-mode footer .container,
body.spatial-mode .hud-bar .container {
  margin: 0 auto !important;
}

/* 所有页面默认隐藏 */
body.spatial-mode .hero,
body.spatial-mode section {
  display: none !important;
}

/* 当前页面：全屏显示，内部可滚动 */
body.spatial-mode .spatial-page-active {
  display: block !important;
  min-height: 100vh;
  height: 100vh;
  overflow-y: auto;
  animation: spatial-page-in 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Hero 保持 flex 布局 */
body.spatial-mode .hero.spatial-page-active {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 0;
}

/* section 去掉顶部边框 */
body.spatial-mode section.spatial-page-active {
  border-top: none !important;
  padding-top: 4rem;
}

@keyframes spatial-page-in {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ========== 底部提示 ========== */
.spatial-hint {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.12em;
  z-index: 700;
  pointer-events: none;
  white-space: nowrap;
  animation: spatial-pulse 3s ease-in-out infinite;
}

@keyframes spatial-pulse {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 0.9; }
}

/* ========== 右上角进度 ========== */
.spatial-progress {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  font-family: var(--font-pixel);
  font-size: 0.68rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  z-index: 700;
  pointer-events: none;
}

/* ========== 左上角返回按钮 ========== */
.spatial-back {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--rule);
  border-radius: 50%;
  color: var(--accent);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 700;
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.spatial-back.show {
  opacity: 1;
  pointer-events: auto;
}

.spatial-back:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  .spatial-hint { font-size: 0.6rem; bottom: 1rem; }
  .spatial-progress { font-size: 0.56rem; top: 1rem; right: 1rem; }
  .spatial-back { top: 1rem; left: 1rem; width: 32px; height: 32px; }
  body.spatial-mode section.spatial-page-active { padding-top: 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  body.spatial-mode .spatial-page-active { animation: none; }
}
