:root {
  color-scheme: light;
  --bg: #151321;
  --panel: rgba(255, 252, 246, 0.94);
  --ink: #2f2631;
  --muted: #776a73;
  --peach: #f5a65f;
  --peach-soft: #ffe0bd;
  --cream: #fff4d6;
  --coconut: #dff5ff;
  --coconut-deep: #77c9dc;
  --violet: #8b7bd8;
  --line: rgba(255, 244, 214, 0.18);
  --shadow: 0 24px 60px rgba(5, 6, 18, 0.32);
  --radius: 8px;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--ink);
  background: var(--bg);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100svh;
  margin: 0 auto;
  position: relative;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(4, 6, 20, 0.02), rgba(4, 7, 18, 0.88)),
    url("../assets/generated/starfield-bg.png") center / cover;
}

.gate-screen,
.cinema-app,
.admin-app {
  min-height: 100svh;
  padding: max(22px, env(safe-area-inset-top)) 18px max(22px, env(safe-area-inset-bottom));
}

.gate-screen {
  display: grid;
  place-items: center;
}

.premiere-card,
.welcome-strip,
.admin-panel,
.bottom-sheet {
  border: 1px solid rgba(255, 244, 214, 0.2);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.premiere-card {
  width: min(100%, 390px);
  padding: 28px 22px 22px;
  position: relative;
}

.overline {
  margin: 0 0 8px;
  color: #9f5d2d;
  font-size: 0.78rem;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  color: #2d2230;
  font-size: 2.35rem;
  line-height: 1.06;
}

.gate-copy,
.chapter-story,
.letter-body {
  color: var(--muted);
  line-height: 1.75;
}

.letter-body {
  min-height: 7em;
  max-height: 7em;
  overflow: auto;
  overscroll-behavior: contain;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.input-row input,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(47, 38, 49, 0.16);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  outline: none;
}

.input-row input {
  height: 48px;
  padding: 0 13px;
}

.input-row input:focus-visible,
textarea:focus-visible {
  border-color: var(--coconut-deep);
  box-shadow: 0 0 0 3px rgba(119, 201, 220, 0.34);
}

textarea {
  resize: vertical;
  padding: 12px;
  line-height: 1.6;
}

.input-row button,
.primary-button,
.secondary-button,
.quick-actions button {
  min-height: 46px;
  border: 0;
  border-radius: var(--radius);
  padding: 0 16px;
  font-weight: 800;
}

.input-row button,
.primary-button {
  background: #f0994a;
  color: #211722;
}

.secondary-button,
.quick-actions button {
  border: 1px solid rgba(255, 244, 214, 0.22);
  background: rgba(255, 252, 246, 0.9);
  color: #2d2230;
}

.danger-button {
  color: #a83248;
}

.gate-error {
  min-height: 22px;
  margin: 10px 0 0;
  color: #a83248;
}

.entry-loading[hidden],
[hidden] {
  display: none !important;
}

.entry-loading {
  margin-top: 16px;
  text-align: center;
}

.entry-loading p {
  margin: 8px 0 2px;
  font-weight: 900;
}

.entry-loading strong {
  color: #9f5d2d;
  font-size: 0.9rem;
}

.projector-scene {
  position: relative;
  width: min(100%, 330px);
  height: 128px;
  margin: 10px auto 2px;
  overflow: hidden;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 74% 50%, rgba(255, 244, 214, 0.34), transparent 25%),
    linear-gradient(135deg, #161321, #2f2631);
  box-shadow: inset 0 0 0 1px rgba(255, 244, 214, 0.18), 0 18px 40px rgba(47, 38, 49, 0.22);
}

.projector-loader {
  position: absolute;
  left: 18px;
  top: 31px;
  width: 94px;
  height: 66px;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.34));
}

.projector-body,
.projector-lens,
.projector-reel {
  position: absolute;
  display: block;
}

.projector-body {
  left: 17px;
  bottom: 0;
  width: 70px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff4d6, #f5a65f);
}

.projector-lens {
  right: -8px;
  bottom: 9px;
  width: 26px;
  height: 16px;
  border-radius: 4px 12px 12px 4px;
  background: #77c9dc;
}

.projector-reel {
  top: 0;
  width: 36px;
  height: 36px;
  border: 5px solid #fff4d6;
  border-radius: 50%;
  background:
    radial-gradient(circle, #151321 0 16%, transparent 17%),
    conic-gradient(from 0deg, rgba(21, 19, 33, 0.84) 0 18deg, transparent 18deg 54deg, rgba(21, 19, 33, 0.84) 54deg 72deg, transparent 72deg 126deg, rgba(21, 19, 33, 0.84) 126deg 144deg, transparent 144deg 360deg);
  animation: projectorReel 1.1s linear infinite;
}

.projector-reel.is-left {
  left: 0;
}

.projector-reel.is-right {
  left: 43px;
  animation-direction: reverse;
}

.projector-beam {
  position: absolute;
  left: 108px;
  top: 46px;
  width: 150px;
  height: 38px;
  clip-path: polygon(0 32%, 100% 0, 100% 100%, 0 68%);
  background: linear-gradient(90deg, rgba(255, 244, 214, 0.78), rgba(255, 244, 214, 0.14));
  opacity: 0.88;
  animation: projectorBeam 1.8s ease-in-out infinite;
}

.projector-screen {
  position: absolute;
  right: 19px;
  top: 25px;
  width: 72px;
  height: 78px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 244, 214, 0.78);
  border-radius: 6px;
  background:
    linear-gradient(90deg, rgba(47, 38, 49, 0.16) 0 8%, transparent 8% 92%, rgba(47, 38, 49, 0.16) 92%),
    #fff8e8;
  color: #2d2230;
}

.film-countdown {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(47, 38, 49, 0.22);
  border-radius: 50%;
  font-size: 1.5rem;
  font-weight: 900;
  animation: filmCountdown 3s steps(3, end) infinite;
}

.ticket-corner {
  margin-top: 18px;
  color: rgba(47, 38, 49, 0.48);
  font-size: 0.78rem;
  text-align: center;
}

.cinema-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--cream);
}

.cinema-header h2 {
  margin: 0;
  font-size: 1.55rem;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.icon-button,
.sheet-close {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 244, 214, 0.22);
  border-radius: 50%;
  background: rgba(255, 252, 246, 0.12);
  color: var(--cream);
  font-weight: 900;
}

.icon-button.is-muted {
  opacity: 0.62;
  text-decoration: line-through;
}

.welcome-strip {
  margin: 14px 0;
  padding: 14px;
}

.welcome-strip p {
  margin-bottom: 10px;
  line-height: 1.55;
}

.screening-progress {
  display: grid;
  gap: 8px;
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(47, 38, 49, 0.12);
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--peach), var(--cream), var(--coconut-deep));
}

.route-stage {
  min-height: 560px;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 16%, rgba(255, 245, 214, 0.18), transparent 19%),
    radial-gradient(circle at 28% 72%, rgba(119, 201, 220, 0.16), transparent 25%),
    url("../assets/generated/starfield-bg.png") center / cover,
    rgba(12, 13, 25, 0.42);
  border: 1px solid rgba(255, 244, 214, 0.12);
}

.viewer-bonus-stats {
  position: absolute;
  left: 14px;
  top: 12px;
  z-index: 3;
  display: grid;
  gap: 3px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.35;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.62);
  pointer-events: none;
}

.viewer-bonus-stats strong {
  color: #fff;
  font-size: inherit;
}

.route-constellation {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(128deg, transparent 17%, rgba(245, 166, 95, 0.34) 17.3%, transparent 17.8%),
    linear-gradient(146deg, transparent 31%, rgba(141, 214, 232, 0.22) 31.3%, transparent 31.9%),
    linear-gradient(24deg, transparent 62%, rgba(255, 244, 214, 0.18) 62.2%, transparent 62.8%);
  pointer-events: none;
}

.planet-route {
  position: absolute;
  inset: 18px;
  z-index: 2;
}

.route-trail {
  position: absolute;
  inset: 18px;
  z-index: 1;
  width: calc(100% - 36px);
  height: calc(100% - 36px);
  overflow: visible;
  pointer-events: none;
}

.route-trail-path {
  fill: none;
  stroke: rgba(255, 244, 214, 0.72);
  stroke-width: 0.85;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1.2 1.4;
  filter: drop-shadow(0 0 5px rgba(245, 166, 95, 0.44));
}

.route-arrow {
  fill: rgba(255, 244, 214, 0.86);
  filter: drop-shadow(0 0 4px rgba(245, 166, 95, 0.58));
}

.planet-button,
.finale-planet {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 96px;
  min-height: 96px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  padding: 0;
  color: #fffaf0;
  font-size: 0.86rem;
  font-weight: 900;
  text-shadow: 0 2px 7px rgba(0, 0, 0, 0.55);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34), 0 0 0 7px rgba(255, 244, 214, 0.08);
  background-color: transparent;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 122%;
}

.planet-button span,
.planet-button small,
.finale-planet {
  position: relative;
  z-index: 1;
}

.planet-label {
  width: 46px;
  height: 46px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  place-items: center;
  gap: 0;
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 0.92;
  transform: translate(-1px, -1px);
}

.planet-label span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.planet-button[data-tone="peach"] {
  background-image: url("../assets/generated/planet-peach.png");
}

.planet-button[data-tone="coconut"] {
  background-image: url("../assets/generated/planet-coconut.png");
}

.planet-button[data-tone="gold"] {
  background-image: url("../assets/generated/planet-gold.png");
}

.planet-button[data-tone="violet"] {
  background-image: url("../assets/generated/planet-violet.png");
}

.planet-button[data-tone="rose"] {
  background-image: url("../assets/generated/planet-rose.png");
}

.planet-button[data-tone="mint"] {
  background-image: url("../assets/generated/planet-mint.png");
}

.planet-button[data-tone="sky"] {
  background-image: url("../assets/generated/planet-sky.png");
}

.planet-button:not(.is-viewed),
.finale-planet:not(.is-viewed) {
  opacity: 0.46;
  filter: saturate(0.42) brightness(0.86);
}

.planet-button.is-next,
.finale-planet.is-next {
  opacity: 0.76;
  filter: saturate(0.76) brightness(0.96);
}

.planet-button.is-locked,
.finale-planet.is-locked {
  cursor: default;
}

.planet-button.is-viewed,
.finale-planet.is-viewed {
  opacity: 1;
  filter: none;
}

.planet-button.is-viewed::after,
.finale-planet.is-viewed::after {
  content: "✓";
  position: absolute;
  right: -2px;
  top: -2px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(22, 155, 89, 0.22);
  background: #fff;
  color: #169b59;
  font-size: 1rem;
  font-weight: 900;
  text-shadow: none;
  box-shadow: 0 8px 18px rgba(5, 6, 18, 0.2);
}

.finale-planet {
  left: 80%;
  top: 85%;
  background-image: url("../assets/generated/planet-finale.png");
}

.finale-planet[aria-disabled="true"] {
  opacity: 0.45;
  filter: saturate(0.42) brightness(0.86);
  cursor: default;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: rgba(8, 8, 18, 0.56);
}

.bottom-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 11;
  width: min(100%, 520px);
  max-height: 92svh;
  overflow: auto;
  transform: translateX(-50%);
  padding: 22px 18px max(22px, env(safe-area-inset-bottom));
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.chapter-sheet,
.finale-sheet,
.ticket-sheet,
.future-sheet {
  color: var(--ink);
}

.sheet-close {
  position: sticky;
  top: 0;
  float: right;
  color: #2d2230;
  background: rgba(255, 255, 255, 0.82);
}

.memory-tag {
  margin-bottom: 8px;
  color: #9f5d2d;
  font-size: 0.78rem;
  font-weight: 800;
}

.chapter-tagline {
  color: #4f3d48;
  font-weight: 800;
  line-height: 1.6;
}

.chapter-moment {
  position: relative;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 112px;
  margin: 14px 0;
  padding: 14px;
  overflow: hidden;
  border: 1px solid rgba(47, 38, 49, 0.12);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 244, 214, 0.8), rgba(255, 255, 255, 0.9)),
    repeating-linear-gradient(90deg, rgba(47, 38, 49, 0.05) 0 1px, transparent 1px 12px);
}

.chapter-moment[hidden] {
  display: none;
}

.moment-visual {
  position: relative;
  width: 76px;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(47, 38, 49, 0.14);
  border-radius: 18px;
  background: #fff8e8;
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.52);
}

.moment-visual::before,
.moment-visual::after,
.moment-visual span {
  content: "";
  position: absolute;
  display: block;
}

.moment-visual::before {
  inset: 18px;
  border: 1px solid rgba(214, 107, 95, 0.24);
  border-radius: 14px;
}

.moment-visual::after {
  width: 28px;
  height: 28px;
  left: 24px;
  top: 24px;
  border: 2px solid rgba(245, 166, 95, 0.78);
  border-radius: 9px;
  transform: rotate(45deg);
  animation: momentPulse 2.8s ease-in-out infinite;
}

.moment-visual span {
  width: 18px;
  height: 9px;
  left: var(--x);
  top: var(--y);
  border-radius: 12px 12px 2px 12px;
  background: rgba(214, 107, 95, 0.68);
  transform: rotate(var(--angle));
  animation: momentDrift 3.6s ease-in-out infinite;
  animation-delay: var(--delay);
}

.moment-copy {
  min-width: 0;
}

.moment-copy .memory-tag {
  margin-bottom: 4px;
}

.moment-copy h4 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.moment-lines p {
  margin: 2px 0;
  color: var(--muted);
  line-height: 1.5;
}

.chapter-moment.is-flower .moment-visual::before {
  width: 3px;
  height: 36px;
  left: 36px;
  top: 34px;
  inset: auto;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #77a86c, #5f7c75);
  transform: rotate(8deg);
}

.chapter-moment.is-flower .moment-visual::after {
  width: 18px;
  height: 18px;
  left: 29px;
  top: 22px;
  border: 0;
  border-radius: 50%;
  background: #f5a65f;
  box-shadow: 0 0 16px rgba(245, 166, 95, 0.42);
  transform: none;
  animation: momentBloom 3.2s ease-in-out infinite;
}

.chapter-moment.is-flower .moment-visual span {
  width: 16px;
  height: 24px;
  left: 30px;
  top: 14px;
  border-radius: 50% 50% 8px 50%;
  background: rgba(214, 107, 95, 0.72);
  transform-origin: 8px 30px;
  animation: momentPetal 3.2s ease-in-out infinite;
  animation-delay: var(--delay);
}

.chapter-moment.is-route .moment-visual {
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 244, 214, 0.92), transparent 18%),
    linear-gradient(135deg, #fff8e8, #e7f8ff);
}

.chapter-moment.is-route .moment-visual::before {
  left: 9px;
  right: 9px;
  top: 38px;
  bottom: auto;
  height: 2px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(214, 107, 95, 0.25), #f5a65f, rgba(119, 201, 220, 0.34));
}

.chapter-moment.is-route .moment-visual::after {
  width: 10px;
  height: 10px;
  left: 33px;
  top: 33px;
  border: 0;
  border-radius: 50%;
  background: #fff4d6;
  box-shadow: 0 0 18px rgba(245, 166, 95, 0.8);
  transform: none;
  animation: momentMeetGlow 3.2s ease-in-out infinite;
}

.chapter-moment.is-route .moment-visual span {
  width: 15px;
  height: 15px;
  top: 31px;
  border-radius: 50%;
  background: #d66b5f;
  box-shadow: 0 0 12px rgba(214, 107, 95, 0.42);
  animation: momentMeet 3.2s ease-in-out infinite;
}

.chapter-moment.is-route .moment-visual span:nth-child(1) {
  left: 8px;
  --meet-end: 22px;
}

.chapter-moment.is-route .moment-visual span:nth-child(2) {
  left: 53px;
  --meet-end: -22px;
  background: #77c9dc;
  box-shadow: 0 0 12px rgba(119, 201, 220, 0.48);
}

.chapter-moment.is-train .moment-visual {
  background:
    linear-gradient(180deg, rgba(255, 244, 214, 0.92) 0 48%, rgba(119, 201, 220, 0.18) 48% 100%),
    #fff8e8;
}

.chapter-moment.is-train .moment-visual::before {
  left: 7px;
  right: 7px;
  top: 47px;
  bottom: auto;
  height: 7px;
  border: 0;
  border-radius: 999px;
  background:
    repeating-linear-gradient(90deg, rgba(47, 38, 49, 0.5) 0 4px, transparent 4px 9px),
    linear-gradient(180deg, transparent 0 2px, rgba(47, 38, 49, 0.52) 2px 4px, transparent 4px 100%);
}

.chapter-moment.is-train .moment-visual::after {
  width: 7px;
  height: 20px;
  left: 12px;
  top: 21px;
  border: 0;
  border-radius: 4px;
  background: rgba(47, 38, 49, 0.18);
  transform: skewX(-16deg);
  animation: momentTrainSmoke 3.8s ease-in-out infinite;
}

.chapter-moment.is-train .moment-visual span {
  width: 15px;
  height: 14px;
  left: var(--train-x);
  top: 31px;
  border-radius: 3px;
  background: #2d2230;
  box-shadow:
    inset 0 0 0 2px rgba(255, 244, 214, 0.16),
    3px 15px 0 -4px #2d2230;
  animation: momentTrain 3.8s ease-in-out infinite;
  animation-delay: 0s;
}

.chapter-moment.is-train .moment-visual span:first-child {
  width: 20px;
  border-radius: 4px 8px 4px 4px;
  background: #d66b5f;
}

.chapter-moment.is-pulse .moment-visual::before {
  inset: 16px;
  border-color: rgba(214, 107, 95, 0.2);
  border-radius: 18px;
}

.chapter-moment.is-pulse .moment-visual::after {
  width: 26px;
  height: 26px;
  left: 25px;
  top: 25px;
  border: 0;
  border-radius: 9px;
  background: rgba(214, 107, 95, 0.72);
  box-shadow: 0 0 18px rgba(214, 107, 95, 0.28);
}

.chapter-moment.is-pulse .moment-visual span {
  width: 34px;
  height: 34px;
  left: 21px;
  top: 21px;
  border: 1px solid rgba(214, 107, 95, 0.36);
  border-radius: 12px;
  background: transparent;
  animation: momentPulse 2.2s ease-in-out infinite;
  animation-delay: var(--delay);
}

.chapter-moment.is-sparkle .moment-visual::before {
  left: 10px;
  top: 16px;
  right: 10px;
  bottom: 15px;
  border: 1px dashed rgba(95, 124, 117, 0.34);
  border-radius: 9px;
  background:
    linear-gradient(120deg, transparent 18%, rgba(95, 124, 117, 0.28) 18% 21%, transparent 21% 46%, rgba(245, 166, 95, 0.36) 46% 49%, transparent 49%),
    rgba(255, 255, 255, 0.32);
}

.chapter-moment.is-sparkle .moment-visual::after {
  width: 12px;
  height: 12px;
  left: 52px;
  top: 18px;
  border: 0;
  border-radius: 3px;
  background: #77c9dc;
  transform: rotate(45deg);
  animation: momentSpark 2.8s ease-in-out infinite;
}

.chapter-moment.is-sparkle .moment-visual span {
  width: 12px;
  height: 12px;
  left: var(--spark-x);
  top: var(--spark-y);
  border-radius: 2px;
  background: #f5a65f;
  transform: rotate(45deg);
  animation: momentSpark 2.8s ease-in-out infinite;
  animation-delay: var(--delay);
}

.chapter-moment.is-chat .moment-visual::before {
  left: 35px;
  top: 10px;
  width: 2px;
  height: 56px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, transparent, rgba(119, 201, 220, 0.54), transparent);
}

.chapter-moment.is-chat .moment-visual::after {
  width: 9px;
  height: 9px;
  left: 34px;
  top: 33px;
  border: 0;
  border-radius: 50%;
  background: #fff4d6;
  box-shadow: 0 0 15px rgba(119, 201, 220, 0.58);
  transform: none;
  animation: momentMeetGlow 3.6s ease-in-out infinite;
}

.chapter-moment.is-chat .moment-visual span {
  width: 34px;
  height: 16px;
  left: var(--chat-x);
  top: var(--chat-y);
  border-radius: 8px 8px 8px 2px;
  background: rgba(95, 124, 117, 0.72);
  animation: momentChat 3s ease-in-out infinite;
  animation-delay: var(--delay);
}

.chapter-moment.is-forever .moment-visual::before {
  inset: 18px 10px;
  border-color: rgba(214, 107, 95, 0.3);
  border-radius: 50% 50% 50% 50%;
  transform: rotate(-16deg);
}

.chapter-moment.is-forever .moment-visual::after {
  inset: 18px 10px;
  width: auto;
  height: auto;
  left: 10px;
  top: 18px;
  border: 1px solid rgba(119, 201, 220, 0.42);
  border-radius: 50%;
  background: transparent;
  transform: rotate(16deg);
  animation: momentMeetGlow 4.4s ease-in-out infinite;
}

.chapter-moment.is-forever .moment-visual span {
  width: 24px;
  height: 24px;
  left: 26px;
  top: 26px;
  border: 2px solid rgba(214, 107, 95, 0.42);
  border-radius: 7px;
  background: transparent;
  transform-origin: 12px 12px;
  animation: momentForever 4.4s linear infinite;
  animation-delay: var(--delay);
}

.media-gallery {
  margin: 14px 0;
}

.media-stage {
  width: 100%;
  aspect-ratio: 4 / 5;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 244, 214, 0.1), transparent 21%),
    linear-gradient(145deg, rgba(12, 13, 25, 0.96), rgba(47, 38, 49, 0.94));
  border: 1px solid rgba(255, 244, 214, 0.16);
}

.media-stage video,
.media-image,
.demo-poster {
  width: 100%;
  height: 100%;
}

.media-stage video {
  object-fit: contain;
  background: rgba(8, 8, 18, 0.92);
}

.media-image {
  display: grid;
  place-items: center;
  padding: 18px;
  color: rgba(255, 244, 214, 0.72);
  background-image:
    radial-gradient(circle at 24% 18%, rgba(245, 166, 95, 0.16), transparent 21%),
    radial-gradient(circle at 80% 78%, rgba(119, 201, 220, 0.16), transparent 22%),
    linear-gradient(145deg, #171426, #2c2232);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: inset 0 0 48px rgba(255, 244, 214, 0.1);
}

.media-stage.is-loading-media .media-image::before {
  content: "正在装片";
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.12);
  color: var(--cream);
  font-size: 0.86rem;
  font-weight: 800;
}

.media-stage.has-image .media-image::before {
  content: none;
}

.demo-poster {
  display: grid;
  place-items: center;
  padding: 20px;
  color: #211722;
  text-align: center;
  font-weight: 900;
}

.media-caption {
  --media-caption-lines: 3;
  --media-caption-line-height: 1.78;
  --media-caption-padding-top: 10px;
  min-height: calc(var(--media-caption-lines) * var(--media-caption-line-height) * 1em + var(--media-caption-padding-top));
  max-height: calc(var(--media-caption-lines) * var(--media-caption-line-height) * 1em + var(--media-caption-padding-top));
  overflow: auto;
  padding: var(--media-caption-padding-top) 2px 0;
  color: var(--muted);
  line-height: var(--media-caption-line-height);
  white-space: pre-line;
}

.media-controls,
.letter-controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

.media-controls button,
.letter-controls button {
  min-height: 42px;
  border: 0;
  border-radius: var(--radius);
  background: #2d2230;
  color: #fff;
  font-weight: 800;
}

.media-controls button.is-disabled,
.letter-controls button.is-disabled {
  background: rgba(47, 38, 49, 0.18);
  color: rgba(47, 38, 49, 0.42);
  box-shadow: none;
  cursor: default;
}

.chapter-ticket,
.chapter-quiz,
.ticket-result {
  margin-top: 14px;
  padding: 14px;
  border: 1px dashed rgba(47, 38, 49, 0.24);
  border-radius: var(--radius);
  background: rgba(255, 244, 214, 0.52);
}

.chapter-quiz button {
  display: block;
  width: 100%;
  min-height: 42px;
  margin-top: 8px;
  border: 1px solid rgba(47, 38, 49, 0.14);
  border-radius: var(--radius);
  background: #fff;
}

.future-composer {
  display: grid;
  gap: 10px;
}

.future-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.future-toggle {
  width: 100%;
}

.future-toggle.is-solo {
  grid-column: 1 / -1;
}

.future-letter-history {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.future-letter {
  padding: 12px;
  border: 1px solid rgba(47, 38, 49, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 244, 214, 0.48);
}

.future-letter small {
  display: block;
  margin-bottom: 6px;
  color: #9f5d2d;
  font-weight: 800;
}

.future-letter p,
.future-empty {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  white-space: pre-line;
}

.finale-characters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  gap: 10px;
  align-items: center;
  margin: 18px 0 16px;
  isolation: isolate;
}

.finale-characters img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  border: 2px solid rgba(255, 246, 236, 0.96);
  box-shadow: 0 12px 28px rgba(90, 43, 50, 0.18);
  transform-origin: center;
  animation: foreverFloat 5.4s ease-in-out infinite;
  z-index: 1;
}

.finale-characters img:nth-of-type(1) {
  animation-delay: -0.5s;
}

.finale-characters img:nth-of-type(2) {
  animation-delay: -3.1s;
}

.forever-ring {
  position: absolute;
  inset: 10% 14%;
  z-index: 0;
  border: 1px solid rgba(214, 107, 95, 0.22);
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 45%, rgba(255, 244, 214, 0.64), transparent 34%),
    radial-gradient(circle at 68% 55%, rgba(245, 166, 95, 0.24), transparent 38%);
  animation: foreverGlow 6.8s ease-in-out infinite;
}

.forever-heart {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.94);
  color: #d86b5f;
  box-shadow: 0 10px 26px rgba(90, 43, 50, 0.18);
  font-size: 22px;
  animation: foreverBeat 2.4s ease-in-out infinite;
}

@keyframes foreverFloat {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-8px) rotate(1.5deg);
  }
}

@keyframes foreverGlow {
  0%,
  100% {
    opacity: 0.72;
    transform: scale(0.98);
  }
  50% {
    opacity: 1;
    transform: scale(1.03);
  }
}

@keyframes foreverBeat {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
  40% {
    transform: translate(-50%, -50%) scale(1.12);
  }
  64% {
    transform: translate(-50%, -50%) scale(0.98);
  }
}

@keyframes projectorReel {
  to {
    transform: rotate(360deg);
  }
}

@keyframes projectorBeam {
  0%,
  100% {
    opacity: 0.58;
    transform: scaleX(0.96);
  }

  50% {
    opacity: 0.96;
    transform: scaleX(1.04);
  }
}

@keyframes filmCountdown {
  0% {
    content: "3";
    transform: scale(1);
  }

  33% {
    transform: scale(0.94);
  }

  66% {
    transform: scale(1.04);
  }
}

@keyframes momentDrift {
  0%,
  100% {
    opacity: 0.42;
    transform: translateY(0) rotate(var(--angle));
  }

  50% {
    opacity: 1;
    transform: translateY(-8px) rotate(var(--angle-active));
  }
}

@keyframes momentBloom {
  0%,
  100% {
    opacity: 0.72;
    transform: scale(0.82);
  }

  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

@keyframes momentPetal {
  0%,
  100% {
    opacity: 0.48;
    transform: rotate(calc(var(--angle) - 18deg)) translateY(4px) scale(0.74);
  }

  50% {
    opacity: 0.96;
    transform: rotate(var(--angle-active)) translateY(-2px) scale(1);
  }
}

@keyframes momentMeet {
  0%,
  100% {
    opacity: 0.62;
    transform: translateX(0) scale(0.78);
  }

  42%,
  58% {
    opacity: 1;
    transform: translateX(var(--meet-end)) scale(1.08);
  }
}

@keyframes momentMeetGlow {
  0%,
  100% {
    opacity: 0.24;
    transform: scale(0.7);
  }

  50% {
    opacity: 1;
    transform: scale(1.18);
  }
}

@keyframes momentTrain {
  0%,
  100% {
    transform: translateX(-8px);
  }

  50% {
    transform: translateX(13px);
  }
}

@keyframes momentTrainSmoke {
  0%,
  100% {
    opacity: 0.16;
    transform: translate(0, 0) skewX(-16deg) scale(0.8);
  }

  50% {
    opacity: 0.42;
    transform: translate(-3px, -9px) skewX(-16deg) scale(1.08);
  }
}

@keyframes momentRoute {
  0%,
  100% {
    opacity: 0.32;
    transform: translateX(var(--route-x)) scaleX(0.74);
  }

  50% {
    opacity: 1;
    transform: translateX(var(--route-x-active)) scaleX(1);
  }
}

@keyframes momentPulse {
  0%,
  100% {
    opacity: 0.36;
    transform: scale(0.72) rotate(45deg);
  }

  50% {
    opacity: 0.88;
    transform: scale(1.08) rotate(45deg);
  }
}

@keyframes momentSpark {
  0%,
  100% {
    opacity: 0.36;
    transform: rotate(45deg) scale(0.72);
  }

  50% {
    opacity: 1;
    transform: rotate(45deg) scale(1.22);
  }
}

@keyframes momentChat {
  0%,
  100% {
    opacity: 0.48;
    transform: translateY(0);
  }

  50% {
    opacity: 1;
    transform: translateY(-5px);
  }
}

@keyframes momentForever {
  from {
    transform: rotate(0deg) translateX(16px) rotate(0deg);
  }

  to {
    transform: rotate(360deg) translateX(16px) rotate(-360deg);
  }
}

.admin-panel {
  padding: 14px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.admin-block {
  margin-top: 14px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 20;
  max-width: min(92vw, 460px);
  transform: translateX(-50%);
  margin: 0;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.96);
  color: #2d2230;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.toast.is-visible {
  opacity: 1;
}

.demo-poster[data-demo*="peach"],
.demo-poster[data-demo*="sunny"],
.demo-poster[data-demo*="table"],
.demo-poster[data-demo*="final"] {
  background: linear-gradient(135deg, #fff4d6, #f5a65f 55%, #d86b5f);
}

.demo-poster[data-demo*="coconut"],
.demo-poster[data-demo*="dawn"] {
  background: linear-gradient(135deg, #ffffff, #dff5ff 55%, #77c9dc);
}

.demo-poster[data-demo*="trip"] {
  background: linear-gradient(135deg, #fff7cc, #f5c86b 50%, #8fd6e8);
}

.demo-poster[data-demo*="rain"] {
  background: linear-gradient(135deg, #eee9ff, #8b7bd8 55%, #231c38);
  color: #fff4d6;
}

.demo-poster.is-video-demo::before {
  content: "";
  width: 58px;
  height: 58px;
  display: block;
  border-radius: 50%;
  background: rgba(255, 252, 246, 0.7);
  box-shadow: 0 0 0 8px rgba(255, 252, 246, 0.18);
  clip-path: polygon(28% 18%, 28% 82%, 82% 50%);
}

.demo-poster span,
.demo-poster small {
  display: block;
}

.demo-poster span {
  font-size: 1.35rem;
}

.demo-poster small {
  margin-top: 8px;
  opacity: 0.72;
}

.quiz-reward,
.saved-note {
  color: #9f5d2d;
  font-weight: 800;
}

.ticket-result h4 {
  margin: 0 0 8px;
}

.ticket-result p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.admin-stat {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: var(--radius);
  background: rgba(255, 244, 214, 0.52);
}

.admin-stat strong {
  font-size: 1.2rem;
}

.admin-stat span,
.admin-list p,
.admin-copy {
  color: var(--muted);
}

@media (min-width: 700px) {
  .route-stage {
    min-height: 620px;
  }
}
