:root {
  --red-950: #4d0706;
  --red-900: #710b0a;
  --red-800: #8d1110;
  --red-700: #b31516;
  --gold-100: #fff2bf;
  --gold-200: #f8df91;
  --gold-400: #d7a93c;
  --gold-600: #9a6a16;
  --ink: #4a160d;
  --paper: #fff7df;
  --paper-deep: #f7e7bd;
  --shadow: rgba(48, 3, 2, 0.3);
  --font-cn: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", "Source Han Sans SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--red-950);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-cn);
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 220, 130, 0.18), transparent 28rem),
    radial-gradient(circle at 86% 22%, rgba(255, 214, 113, 0.14), transparent 22rem),
    linear-gradient(145deg, var(--red-950), var(--red-800) 42%, var(--red-900));
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.24;
  background-image:
    linear-gradient(135deg, rgba(255, 232, 160, 0.2) 25%, transparent 25%),
    linear-gradient(225deg, rgba(255, 232, 160, 0.18) 25%, transparent 25%);
  background-size: 32px 32px;
}

.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #ffe7a0, #d31319, #ffe7a0);
  box-shadow: 0 0 14px rgba(255, 231, 160, 0.66);
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 220ms ease, opacity 180ms ease;
}

.progress-bar.is-visible {
  opacity: 1;
}

.music-btn {
  position: fixed;
  top: 14px;
  right: max(14px, calc((100vw - 520px) / 2 + 14px));
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 12px;
  color: var(--gold-100);
  font-family: var(--font-cn);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(255, 231, 151, 0.72);
  border-radius: 999px;
  background: rgba(113, 11, 10, 0.82);
  box-shadow: 0 8px 20px rgba(48, 3, 2, 0.24);
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.music-btn span:first-child {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 242, 191, 0.16);
}

.music-btn.is-playing span:first-child {
  animation: music-spin 2.4s linear infinite;
}

.music-btn.is-disabled {
  opacity: 0.68;
  cursor: not-allowed;
}

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

.invitation {
  position: relative;
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 14px;
}

.hero {
  position: relative;
  display: grid;
  min-height: 46vh;
  place-items: center;
  overflow: hidden;
  padding: 42px 22px 34px;
  color: var(--gold-100);
  text-align: center;
  border: 1px solid rgba(255, 225, 148, 0.55);
  border-radius: 8px 8px 0 0;
  background:
    linear-gradient(90deg, rgba(255, 221, 130, 0.22), transparent 18%, transparent 82%, rgba(255, 221, 130, 0.22)),
    radial-gradient(circle at center, rgba(255, 222, 135, 0.2), transparent 17rem),
    linear-gradient(160deg, #8f100f, #6f0908);
  box-shadow: 0 18px 60px var(--shadow);
}

.hero::before,
.hero::after {
  position: absolute;
  width: 180px;
  height: 180px;
  content: "";
  border: 1px solid rgba(248, 223, 145, 0.35);
  transform: rotate(45deg);
}

.hero::before {
  top: -92px;
  left: -92px;
}

.hero::after {
  right: -92px;
  bottom: -92px;
}

.eyebrow {
  z-index: 1;
  margin: 0;
  color: var(--gold-200);
  font-size: 13px;
  letter-spacing: 0;
}

.double-happiness {
  z-index: 1;
  width: clamp(116px, 38vw, 172px);
  height: clamp(116px, 38vw, 172px);
  display: grid;
  margin: 12px auto 8px;
  place-items: center;
  color: var(--gold-100);
  font-size: clamp(76px, 23vw, 112px);
  line-height: 1;
  border: 2px solid rgba(255, 235, 166, 0.88);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 231, 151, 0.16), rgba(136, 12, 10, 0.35) 66%),
    repeating-conic-gradient(from 45deg, rgba(255, 225, 130, 0.2) 0 8deg, transparent 8deg 16deg);
  box-shadow: inset 0 0 0 8px rgba(255, 220, 124, 0.12), 0 10px 26px rgba(42, 0, 0, 0.24);
}

h1 {
  z-index: 1;
  margin: 0;
  font-size: clamp(30px, 9vw, 48px);
  font-weight: 700;
  letter-spacing: 0;
}

.couple-line {
  z-index: 1;
  margin: 14px 0 0;
  color: var(--gold-200);
  font-size: 18px;
}

.cloud {
  position: absolute;
  width: 120px;
  height: 54px;
  opacity: 0.3;
  border: 2px solid var(--gold-200);
  border-right: 0;
  border-radius: 40px 0 0 40px;
}

.cloud::before,
.cloud::after {
  position: absolute;
  content: "";
  border: 2px solid var(--gold-200);
  border-right: 0;
  border-radius: 40px 0 0 40px;
}

.cloud::before {
  top: -20px;
  left: 28px;
  width: 68px;
  height: 40px;
}

.cloud::after {
  right: -24px;
  bottom: -18px;
  width: 72px;
  height: 34px;
}

.cloud-left {
  left: -34px;
  top: 70px;
}

.cloud-right {
  right: -34px;
  bottom: 92px;
  transform: rotate(180deg);
}

.content {
  position: relative;
  padding: 18px 14px 28px;
  border: 1px solid rgba(255, 225, 148, 0.55);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background:
    linear-gradient(rgba(255, 247, 223, 0.94), rgba(255, 247, 223, 0.96)),
    repeating-linear-gradient(45deg, rgba(183, 21, 22, 0.08) 0 2px, transparent 2px 15px);
}

.guest-card,
.message,
.details,
.parents,
.photo-stage {
  margin-bottom: 18px;
}

.guest-card {
  padding: 18px 16px;
  text-align: center;
  border: 1px solid rgba(154, 106, 22, 0.32);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 252, 238, 0.94), rgba(247, 231, 189, 0.72));
}

.guest-label {
  margin: 0 0 8px;
  color: var(--gold-600);
  font-size: 13px;
}

.guest-name {
  margin: 0;
  color: var(--red-900);
  font-size: clamp(24px, 7vw, 34px);
  font-weight: 700;
}

.photo-stage {
  overflow: hidden;
  border: 1px solid rgba(154, 106, 22, 0.38);
  border-radius: 8px;
  background: #6f0908;
}

.slider {
  position: relative;
  aspect-ratio: 4 / 5;
  min-height: 360px;
  overflow: hidden;
}

.slides {
  position: absolute;
  inset: 0;
}

.slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 700ms ease;
}

.slide.active {
  opacity: 1;
}

.photo-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  padding: 28px;
  color: var(--gold-100);
  text-align: center;
  background:
    radial-gradient(circle at center, rgba(255, 226, 146, 0.2), transparent 14rem),
    repeating-conic-gradient(from 45deg, rgba(255, 225, 130, 0.14) 0 8deg, transparent 8deg 16deg),
    linear-gradient(160deg, #8f100f, #5c0706);
}

.photo-fallback span {
  font-size: clamp(34px, 12vw, 58px);
  font-weight: 700;
}

.photo-fallback small {
  max-width: 18em;
  color: var(--gold-200);
  font-size: 13px;
  line-height: 1.6;
}

.slider.has-photos .photo-fallback {
  display: none;
}

.slide-btn {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 38px;
  height: 44px;
  padding: 0;
  color: var(--gold-100);
  font-size: 34px;
  line-height: 1;
  border: 0;
  background: rgba(65, 0, 0, 0.42);
  transform: translateY(-50%);
  cursor: pointer;
}

.slide-btn:focus-visible,
.action-btn:focus-visible {
  outline: 3px solid rgba(255, 231, 151, 0.82);
  outline-offset: 2px;
}

.prev {
  left: 0;
  border-radius: 0 8px 8px 0;
}

.next {
  right: 0;
  border-radius: 8px 0 0 8px;
}

.dots {
  position: absolute;
  right: 0;
  bottom: 14px;
  left: 0;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 1px solid rgba(255, 239, 191, 0.86);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  cursor: pointer;
}

.dot.active {
  background: var(--gold-100);
}

.slider:not(.has-photos) .slide-btn,
.slider:not(.has-photos) .dots {
  display: none;
}

.message {
  padding: 2px 4px;
  font-size: 17px;
  line-height: 2;
  text-align: justify;
}

.message p {
  margin: 0 0 12px;
}

.message strong {
  color: var(--red-900);
}

.details {
  display: grid;
  gap: 10px;
}

.detail-item {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border-bottom: 1px solid rgba(154, 106, 22, 0.18);
  background: rgba(255, 252, 238, 0.46);
}

.detail-item > span:first-child {
  color: var(--gold-600);
  font-size: 14px;
  font-family: var(--font-cn);
  font-weight: 500;
}

.detail-item strong {
  color: var(--ink);
  font-family: var(--font-cn);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.55;
}

.detail-item strong span {
  color: inherit;
  font: inherit;
}

.parents {
  color: var(--red-900);
  text-align: center;
  font-family: var(--font-cn);
  line-height: 1.9;
}

.parents p {
  margin: 6px 0;
  font-size: 16px;
  font-weight: 500;
}

.parents .invite-title {
  margin-bottom: 8px;
  color: var(--gold-600);
  font-size: 15px;
  font-weight: 500;
}

.spacer {
  display: inline-block;
  width: 0.8em;
}

.actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 18px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 14px;
  color: var(--gold-100);
  font-weight: 700;
  text-decoration: none;
  border: 1px solid rgba(255, 231, 151, 0.64);
  border-radius: 8px;
  background: linear-gradient(180deg, #b31516, #7b0d0b);
  box-shadow: 0 8px 18px rgba(77, 7, 6, 0.18);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.action-btn.secondary {
  color: var(--red-900);
  background: linear-gradient(180deg, #fff3bf, #e8c66e);
}

.action-btn:hover,
.danger-btn:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.action-btn:active,
.danger-btn:active {
  transform: translateY(1px) scale(0.99);
}

.action-btn:disabled,
.danger-btn:disabled,
.action-btn.is-busy,
.danger-btn.is-busy {
  cursor: wait;
  filter: saturate(0.86);
  opacity: 0.82;
}

.action-btn.is-busy::after,
.danger-btn.is-busy::after {
  width: 14px;
  height: 14px;
  margin-left: 8px;
  content: "";
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: button-spin 760ms linear infinite;
}

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

@media (max-width: 360px) {
  .invitation {
    padding: 8px;
  }

  .content {
    padding: 14px 10px 22px;
  }

  .slider {
    min-height: 310px;
  }

  .actions {
    grid-template-columns: 1fr;
  }
}

.editor-page {
  min-height: 100vh;
}

.editor-shell {
  width: min(100%, 620px);
  margin: 0 auto;
  padding: 18px 14px 34px;
}

.editor-panel {
  margin-bottom: 16px;
  padding: 20px 16px;
  color: var(--ink);
  border: 1px solid rgba(255, 225, 148, 0.55);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 247, 223, 0.98), rgba(247, 231, 189, 0.96));
  box-shadow: 0 16px 40px var(--shadow);
}

.editor-panel.compact {
  box-shadow: none;
}

.editor-kicker {
  margin: 0 0 8px;
  color: var(--gold-600);
  font-size: 13px;
  font-weight: 600;
}

.editor-panel h1,
.editor-panel h2 {
  margin: 0;
  color: var(--red-900);
  font-family: var(--font-cn);
  letter-spacing: 0;
}

.editor-panel h1 {
  font-size: 28px;
}

.editor-panel h2 {
  font-size: 20px;
}

.editor-subtitle {
  margin: 10px 0 18px;
  color: rgba(74, 22, 13, 0.72);
  font-size: 14px;
  line-height: 1.7;
}

.form-field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.form-field span {
  color: var(--gold-600);
  font-size: 14px;
  font-weight: 600;
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 12px;
  color: var(--ink);
  font-family: var(--font-cn);
  font-size: 16px;
  line-height: 1.5;
  border: 1px solid rgba(154, 106, 22, 0.32);
  border-radius: 8px;
  background: rgba(255, 252, 238, 0.86);
}

.form-field textarea {
  resize: vertical;
  word-break: break-all;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: 3px solid rgba(215, 169, 60, 0.25);
  border-color: var(--gold-600);
}

.editor-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

button.action-btn {
  cursor: pointer;
  font-family: var(--font-cn);
  font-size: 15px;
}

.editor-status {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--red-900);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

.editor-status.flash {
  animation: status-pop 360ms ease;
}

@keyframes status-pop {
  50% {
    transform: scale(1.04);
  }
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.quick-links a {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 10px;
  color: var(--red-900);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid rgba(154, 106, 22, 0.24);
  border-radius: 999px;
  background: rgba(255, 252, 238, 0.68);
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}

.settings-grid .wide {
  grid-column: 1 / -1;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.media-card {
  overflow: hidden;
  border: 1px solid rgba(154, 106, 22, 0.32);
  border-radius: 8px;
  background: rgba(255, 252, 238, 0.76);
}

.media-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.media-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: rgba(154, 106, 22, 0.18);
}

.mini-btn {
  min-height: 38px;
  color: var(--red-900);
  font-family: var(--font-cn);
  font-weight: 700;
  border: 0;
  background: rgba(255, 252, 238, 0.86);
  cursor: pointer;
  transition: filter 160ms ease, transform 160ms ease;
}

.mini-btn:hover {
  filter: brightness(1.03);
}

.mini-btn:active {
  transform: scale(0.98);
}

.mini-btn:disabled {
  color: rgba(74, 22, 13, 0.38);
  cursor: not-allowed;
  filter: none;
}

.danger-btn {
  width: 100%;
  min-height: 40px;
  color: #fff7df;
  font-family: var(--font-cn);
  font-weight: 700;
  border: 0;
  background: #8d1110;
  cursor: pointer;
}

.music-current {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  word-break: break-all;
}

.music-current audio {
  width: 100%;
}

.empty-note {
  margin: 12px 0 0;
  color: rgba(74, 22, 13, 0.66);
  font-size: 14px;
}

@media (max-width: 420px) {
  .editor-actions {
    grid-template-columns: 1fr;
  }

  .settings-grid,
  .media-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 760px) {
  .invitation {
    padding-block: 28px;
  }
}
