/* ─────────────────────────────────────────────
   中式红金婚礼请柬
   ───────────────────────────────────────────── */

@font-face {
  font-family: "MaShanZheng";
  src: url("/fonts/mashanzheng.woff2") format("woff2");
  font-display: block;
}

@font-face {
  font-family: "LXGWWenKai";
  src: url("/fonts/wenkai.woff2") format("woff2");
  font-display: block;
}

:root {
  --red-abyss: #2a0507;
  --red-deep: #3f090b;
  --red-card: #621013;
  --red-line: #8c1a1a;

  --gold-hi: #f7e8bf;
  --gold: #d9b878;
  --gold-dim: #b08d4a;
  --gold-line: rgba(217, 184, 120, 0.42);

  --ivory: #f0e3cc;
  --ivory-dim: rgba(240, 227, 204, 0.62);

  --paper: #f4e9d6;
  --paper-ink: #3d1012;

  --font-serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", serif;
  --font-kai: "LXGWWenKai", "Kaiti SC", "STKaiti", "KaiTi", "Songti SC", serif;
  --font-display: "MaShanZheng", "Xingkai SC", "STXingkai", "Songti SC", serif;
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-latin: "Didot", "Baskerville", "Palatino", "Times New Roman", serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --foil: linear-gradient(
    100deg,
    #8a6a2f 0%,
    #d9b878 18%,
    #f7e8bf 32%,
    #d9b878 46%,
    #9c7a3a 60%,
    #e6cf9a 78%,
    #b08d4a 100%
  );
}

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

html {
  -webkit-text-size-adjust: 100%;
  background: var(--red-abyss);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ivory);
  font-family: var(--font-serif);
  background: transparent;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(120% 70% at 50% -10%, #7d1519 0%, #4a0a0d 46%, var(--red-abyss) 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

.stage {
  position: relative;
  z-index: 1;
  padding: clamp(24px, 6vw, 72px) clamp(14px, 4vw, 24px) 92px;
}

/* ── 请柬主体 ───────────────────────────── */

.invite {
  --page-pad: clamp(14px, 4vw, 24px);
  --card-w: min(520px, calc(100vw - 2 * var(--page-pad)));
  --u: calc(var(--card-w) / 1080);
  position: relative;
  max-width: 520px;
  margin: 0 auto;
  padding: calc(var(--u) * 132) calc(var(--u) * 118) calc(var(--u) * 104);
  text-align: center;
  background:
    radial-gradient(130% 90% at 50% -20%, rgba(255, 255, 255, 0.07), transparent 58%),
    linear-gradient(180deg, #6d1316 0%, #5a0d10 56%, #4b0a0c 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 42px 90px -34px rgba(0, 0, 0, 0.85),
    0 0 0 1px rgba(217, 184, 120, 0.16);
}

.invite::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(217, 184, 120, 0.16);
  pointer-events: none;
}

.corner {
  position: absolute;
  width: 44px;
  height: 44px;
  color: var(--gold);
  opacity: 0.75;
  pointer-events: none;
}

.corner path {
  fill: none;
  stroke: currentColor;
}

.corner path:nth-child(1) { stroke-width: 1; }
.corner path:nth-child(2) { stroke-width: 0.7; opacity: 0.55; }
.corner path:nth-child(3) { stroke-width: 0.7; opacity: 0.4; }

.corner--tl { top: 11px; left: 11px; }
.corner--tr { top: 11px; right: 11px; transform: rotate(90deg); }
.corner--br { bottom: 11px; right: 11px; transform: rotate(180deg); }
.corner--bl { bottom: 11px; left: 11px; transform: rotate(270deg); }

.eyebrow {
  margin: 0 0 calc(var(--u) * 44);
  font-family: var(--font-serif);
  font-size: calc(var(--u) * 26);
  letter-spacing: 0.62em;
  text-indent: 0.62em;
  color: var(--gold-dim);
}

/* 囍 印 */

.seal {
  position: relative;
  width: calc(var(--u) * 196);
  height: calc(var(--u) * 196);
  margin: 0 auto clamp(26px, 6vw, 34px);
  display: grid;
  place-items: center;
  border: 1px solid var(--gold-line);
  box-shadow: 0 12px 34px -18px rgba(0, 0, 0, 0.9);
}

.seal::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(217, 184, 120, 0.24);
}

.seal::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 45%, rgba(247, 232, 191, 0.12), transparent 68%);
  pointer-events: none;
}

.seal span {
  font-family: var(--font-serif);
  font-size: calc(var(--u) * 112);
  line-height: 1;
  background: var(--foil);
  background-size: 240% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.55));
  animation: sheen 9s ease-in-out infinite;
}

/* 新人姓名 */

.names {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--u) * 30);
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: calc(var(--u) * 88);
  letter-spacing: 0.06em;
  line-height: 1.35;
}

.names__part {
  background: var(--foil);
  background-size: 260% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.4));
  animation: sheen 11s ease-in-out infinite;
}

.names__amp svg {
  display: block;
  width: calc(var(--u) * 22);
  height: auto;
  fill: var(--gold);
  opacity: 0.85;
}

.motto {
  margin: calc(var(--u) * 34) 0 0;
  font-family: var(--font-kai);
  font-size: calc(var(--u) * 30);
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: var(--ivory-dim);
}

/* 分隔线 */

.rule {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: clamp(26px, 6vw, 34px) auto;
  width: 74%;
}

.rule::before,
.rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-line), transparent);
}

.rule i {
  width: 5px;
  height: 5px;
  margin: 0 14px;
  border: 1px solid var(--gold);
  transform: rotate(45deg);
  opacity: 0.8;
  flex: none;
}

/* 日期与地点 */

.lead {
  margin: 0;
  font-family: var(--font-kai);
  font-size: calc(var(--u) * 28);
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  color: var(--ivory-dim);
}

.date-cn {
  margin: 14px 0 0;
  font-family: var(--font-serif);
  font-size: calc(var(--u) * 52);
  letter-spacing: 0.1em;
  text-indent: 0.1em;
  color: var(--ivory);
}

.date-sub {
  margin: 11px 0 0;
  font-family: var(--font-kai);
  font-size: calc(var(--u) * 30);
  letter-spacing: 0.18em;
  color: var(--ivory-dim);
}

.date-sub .dot {
  margin: 0 8px;
  color: var(--gold-dim);
}

.date-latin {
  margin: 16px 0 0;
  font-family: var(--font-latin);
  font-size: calc(var(--u) * 26);
  letter-spacing: 0.46em;
  text-indent: 0.46em;
  color: var(--gold-dim);
}

.time {
  margin: clamp(24px, 5vw, 30px) 0 0;
  font-family: var(--font-serif);
  font-size: calc(var(--u) * 38);
  letter-spacing: 0.12em;
  color: var(--gold);
}

.venue {
  margin: 0;
  font-family: var(--font-serif);
  font-size: calc(var(--u) * 44);
  letter-spacing: 0.06em;
  color: var(--ivory);
}

.address {
  margin: 10px 0 0;
  font-family: var(--font-kai);
  font-size: calc(var(--u) * 26);
  letter-spacing: 0.08em;
  color: var(--ivory-dim);
}

.map-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  padding: 10px 22px;
  border: 1px solid var(--gold-line);
  color: var(--gold);
  font-family: var(--font-kai);
  font-size: calc(var(--u) * 26);
  letter-spacing: 0.26em;
  text-indent: 0.26em;
  text-decoration: none;
  transition: background-color 0.4s var(--ease-out), color 0.4s var(--ease-out);
}

.map-link svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  transition: transform 0.4s var(--ease-out);
}

.map-link:hover {
  background: rgba(217, 184, 120, 0.1);
  color: var(--gold-hi);
}

.map-link:hover svg {
  transform: translateX(3px);
}

.closing {
  margin: clamp(30px, 7vw, 40px) 0 0;
  font-family: var(--font-kai);
  font-size: calc(var(--u) * 40);
  letter-spacing: 0.52em;
  text-indent: 0.52em;
  color: var(--gold);
}

/* ── 回执 ───────────────────────────────── */

.rsvp {
  position: relative;
  max-width: 520px;
  margin: clamp(22px, 5vw, 34px) auto 0;
  padding: clamp(34px, 8vw, 46px) clamp(24px, 6.5vw, 46px) clamp(34px, 8vw, 44px);
  background:
    radial-gradient(120% 80% at 50% 0%, #fbf4e6 0%, var(--paper) 62%, #ecdfc7 100%);
  color: var(--paper-ink);
  box-shadow: 0 30px 70px -34px rgba(0, 0, 0, 0.9);
}

.rsvp::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(107, 17, 20, 0.16);
  pointer-events: none;
}

.rsvp__head {
  text-align: center;
}

.rsvp__head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: 0.46em;
  text-indent: 0.46em;
  color: #6b1114;
}

.rsvp__intro {
  margin: 14px 0 0;
  font-family: var(--font-kai);
  font-size: 14px;
  letter-spacing: 0.08em;
  color: rgba(61, 16, 18, 0.6);
}

.rsvp__form {
  margin-top: clamp(28px, 6vw, 36px);
}

.field + .field {
  margin-top: 26px;
}

.field__label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  letter-spacing: 0.3em;
  color: rgba(107, 17, 20, 0.72);
}

input[type="text"],
input[type="number"],
textarea {
  width: 100%;
  padding: 10px 2px;
  border: 0;
  border-bottom: 1px solid rgba(107, 17, 20, 0.28);
  border-radius: 0;
  background: transparent;
  color: var(--paper-ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

textarea {
  resize: none;
}

input::placeholder,
textarea::placeholder {
  color: rgba(61, 16, 18, 0.3);
}

input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus {
  outline: none;
  border-bottom-color: #8c1a1a;
  box-shadow: 0 1px 0 0 #8c1a1a;
}

/* 出席选择 */

.choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.choice__item {
  position: relative;
  cursor: pointer;
}

.choice__item input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.choice__face {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 14px 8px;
  border: 1px solid rgba(107, 17, 20, 0.25);
  background: rgba(255, 255, 255, 0.28);
  transition: all 0.32s var(--ease-out);
}

.choice__title {
  font-family: var(--font-serif);
  font-size: 15px;
  letter-spacing: 0.14em;
  text-indent: 0.14em;
}

.choice__hint {
  font-family: var(--font-sans);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  opacity: 0.55;
}

.choice__item input:checked + .choice__face {
  background: #6b1114;
  border-color: #6b1114;
  color: var(--paper);
  box-shadow: 0 10px 24px -14px rgba(107, 17, 20, 0.9);
}

.choice__item input:focus-visible + .choice__face {
  outline: 2px solid #8c1a1a;
  outline-offset: 2px;
}

/* 人数步进 */

.stepper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stepper__btn {
  width: 40px;
  height: 40px;
  flex: none;
  border: 1px solid rgba(107, 17, 20, 0.28);
  background: transparent;
  color: #6b1114;
  font-family: var(--font-latin);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.28s var(--ease-out), color 0.28s var(--ease-out);
}

.stepper__btn:hover:not(:disabled) {
  background: #6b1114;
  color: var(--paper);
}

.stepper__btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.stepper input {
  width: 64px;
  padding: 0;
  border-bottom: 1px solid rgba(107, 17, 20, 0.28);
  text-align: center;
  font-family: var(--font-latin);
  font-size: 19px;
  line-height: 38px;
  height: 40px;
  -moz-appearance: textfield;
  appearance: textfield;
}

.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.stepper__hint {
  margin-left: 6px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: rgba(61, 16, 18, 0.45);
}

.field.is-muted {
  opacity: 0.4;
  pointer-events: none;
}

/* 提交 */

.form-error {
  margin: 20px 0 0;
  font-family: var(--font-kai);
  font-size: 14px;
  color: #a3141a;
  text-align: center;
}

.submit {
  width: 100%;
  height: 54px;
  margin-top: 30px;
  border: 1px solid #6b1114;
  background: #6b1114;
  color: var(--paper);
  font-family: var(--font-serif);
  font-size: 15px;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  cursor: pointer;
  transition: background-color 0.35s var(--ease-out), transform 0.35s var(--ease-out),
    box-shadow 0.35s var(--ease-out);
}

.submit:hover:not(:disabled) {
  background: #7d161a;
  transform: translateY(-1px);
  box-shadow: 0 14px 30px -16px rgba(107, 17, 20, 0.8);
}

.submit:active:not(:disabled) {
  transform: translateY(0);
}

.submit:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* 回执成功态 */

.receipt {
  padding: 18px 0 6px;
  text-align: center;
  animation: rise 0.8s var(--ease-out) both;
}

.receipt__mark {
  width: 62px;
  height: 62px;
  margin: 0 auto 22px;
  border: 1px solid rgba(107, 17, 20, 0.35);
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.receipt__mark svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: #6b1114;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 42;
  stroke-dashoffset: 42;
  animation: draw 0.9s var(--ease-out) 0.25s forwards;
}

.receipt__title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 17px;
  letter-spacing: 0.4em;
  text-indent: 0.4em;
  color: #6b1114;
}

.receipt__detail {
  margin: 16px 0 0;
  font-family: var(--font-kai);
  font-size: 15px;
  line-height: 1.9;
  color: rgba(61, 16, 18, 0.75);
}

.receipt__note {
  margin: 22px 0 0;
  font-family: var(--font-sans);
  font-size: 13px;
  color: rgba(61, 16, 18, 0.4);
}

.stage__foot {
  margin: clamp(28px, 6vw, 40px) auto 0;
  text-align: center;
  font-family: var(--font-kai);
  font-size: 12.5px;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: rgba(217, 184, 120, 0.34);
}

/* ── 入场动画 ───────────────────────────── */

.invite > *:not(.corner) {
  animation: rise 0.95s var(--ease-out) both;
}

.invite > *:nth-child(5)  { animation-delay: 0.06s; }
.invite > *:nth-child(6)  { animation-delay: 0.13s; }
.invite > *:nth-child(7)  { animation-delay: 0.22s; }
.invite > *:nth-child(8)  { animation-delay: 0.30s; }
.invite > *:nth-child(9)  { animation-delay: 0.36s; }
.invite > *:nth-child(10) { animation-delay: 0.42s; }
.invite > *:nth-child(11) { animation-delay: 0.47s; }
.invite > *:nth-child(12) { animation-delay: 0.52s; }
.invite > *:nth-child(13) { animation-delay: 0.57s; }
.invite > *:nth-child(14) { animation-delay: 0.62s; }
.invite > *:nth-child(15) { animation-delay: 0.68s; }
.invite > *:nth-child(16) { animation-delay: 0.73s; }
.invite > *:nth-child(17) { animation-delay: 0.78s; }
.invite > *:nth-child(18) { animation-delay: 0.86s; }

.rsvp {
  animation: rise 1s var(--ease-out) 0.5s both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sheen {
  0%, 100% { background-position: 0% 0; }
  50% { background-position: 100% 0; }
}

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

/* ── 响应式与无动画偏好 ─────────────────── */

@media (max-width: 420px) {
  .rsvp__intro {
    font-size: 13px;
  }
}

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

/* 背景音乐 */

.credit {
  max-width: 300px;
  margin: 10px auto 0;
  line-height: 1.7;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.02em;
  color: rgba(217, 184, 120, 0.28);
}

.bgm-wrap {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
}

.bgm__hint {
  padding: 6px 12px;
  border: 1px solid rgba(217, 184, 120, 0.4);
  border-radius: 999px;
  background: rgba(42, 5, 7, 0.85);
  color: var(--gold);
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

.bgm__hint.is-visible {
  opacity: 1;
  transform: none;
}

.bgm {
  width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(217, 184, 120, 0.5);
  border-radius: 50%;
  background: rgba(42, 5, 7, 0.72);
  color: var(--gold);
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.bgm:hover {
  border-color: var(--gold);
  background: rgba(42, 5, 7, 0.9);
}

.bgm svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  transform-origin: center;
  animation: spin 7s linear infinite;
  animation-play-state: paused;
}

.bgm__dot {
  fill: currentColor;
  stroke: none;
}

.bgm.is-playing {
  border-color: var(--gold);
  background: rgba(107, 17, 20, 0.9);
}

.bgm.is-playing svg {
  animation-play-state: running;
}

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

/* 开启封面 */

.gate {
  position: fixed;
  inset: 0;
  z-index: 60;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  margin: 0;
  padding: 0;
  border: 0;
  background: radial-gradient(120% 70% at 50% 20%, #7d1519 0%, #4a0a0d 46%, #2a0507 100%);
  color: var(--gold);
  font-family: var(--font-serif);
  cursor: pointer;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.9s ease, visibility 0.9s ease;
}

.gate.is-open {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.gate__seal {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold-line);
  font-size: 48px;
  line-height: 1;
  background: var(--foil);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.gate__names {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 0.08em;
  color: var(--gold);
}

.gate__hint {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.34em;
  color: rgba(217, 184, 120, 0.72);
  animation: gatePulse 2.6s ease-in-out infinite;
}

@keyframes gatePulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}
