/* ========== 设计令牌 ========== */
:root {
  --bg: #050505;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.5);
  --border: rgba(255, 255, 255, 0.12);
  --border-hover: rgba(255, 255, 255, 0.25);
  --accent: #ffffff;
  --shadow: rgba(0, 0, 0, 0.35);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --duration-fast: 160ms;
  --duration-base: 240ms;
}

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

html,
body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% -10%, rgba(255, 255, 255, 0.09) 0%, transparent 42%),
    radial-gradient(circle at 80% 120%, rgba(255, 255, 255, 0.04) 0%, transparent 35%),
    linear-gradient(180deg, #0a0a0a 0%, #000000 100%);
}

/* ========== 星球与星轨背景 ========== */
.home-planet {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.home-planet svg {
  width: min(78vw, 560px);
  height: min(78vw, 560px);
  transform: translateY(-8vh);
}

.home-planet-body {
  transform-origin: 180px 180px;
  color: rgba(255, 255, 255, 0.16);
}

.home-planet-orbit {
  transform-origin: 180px 180px;
  color: rgba(255, 255, 255, 0.10);
  animation: homeOrbit 26s linear infinite;
}

@keyframes homeOrbit {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ========== 主页容器 ========== */
.home-page {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 48px;
  min-height: 60vh;
  position: relative;
  z-index: 1;
}

/* ========== 标题区 ========== */
.home-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.home-title {
  font-size: clamp(3rem, 11vw, 5.5rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.1;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

.home-title .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(18px);
  filter: blur(6px);
  animation: charReveal 700ms var(--ease-out) forwards;
}

.home-title .char:nth-child(1) { animation-delay: 0ms; }
.home-title .char:nth-child(2) { animation-delay: 90ms; }
.home-title .char:nth-child(3) { animation-delay: 180ms; }
.home-title .char:nth-child(4) { animation-delay: 270ms; }

@keyframes charReveal {
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.home-subtitle {
  font-size: clamp(0.95rem, 2.6vw, 1.15rem);
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(12px);
  animation: fadeInUp 600ms var(--ease-out) 480ms forwards;
}

/* ========== 主内容区 ========== */
.home-main {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 32px;
  align-items: center;
  opacity: 0;
  transform: translateY(12px);
  animation: fadeInUp 600ms var(--ease-out) 720ms forwards;
}

/* ========== 进入按钮 ========== */
.enter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 44px;
  background: var(--accent);
  color: #000000;
  text-decoration: none;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  transition:
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.enter-btn:active {
  transform: scale(0.97);
}

@media (hover: hover) and (pointer: fine) {
  .enter-btn:hover {
    box-shadow: 0 8px 26px rgba(255, 255, 255, 0.18);
  }
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== 无障碍：减少动画 ========== */
@media (prefers-reduced-motion: reduce) {
  .home-title .char,
  .home-subtitle,
  .home-main,
  .marquee-bar {
    animation: none;
    opacity: 1;
    transform: none;
    filter: none;
  }

  .marquee-track,
  .home-planet-orbit {
    animation: none;
  }

  .page-transition,
  .page-transition::before,
  .transition-logo,
  .transition-line {
    animation: none !important;
    transition: none;
  }
}

/* ========== 底部滚动字幕 ========== */
.marquee-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 14px 0;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  opacity: 0;
  animation: fadeInUp 600ms var(--ease-out) 900ms forwards;
  z-index: 10;
}

.marquee-track {
  display: flex;
  white-space: nowrap;
  width: max-content;
  animation: marqueeScroll 24s linear infinite;
}

.marquee-text {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.28);
  padding-right: 2.5em;
  user-select: none;
}

@keyframes marqueeScroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* ========== 页面过渡：主页 → 功能页 ========== */
.page-transition {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: #050505;
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms var(--ease-out);
}

.page-transition.active {
  opacity: 1;
  pointer-events: all;
}

.page-transition::before {
  content: '';
  position: absolute;
  inset: 0;
  background: #ffffff;
  clip-path: circle(0% at 50% 50%);
  z-index: 1;
}

.page-transition.expand::before {
  animation: circleExpand 900ms var(--ease-in-out) forwards;
}

.transition-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.transition-logo {
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 600;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.92);
  opacity: 0;
  transform: translateY(10px);
}

.transition-line {
  width: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.65);
}

.page-transition.go .transition-logo {
  animation: fadeInUp 600ms var(--ease-out) 120ms forwards;
}

.page-transition.go .transition-line {
  animation: lineExpand 700ms var(--ease-in-out) forwards;
}

@keyframes lineExpand {
  to {
    width: 120px;
  }
}

@keyframes circleExpand {
  to {
    clip-path: circle(150% at 50% 50%);
  }
}

/* ========== 移动端适配 ========== */
@media (max-width: 560px) {
  body {
    padding: 20px;
  }

  .home-page {
    gap: 40px;
    min-height: 50vh;
  }

  .enter-btn {
    padding: 15px 38px;
    font-size: 0.9rem;
  }

  .marquee-bar {
    padding: 12px 0;
  }

  .marquee-text {
    font-size: 0.68rem;
    letter-spacing: 0.14em;
  }
}
