:root {
  --ivory: #fbf7f1;
  --ink: #2c261f;
  --muted: #6d6258;
  --rose: #8d3d46;
  --gold: #a68456;
  --line: rgba(166, 132, 86, 0.38);
  --paper: #fffdf9;
  --kai: "KaiTi", "STKaiti", "Songti SC", "STSong", "SimSun", serif;
  --serif: "Songti SC", "STSong", "SimSun", "PMingLiU", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100dvh;
  background:
    radial-gradient(ellipse at 8% 0%, rgba(163, 75, 85, 0.08), transparent 36%),
    radial-gradient(ellipse at 100% 12%, rgba(61, 83, 68, 0.08), transparent 32%),
    #e7ddd0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
::selection { background: #ead3c4; }

.stage {
  width: min(100%, 430px);
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--ivory);
  position: relative;
  box-shadow: 0 0 48px rgba(70, 48, 30, 0.08);
}

.cover {
  position: relative;
  height: 100dvh;
  overflow: hidden;
  color: #fffaf6;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #241c18;
}
html.js .cover {
  position: fixed;
  z-index: 20;
  top: 0;
  bottom: 0;
  left: 50%;
  width: min(100vw, 430px);
  height: auto;
  transform: translateX(-50%);
  transition: transform 0.75s cubic-bezier(.4, 0, .2, 1);
}
html.js body.is-open .cover {
  transform: translate(-50%, -105%);
  pointer-events: none;
}
html.js body:not(.is-open) { overflow: hidden; height: 100dvh; }
.cover-img, .cover-shade { position: absolute; inset: 0; width: 100%; height: 100%; }
.cover-img { object-fit: cover; object-position: center 42%; }
.cover-shade {
  background:
    linear-gradient(to bottom, rgba(20, 12, 10, 0.42), transparent 26%),
    linear-gradient(to top, rgba(20, 12, 10, 0.78) 0%, rgba(20, 12, 10, 0.2) 46%, transparent 70%);
}
.cover-top, .cover-bottom { position: relative; z-index: 1; text-align: center; }
.cover-top { padding: calc(22px + env(safe-area-inset-top)) 20px 0; }
.cover-bottom { padding: 0 20px calc(28px + env(safe-area-inset-bottom)); }
.eyebrow-cn, .cover-date, .cover-place, .seal-caption {
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.45);
}
.eyebrow-cn {
  margin: 0;
  letter-spacing: 0.48em;
  padding-left: 0.48em;
  font-size: 14px;
}
.cover h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 44px;
  line-height: 1.15;
  letter-spacing: 0.24em;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.45);
}
.cover h1 span { display: block; padding-left: 0.24em; }
.cover h1 small {
  display: block;
  margin: 8px 0;
  font-size: 15px;
  letter-spacing: 0.5em;
  padding-left: 0.5em;
  color: #f0d7b0;
}
.cover-date { margin: 14px 0 0; letter-spacing: 0.28em; padding-left: 0.28em; font-size: 15px; }
.cover-place { margin: 6px 0 0; font-size: 14px; letter-spacing: 0.12em; }
.seal, .seal-caption, .chevron { display: none; }
html.js .seal {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  margin: 18px auto 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 228, 196, 0.85);
  box-shadow: 0 0 0 6px rgba(124, 58, 66, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  background: radial-gradient(circle at 40% 35%, #a85a62, #6e3038 72%);
  color: #fff6ea;
  font-family: var(--kai);
  font-size: 30px;
  letter-spacing: 0;
}
html.js .seal-caption {
  display: block;
  margin: 8px 0 0;
  letter-spacing: 0.34em;
  padding-left: 0.34em;
  font-size: 13px;
}
html.js .chevron {
  display: block;
  width: 8px;
  height: 8px;
  margin: 12px auto 0;
  border-right: 1px solid rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.85);
  transform: rotate(45deg);
  animation: bob 1.6s ease-in-out infinite;
}
@keyframes bob { 50% { transform: rotate(45deg) translateY(4px); } }

.flourish { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 14px auto; }
.flourish span {
  width: 64px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.flourish i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a34b55;
  box-shadow: -14px 0 0 -2px #c4a0a4, 14px 0 0 -2px #c4a0a4;
}
.flourish.light span { background: linear-gradient(90deg, transparent, rgba(240, 215, 176, 0.95), transparent); }
.flourish.light i { background: #f0d7b0; box-shadow: -12px 0 0 -2px rgba(240, 215, 176, 0.75), 12px 0 0 -2px rgba(240, 215, 176, 0.75); }

main { padding-bottom: calc(158px + env(safe-area-inset-bottom)); }
section { padding: 28px 22px 8px; }
.section-en {
  margin: 0 0 6px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
}
h2, .section-title {
  margin: 0;
  text-align: center;
  font-family: var(--kai);
  font-weight: 400;
  font-size: 32px;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
}
.letter-card {
  background: var(--paper);
  border: 1px solid var(--line);
  outline: 1px solid rgba(166, 132, 86, 0.22);
  outline-offset: -7px;
  padding: 32px 22px 24px;
  text-align: center;
}
.date-cn {
  margin: 8px 0 0;
  font-family: var(--kai);
  font-size: 22px;
  letter-spacing: 0.08em;
}
.weekday { margin: 4px 0 0; letter-spacing: 0.42em; padding-left: 0.42em; color: var(--gold); font-size: 14px; }
.prose {
  margin-top: 18px;
  text-align: left;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.95;
  color: #3f362f;
}
.prose p { margin: 0 0 0.85em; }
.sign { text-align: right; letter-spacing: 0.06em; }

.count {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 18px;
}
.count div {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.count b {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.count span { margin-top: 2px; font-size: 12px; color: var(--muted); }
.count-date, .lead { text-align: center; color: var(--muted); font-size: 14px; line-height: 1.7; }
.count-date { margin: 14px 0 8px; letter-spacing: 0.06em; }

.facts { list-style: none; margin: 16px 0; padding: 0; }
.facts li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.facts span { color: var(--gold); letter-spacing: 0.18em; flex: none; }
.facts strong { font-weight: 500; text-align: right; }
.venue-map {
  display: block;
  margin: 2px 0 16px;
  text-decoration: none;
  color: var(--muted);
}
.venue-map img {
  display: block;
  width: 100%;
  height: 210px;
  object-fit: cover;
  object-position: center;
  border-radius: 16px;
  border: 1px solid var(--line);
}
.venue-map span {
  display: block;
  margin-top: 8px;
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.12em;
}
.venue-map small {
  display: block;
  margin-top: 2px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #a89888;
}
.eve {
  margin: 4px 0 16px;
  padding: 16px 14px 14px;
  border-radius: 16px;
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--line);
}
.eve b {
  display: block;
  font-family: var(--kai);
  font-weight: 400;
  font-size: 26px;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
}
.eve p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--rose);
  background: var(--rose);
  color: #fffaf6;
  text-decoration: none;
  letter-spacing: 0.08em;
  flex: 1;
  min-width: 30%;
}
.btn.ghost { background: transparent; color: var(--rose); }
.btn.submit { width: 100%; margin-top: 8px; flex: none; }
.btn:disabled { opacity: 0.6; }

.gallery { padding-left: 0; padding-right: 0; }
.pad { padding: 0 22px; }
.gallery-list { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 0; }
.shot {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #e6dcd0;
  overflow: hidden;
  border-radius: 2px;
}
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot.land { aspect-ratio: 3 / 2; }
.shot.port { aspect-ratio: 2 / 3; }

.field { display: block; margin-top: 16px; }
.field > span, .field > .hint, .hint { color: var(--muted); font-size: 13px; }
.field > span { display: block; margin-bottom: 8px; letter-spacing: 0.06em; }
input[type="text"], input[type="tel"], input[type="password"], textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
}
textarea { min-height: 96px; resize: vertical; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; }
.choice span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  text-align: center;
  padding: 8px;
  letter-spacing: 0.04em;
}
.choice input:checked + span { border-color: var(--rose); background: #f8ecec; color: var(--rose); }
.choice input:focus-visible + span { outline: 2px solid var(--gold); }
.stepper { display: flex; align-items: center; gap: 16px; }
.stepper button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 20px;
}
.stepper strong { min-width: 1.2em; text-align: center; font-size: 20px; font-weight: 500; }
.hint { margin: 8px 0 0; }
.form-error { color: #9c3040; min-height: 1.4em; font-size: 14px; }
.form-success { text-align: center; padding: 8px 0 12px; }
.form-success h3 {
  margin: 0 0 8px;
  font-family: var(--kai);
  font-weight: 400;
  font-size: 28px;
  letter-spacing: 0.12em;
}
.form-success p { color: var(--muted); margin: 0 0 16px; }
.stat { text-align: center; color: #3d5344; margin: 12px 0 0; }
.gift-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-top: 16px;
}
.gift-btn {
  grid-column: span 2;
  appearance: none;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 16px;
  min-height: 92px;
  padding: 12px 4px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--ink);
}
.gift-btn:nth-child(4) { grid-column: 2 / span 2; }
.gift-btn:nth-child(5) { grid-column: 4 / span 2; }
.gift-btn svg { width: 36px; height: 36px; display: block; }
.gift-btn span { font-size: 13px; letter-spacing: 0.14em; }
.gift-btn.is-sent { border-color: var(--rose); background: #f8ecec; color: var(--rose); }
.gift-line {
  min-height: 1.6em;
  margin: 14px 0 0;
  text-align: center;
  color: var(--rose);
  letter-spacing: 0.08em;
}
.gift-ticker {
  position: fixed;
  z-index: 26;
  right: max(12px, calc(50vw - 203px));
  bottom: calc(104px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(196px, calc(100% - 24px));
  margin: 0;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  border: 1px solid rgba(166, 132, 86, 0.45);
  background: rgba(255, 253, 249, 0.96);
  box-shadow: 0 10px 24px rgba(70, 48, 30, 0.16);
  color: var(--ink);
  line-height: 1.25;
  pointer-events: none;
}
body:not(.is-open) .gift-ticker {
  top: calc(72px + env(safe-area-inset-top));
  right: auto;
  bottom: auto;
  left: max(12px, calc(50vw - 203px));
}
.gift-ticker-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  background:
    radial-gradient(circle at 50% 42%, #fff 0 28%, transparent 29%),
    #f6e4e4;
  box-shadow: inset 0 0 0 1px rgba(141, 61, 70, 0.16);
}
.gift-ticker-icon svg { width: 22px; height: 22px; display: block; }
.gift-ticker-copy { display: flex; flex-direction: column; min-width: 0; }
.gift-ticker b {
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gift-ticker-kind {
  color: var(--rose);
  font-size: 12px;
  letter-spacing: 0.08em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gift-ticker.is-on { animation: giftTicker 3.2s ease; }
.gift-ticker.is-on .gift-ticker-icon { animation: giftIcon 3.2s ease; }
@keyframes giftTicker {
  0% { opacity: 0; transform: translateY(10px) scale(0.96); }
  16% { opacity: 1; transform: none; }
  78% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-8px) scale(0.98); }
}
@keyframes giftIcon {
  0% { transform: scale(0.72) rotate(-8deg); }
  18% { transform: scale(1) rotate(0deg); }
  100% { transform: none; }
}
body.typing .gift-ticker,
body.modal-open .gift-ticker { visibility: hidden; }
.gift-fx {
  position: fixed;
  z-index: 35;
  top: 0;
  bottom: 0;
  left: 50%;
  width: min(100vw, 430px);
  transform: translateX(-50%);
  pointer-events: none;
  background: rgba(36, 22, 18, 0);
}
.gift-fx canvas { width: 100%; height: 100%; display: block; }
.gift-bloom {
  position: absolute;
  left: 50%;
  top: 58%;
  margin: 0;
  color: var(--rose);
  font-family: var(--kai);
  font-size: 28px;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  text-shadow: 0 0 12px rgba(255, 253, 249, 0.96), 0 1px 0 #fffdf9;
  opacity: 0;
  transform: translate(-50%, 8px);
}
.gift-fx.is-on .gift-bloom { animation: giftBloom 1.9s ease forwards; }
@keyframes giftBloom {
  0% { opacity: 0; transform: translate(-50%, 16px) scale(0.92); }
  18% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  72% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -12px) scale(1.04); }
}
.blessings { margin-top: 28px; }
.blessings h3 {
  margin: 0;
  text-align: center;
  font-family: var(--kai);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: 0.16em;
}
.blessing {
  background: #fff;
  border: 1px solid rgba(166, 132, 86, 0.22);
  border-radius: 14px;
  padding: 12px 14px;
  margin-top: 10px;
}
.blessing b { display: block; font-weight: 500; margin-bottom: 4px; }
.blessing p { margin: 0; color: #4e453e; line-height: 1.6; }
.empty-note { text-align: center; color: var(--muted); font-size: 14px; }
.banner {
  background: #f8f1e4;
  border: 1px solid var(--line);
  color: #6b4b32;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.65;
}
.footer { text-align: center; color: var(--muted); font-size: 13px; letter-spacing: 0.12em; padding: 28px 22px 12px; }
.footer p { margin: 0 0 4px; }
.footer .beian { color: inherit; text-decoration: none; letter-spacing: 0.04em; }

.music-btn {
  position: fixed;
  z-index: 28;
  top: calc(14px + env(safe-area-inset-top));
  right: max(12px, calc(50vw - 203px));
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(166, 132, 86, 0.75);
  background: rgba(251, 247, 241, 0.94);
  color: var(--rose);
  box-shadow: 0 8px 20px rgba(70, 48, 30, 0.16);
}
.music-btn svg { width: 26px; height: 26px; display: block; margin: 0 auto; }
.music-btn circle { fill: none; stroke: currentColor; stroke-width: 1.4; }
.music-btn path { fill: currentColor; }
.music-btn.is-on svg { animation: musicSpin 4.8s linear infinite; }
@keyframes musicSpin { to { transform: rotate(360deg); } }

.dock {
  display: none;
  position: fixed;
  z-index: 25;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 430px);
  gap: 10px;
  padding: 18px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(251, 247, 241, 0.98) 62%, rgba(251, 247, 241, 0));
  box-sizing: border-box;
}
body.is-open .dock { display: flex; }
body.typing .dock, body.modal-open .dock { display: none; }

.lightbox, .modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(18, 12, 10, 0.9);
}
.lightbox[hidden], .modal[hidden] { display: none !important; }
.lightbox { display: flex; align-items: center; justify-content: center; padding: 48px 12px 20px; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.modal { overflow: auto; padding: 18px 16px 28px; }
.modal-card { width: min(100%, 420px); margin: 0 auto; }
.modal-card img { width: 100%; height: auto; display: block; border-radius: 8px; -webkit-touch-callout: default; }
.modal-tip, .modal-warn { color: #fffaf6; font-size: 14px; line-height: 1.6; text-align: center; }
.modal-warn { color: #f0d7b0; }
.icon-close {
  display: block;
  margin-left: auto;
  background: transparent;
  color: #fff;
  border: 0;
  letter-spacing: 0.12em;
  min-height: 40px;
}
#poster-save { width: 100%; margin-top: 12px; background: #fffaf6; color: var(--ink); border-color: #fffaf6; }

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(108px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(8px);
  background: rgba(42, 36, 32, 0.92);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s ease;
  z-index: 70;
  font-size: 14px;
}
#toast.show { opacity: 1; transform: translateX(-50%); }

.js .reveal { opacity: 0; transform: translateY(16px); }
.js .reveal.in { opacity: 1; transform: none; transition: opacity 0.7s ease, transform 0.7s ease; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; }
  html.js .cover { transition: none; }
  .chevron { animation: none; }
  .music-btn.is-on svg { animation: none; }
  .gift-ticker.is-on { animation: none; opacity: 1; transform: none; }
  .gift-ticker.is-on .gift-ticker-icon { animation: none; }
  .gift-fx.is-on .gift-bloom { animation: none; opacity: 1; transform: translate(-50%, 0); }
}
