:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #756c60;
  background: #f4f1eb;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; }
body { overflow: hidden; }
.invitation {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) calc(env(safe-area-inset-bottom, 0px) + var(--preview-obstruction, 0px)) env(safe-area-inset-left, 0px);
  touch-action: pan-y pinch-zoom;
}
.pages {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  width: calc(100% - 16px);
  margin: 0 8px 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pinch-zoom;
  outline-offset: -3px;
}
.pages::-webkit-scrollbar { display: none; }
.page {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  min-width: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.page img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  -webkit-touch-callout: default;
  /* Original file, no overlay, filter, thumbnail, or canvas. */
}
.page-preview { pointer-events: none; }
.page-original { opacity: 0; pointer-events: none; }
.is-loaded .page-original { opacity: 1; pointer-events: auto; }
.is-loaded .page-preview { visibility: hidden; }
.image-progress {
  position: absolute;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(250, 248, 243, .94);
  color: #756c60;
  pointer-events: none;
}
.image-progress svg { position: absolute; inset: 0; width: 64px; height: 64px; transform: rotate(-90deg); }
.image-progress circle { fill: none; stroke-width: 2; }
.progress-track { stroke: #ddd6ca; }
.progress-value { stroke: #756c60; stroke-linecap: round; stroke-dasharray: 163.363; stroke-dashoffset: 163.363; transition: stroke-dashoffset .12s linear; }
.progress-number { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.no-script-image { display: none; }
.page-guide {
  position: relative;
  width: 100%;
  align-self: center;
  flex: 0 0 52px;
  height: 52px;
  background: #f4f1eb;
}
.page-dots {
  position: absolute;
  top: 2px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.swipe-cue {
  position: absolute;
  top: 28px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 16px;
  min-height: 16px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .08em;
  line-height: 1;
  color: #756c60;
}
.swipe-arrow { display: inline-block; font-size: 17px; }
.is-ready .cue-enter .swipe-arrow { animation: invite-swipe 1.5s ease-in-out .5s 2; }
@keyframes invite-swipe {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(5px); }
}
.save-hint { display: inline-block; pointer-events: none; }
.is-ready .cue-enter .save-hint:not([hidden]) { animation: invite-save 1.5s ease-in-out .5s 2; }
@keyframes invite-save {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
.pages.accordion { position: relative; display: block; overflow: hidden; touch-action: pan-y pinch-zoom; scroll-snap-type: none; }
.accordion .page { position: absolute; inset: 0; }
.accordion .page:not([aria-current]) { visibility: hidden; pointer-events: none; }
.accordion.is-folding .page { visibility: hidden; pointer-events: none; }
.accordion .page img { -webkit-user-drag: none; }
.fold-scene { position: absolute; inset: 0; pointer-events: none; perspective-origin: 50% 50%; }
.fold-sheet { position: absolute; transform-style: preserve-3d; transform-origin: 0 50%; }
.fold-panel { position: absolute; top: 0; left: 0; width: 100%; height: 100%; transform-origin: 0 50%; transform-style: preserve-3d; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: #f8f5ee; }
.fold-panel img { display: block; width: 100%; height: 100%; object-fit: contain; }
.fold-panel::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(61,49,32,.18), transparent 24%, transparent 76%, rgba(61,49,32,.11)); opacity: var(--fold-shade, 0); }
.fold-panel + .fold-panel { border-left: 1px solid rgba(110,92,68,.13); }
.page-dots a {
  display: flex;
  width: 26px;
  height: 24px;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.page-dots a::after {
  content: "";
  box-sizing: content-box;
  width: 5px;
  height: 5px;
  border: 1px solid #9a9185;
  border-radius: 50%;
}
.page-dots a[aria-current="page"]::after { background: #756c60; border-color: #756c60; }
.page-dots a:focus-visible, .pages:focus-visible, button:focus-visible { outline: 2px solid #756c60; outline-offset: -2px; }
.load-error {
  position: absolute;
  max-width: 80%;
  text-align: center;
  padding: 16px;
  background: #f4f1eb;
  line-height: 1.8;
  font-size: 13px;
}
.load-error button { color: inherit; background: none; border: 0; padding: 8px 16px; font: inherit; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
[hidden] { display: none !important; }
.swipe-cue[hidden] { display: inline-flex !important; visibility: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (prefers-reduced-motion: reduce) { .is-ready .cue-enter .swipe-arrow, .is-ready .cue-enter .save-hint:not([hidden]) { animation: none; } .progress-value { transition: none; } }

/* Native panning in both directions takes over while magnified. */
.is-zoomed .invitation, .is-zoomed .pages, .is-zoomed .pages.accordion { touch-action: auto; }

/* Leave the test-host notice visible without placing invitation details beneath it. */
.wechat-preview { --preview-obstruction: 106px; }
