:root {
  --pink: #ff6fa8;
  --pink-deep: #f0488c;
  --pink-soft: #ffe4f0;
  --ink: #222;
  --muted: #8a8a8a;
  --bg: #f7f7f8;
  --card: #ffffff;
  --line: rgba(0, 0, 0, 0.08);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font-brush: "Ma Shan Zheng", "Great Vibes", cursive;
  --font-en: "Great Vibes", cursive;
  --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* 开场 */
.seal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 30%, #fff 0%, var(--pink-soft) 45%, #f7d6e6 100%);
  cursor: pointer;
  transition: opacity 0.7s ease, visibility 0.7s;
}

.seal.is-gone {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.seal__inner {
  text-align: center;
  padding: 1.5rem;
}

.seal__hi {
  font-size: 1rem;
  letter-spacing: 0.04em;
  line-height: 1.7;
  color: #444;
}

.seal__heart {
  margin: 1.4rem auto;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #ff9ec8, var(--pink-deep));
  color: #fff;
  font-size: 1.8rem;
  box-shadow: 0 12px 30px rgba(240, 72, 140, 0.35);
  animation: pulse 2.2s ease-in-out infinite;
}

.seal__hint {
  color: var(--pink-deep);
  letter-spacing: 0.4em;
  text-indent: 0.4em;
  font-size: 0.85rem;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* 音乐按钮 */
.music-btn {
  position: fixed;
  top: calc(12px + var(--safe-t));
  right: 14px;
  z-index: 50;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(145deg, #ff9ec8, var(--pink));
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 8px 18px rgba(240, 72, 140, 0.28);
  transition: opacity 0.35s ease;
}

.music-btn.is-ready {
  opacity: 1;
  pointer-events: auto;
}

.music-btn__icon {
  width: 18px;
  height: 18px;
  position: relative;
  z-index: 1;
}

.music-btn__ring {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.55);
}

.music-btn.is-playing .music-btn__ring {
  animation: spin 6s linear infinite;
}

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

/* 页面滚动 */
.pages {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(5.5rem + var(--safe-b));
}

.page {
  position: relative;
  padding: calc(1.4rem + var(--safe-t)) 1.2rem 1.5rem;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* 封面 */
.page--cover {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background:
    radial-gradient(circle at 50% 0%, #fff 0%, var(--bg) 60%);
}

.cover-hi {
  text-align: center;
  font-size: 0.92rem;
  color: #444;
  margin-bottom: 0.9rem;
  letter-spacing: 0.02em;
}

.vinyl-wrap {
  position: relative;
  width: min(100%, 20rem);
  margin: 0.2rem auto 1rem;
}

.brush {
  font-family: var(--font-brush);
  color: var(--pink);
  line-height: 1;
  pointer-events: none;
}

.brush--top {
  position: absolute;
  left: -0.2rem;
  top: 0.3rem;
  z-index: 3;
  font-size: 2.5rem;
  transform: rotate(-8deg);
  text-shadow: 0 6px 16px rgba(255, 111, 168, 0.25);
}

.brush--en {
  position: absolute;
  right: 0.4rem;
  bottom: 1.4rem;
  z-index: 3;
  font-family: var(--font-en);
  font-size: 2rem;
  transform: rotate(-6deg);
}

.brush--end {
  font-size: 2.4rem;
  margin-bottom: 0.8rem;
}

.vinyl {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.vinyl__disc {
  width: 92%;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle at center,
      #1a1a1a 0 1px,
      #2a2a2a 1px 3px,
      #111 3px 5px);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.22),
    inset 0 0 0 10px #0d0d0d;
  display: grid;
  place-items: center;
  animation: vinyl-idle 18s linear infinite;
}

.music-btn.is-playing ~ .pages .vinyl__disc,
.pages.is-playing .vinyl__disc {
  animation-duration: 8s;
}

.vinyl__photo {
  width: 58%;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 25%, #ffe8f2, #ffc1da 45%, #f48fb1 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.55);
}

.vinyl__xi {
  font-family: var(--font-brush);
  font-size: 2.4rem;
  color: #fff;
  line-height: 1;
  text-shadow: 0 4px 10px rgba(240, 72, 140, 0.35);
}

.vinyl__pair {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: 0.15em;
}

@keyframes vinyl-idle {
  to {
    transform: rotate(360deg);
  }
}

.player-card {
  width: min(100%, 21rem);
  margin: 0 auto 1.25rem;
  padding: 1rem 1rem 0.9rem;
  border-radius: 22px;
  background: var(--card);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.06);
  display: flex;
  gap: 0.85rem;
  align-items: center;
}

.player-card__main {
  flex: 1;
  min-width: 0;
}

.player-card__title {
  font-size: 0.98rem;
  font-weight: 500;
  margin-bottom: 0.7rem;
}

.player-card__bar {
  height: 3px;
  border-radius: 99px;
  background: #ececec;
  position: relative;
  overflow: hidden;
}

.player-card__bar i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 8%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--pink), var(--pink-deep));
  transition: width 0.3s linear;
}

.player-card__status {
  margin-top: 0.55rem;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.player-card__thumb {
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 12px;
  background: linear-gradient(145deg, #ffb6d5, var(--pink));
  color: #fff;
  display: grid;
  place-items: center;
  position: relative;
  flex-shrink: 0;
  font-size: 1.2rem;
}

.eq {
  position: absolute;
  right: 4px;
  bottom: 4px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 10px;
}

.eq i {
  width: 2px;
  background: #222;
  border-radius: 1px;
  height: 40%;
}

.pages.is-playing .eq i {
  animation: eq 0.8s ease-in-out infinite;
}
.pages.is-playing .eq i:nth-child(2) {
  animation-delay: 0.1s;
}
.pages.is-playing .eq i:nth-child(3) {
  animation-delay: 0.2s;
}
.pages.is-playing .eq i:nth-child(4) {
  animation-delay: 0.3s;
}

@keyframes eq {
  0%,
  100% {
    height: 30%;
  }
  50% {
    height: 100%;
  }
}

.cover-invite {
  text-align: center;
  margin-bottom: 1.4rem;
}

.cover-invite__en {
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  font-style: italic;
  color: #555;
  margin-bottom: 0.45rem;
}

.cover-invite__names {
  font-size: 1.55rem;
  font-weight: 500;
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 0.45rem;
}

.cover-invite__names em {
  font-style: normal;
  color: var(--pink);
  font-family: var(--font-en);
  font-size: 1.4rem;
}

.cover-invite__date {
  margin-top: 0.45rem;
  color: var(--muted);
  letter-spacing: 0.2em;
}

.arch-pair {
  width: min(100%, 22rem);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.arch {
  background: linear-gradient(180deg, #ffd4e6, #ffb3d1);
  border-radius: 999px 999px 18px 18px;
  min-height: 9.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 1rem 0.6rem 1.1rem;
  color: #fff;
  box-shadow: 0 10px 24px rgba(240, 72, 140, 0.18);
}

.arch span {
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  opacity: 0.9;
}

.arch strong {
  margin-top: 0.35rem;
  font-size: 1.15rem;
  font-weight: 500;
}

/* 卡片页 */
.page--letter,
.page--bless {
  display: flex;
  justify-content: center;
}

.soft-card {
  width: min(100%, 22.5rem);
  background: var(--card);
  border-radius: 24px;
  padding: 1.5rem 1.25rem 1.35rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.05);
  text-align: center;
}

.soft-card__eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--pink);
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.soft-card__title {
  font-family: var(--font-brush);
  font-size: 2rem;
  font-weight: 400;
  color: var(--pink-deep);
  margin-bottom: 0.85rem;
}

.soft-card__text,
.soft-card__lead {
  font-size: 0.88rem;
  line-height: 1.9;
  color: #555;
  letter-spacing: 0.04em;
  margin-bottom: 1.1rem;
}

.meta {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  padding: 0.2rem 0.1rem 1rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.meta dt {
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  color: var(--pink);
  margin-bottom: 0.25rem;
}

.meta dd {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.98rem;
}

.meta strong {
  font-weight: 600;
}

.letter__lunar {
  font-size: 0.82rem;
  color: var(--muted);
}

.letter__count {
  margin: 1rem 0;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.letter__count strong {
  color: var(--pink-deep);
  font-size: 1.05rem;
  margin: 0 0.12rem;
}

.btn-pink {
  width: 100%;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 0.9rem 1rem;
  background: linear-gradient(135deg, #ff8aba, var(--pink-deep));
  color: #fff;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  font-size: 0.92rem;
  box-shadow: 0 10px 24px rgba(240, 72, 140, 0.28);
}

.btn-pink:active {
  opacity: 0.92;
}

.signline {
  margin-top: 1rem;
  color: var(--pink-deep);
  letter-spacing: 0.08em;
}

/* 表单 */
.bless__form {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  text-align: left;
}

.bless__form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.bless__form label > span {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--pink-deep);
}

.bless__form input,
.bless__form textarea {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 0.65rem 0.1rem;
  outline: none;
  user-select: text;
}

.bless__form input:focus,
.bless__form textarea:focus {
  border-bottom-color: var(--pink);
}

.bless__form textarea {
  resize: none;
  line-height: 1.65;
}

.bless__hint {
  display: block;
  margin-top: 0.3rem;
  font-style: normal;
  font-size: 0.72rem;
  color: var(--muted);
}

.bless__toast {
  margin-top: 0.9rem;
  color: var(--pink-deep);
  letter-spacing: 0.08em;
  font-size: 0.86rem;
}

.picker-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 0.65rem 0.1rem;
  text-align: left;
  cursor: pointer;
}

.picker-trigger em {
  font-style: normal;
  flex: 1;
}

.picker-trigger i {
  width: 0.45rem;
  height: 0.45rem;
  border-right: 1.5px solid rgba(0, 0, 0, 0.35);
  border-bottom: 1.5px solid rgba(0, 0, 0, 0.35);
  transform: rotate(45deg) translateY(-2px);
}

.picker-sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.picker-sheet[hidden] {
  display: none !important;
}

.picker-sheet__mask {
  position: absolute;
  inset: 0;
  background: rgba(20, 10, 16, 0.35);
}

.picker-sheet__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 430px);
  padding: 0.55rem 1rem calc(1rem + var(--safe-b));
  background: #fff;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.12);
  animation: picker-up 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.picker-sheet__handle {
  width: 2.2rem;
  height: 0.28rem;
  margin: 0.15rem auto 0.85rem;
  border-radius: 99px;
  background: #e8e8e8;
}

.picker-sheet__title {
  text-align: center;
  font-family: var(--font-brush);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--pink-deep);
  margin-bottom: 0.85rem;
}

.picker-sheet__list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.picker-option {
  width: 100%;
  border: 1px solid #f0f0f0;
  background: #fafafa;
  border-radius: 14px;
  padding: 0.9rem 1rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.picker-option strong {
  font-weight: 500;
}

.picker-option small {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.picker-option__check {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  border: 1px solid #ddd;
  flex-shrink: 0;
  position: relative;
}

.picker-option.is-active {
  border-color: var(--pink);
  background: var(--pink-soft);
}

.picker-option.is-active .picker-option__check {
  border-color: var(--pink);
  background: var(--pink);
}

.picker-option.is-active .picker-option__check::after {
  content: "";
  position: absolute;
  left: 0.32rem;
  top: 0.18rem;
  width: 0.28rem;
  height: 0.5rem;
  border-right: 1.5px solid #fff;
  border-bottom: 1.5px solid #fff;
  transform: rotate(40deg);
}

.picker-sheet__cancel {
  width: 100%;
  margin-top: 0.85rem;
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 0.85rem;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  cursor: pointer;
}

@keyframes picker-up {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

/* 结尾 */
.page--end {
  min-height: 70dvh;
  display: grid;
  place-items: center;
  text-align: center;
  background:
    radial-gradient(circle at 50% 40%, #fff 0%, var(--pink-soft) 55%, var(--bg) 100%);
}

.end__wish {
  font-size: 1.35rem;
  letter-spacing: 0.2em;
  margin-bottom: 0.8rem;
}

.end__names {
  font-size: 1.4rem;
  color: var(--pink-deep);
  letter-spacing: 0.12em;
}

.end__date {
  margin-top: 0.5rem;
  color: var(--muted);
  letter-spacing: 0.25em;
}

/* 底部 dock */
.dock {
  position: fixed;
  left: 50%;
  bottom: calc(0.7rem + var(--safe-b));
  transform: translateX(-50%);
  z-index: 40;
  width: min(calc(100% - 1.2rem), 26rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  padding: 0.55rem 0.7rem;
  border-radius: 999px;
  background: rgba(30, 30, 30, 0.78);
  backdrop-filter: blur(10px);
  color: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.dock button {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  padding: 0.35rem 0.25rem;
  cursor: pointer;
  white-space: nowrap;
  opacity: 0.92;
}

.dock__heart {
  color: #ff9ec8 !important;
  font-weight: 500;
}

@media (min-width: 768px) {
  body {
    display: grid;
    place-items: center;
    background: #111;
  }

  .seal,
  .pages {
    width: min(430px, 100%);
    height: min(100dvh, 900px);
    max-height: 100dvh;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 30px 80px rgba(0, 0, 0, 0.45);
  }

  .music-btn {
    right: calc(50% - min(215px, 50vw) + 14px);
  }

  .dock {
    width: min(410px, calc(100% - 1.2rem));
  }
}

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