:root {
  color-scheme: dark;
  --night: #090714;
  --night-soft: #121022;
  --ink: #f7f2ff;
  --muted: #b7afc9;
  --violet: #b994ff;
  --lilac: #dccbff;
  --blue: #8fb7ff;
  --pink: #f3accd;
  --glass: rgba(24, 20, 43, 0.7);
  --line: rgba(226, 214, 255, 0.2);
  --glow: 0 24px 80px rgba(126, 91, 211, 0.22);
  --radius: 28px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  overflow-x: hidden;
  background: var(--night);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100%;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 72% 6%, rgba(164, 115, 234, 0.2), transparent 28rem),
    radial-gradient(circle at 10% 78%, rgba(95, 130, 210, 0.14), transparent 28rem),
    linear-gradient(165deg, #100c20 0%, #090714 46%, #070611 100%);
}

button, input, video { font: inherit; }

button {
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 4px;
}

[hidden] { display: none !important; }

#particle-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.aurora {
  position: fixed;
  z-index: 0;
  width: 48vw;
  height: 48vw;
  border-radius: 50%;
  filter: blur(84px);
  opacity: 0.12;
  pointer-events: none;
  animation: aurora-drift 14s ease-in-out infinite alternate;
}

.aurora-one { top: -12vw; right: -12vw; background: var(--violet); }
.aurora-two { bottom: -18vw; left: -10vw; background: var(--blue); animation-delay: -6s; }

.system-bar {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top)) 18px 12px;
  color: rgba(239, 232, 255, 0.58);
  font-size: 10px;
  letter-spacing: 0.15em;
  pointer-events: none;
}

.system-brand { display: flex; align-items: center; gap: 8px; }
.signal-dot { width: 6px; height: 6px; border-radius: 50%; background: #91e8c3; box-shadow: 0 0 12px #91e8c3; }

.icon-button {
  width: 44px;
  height: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(13, 10, 27, 0.58);
  backdrop-filter: blur(16px);
  pointer-events: auto;
}

.icon-button[aria-pressed="true"] { color: var(--pink); border-color: rgba(243, 172, 205, 0.5); }

.app-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

.scene {
  position: absolute;
  inset: 0;
  display: grid;
  align-items: center;
  justify-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(76px + env(safe-area-inset-top)) 20px calc(30px + env(safe-area-inset-bottom));
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.985);
  transition: opacity 0.55s ease, transform 0.65s cubic-bezier(.2,.8,.2,1), visibility 0.55s;
}

.scene.is-active {
  position: relative;
  opacity: 1;
  visibility: visible;
  transform: none;
}

.glass-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(39, 31, 62, 0.78), rgba(14, 12, 27, 0.74));
  box-shadow: var(--glow), inset 0 1px rgba(255,255,255,0.06);
  backdrop-filter: blur(20px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--lilac);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2, h3 { text-wrap: balance; }

.boot-terminal {
  width: min(100%, 430px);
  padding: 38px 28px 25px;
}

.orbit-mark {
  position: relative;
  width: 70px;
  height: 70px;
  margin: 0 auto 34px;
  border: 1px solid rgba(210, 191, 255, 0.35);
  border-radius: 50%;
  animation: slow-spin 10s linear infinite;
}

.orbit-mark::before, .orbit-mark::after {
  content: "";
  position: absolute;
  inset: 10px -12px;
  border: 1px solid rgba(143, 183, 255, 0.22);
  border-radius: 50%;
  transform: rotate(55deg);
}

.orbit-mark::after { inset: -5px 17px; transform: rotate(-45deg); }
.orbit-mark span { position: absolute; inset: 28px; border-radius: 50%; background: #fff; box-shadow: 0 0 18px 7px rgba(201, 174, 255, 0.75); }
.orbit-mark i { position: absolute; top: 0; left: 50%; width: 5px; height: 5px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 12px var(--pink); }

.boot-title { min-height: 58px; margin: 0 0 35px; font-size: clamp(21px, 6vw, 27px); font-weight: 420; line-height: 1.45; }
.typing-dots { display: inline-block; animation: blink 1.1s steps(2,end) infinite; }
.progress-track { height: 2px; overflow: hidden; background: rgba(255,255,255,0.1); }
.progress-track span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--blue), var(--violet), var(--pink)); box-shadow: 0 0 16px var(--violet); transition: width 0.35s ease; }
.progress-meta { display: flex; justify-content: space-between; margin-top: 11px; color: #8f879f; font-size: 9px; letter-spacing: 0.12em; }
.progress-meta strong { color: var(--lilac); font-weight: 500; }

.identity-card { width: min(100%, 400px); padding: 42px 26px 26px; text-align: center; }
.mini-star { display: block; margin-bottom: 22px; color: var(--pink); font-size: 24px; filter: drop-shadow(0 0 12px var(--pink)); }
.identity-card h2 { margin: 0; font-size: 18px; font-weight: 400; color: var(--muted); }
.name-display { display: block; margin: 9px auto 3px; padding: 4px 12px; border: 0; background: none; font-family: Georgia, "Songti SC", serif; font-size: clamp(45px, 13vw, 62px); font-weight: 400; letter-spacing: 0.06em; text-shadow: 0 0 35px rgba(185, 148, 255, 0.38); }
.muted-copy { margin: 8px 0 34px; color: var(--muted); font-size: 13px; }

.primary-button, .small-button, .text-button {
  min-height: 48px;
  border: 0;
  cursor: pointer;
}

.primary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 19px 0 23px;
  border-radius: 999px;
  color: #21152e;
  background: linear-gradient(110deg, #ede3ff, #d4c1fa 54%, #f8cfe2);
  box-shadow: 0 12px 38px rgba(168, 126, 235, 0.25);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.06em;
}

.primary-button i { font-size: 18px; font-style: normal; }
.primary-button:disabled { cursor: wait; opacity: 0.55; }
.primary-button.pale { margin-top: 35px; color: #332840; background: #f4edfa; }

.letter-card {
  position: relative;
  width: min(100%, 430px);
  padding: 70px 28px 28px;
  overflow: hidden;
  border: 1px solid rgba(240, 226, 255, 0.36);
  border-radius: 30px 30px 80px 30px;
  color: #3d3348;
  background:
    linear-gradient(rgba(255,255,255,0.76), rgba(243,238,250,0.9)),
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(77,56,94,0.08) 28px);
  box-shadow: 0 30px 100px rgba(5, 3, 13, 0.55), 0 0 70px rgba(185, 148, 255, 0.16);
}

.letter-card::before { content: ""; position: absolute; width: 180px; height: 180px; top: -90px; right: -58px; border: 1px solid rgba(111,82,146,0.16); border-radius: 50%; box-shadow: 0 0 0 26px rgba(111,82,146,0.05), 0 0 0 52px rgba(111,82,146,0.03); }
.letter-card .eyebrow { color: #806594; }
.letter-card h2 { margin: 0 0 28px; font-family: Georgia, "Songti SC", serif; font-size: clamp(30px, 8.2vw, 42px); font-weight: 400; line-height: 1.4; }
.letter-card > p:not(.eyebrow) { margin: 8px 0; font-size: 13px; color: #675d70; }
.letter-seal { position: absolute; top: 21px; right: 25px; display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid rgba(97,69,125,0.3); border-radius: 50%; color: #8e699c; }
.letter-rule { width: 64px; height: 1px; margin: 0 0 24px; background: #9d83ad; }

.scene-heading { align-self: end; width: min(100%, 430px); text-align: center; }
.scene-heading h2 { margin: 0 0 9px; font-family: Georgia, "Songti SC", serif; font-size: 31px; font-weight: 400; }
.scene-heading > p:last-child { margin: 0; color: var(--muted); font-size: 12px; }
.constellation-scene { grid-template-rows: auto minmax(380px, 1fr); align-content: center; }
.constellation-map { position: relative; width: min(92vw, 380px); height: min(48dvh, 430px); min-height: 360px; }
.constellation-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.constellation-lines path { fill: none; stroke: rgba(206,186,255,0.2); stroke-width: 1; stroke-dasharray: 4 8; }
.star-node { position: absolute; display: grid; place-items: center; width: 66px; height: 66px; border: 1px solid rgba(214,195,255,0.18); border-radius: 50%; background: rgba(19,15,35,0.7); backdrop-filter: blur(10px); transition: transform .4s ease, border-color .4s ease, box-shadow .4s ease; }
.star-node span { position: absolute; top: -17px; font-size: 9px; color: #8d839d; }
.star-node i { color: #625879; font-size: 18px; font-style: normal; }
.star-node.is-ready { border-color: rgba(219,199,255,0.58); box-shadow: 0 0 35px rgba(173,129,243,0.28); animation: star-pulse 2s ease-in-out infinite; }
.star-node.is-ready i, .star-node.is-unlocked i { color: #fff; filter: drop-shadow(0 0 10px var(--violet)); }
.star-node.is-unlocked { border-color: var(--pink); background: rgba(87,56,111,0.58); }
.star-one { left: 6%; bottom: 10%; }.star-two { left: 34%; bottom: 45%; }.star-three { right: 18%; top: 28%; }.star-four { right: 0; top: 3%; }
.constellation-center { position: absolute; left: 50%; bottom: 5%; display: flex; gap: 6px; align-items: center; transform: translateX(-50%); color: #8e849e; font-size: 10px; letter-spacing: .12em; }
.constellation-center b { color: var(--pink); font-weight: 400; }
.unlock-card { position: fixed; z-index: 25; left: 20px; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); max-width: 430px; margin: auto; padding: 24px; animation: card-rise .45s ease both; }
.unlock-card h3 { margin: 0 0 10px; font-family: Georgia, "Songti SC", serif; font-size: 24px; font-weight: 400; }
.unlock-card > p:not(.eyebrow) { margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.small-button { width: 100%; padding: 0 18px; border-radius: 999px; color: #2b2037; background: #ede3fa; font-weight: 650; }

.memory-layout { display: grid; width: min(100%, 440px); align-items: center; gap: 22px; }
.memory-copy h2, .portrait-copy h2 { margin: 0 0 13px; font-family: Georgia, "Songti SC", serif; font-size: clamp(34px, 9vw, 48px); font-weight: 400; line-height: 1.2; }
.portrait-copy h2 { font-size: clamp(30px, 8vw, 42px); }
.memory-copy > p:last-child { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.romantic-note { position: relative; margin: 18px 0 0; padding: 15px 0 0 18px; border-left: 1px solid rgba(243,172,205,.42); color: #ddd3ea; font-family: Georgia, "Songti SC", serif; font-size: 14px; line-height: 1.85; }
.photo-frame { justify-self: center; width: min(78vw, 310px); padding: 10px 10px 17px; border: 0; color: #4b4352; background: #eee9ed; box-shadow: 0 26px 70px rgba(0,0,0,.42); transform: rotate(-2.5deg); }
.photo-frame img { display: block; width: 100%; height: min(43dvh, 380px); object-fit: cover; }
.photo-frame span { display: block; padding: 12px 4px 0; font-family: Georgia, "Songti SC", serif; font-size: 12px; }
.photo-frame.is-fallback { display: grid; min-height: 330px; place-content: center; background: radial-gradient(circle at 50% 38%, rgba(185,148,255,.22), transparent 120px), #171126; color: var(--lilac); }
.photo-frame .fallback-visual { padding: 24px; font-size: 15px; line-height: 1.8; }
.scene-next { margin-top: 2px; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; overflow: hidden; padding: 1px; }
.stats-grid > div { min-height: 100px; padding: 18px 14px; background: rgba(9,7,20,.52); }
.stats-grid span { display: block; margin-bottom: 13px; color: #968da7; font-size: 10px; }
.stats-grid strong { font-family: Georgia, serif; font-size: 22px; font-weight: 400; color: var(--lilac); }
.system-note { margin: -5px 4px 0; color: #8e859d; font-size: 11px; line-height: 1.7; }
.mini-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.gallery-thumb { position: relative; min-height: 150px; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: #151022; }
.gallery-thumb:first-child { grid-row: span 2; }
.gallery-thumb img { display: block; width: 100%; height: 100%; min-height: 150px; object-fit: cover; transition: transform .5s ease; }
.gallery-thumb.is-fallback { display: grid; place-items: center; padding: 18px; background: radial-gradient(circle, rgba(185,148,255,.2), transparent 70%), #151022; }
.gallery-thumb .fallback-visual { color: var(--lilac); font-size: 12px; line-height: 1.6; text-align: center; }

.portrait-scene { align-content: center; gap: 22px; }
.portrait-copy { width: min(100%, 440px); }
.portrait-stack { position: relative; width: min(86vw, 390px); height: min(52dvh, 515px); min-height: 420px; padding: 0; border: 0; background: transparent; perspective: 1000px; }
.portrait-layer { position: absolute; inset: 0; margin: 0; padding: 10px 10px 42px; color: #4b4352; background: #eee9ed; box-shadow: 0 28px 90px rgba(0,0,0,.55); transition: opacity 1.2s ease, transform 1.2s cubic-bezier(.2,.8,.2,1); }
.portrait-layer img { display: block; width: 100%; height: 100%; object-fit: cover; }
.portrait-layer figcaption { padding-top: 10px; font-family: Georgia, "Songti SC", serif; font-size: 12px; }
.portrait-work { transform: rotate(-2deg); }
.portrait-finished { opacity: 0; transform: rotate(2deg) scale(.92); }
.portrait-stack.is-revealed .portrait-work { opacity: 0; transform: rotate(-7deg) translateX(-20%) scale(.9); }
.portrait-stack.is-revealed .portrait-finished { opacity: 1; transform: rotate(1deg) scale(1); }
.portrait-hint { position: absolute; z-index: 3; left: 50%; bottom: -14px; transform: translateX(-50%); width: max-content; padding: 9px 14px; border: 1px solid var(--line); border-radius: 99px; background: #141021dd; color: var(--lilac); font-size: 9px; letter-spacing: .14em; }
.portrait-stack.is-revealed .portrait-hint { opacity: 0; }
.portrait-next { width: min(100%, 390px); }

.final-message-scene { align-content: center; }
.final-lines { width: min(100%, 600px); min-height: 250px; display: grid; place-content: center; gap: 15px; text-align: center; }
.final-line { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(22px, 6vw, 34px); line-height: 1.5; opacity: 0; transform: translateY(12px); animation: line-in 1s ease forwards; }
.final-line.small { color: var(--muted); font-size: clamp(15px, 4vw, 20px); }
.final-next { width: min(100%, 390px); margin-top: 26px; }

.firework-scene { text-align: center; }
.finish-content { width: min(100%, 500px); }
.finish-content h2 { margin: 9px 0 15px; font-family: Georgia, "Songti SC", serif; font-size: clamp(56px, 16vw, 86px); font-weight: 400; text-shadow: 0 0 44px rgba(205,178,255,.42); }
.name-pair { display: flex; justify-content: center; align-items: center; gap: 13px; font-size: 18px; letter-spacing: .08em; }
.name-pair i { color: var(--pink); font-family: Georgia, serif; font-style: normal; }
.finish-copy { margin: 18px 0 38px; color: var(--muted); }
.finish-actions { display: grid; gap: 10px; width: min(100%, 390px); margin: auto; }
.text-button { width: 100%; color: var(--lilac); background: transparent; font-size: 13px; }
.hidden-star { position: fixed; right: 14px; bottom: calc(10px + env(safe-area-inset-bottom)); width: 48px; height: 48px; border: 0; background: transparent; color: rgba(255,255,255,.16); font-size: 12px; }

.archive-scene { align-items: start; }
.archive-panel { width: min(100%, 760px); padding: 19px; }
.archive-topline { display: flex; justify-content: space-between; padding-bottom: 15px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 9px; letter-spacing: .16em; }
.archive-topline strong { color: #91e8c3; }
.archive-hero { display: grid; grid-template-columns: 105px 1fr; gap: 17px; align-items: center; padding: 22px 0; }
.archive-hero img { width: 105px; height: 135px; object-fit: cover; border-radius: 45px 45px 16px 16px; filter: grayscale(.15); }
.archive-hero h2 { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 14px; font-family: Georgia, "Songti SC", serif; font-size: 24px; font-weight: 400; }
.archive-hero h2 b { color: var(--pink); font-weight: 400; }
.archive-hero p:not(.eyebrow) { margin: 5px 0; color: var(--muted); font-size: 10px; }
.archive-hero p strong { color: var(--lilac); }
.archive-gallery { display: grid; grid-auto-flow: column; grid-auto-columns: 72%; gap: 12px; overflow-x: auto; padding: 4px 1px 16px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.archive-gallery::-webkit-scrollbar { display: none; }
.archive-gallery .gallery-thumb { min-height: 220px; scroll-snap-align: center; }
.achievement { display: grid; grid-template-columns: 52px 1fr; gap: 15px; padding: 18px; border: 1px solid rgba(243,172,205,.28); border-radius: 22px; background: linear-gradient(115deg,rgba(69,46,91,.42),rgba(20,16,34,.65)); }
.achievement-icon { display: grid; place-items: center; width: 52px; height: 52px; border: 1px solid rgba(238,215,255,.35); border-radius: 50%; color: var(--pink); box-shadow: inset 0 0 22px rgba(205,156,255,.18); }
.achievement small { display: block; color: #968ba8; font-size: 8px; letter-spacing: .12em; }
.achievement strong { display: block; margin: 4px 0; font-family: Georgia, "Songti SC", serif; font-size: 19px; font-weight: 400; }
.achievement p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.archive-back { margin-top: 10px; }

.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); width: max-content; max-width: calc(100vw - 40px); transform: translateX(-50%); padding: 12px 17px; border: 1px solid var(--line); border-radius: 99px; background: rgba(16,12,29,.9); box-shadow: var(--glow); color: var(--lilac); font-size: 12px; text-align: center; backdrop-filter: blur(18px); animation: toast-in .3s ease both; }
.media-modal { position: fixed; z-index: 80; inset: 0; display: grid; place-items: center; padding: 58px 16px 30px; background: rgba(5,4,11,.94); backdrop-filter: blur(16px); }
.media-modal figure { width: min(100%, 900px); max-height: 82dvh; margin: 0; text-align: center; }
.media-modal img, .media-modal video { display: block; max-width: 100%; max-height: 72dvh; margin: auto; border-radius: 18px; object-fit: contain; }
.media-modal figcaption { min-height: 36px; padding-top: 13px; color: var(--muted); font-size: 12px; }
.modal-close, .modal-nav { position: fixed; z-index: 2; width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 50%; background: rgba(22,18,36,.8); }
.modal-close { top: calc(12px + env(safe-area-inset-top)); right: 14px; font-size: 25px; }
.modal-nav { top: 50%; transform: translateY(-50%); font-size: 30px; }
.modal-prev { left: 10px; }.modal-next { right: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@keyframes slow-spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: .2; } }
@keyframes aurora-drift { to { transform: translate3d(10vw,8vh,0) scale(1.2); } }
@keyframes star-pulse { 50% { transform: scale(1.08); box-shadow: 0 0 55px rgba(189,145,255,.48); } }
@keyframes card-rise { from { opacity: 0; transform: translateY(20px); } }
@keyframes line-in { to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%,10px); } }

@media (min-width: 430px) {
  .scene { padding-left: 26px; padding-right: 26px; }
  .boot-terminal, .identity-card { padding-left: 34px; padding-right: 34px; }
}

@media (min-width: 768px) {
  body::before { content: ""; position: fixed; z-index: 0; inset: 8vh 50% auto auto; width: 1px; height: 84vh; background: linear-gradient(transparent,var(--line),transparent); }
  .system-bar { padding-left: 30px; padding-right: 30px; }
  .memory-layout { grid-template-columns: .82fr 1.18fr; width: min(90vw, 860px); column-gap: 55px; }
  .memory-copy { align-self: center; }
  .memory-layout .scene-next { grid-column: 1; width: 280px; }
  .memory-layout .photo-frame, .memory-layout .stats-grid, .memory-layout .mini-gallery { grid-column: 2; grid-row: 1 / span 2; }
  .stats-layout .romantic-note { grid-column: 1; }
  .system-note { grid-column: 2; }
  .archive-panel { padding: 26px; }
  .archive-gallery { grid-auto-columns: 36%; }
}

@media (hover:hover) {
  .primary-button:hover { transform: translateY(-2px); box-shadow: 0 16px 46px rgba(168,126,235,.34); }
  .gallery-thumb:hover img { transform: scale(1.04); }
  .star-node:not(:disabled):hover { transform: scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .aurora { display: none; }
}

/* ==================== 浪漫回忆长卷 ==================== */
body[data-state="LONGFORM"] {
  background:
    radial-gradient(circle at 78% 8%, rgba(201, 147, 210, 0.16), transparent 30rem),
    radial-gradient(circle at 12% 42%, rgba(96, 130, 214, 0.16), transparent 34rem),
    linear-gradient(180deg, #090714 0%, #100b1d 35%, #080713 100%);
}

body[data-state="LONGFORM"] .system-bar {
  background: linear-gradient(180deg, rgba(8, 7, 20, 0.88), transparent);
}

.longform.scene {
  position: relative;
  inset: auto;
  display: block;
  width: 100%;
  min-height: 100vh;
  padding: 0 0 calc(64px + env(safe-area-inset-bottom));
  overflow: visible;
}

.longform-hero {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(92px + env(safe-area-inset-top)) 24px 72px;
  text-align: center;
  isolation: isolate;
}

.longform-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: min(82vw, 620px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(193, 151, 236, 0.17), transparent 64%);
  filter: blur(12px);
}

.longform-hero::after {
  content: "✦   ·   ✦";
  position: absolute;
  bottom: 16%;
  color: rgba(226, 211, 255, 0.34);
  font-size: 12px;
  letter-spacing: 0.55em;
}

.longform-hero h1 {
  margin: 0;
  font-family: Georgia, "Songti SC", "STSong", serif;
  font-size: clamp(44px, 13vw, 82px);
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: 0.04em;
  text-shadow: 0 0 52px rgba(185, 148, 255, 0.26);
}

.longform-hero > p:not(.eyebrow) {
  max-width: 34rem;
  margin: 28px auto 0;
  color: var(--muted);
  font-family: Georgia, "Songti SC", serif;
  font-size: 15px;
  line-height: 2;
}

.scroll-hint {
  position: absolute;
  bottom: calc(32px + env(safe-area-inset-bottom));
  color: rgba(230, 219, 248, 0.52);
  font-size: 10px;
  letter-spacing: 0.16em;
  animation: gentle-float 2.8s ease-in-out infinite;
}

.memory-progress {
  position: fixed;
  z-index: 18;
  top: calc(76px + env(safe-area-inset-top));
  right: 10px;
  bottom: calc(26px + env(safe-area-inset-bottom));
  width: 16px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .4s ease;
}

body[data-state="LONGFORM"] .memory-progress { opacity: 1; }

.memory-progress::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 7px;
  width: 1px;
  background: rgba(224, 207, 255, 0.16);
}

.memory-progress span {
  position: absolute;
  top: 8px;
  left: 7px;
  width: 1px;
  height: var(--memory-progress, 0%);
  max-height: calc(100% - 16px);
  background: linear-gradient(var(--blue), var(--violet), var(--pink));
  box-shadow: 0 0 10px rgba(185, 148, 255, .7);
}

.memory-progress i {
  position: absolute;
  top: var(--memory-progress, 0%);
  left: 0;
  color: var(--pink);
  font-size: 14px;
  font-style: normal;
  filter: drop-shadow(0 0 7px var(--pink));
  transform: translateY(-45%);
}

#longform-content { width: 100%; }

.memory-chapter {
  position: relative;
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 104px 18px;
  isolation: isolate;
}

.has-reveal .memory-chapter {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .8s ease, transform .9s cubic-bezier(.2,.8,.2,1);
}

.has-reveal .memory-chapter.is-visible {
  opacity: 1;
  transform: none;
}

.memory-chapter::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 11%;
  left: 50%;
  width: min(92vw, 760px);
  height: 54%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(134, 99, 195, 0.09), transparent 68%);
  transform: translateX(-50%);
  pointer-events: none;
}

.memory-chapter:nth-child(even)::before {
  background: radial-gradient(ellipse, rgba(103, 145, 208, 0.08), transparent 68%);
}

.chapter-heading {
  width: min(100%, 650px);
  margin: 0 auto 52px;
  text-align: center;
}

.chapter-heading h2 {
  margin: 0;
  font-family: Georgia, "Songti SC", "STSong", serif;
  font-size: clamp(33px, 9.3vw, 58px);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0.025em;
}

.chapter-heading > p:last-child {
  margin: 22px auto 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
}

.chapter-body {
  display: grid;
  gap: 42px;
}

.memory-note {
  position: relative;
  width: min(88%, 590px);
  margin: 22px auto;
  padding: 29px 24px 28px;
  border: 1px solid rgba(225, 209, 255, 0.15);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(38, 29, 58, .62), rgba(17, 14, 31, .54));
  box-shadow: 0 20px 55px rgba(3, 2, 10, .22);
  backdrop-filter: blur(14px);
  text-align: center;
}

.memory-note span {
  position: absolute;
  top: -11px;
  left: 50%;
  width: 28px;
  color: var(--pink);
  background: #0d0a1a;
  transform: translateX(-50%);
}

.memory-note p {
  margin: 0;
  color: #eee7f8;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(16px, 4.4vw, 20px);
  line-height: 1.95;
}

.memory-mosaic {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.memory-photo {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 48px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(226, 213, 255, .16);
  border-radius: 18px;
  background: rgba(20, 16, 36, .72);
  box-shadow: 0 16px 38px rgba(3, 2, 10, .25);
  cursor: zoom-in;
}

.memory-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center;
  background: linear-gradient(145deg, #1b1530, #0b0915);
  transition: transform .65s cubic-bezier(.2,.8,.2,1), filter .4s ease;
}

.memory-photo span {
  display: block;
  padding: 12px 11px 14px;
  color: #d8cee5;
  font-size: 11px;
  line-height: 1.65;
  text-align: left;
}

.memory-photo:nth-child(5n + 1) { grid-column: 1 / -1; }
.memory-photo:nth-child(5n + 1) img { aspect-ratio: 16 / 10; }
.memory-photo:active img { transform: scale(.985); }

.memory-mosaic.scenic .memory-photo:nth-child(3n + 2) img,
.memory-mosaic.crossover .memory-photo:nth-child(3n + 1) img {
  aspect-ratio: 16 / 11;
}

.memory-mosaic.intimate .memory-photo img,
.memory-mosaic.ceremony .memory-photo img { aspect-ratio: 3 / 4; }

.burst-strip {
  display: flex;
  gap: 13px;
  width: calc(100% + 36px);
  margin-left: -18px;
  padding: 8px 18px 20px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.burst-strip::-webkit-scrollbar { display: none; }
.burst-strip .memory-photo {
  flex: 0 0 min(78vw, 390px);
  scroll-snap-align: center;
}
.burst-strip .memory-photo img { aspect-ratio: 4 / 3; }

.video-gallery {
  display: grid;
  gap: 22px;
  width: 100%;
}

.video-memory {
  width: 100%;
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(225, 210, 255, .17);
  border-radius: 25px;
  background: linear-gradient(145deg, rgba(36, 28, 54, .76), rgba(13, 11, 25, .78));
  box-shadow: 0 24px 62px rgba(2, 1, 8, .36);
}

.video-shell {
  position: relative;
  overflow: hidden;
  border-radius: 17px;
  background: #070611;
}

.video-memory video {
  display: block;
  width: 100%;
  max-height: 72vh;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  background: #070611;
}

.video-badge {
  position: absolute;
  top: 11px;
  left: 11px;
  padding: 6px 9px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  color: rgba(255,255,255,.76);
  background: rgba(8, 7, 18, .62);
  backdrop-filter: blur(10px);
  font-size: 8px;
  letter-spacing: .13em;
  pointer-events: none;
}

.video-memory figcaption {
  padding: 15px 8px 6px;
  color: #d9cfeb;
  font-size: 12px;
  line-height: 1.75;
}

.portrait-climax {
  display: grid;
  gap: 32px;
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 34px 0;
}

.portrait-climax .memory-photo:first-child {
  width: 88%;
  justify-self: start;
  transform: rotate(-1.5deg);
}

.portrait-climax .memory-photo:last-child {
  width: 94%;
  justify-self: end;
  border-color: rgba(246, 221, 237, .4);
  box-shadow: 0 26px 90px rgba(197, 142, 187, .21), 0 0 80px rgba(185, 148, 255, .14);
  transform: rotate(1deg);
}

.portrait-climax .memory-photo img { aspect-ratio: auto; object-fit: contain; }

#chapter-portrait {
  padding-top: 140px;
  padding-bottom: 150px;
}

#chapter-portrait::before {
  height: 85%;
  background: radial-gradient(ellipse, rgba(224, 162, 204, .13), transparent 67%);
}

.final-letter {
  width: min(100%, 680px);
  margin: 0 auto;
  padding: 42px 26px;
  color: #3b3244;
  background:
    linear-gradient(rgba(250,247,252,.96), rgba(241,234,245,.94)),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(101,75,115,.07) 32px);
  box-shadow: 0 35px 100px rgba(3, 2, 9, .52), 0 0 80px rgba(190, 147, 216, .13);
}

.final-letter p {
  margin: 0 0 20px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 15px;
  line-height: 2.05;
}

.final-letter .letter-recipient { font-size: 22px; }

.final-letter footer {
  display: grid;
  gap: 6px;
  margin-top: 38px;
  text-align: right;
}

.final-letter footer strong { font-family: Georgia, "Songti SC", serif; font-size: 21px; font-weight: 400; }
.final-letter footer span { color: #75697e; font-size: 11px; }

.longform-footer {
  display: grid;
  gap: 20px;
  width: min(calc(100% - 36px), 430px);
  margin: 0 auto;
  padding: 48px 0 calc(32px + env(safe-area-inset-bottom));
  text-align: center;
}

.longform-footer p { margin: 0; color: rgba(223, 211, 239, .55); font-size: 11px; letter-spacing: .08em; }

.memory-photo.is-fallback,
.video-memory.is-fallback .video-shell {
  min-height: 220px;
  background:
    radial-gradient(circle at center, rgba(185,148,255,.16), transparent 35%),
    linear-gradient(145deg, #1b1530, #0c0918);
}

.memory-photo.is-fallback img { display: none; }
.memory-photo.is-fallback::before { content: "✦"; display: grid; place-items: center; min-height: 190px; color: var(--violet); font-size: 30px; }
.memory-photo.is-fallback { cursor: pointer; }
.memory-photo.is-fallback::after {
  content: "图片暂时没加载出来 · 点一下重新加载";
  display: block;
  padding: 0 14px 16px;
  color: var(--lilac);
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}
.memory-photo.is-retrying::after { content: "正在重新加载…"; }

@keyframes gentle-float {
  0%, 100% { transform: translateY(0); opacity: .48; }
  50% { transform: translateY(7px); opacity: .78; }
}

@media (min-width: 700px) {
  .memory-chapter { padding-inline: 34px; }
  .memory-mosaic { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
  .memory-photo:nth-child(5n + 1) { grid-column: span 2; grid-row: span 2; }
  .memory-photo:nth-child(5n + 1) img { height: 100%; min-height: 420px; aspect-ratio: auto; }
  .video-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-videos { grid-template-columns: 1fr; width: min(100%, 850px); margin-inline: auto; }
  .burst-strip { width: 100%; margin-left: 0; padding-inline: 0; }
  .burst-strip .memory-photo { flex-basis: min(55vw, 480px); }
  .memory-progress { right: 22px; }
}

@media (min-width: 1000px) {
  .memory-chapter { padding-top: 140px; padding-bottom: 140px; }
  .chapter-heading { margin-bottom: 72px; }
  .memory-mosaic { gap: 19px; }
  .memory-photo span { padding: 15px 15px 17px; font-size: 12px; }
  .memory-photo:hover img { transform: scale(1.025); filter: saturate(1.05); }
  .portrait-climax { grid-template-columns: .82fr 1.18fr; align-items: end; }
  .portrait-climax .memory-photo:first-child,
  .portrait-climax .memory-photo:last-child { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-hint { animation: none; }
  .memory-photo img,
  .memory-progress,
  .memory-progress span,
  .memory-progress i { transition: none; }
}
