:root {
  --font-system: -apple-system, "SF Pro Display", "Helvetica Neue", sans-serif;
  --font-handwriting: "Ma Shan Zheng", cursive;

  --color-bg:        #F2F2F7;
  --color-surface:   rgba(255,255,255,0.72);
  --color-text:      #1C1C1E;
  --color-muted:     #6C6C70;
  --color-accent:    #007AFF;
  --color-gold:      #FFD60A;
  --color-sepia:     #F5ECD7;
  --color-dark:      #1C1C1E;

  --radius-sm: 8px; --radius-md: 12px;
  --radius-lg: 16px; --radius-xl: 20px;

  --shadow-card: 0 8px 40px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  --shadow-logo: 0 4px 16px rgba(0,0,0,0.3);

  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.0, 0, 0.2, 1);
}

/* 全局基础样式 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-system); background: var(--color-bg); overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }

/* 滚动动画 (CSS Scroll-Driven) */
.scroll-fade { opacity: 1; }
@supports (animation-timeline: scroll()) {
  .scroll-fade {
    opacity: 0;
    animation: fade-in linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 55%;
  }
  @keyframes fade-in { to { opacity: 1; } }
}

/* 打字机光标 */
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }
.cursor { animation: blink 1s step-end infinite; color: #ffffff; margin-left: 2px; font-weight: 300; }

/* 向下箭头动画 */
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(8px)} }
.scroll-hint { animation: float 2s ease-in-out infinite; }

/* 信纸展开与段落淡入 */
.letter-card {
  transform-origin: top center;
  transform: scaleY(0);
  opacity: 0;
  transition: transform 600ms var(--ease-spring), opacity 400ms ease;
}
.letter-card.expanded {
  transform: scaleY(1);
  opacity: 1;
}
.letter-p {
  opacity: 0;
  transition: opacity 500ms ease;
}
.letter-p.visible { opacity: 1; }

/* ==========================================================================
   第一幕 — 封面 (Splash)
   ========================================================================== */
#splash {
  position: relative;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  background: url('hz.jpg') no-repeat center center;
  background-size: cover;
}

.splash-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
  z-index: 1;
}

.splash-inner {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 5vh, 3rem) 1.5rem;
  text-align: center;
}

.splash-header {
  margin-bottom: 2rem;
}

.logo-container {
  margin: 0 auto 1.25rem;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: var(--shadow-logo);
  overflow: hidden;
}

.logo-container .logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.association-name {
  color: #ffffff;
  font-size: clamp(1.25rem, 4vw, 1.75rem);
  font-weight: 500;
  letter-spacing: 0.1em;
}

.splash-content {
  margin-bottom: 4rem;
  max-width: 280px;
}

.motto-text {
  font-size: clamp(1.1rem, 3.5vw, 1.35rem);
  color: #ffffff;
  letter-spacing: 0.15em;
  min-height: 1.5em; /* 防止打字过程页面闪烁 */
  font-weight: 300;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.splash-footer {
  position: absolute;
  bottom: clamp(1.5rem, 6dvh, 3.5rem);
}

.scroll-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 0.5px solid rgba(255, 255, 255, 0.2);
  transition: background 0.3s ease, transform 0.3s ease;
  cursor: pointer;
  text-decoration: none;
}

.scroll-hint:hover, .scroll-hint:focus {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(2px);
  outline: none;
}

.scroll-hint svg {
  width: 20px;
  height: 20px;
}

/* ==========================================================================
   第二幕 — 一封信 (Letter)
   ========================================================================== */
#letter {
  background-color: var(--color-sepia);
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2.5rem, 8dvh, 5rem) 1.25rem;
}

.letter-container {
  width: 100%;
  max-width: 680px;
  display: flex;
  justify-content: center;
}

.letter-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: clamp(1.5rem, 5vw, 3rem);
  width: 100%;
  box-sizing: border-box;
}

.deco-line {
  width: 40px;
  height: 1.5px;
  background-color: #C5A880; /* 精致淡金色 */
  margin: 0 auto 1.25rem;
}

.letter-title {
  text-align: center;
  font-family: var(--font-system);
  font-weight: 300;
  font-size: clamp(1.35rem, 4.5vw, 1.75rem);
  color: var(--color-text);
  margin-bottom: 2rem;
  letter-spacing: 0.15em;
}

.letter-body {
  font-family: var(--font-handwriting);
  font-size: clamp(1.1rem, 3.8vw, 1.3rem);
  line-height: 2;
  color: #3a2e1e;
  text-align: justify;
}

.letter-p {
  margin-bottom: 1.5rem;
  text-indent: 2em;
}

.letter-p:last-child {
  margin-bottom: 0;
}

.letter-signature {
  margin-top: 3.5rem;
  text-align: right;
  font-family: var(--font-handwriting);
  font-size: clamp(1.1rem, 3.8vw, 1.3rem);
  color: #7a6040;
  line-height: 1.8;
}

.signature-line {
  margin-bottom: 0.25rem;
}

/* ==========================================================================
   第三幕 — 倒计时 (Countdown)
   ========================================================================== */
#countdown {
  background-color: var(--color-dark);
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2.5rem, 8dvh, 5rem) 1.25rem;
  position: relative;
}

.countdown-container {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.countdown-header {
  margin-bottom: 2.5rem;
}

.countdown-logo-container {
  margin: 0 auto 1rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.countdown-logo-container .countdown-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.countdown-title {
  color: #ffffff;
  font-size: clamp(1.15rem, 4vw, 1.35rem);
  font-weight: 400;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.countdown-subtitle {
  color: var(--color-gold);
  font-size: clamp(0.875rem, 2.5vw, 1rem);
  font-weight: 400;
  letter-spacing: 0.05em;
}

.countdown-content {
  width: 100%;
  margin-bottom: 3.5rem;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-width: 360px;
  margin: 0 auto;
}

.countdown-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.countdown-number {
  font-size: clamp(2rem, 8vw, 3rem);
  color: #ffffff;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  display: inline-block;
  will-change: transform;
}

.countdown-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 6px;
  letter-spacing: 0.05em;
}

.countdown-footer {
  margin-top: auto;
}

.motto-footer {
  color: rgba(255, 255, 255, 0.25);
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  font-weight: 300;
}

/* iOS 底部安全区域适配 */
@media (max-width: 768px) {
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }
}
