:root {
  --pink-bg: #fff7fa;
  --pink-light: #ffd6e6;
  --pink-main: #e85d8c;
  --pink-deep: #b83260;

  --text-main: #642638;
  --text-soft: #9a5a6c;

  --cream: #fffdf8;
  --gold: #f6c177;

  --night: #14162f;
  --night-deep: #080a1a;
  --star: #fff7c2;

  --shadow-soft: 0 24px 70px rgba(184, 50, 96, 0.18);
  --shadow-card: 0 18px 50px rgba(70, 20, 40, 0.12);

  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text-main);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--pink-bg);
  overflow-x: hidden;
}

button {
  font-family: inherit;
}

.hidden {
  display: none !important;
}

.section {
  position: relative;
  min-height: 100vh;
  padding: 80px 20px;
  overflow: hidden;
}

.section-inner {
  position: relative;
  z-index: 2;
  width: min(960px, 100%);
  margin: 0 auto;
  text-align: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--pink-main);
  font-size: 13px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-weight: 700;
}

.eyebrow.light {
  color: rgba(255, 247, 194, 0.92);
}

.section-title {
  margin: 0;
  font-size: clamp(32px, 6vw, 58px);
  line-height: 1.18;
  letter-spacing: 0.04em;
}

.section-subtitle {
  margin: 18px auto 44px;
  max-width: 680px;
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.9;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  border: none;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
}

.primary-btn {
  padding: 14px 28px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--pink-main), var(--pink-deep));
  box-shadow: 0 14px 32px rgba(232, 93, 140, 0.35);
  font-size: 15px;
  letter-spacing: 0.08em;
}

.secondary-btn {
  margin-top: 26px;
  padding: 13px 26px;
  border-radius: 999px;
  color: var(--pink-deep);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(232, 93, 140, 0.24);
  box-shadow: var(--shadow-card);
  font-size: 15px;
}

.ghost-btn {
  padding: 11px 18px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover {
  transform: translateY(-2px);
}

.primary-btn:active,
.secondary-btn:active,
.ghost-btn:active {
  transform: translateY(0);
}

/* 音乐按钮 */
.music-toggle {
  position: fixed;
  right: 18px;
  top: 18px;
  z-index: 30;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  color: #fff;
  background: rgba(232, 93, 140, 0.82);
  box-shadow: 0 12px 26px rgba(232, 93, 140, 0.32);
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.music-toggle.paused {
  opacity: 0.55;
}

/* 花瓣 */
.petal-layer {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow: hidden;
}

.petal {
  position: absolute;
  top: -30px;
  width: 12px;
  height: 18px;
  border-radius: 12px 12px 12px 0;
  background: rgba(255, 182, 206, 0.75);
  transform: rotate(45deg);
  animation-name: fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes fall {
  0% {
    transform: translate3d(0, -30px, 0) rotate(0deg);
    opacity: 0;
  }

  10% {
    opacity: 0.9;
  }

  100% {
    transform: translate3d(var(--drift), 110vh, 0) rotate(360deg);
    opacity: 0;
  }
}

/* 开场 */
.intro-section {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.95), transparent 32%),
    radial-gradient(circle at 80% 10%, rgba(255, 214, 230, 0.65), transparent 30%),
    linear-gradient(135deg, #fff7fa, #ffe4ef);
}

.soft-glow {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  filter: blur(25px);
  animation: breathe 4s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% {
    transform: scale(0.96);
    opacity: 0.65;
  }

  50% {
    transform: scale(1.06);
    opacity: 0.95;
  }
}

.intro-card {
  position: relative;
  z-index: 2;
  width: min(520px, 100%);
  padding: 54px 28px;
  border-radius: var(--radius-lg);
  text-align: center;
  background: rgba(255, 253, 248, 0.72);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(18px);
}

.intro-card h1 {
  margin: 0;
  font-size: clamp(38px, 8vw, 68px);
  letter-spacing: 0.08em;
}

.intro-text {
  margin: 22px 0 34px;
  color: var(--text-soft);
  font-size: 17px;
  line-height: 2;
}

.scroll-hint {
  position: absolute;
  bottom: 30px;
  z-index: 2;
  color: rgba(100, 38, 56, 0.55);
  font-size: 13px;
}

/* 信封 */
.letter-section {
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.9), transparent 28%),
    linear-gradient(180deg, #fff7fa, #fff0f6);
}

.envelope {
  position: relative;
  width: 280px;
  height: 190px;
  margin: 0 auto;
  cursor: pointer;
  perspective: 900px;
}

.envelope-body {
  position: absolute;
  inset: 55px 0 0;
  border-radius: 0 0 18px 18px;
  background: linear-gradient(135deg, #ffd1e2, #f9a8c5);
  box-shadow: 0 18px 45px rgba(184, 50, 96, 0.22);
}

.envelope-left,
.envelope-right {
  position: absolute;
  bottom: 0;
  width: 0;
  height: 0;
  border-top: 95px solid transparent;
  border-bottom: 95px solid #ffc0d7;
}

.envelope-left {
  left: 0;
  border-right: 140px solid transparent;
}

.envelope-right {
  right: 0;
  border-left: 140px solid transparent;
}

.envelope-flap {
  position: absolute;
  top: 55px;
  left: 0;
  width: 0;
  height: 0;
  z-index: 4;
  border-left: 140px solid transparent;
  border-right: 140px solid transparent;
  border-top: 105px solid #f78fb5;
  transform-origin: top center;
  transition: transform 0.9s ease;
}

.paper-preview {
  position: absolute;
  left: 28px;
  right: 28px;
  top: 58px;
  height: 130px;
  border-radius: 12px;
  background: #fffdf8;
  box-shadow: 0 14px 35px rgba(100, 38, 56, 0.12);
  transform: translateY(0);
  transition: transform 0.9s ease 0.2s;
}

.heart-seal {
  position: absolute;
  left: 50%;
  top: 122px;
  z-index: 5;
  transform: translateX(-50%);
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--pink-main);
  box-shadow: 0 8px 20px rgba(184, 50, 96, 0.28);
  transition: opacity 0.4s ease;
}

.envelope.open .envelope-flap {
  transform: rotateX(180deg);
}

.envelope.open .paper-preview {
  transform: translateY(-95px);
}

.envelope.open .heart-seal {
  opacity: 0;
}

.letter-paper {
  width: min(760px, 100%);
  margin: 52px auto 0;
  padding: clamp(26px, 5vw, 48px);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(rgba(255, 253, 248, 0.93), rgba(255, 253, 248, 0.93)),
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 33px,
      rgba(232, 93, 140, 0.09) 34px
    );
  box-shadow: var(--shadow-soft);
  text-align: left;
}

.letter-text {
  white-space: pre-wrap;
  color: #5b2736;
  font-family: "STKaiti", "KaiTi", "PingFang SC", serif;
  font-size: clamp(17px, 4vw, 22px);
  line-height: 2.05;
}

.letter-paper .primary-btn {
  display: block;
  margin: 34px auto 0;
}

/* 时间线 */
.timeline-section {
  background:
    radial-gradient(circle at 82% 5%, rgba(255, 255, 255, 0.9), transparent 25%),
    linear-gradient(180deg, #fff0f6, #fff8fb);
}

.timeline-list {
  position: relative;
  width: min(780px, 100%);
  margin: 0 auto;
  padding: 20px 0 10px;
}

.timeline-list::before {
  content: "";
  position: absolute;
  left: 24px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(var(--pink-light), var(--pink-main), var(--pink-light));
  opacity: 0.65;
}

.timeline-card {
  position: relative;
  margin: 0 0 38px 58px;
  padding: 18px;
  border-radius: 26px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: var(--shadow-card);
  text-align: left;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.timeline-card.show {
  opacity: 1;
  transform: translateY(0);
}

.timeline-card::before {
  content: "";
  position: absolute;
  left: -43px;
  top: 34px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--pink-main);
  border: 5px solid #fff;
  box-shadow: 0 0 0 5px rgba(232, 93, 140, 0.13);
}

.timeline-month {
  margin: 0 0 5px;
  color: var(--pink-main);
  font-weight: 800;
  letter-spacing: 0.12em;
  font-size: 13px;
}

.timeline-title {
  margin: 0;
  font-size: 24px;
  color: var(--text-main);
}

.timeline-date {
  margin: 8px 0 16px;
  color: var(--text-soft);
  font-size: 13px;
}

.polaroid {
  padding: 10px 10px 18px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(70, 20, 40, 0.1);
}

.timeline-media {
  display: block;
  width: 100%;
  max-height: 540px;
  object-fit: contain;
  border-radius: 12px;
  background: #f7dfe8;
}

.timeline-keywords {
  margin: 18px 0 10px;
  color: var(--pink-deep);
  font-size: 14px;
  font-weight: 700;
}

.timeline-copy {
  margin: 8px 0 0;
  color: #6d3445;
  line-height: 1.9;
  font-size: 15px;
}

.timeline-ending {
  width: min(680px, 100%);
  margin: 54px auto 0;
  padding: 34px 24px;
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 248, 0.76);
  box-shadow: var(--shadow-card);
}

.timeline-ending p {
  margin: 0 0 24px;
  color: var(--text-soft);
  line-height: 2;
}

/* 礼物 */
.gift-section,
.ending-section {
  display: grid;
  place-items: center;
  color: #fff;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.12), transparent 32%),
    linear-gradient(180deg, var(--night), var(--night-deep));
}

.star-layer {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255, 247, 194, 0.9) 1px, transparent 1.5px),
    radial-gradient(circle, rgba(255, 255, 255, 0.7) 1px, transparent 1.5px);
  background-size: 90px 90px, 140px 140px;
  background-position: 0 0, 35px 45px;
  opacity: 0.55;
  animation: starMove 16s linear infinite;
}

@keyframes starMove {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(40px);
  }
}

.gift-content,
.ending-card {
  position: relative;
  z-index: 2;
  text-align: center;
}

.gift-title {
  margin: 0;
  font-size: clamp(34px, 7vw, 64px);
  letter-spacing: 0.08em;
}

.gift-subtitle {
  margin: 18px 0 48px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 18px;
}

.gift-box {
  position: relative;
  width: 190px;
  height: 180px;
  margin: 0 auto;
  cursor: pointer;
  filter: drop-shadow(0 24px 34px rgba(0, 0, 0, 0.32));
}

.gift-body {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 126px;
  border-radius: 14px 14px 22px 22px;
  background: linear-gradient(135deg, #ff8ab3, #e85d8c);
  transition: transform 0.5s ease;
}

.gift-lid {
  position: absolute;
  left: 0;
  right: 0;
  top: 32px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ffc0d7, #f56f9e);
  z-index: 3;
  transition: transform 0.75s ease;
}

.gift-ribbon-vertical {
  position: absolute;
  left: 50%;
  top: 0;
  width: 28px;
  height: 100%;
  transform: translateX(-50%);
  background: rgba(255, 247, 194, 0.9);
}

.gift-ribbon-horizontal {
  position: absolute;
  left: 0;
  right: 0;
  top: 48px;
  height: 26px;
  background: rgba(255, 247, 194, 0.9);
}

.gift-bow {
  position: absolute;
  top: -28px;
  width: 54px;
  height: 38px;
  border: 12px solid rgba(255, 247, 194, 0.95);
  border-radius: 50% 50% 45% 45%;
}

.bow-left {
  left: 40px;
  transform: rotate(-25deg);
}

.bow-right {
  right: 40px;
  transform: rotate(25deg);
}

.gift-box.opened .gift-lid {
  transform: translateY(-82px) rotate(-12deg);
}

.gift-box.opened .gift-body {
  transform: scale(0.96);
}

.gift-tip {
  margin-top: 28px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 14px;
}

/* 结尾 */
.ending-card {
  width: min(760px, 100%);
  padding: 40px 24px;
}

.ending-text {
  white-space: pre-wrap;
  margin: 24px auto 34px;
  color: rgba(255, 255, 255, 0.88);
  font-family: "STKaiti", "KaiTi", "PingFang SC", serif;
  font-size: clamp(20px, 4.8vw, 30px);
  line-height: 2.05;
}

.ending-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.last-updated {
  margin-top: 30px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 12px;
}

/* reveal */
.reveal {
  opacity: 0;
  transform: translateY(35px);
  transition: opacity 0.75s ease, transform 0.75s ease;
}

.reveal.show {
  opacity: 1;
  transform: translateY(0);
}

/* 移动端 */
@media (max-width: 640px) {
  .section {
    padding: 72px 16px;
  }

  .intro-card {
    padding: 46px 22px;
  }

  .envelope {
    width: 240px;
    height: 170px;
  }

  .envelope-body {
    top: 50px;
  }

  .envelope-left,
  .envelope-right {
    border-top-width: 85px;
    border-bottom-width: 85px;
  }

  .envelope-left {
    border-right-width: 120px;
  }

  .envelope-right {
    border-left-width: 120px;
  }

  .envelope-flap {
    top: 50px;
    border-left-width: 120px;
    border-right-width: 120px;
    border-top-width: 92px;
  }

  .paper-preview {
    left: 24px;
    right: 24px;
    height: 118px;
  }

  .heart-seal {
    top: 110px;
  }

  .timeline-list::before {
    left: 15px;
  }

  .timeline-card {
    margin-left: 40px;
    padding: 14px;
    border-radius: 22px;
  }

  .timeline-card::before {
    left: -33px;
  }

  .timeline-title {
    font-size: 21px;
  }

  .timeline-media {
    max-height: 430px;
  }

  .gift-box {
    transform: scale(0.92);
  }
}
