:root {
  --blue: #1759ba;
  --blue-deep: #053b91;
  --sky: #9db9f0;
  --peach: #ffc9b7;
  --rose: #f47b9a;
  --paper: #fffdfb;
  --ink: #17325f;
}

* { box-sizing: border-box; }
html, body { position: fixed; inset: 0; width: 100%; height: 100%; min-height: 100%; margin: 0; padding: 0; overflow: hidden; }
body {
  background: #9db9f0;
  color: var(--ink);
  font-family: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  touch-action: none;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.wechat-share-cover { position: fixed; left: -9999px; top: -9999px; width: 1px; height: 1px; opacity: .01; pointer-events: none; }

.invitation { position: fixed; inset: 0; width: 100%; height: 100vh; height: 100dvh; margin: 0; padding: 0; overflow: hidden; }
.pages, .page { position: absolute; inset: 0; }
.page {
  display: grid;
  place-items: center;
  background: linear-gradient(155deg, var(--sky), #d5c2e8 52%, var(--peach));
  transform: translate3d(0, 100%, 0);
  opacity: 0;
  transition: transform 720ms cubic-bezier(.22,.78,.24,1), opacity 500ms ease;
  will-change: transform;
}
.page.is-active { transform: translate3d(0,0,0); opacity: 1; z-index: 2; }
.page.is-before { transform: translate3d(0,-18%,0) scale(.97); opacity: 0; z-index: 1; }
.page > img { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: center top; display: block; user-select: none; -webkit-user-drag: none; }
.page:nth-child(n+2):nth-child(-n+5) > img {
  inset: auto;
  top: calc(-6% - 1px);
  left: -1px;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
}
.page:nth-child(n+2):nth-child(-n+5) {
  background: linear-gradient(90deg, #f6c8c6 0%, #e8a8c9 42%, #7253b7 65%, #083b94 100%);
}

.cover-page { position: absolute; }
.cover-start {
  position: absolute; z-index: 4; left: 50%; top: 60.5%; transform: translate(-50%, -50%);
  min-width: 156px; min-height: 45px; padding: 0 24px;
  border: 1px solid rgba(255,255,255,.9); border-radius: 24px;
  background: rgba(255,255,255,.91); color: var(--blue-deep);
  box-shadow: 0 10px 30px rgba(10,53,130,.2);
  font-size: 15px; font-weight: 700; letter-spacing: .18em;
  animation: startPulse 2.4s ease-in-out infinite;
  transition: opacity .35s ease, transform .35s ease;
}
.cover-start::after { content: ""; position: absolute; inset: -7px; border: 1px solid rgba(255,255,255,.58); border-radius: 30px; }
.cover-start.is-dismissed { opacity: 0; transform: translate(-50%, -50%) scale(.92); pointer-events: none; }
@keyframes startPulse { 0%,100% { box-shadow: 0 10px 30px rgba(10,53,130,.2); } 50% { box-shadow: 0 10px 36px rgba(10,53,130,.38); } }

.music-toggle { position: fixed; z-index: 8; top: max(16px, env(safe-area-inset-top)); right: 16px; width: 38px; height: 38px; padding: 0; border: 1px solid rgba(255,255,255,.7); border-radius: 50%; background: rgba(18,67,148,.42); backdrop-filter: blur(8px); color: white; box-shadow: 0 6px 20px rgba(12,49,112,.18); opacity: 0; pointer-events: none; transition: opacity .35s ease; }
.music-toggle span, .music-toggle span::before { position: absolute; content: ""; background: currentColor; }
.music-toggle span { width: 3px; height: 17px; left: 18px; top: 9px; transform: rotate(-8deg); transform-origin: center; }
.music-toggle span::before { width: 10px; height: 7px; border-radius: 50%; left: -7px; top: 13px; }
.music-toggle[aria-pressed="true"] { animation: spin 5s linear infinite; }
.music-toggle[aria-pressed="false"]::after { content: ""; position: absolute; width: 1.5px; height: 28px; background: white; left: 18px; top: 4px; transform: rotate(-42deg); }
@keyframes spin { to { transform: rotate(360deg); } }

.page-dots { position: fixed; z-index: 7; right: 18px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 8px; opacity: 0; pointer-events: none; transition: opacity .35s ease; }
.page-dots button { width: 7px; height: 7px; padding: 0; border: 1px solid rgba(255,255,255,.95); border-radius: 50%; background: rgba(18,72,160,.24); transition: height .3s ease, background .3s ease; }
.page-dots button.is-active { height: 22px; border-radius: 6px; background: white; }
.swipe-hint { position: fixed; z-index: 7; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 5px; color: white; font-size: 15px; font-weight: 700; letter-spacing: .12em; text-shadow: 0 2px 8px rgba(4,45,112,.78); opacity: 0; pointer-events: none; transition: opacity .3s; }
.is-started .music-toggle, .is-started .page-dots { opacity: 1; pointer-events: auto; }
.is-started .swipe-hint { opacity: 1; }
.swipe-hint i { width: 16px; height: 16px; border-left: 2px solid; border-top: 2px solid; transform: rotate(45deg); animation: lift 1.5s ease-in-out infinite; }
@keyframes lift { 0%,100%{ transform: translateY(4px) rotate(45deg); opacity:.35 } 50%{ transform: translateY(-2px) rotate(45deg); opacity:1 } }

.signup-page { overflow-y: auto; place-items: start center; padding: max(28px, env(safe-area-inset-top)) 18px max(34px, env(safe-area-inset-bottom)); touch-action: pan-y; }
.signup-bg { position: fixed; inset: 0; background: linear-gradient(180deg, rgba(89,135,218,.52), rgba(253,180,173,.82)), url('/assets/1.jpg') center/cover; filter: saturate(.82); }
.signup-shell { position: relative; z-index: 1; width: min(100%, 430px); margin: auto; padding: 28px 24px 22px; background: rgba(255,253,251,.94); border: 1px solid rgba(255,255,255,.9); border-radius: 4px 4px 54px 4px; box-shadow: 0 24px 70px rgba(24,64,137,.22); }
.signup-header { margin-bottom: 21px; }
.eyebrow { margin: 0 0 7px; color: var(--blue); font: 700 11px/1.2 Arial,sans-serif; letter-spacing: .18em; }
.signup-header h1 { margin: 0; color: var(--blue-deep); font-family: "STKaiti", "KaiTi", serif; font-size: clamp(36px, 10vw, 46px); font-weight: 500; line-height: 1.12; letter-spacing: .08em; }
.signup-header > p:last-child { margin: 10px 0 0; color: #607294; font-size: 12px; line-height: 1.6; }
form { display: grid; gap: 12px; }
form > label, fieldset { display: grid; grid-template-columns: 82px 1fr; align-items: center; min-height: 46px; margin: 0; padding: 0 12px; border: 1px solid #d8e2f4; border-radius: 3px; background: white; }
form > label > span, legend { color: #3a527b; font-size: 14px; font-weight: 700; }
fieldset { position: relative; }
legend { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); }
input[type="text"], input[type="tel"], input:not([type]) { width: 100%; min-width: 0; height: 44px; padding: 0; border: 0; outline: 0; background: transparent; color: #152c52; font-size: 16px; }
input::placeholder { color: #a7b1c4; }
form > label:focus-within, fieldset:focus-within { border-color: #4e82d9; box-shadow: 0 0 0 3px rgba(78,130,217,.12); }
.gender-options { grid-column: 2; display: flex; gap: 8px; }
.gender-options label { position: relative; }
.gender-options input { position: absolute; opacity: 0; }
.gender-options span { display: inline-flex; align-items: center; justify-content: center; width: 62px; height: 32px; border-radius: 16px; background: #eef3fc; color: #61708c; font-size: 14px; }
.gender-options input:checked + span { background: var(--blue); color: white; }
.gender-options input:focus-visible + span { outline: 3px solid rgba(47,110,219,.25); }
.website-field { position: absolute; left: -9999px; width: 1px; height: 1px; }
form button[type="submit"] { min-height: 48px; margin-top: 3px; border: 0; border-radius: 3px; background: linear-gradient(90deg, var(--blue-deep), #2f76dd); color: white; font-weight: 700; letter-spacing: .14em; box-shadow: 0 10px 24px rgba(20,82,177,.2); }
form button[disabled] { opacity: .58; }
.form-status { min-height: 20px; margin: -2px 0 0; color: #c3445e; font-size: 13px; text-align: center; }
.form-status.is-success { color: #126a4b; }
.notice { margin: 3px 0 0; color: #70809c; font-size: 11px; line-height: 1.6; text-align: center; }

@media (min-width: 700px) {
  .invitation { width: min(100%, 462px); left: 50%; transform: translateX(-50%); box-shadow: 0 0 80px rgba(14,51,114,.32); }
  body { background: radial-gradient(circle at 50% 30%, #dae5fb, #829fd4); }
  .music-toggle { right: calc(50% - 215px); }
  .page-dots { right: calc(50% - 215px); }
}
@media (max-height: 700px) {
  .signup-page { padding-top: 14px; }
  .signup-shell { padding: 20px 20px 16px; }
  .signup-header { margin-bottom: 14px; }
  .signup-header h1 { font-size: 32px; }
  form { gap: 8px; }
  form > label, fieldset { min-height: 41px; }
  input[type="tel"], input:not([type]) { height: 39px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
