/* ===== 基础 ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --night-deep: #0a0a1f;
  --night-mid: #12123a;
  --night-soft: #1a1a4e;
  --cosmos-purple: #2d1b69;
  --star-gold: #ffd54f;
  --star-bright: #fff9c4;
  --wisdom-cyan: #4dd0e1;
  --wisdom-light: #80deea;
  --text-primary: #e8eaf6;
  --text-secondary: #b0bec5;
  --glow-gold: rgba(255, 213, 79, 0.35);
  --glow-cyan: rgba(77, 208, 225, 0.3);
  --font-serif: "Noto Serif SC", "Songti SC", "STSong", serif;
  --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: linear-gradient(180deg, var(--night-deep) 0%, var(--night-mid) 35%, var(--cosmos-purple) 70%, var(--night-soft) 100%);
  color: var(--text-primary);
  line-height: 1.8;
  overflow-x: hidden;
  min-height: 100vh;
}

#star-canvas {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 1;
}

/* ===== Hero ===== */
.hero {
  position: relative; min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 40px 20px; z-index: 3;
}

.hero-stars {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(77,208,225,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(255,213,79,0.06) 0%, transparent 50%);
  pointer-events: none;
}

.hero-content { position: relative; z-index: 2; max-width: 750px; }

.hero-eyebrow {
  font-family: var(--font-serif); font-size: 1.2rem; letter-spacing: 0.6em;
  color: var(--star-gold); margin-bottom: 24px;
  text-shadow: 0 0 20px var(--glow-gold);
  animation: fadeInDown 1.2s ease-out;
}

.hero-title { font-family: var(--font-serif); margin-bottom: 28px; }

.title-main {
  display: block; font-size: clamp(3rem, 10vw, 5.5rem); font-weight: 900;
  background: linear-gradient(135deg, var(--star-bright) 0%, var(--star-gold) 50%, var(--wisdom-light) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.15em;
  filter: drop-shadow(0 0 30px var(--glow-gold));
  animation: fadeInUp 1.2s ease-out 0.2s both;
}

.title-line {
  display: block; font-size: clamp(1.6rem, 5vw, 2.8rem); font-weight: 600;
  color: var(--wisdom-light); margin-top: 8px; letter-spacing: 0.5em;
  text-shadow: 0 0 25px var(--glow-cyan);
  animation: fadeInUp 1.2s ease-out 0.4s both;
}

.hero-constellation {
  margin: 30px auto; max-width: 300px;
  animation: fadeIn 1.5s ease-out 0.6s both;
}

.constellation-svg { width: 100%; height: auto; }

.constellation-svg circle { animation: starTwinkle 2s ease-in-out infinite; }
.constellation-svg circle:nth-of-type(3) { animation-delay: 0.3s; }
.constellation-svg circle:nth-of-type(4) { animation-delay: 0.6s; }
.constellation-svg circle:nth-of-type(5) { animation-delay: 0.9s; }
.constellation-svg circle:nth-of-type(6) { animation-delay: 1.2s; }
.constellation-svg circle:nth-of-type(7) { animation-delay: 1.5s; }

@keyframes starTwinkle {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.hero-subtitle {
  font-size: 0.85rem; letter-spacing: 0.35em; color: var(--wisdom-cyan);
  opacity: 0.7; animation: fadeIn 1.5s ease-out 0.8s both;
}

.scroll-indicator {
  position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  animation: fadeIn 1.5s ease-out 1.2s both;
}

.scroll-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--star-gold);
  box-shadow: 0 0 10px var(--glow-gold);
  animation: scrollDot 2s ease-in-out infinite;
}

@keyframes scrollDot {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(12px); opacity: 0.3; }
}

.scroll-label { font-size: 0.65rem; letter-spacing: 0.4em; color: var(--text-secondary); opacity: 0.5; }

/* ===== 通用 ===== */
.section-inner {
  max-width: 1000px; margin: 0 auto; padding: 80px 24px;
  position: relative; z-index: 3;
}

.section-heading {
  display: flex; align-items: center; justify-content: center; gap: 20px; margin-bottom: 50px;
}

.heading-line {
  flex: 1; max-width: 80px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--star-gold), transparent);
}

.heading-text {
  font-family: var(--font-serif); font-size: clamp(1.5rem, 4vw, 2rem);
  color: var(--star-gold); letter-spacing: 0.25em;
  text-shadow: 0 0 20px var(--glow-gold); white-space: nowrap;
}

/* ===== 智慧箴言轮播 ===== */
.quote-carousel {
  max-width: 650px; margin: 0 auto; text-align: center;
}

.quote-active {
  min-height: 130px; display: flex; flex-direction: column; justify-content: center;
  padding: 28px 20px;
}

.quote-text {
  font-family: var(--font-serif); font-size: clamp(1rem, 2.8vw, 1.2rem);
  font-style: italic; color: var(--text-primary); line-height: 2.1;
  transition: opacity 0.6s ease;
}

.quote-author {
  margin-top: 14px; font-size: 0.85rem; color: var(--wisdom-cyan);
  letter-spacing: 0.1em; transition: opacity 0.6s ease;
}

.quote-nav {
  display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 16px;
}

.quote-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,213,79,0.1); border: 1px solid rgba(255,213,79,0.3);
  color: var(--star-gold); font-size: 1.2rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s ease; line-height: 1;
}

.quote-btn:hover {
  background: rgba(255,213,79,0.25); border-color: var(--star-gold);
  box-shadow: 0 0 12px var(--glow-gold);
}

.quote-dots { display: flex; gap: 7px; }

.quote-dot {
  width: 7px; height: 7px; border-radius: 50%; border: none; padding: 0;
  background: rgba(255,213,79,0.25); cursor: pointer; transition: all 0.3s ease;
}

.quote-dot.active {
  background: var(--star-gold); box-shadow: 0 0 8px var(--glow-gold);
  transform: scale(1.3);
}

/* ===== 时间线 ===== */
.timeline { position: relative; padding-left: 30px; }

.timeline::before {
  content: ""; position: absolute; left: 8px; top: 0; bottom: 0; width: 1px;
  background: linear-gradient(180deg, transparent, var(--wisdom-cyan) 10%, var(--star-gold) 50%, var(--wisdom-cyan) 90%, transparent);
}

.timeline-item { position: relative; padding-bottom: 45px; }
.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute; left: -30px; top: 6px; width: 17px; height: 17px;
  border-radius: 50%; background: var(--night-deep);
  border: 2px solid var(--star-gold); box-shadow: 0 0 12px var(--glow-gold); z-index: 2;
}

.timeline-dot::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%;
  background: var(--star-gold); animation: dotPulse 2.5s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 0.5; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}

.timeline-content {
  background: rgba(18,18,58,0.4); border: 1px solid rgba(77,208,225,0.15);
  border-radius: 8px; padding: 24px 28px; backdrop-filter: blur(6px);
  transition: all 0.3s ease;
}

.timeline-content:hover {
  border-color: rgba(77,208,225,0.4); box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

.timeline-era {
  display: inline-block; font-size: 0.75rem; letter-spacing: 0.3em; color: var(--wisdom-cyan);
  background: rgba(77,208,225,0.1); padding: 3px 12px; border-radius: 2px; margin-bottom: 10px;
}

.timeline-content h3 {
  font-family: var(--font-serif); font-size: 1.2rem; color: var(--star-bright);
  margin-bottom: 10px; letter-spacing: 0.05em;
}

.timeline-content p { font-size: 0.92rem; color: var(--text-secondary); line-height: 1.9; }

/* ===== 星空许愿 ===== */
.wish-intro {
  text-align: center; font-size: 0.95rem; color: var(--text-secondary);
  margin-bottom: 36px; letter-spacing: 0.05em;
}

.wish-stars {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 20px;
  margin-bottom: 36px; min-height: 80px;
}

.wish-star {
  font-size: 1.8rem; cursor: pointer; transition: all 0.3s ease;
  filter: drop-shadow(0 0 6px var(--glow-gold));
  user-select: none; animation: starFloat 3s ease-in-out infinite;
}

.wish-star:nth-child(odd) { animation-delay: 0.5s; color: var(--star-gold); }
.wish-star:nth-child(even) { animation-delay: 1s; color: var(--wisdom-light); }

.wish-star:hover {
  transform: scale(1.4) rotate(15deg);
  filter: drop-shadow(0 0 15px var(--glow-gold));
}

.wish-star:active { transform: scale(0.9); }

@keyframes starFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.wish-display {
  max-width: 500px; margin: 0 auto; min-height: 80px;
  display: flex; align-items: center; justify-content: center; text-align: center;
}

.wish-placeholder {
  font-size: 0.9rem; color: var(--text-secondary); opacity: 0.6; letter-spacing: 0.1em;
}

.wish-result {
  font-family: var(--font-serif); font-size: 1.1rem; color: var(--star-bright);
  line-height: 1.9; text-shadow: 0 0 15px var(--glow-gold);
  animation: wishReveal 0.8s ease-out;
}

@keyframes wishReveal {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 页脚 ===== */
.footer {
  position: relative; z-index: 3; padding: 50px 24px 40px; text-align: center;
  border-top: 1px solid rgba(255,213,79,0.1); background: rgba(10,10,31,0.5);
}

.footer-constellation {
  display: flex; justify-content: center; gap: 30px; margin-bottom: 18px;
}

.f-star { color: var(--star-gold); font-size: 1rem; animation: starTwinkle 2s ease-in-out infinite; }
.f-star:nth-child(2) { animation-delay: 0.5s; color: var(--wisdom-light); }
.f-star:nth-child(3) { animation-delay: 1s; }

.footer-title {
  font-family: var(--font-serif); font-size: 1.3rem; color: var(--star-gold);
  letter-spacing: 0.25em; margin-bottom: 6px;
}

.footer-date {
  font-size: 0.85rem; color: var(--wisdom-cyan); letter-spacing: 0.2em; margin-bottom: 8px;
}

.footer-wish {
  font-size: 0.8rem; color: var(--text-secondary); opacity: 0.6; letter-spacing: 0.1em;
}

/* ===== 滚动渐显 ===== */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 480px) {
  .section-inner { padding: 60px 18px; }
  .timeline { padding-left: 25px; }
  .timeline-dot { left: -25px; }
  .timeline-content { padding: 20px; }
  .heading-line { max-width: 40px; }
}

/* ===== 音乐按钮 ===== */
.music-toggle {
  position: fixed; top: 18px; right: 18px; z-index: 100;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,213,79,0.3);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--star-gold); font-size: 20px;
  transition: all 0.3s ease; backdrop-filter: blur(6px);
}
.music-toggle:hover { background: rgba(255,213,79,0.15); border-color: var(--star-gold); }
.music-toggle.playing .music-icon { animation: musicSpin 3s linear infinite; display: inline-block; }
.music-toggle.paused { opacity: 0.45; }
@keyframes musicSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
