:root {
  --bg: #fbf9f5;
  --surface: #ffffff;
  --ink: #2b2825;
  --ink-2: #6b655c;
  --ink-3: #a39b8f;
  --line: #e7e0d4;
  --line-soft: #f0ebe2;
  --sage: #6f7d68;
  --sage-deep: #566350;
  --champagne: #b79a6b;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, 'PingFang SC', 'Helvetica Neue', 'Microsoft YaHei', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

#app {
  min-height: 100vh;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 20px calc(40px + env(safe-area-inset-bottom));
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

.serif {
  font-family: 'Times New Roman', Times, Georgia, serif;
}

.eyebrow {
  font-family: 'Times New Roman', Times, Georgia, serif;
  font-size: 11px;
  letter-spacing: 5px;
  color: var(--ink-3);
  text-transform: uppercase;
}

/* ---------- 通用 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 22px 18px;
  margin-bottom: 14px;
}

.card-title {
  display: flex;
  align-items: baseline;
  font-size: 15px;
  letter-spacing: 2px;
  margin-bottom: 14px;
}

.card-title .sub {
  margin-left: auto;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--ink-3);
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  border-radius: 4px;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  letter-spacing: 4px;
}

.btn:disabled {
  background: #c9c2b6;
}

.btn-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 46px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  font-size: 14px;
  letter-spacing: 3px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-2);
  background: #fff;
}

.chip.on {
  border-color: var(--sage);
  background: var(--sage);
  color: #fff;
}

.field {
  margin-bottom: 14px;
}

.field-label {
  display: flex;
  align-items: baseline;
  margin-bottom: 6px;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--ink-3);
}

.field-label .tip {
  margin-left: auto;
  font-size: 11px;
}

.input,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f9f7f2;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  padding: 10px 12px;
  outline: none;
}

.input:focus,
.textarea:focus {
  border-color: var(--sage);
}

.textarea {
  min-height: 84px;
  resize: vertical;
}

.hint {
  margin-top: 6px;
  font-size: 11px;
  color: var(--ink-3);
}

.muted {
  color: var(--ink-3);
  font-size: 12px;
}

/* ---------- 请柬 ---------- */
.invite {
  text-align: center;
  padding: 34px 0 10px;
}

.monogram {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-family: 'Times New Roman', Times, Georgia, serif;
  font-size: 14px;
  color: var(--ink-2);
}

.names {
  margin: 14px 0 4px;
  font-size: 30px;
  font-weight: 300;
  letter-spacing: 2px;
}

.names .amp {
  margin: 0 10px;
  font-family: 'Times New Roman', Times, Georgia, serif;
  font-size: 18px;
  color: var(--champagne);
}

.latin {
  font-family: 'Times New Roman', Times, Georgia, serif;
  font-size: 11px;
  letter-spacing: 4px;
  color: var(--ink-3);
}

.date-line {
  margin-top: 18px;
  font-family: 'Times New Roman', Times, Georgia, serif;
  font-size: 15px;
  letter-spacing: 2px;
  color: var(--ink-2);
}

.poem {
  margin-top: 6px;
  font-size: 13px;
  letter-spacing: 3px;
  color: var(--ink-3);
}

.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 26px 0 20px;
}

.ornament::before,
.ornament::after {
  content: '';
  width: 56px;
  height: 1px;
  background: var(--line);
}

.ornament span {
  width: 6px;
  height: 6px;
  margin: 0 10px;
  background: var(--champagne);
  transform: rotate(45deg);
}

.scene {
  text-align: left;
  padding: 18px 16px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

.scene-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.scene-label {
  font-size: 15px;
  letter-spacing: 2px;
}

.scene-meal {
  padding: 1px 6px;
  border: 1px solid rgba(111, 125, 104, 0.45);
  border-radius: 2px;
  font-size: 10px;
  color: var(--sage);
}

.scene-date {
  margin-top: 8px;
  font-family: 'Times New Roman', Times, Georgia, serif;
  font-size: 22px;
}

.scene-date small {
  margin-left: 8px;
  font-family: -apple-system, 'PingFang SC', sans-serif;
  font-size: 11px;
  color: var(--ink-3);
}

.scene-lunar {
  margin-top: 2px;
  font-size: 11px;
  letter-spacing: 1px;
  color: #b0a99d;
}

.scene-hotel {
  margin-top: 8px;
  font-size: 14px;
}

.scene-hotel em {
  font-style: normal;
  font-size: 11px;
  color: var(--sage);
}

.scene-addr {
  font-size: 11px;
  color: var(--ink-3);
}

.scene-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--sage);
}

.links {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 20px 0 6px;
  font-size: 13px;
  color: var(--ink-2);
}

.links a {
  border-bottom: 1px solid #d8d1c4;
  padding-bottom: 1px;
}

.footer {
  margin-top: 26px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 3px;
  color: #bdb6ab;
}

/* ---------- 表单页 ---------- */
.page-head {
  padding: 24px 0 14px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 18px;
}

.page-title {
  margin-top: 6px;
  font-size: 26px;
  font-weight: 300;
  letter-spacing: 4px;
}

.page-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-2);
}

.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.stepper button {
  width: 40px;
  height: 40px;
  border: 1px solid #d6cfc2;
  border-radius: 50%;
  font-size: 18px;
}

.stepper .value {
  font-family: 'Times New Roman', Times, Georgia, serif;
  font-size: 28px;
  min-width: 70px;
  text-align: center;
}

.stepper .value small {
  font-size: 12px;
  color: var(--ink-3);
}

.companion-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.companion-row .input {
  flex: 1;
}

.companion-row .del {
  width: 40px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink-3);
}

.add-row {
  width: 100%;
  padding: 10px;
  border: 1px dashed #ded7ca;
  border-radius: 4px;
  font-size: 13px;
  color: var(--sage);
}

.sticky-cta {
  position: sticky;
  bottom: 0;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(251, 249, 245, 0) 0%, var(--bg) 40%);
}

/* ---------- 祝福墙 ---------- */
.bless {
  padding: 18px 16px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

.bless-text {
  font-size: 15px;
  line-height: 1.85;
  word-break: break-word;
}

.bless-meta {
  display: flex;
  align-items: baseline;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #f4efe7;
  font-size: 11px;
  color: var(--ink-3);
}

.bless-meta .mine {
  margin-left: 6px;
  color: var(--sage);
}

.bless-meta .time {
  margin-left: auto;
}

/* ---------- 相册 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 2px;
  background: #f0ebe2;
}

.upload-row {
  display: flex;
  gap: 10px;
  margin: 14px 0;
}

.upload-row label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border: 1px dashed #ded7ca;
  border-radius: 4px;
  font-size: 13px;
  color: var(--sage);
}

/* ---------- 后台 ---------- */
.tabs {
  display: flex;
  gap: 18px;
  margin: 6px 0 16px;
  border-bottom: 1px solid var(--line-soft);
}

.tabs button {
  padding: 8px 0 10px;
  font-size: 14px;
  color: var(--ink-3);
  border-bottom: 2px solid transparent;
}

.tabs button.on {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.kpi {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

.kpi b {
  display: block;
  font-family: 'Times New Roman', Times, Georgia, serif;
  font-size: 26px;
  font-weight: 400;
}

.kpi span {
  font-size: 11px;
  color: var(--ink-3);
}

.bar-row {
  margin-bottom: 12px;
}

.bar-head {
  display: flex;
  font-size: 13px;
  margin-bottom: 4px;
}

.bar-head span:last-child {
  margin-left: auto;
  font-size: 11px;
  color: var(--ink-3);
}

.bar-track {
  height: 6px;
  background: #f2ede4;
}

.bar-fill {
  height: 100%;
  background: var(--sage);
}

.row-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.row-item .grow {
  flex: 1;
  min-width: 0;
}

.row-item .name {
  font-size: 14px;
}

.row-item .meta {
  font-size: 11px;
  color: var(--ink-3);
}

.row-item .num {
  font-family: 'Times New Roman', Times, Georgia, serif;
  font-size: 18px;
}

.review-photo {
  width: 100%;
  border-radius: 4px;
  background: #f0ebe2;
}

.review-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.review-actions .btn-outline,
.review-actions .btn {
  height: 38px;
  font-size: 13px;
}

.review-card {
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

/* ---------- 音乐按钮 ---------- */
.music-btn {
  position: fixed;
  right: 14px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(251, 249, 245, 0.94);
  box-shadow: 0 4px 14px rgba(43, 40, 37, 0.12);
  z-index: 20;
}

.music-note {
  display: inline-block; /* 行内元素上的 transform 不生效，必须 inline-block */
  font-family: 'Times New Roman', Times, Georgia, serif;
  font-size: 20px;
  line-height: 1;
  color: var(--ink-2);
  transform-origin: 50% 50%;
}

.music-btn.on .music-note {
  color: var(--sage);
  animation: spin 6s linear infinite;
}

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

/* ---------- 提示 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 80px;
  transform: translateX(-50%);
  max-width: 80vw;
  padding: 10px 16px;
  border-radius: 4px;
  background: rgba(43, 40, 37, 0.92);
  color: #fff;
  font-size: 13px;
  z-index: 50;
}

.empty {
  padding: 60px 0;
  text-align: center;
  font-size: 13px;
  color: var(--ink-3);
}

.empty-mark {
  font-size: 26px;
  margin-bottom: 8px;
  color: #d8cbb2;
}

.loading {
  padding: 40px 0;
  text-align: center;
  font-size: 13px;
  color: var(--ink-3);
}

/* ================= 动效 ================= */
.glow {
  position: fixed;
  top: -140px;
  left: 50%;
  width: 440px;
  height: 440px;
  margin-left: -220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(183, 154, 107, 0.18) 0%, rgba(183, 154, 107, 0) 62%);
  pointer-events: none;
  z-index: 0;
  animation: glowBreath 9s ease-in-out infinite;
}

@keyframes glowBreath {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

.petals {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.petal {
  position: absolute;
  top: -40px;
  opacity: 0;
  border-radius: 50% 0 50% 50%;
  animation-name: petalFall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.petal.b {
  border-radius: 0 50% 50% 50%;
  animation-name: petalFallAlt;
}

.petal.gold {
  background: #c8ae7e;
}

.petal.sage {
  background: #9aa78f;
}

.petal.soft {
  background: #ddcdb0;
}

@keyframes petalFall {
  0% {
    transform: translate3d(0, -40px, 0) rotate(0deg);
    opacity: 0;
  }
  8% {
    opacity: 0.62;
  }
  80% {
    opacity: 0.5;
  }
  100% {
    transform: translate3d(45px, 105vh, 0) rotate(320deg);
    opacity: 0;
  }
}

@keyframes petalFallAlt {
  0% {
    transform: translate3d(0, -40px, 0) rotate(24deg);
    opacity: 0;
  }
  8% {
    opacity: 0.55;
  }
  80% {
    opacity: 0.46;
  }
  100% {
    transform: translate3d(-48px, 105vh, 0) rotate(-280deg);
    opacity: 0;
  }
}

.invite {
  position: relative;
  z-index: 1;
}

.reveal {
  animation: revealUp 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

@keyframes revealUp {
  from {
    opacity: 0;
    transform: translate3d(0, 14px, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.r1 { animation-delay: 0.05s; }
.r2 { animation-delay: 0.22s; }
.r3 { animation-delay: 0.38s; }
.r4 { animation-delay: 0.54s; }
.r5 { animation-delay: 0.68s; }
.r6 { animation-delay: 0.82s; }
.r7 { animation-delay: 1s; }
.r8 { animation-delay: 1.15s; }
.r9 { animation-delay: 1.3s; }
.r10 { animation-delay: 1.45s; }
.r11 { animation-delay: 1.62s; }

/* 圆章外圈缓慢旋转的细弧 */
.monogram {
  position: relative;
}

.monogram::after {
  content: '';
  position: absolute;
  top: -6px;
  right: -6px;
  bottom: -6px;
  left: -6px;
  border: 1px solid transparent;
  border-top-color: rgba(183, 154, 107, 0.65);
  border-right-color: rgba(183, 154, 107, 0.18);
  border-radius: 50%;
  animation: ringSpin 26s linear infinite;
}

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

/* 分隔线从中间长出、菱形弹入 */
.ornament::before,
.ornament::after {
  width: 0;
  animation: lineGrow 1.1s cubic-bezier(0.4, 0, 0.2, 1) 1.05s both;
}

@keyframes lineGrow {
  to {
    width: 56px;
  }
}

.ornament span {
  animation: diamondIn 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 1.5s both;
}

@keyframes diamondIn {
  from {
    transform: rotate(45deg) scale(0);
    opacity: 0;
  }
  to {
    transform: rotate(45deg) scale(1);
    opacity: 1;
  }
}

/* 音乐按钮首次跳三下 + 光圈扩散 */
.music-btn.hint {
  animation: hintPop 1.2s ease-in-out 3;
}

@keyframes hintPop {
  0%,
  100% {
    transform: scale(1);
  }
  25% {
    transform: scale(1.18);
  }
  50% {
    transform: scale(1);
  }
  75% {
    transform: scale(1.1);
  }
}

.music-btn.hint::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border: 1px solid rgba(183, 154, 107, 0.7);
  border-radius: 50%;
  opacity: 0;
  animation: hintRing 1.2s ease-out 3;
}

@keyframes hintRing {
  0% {
    transform: scale(1);
    opacity: 0.85;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* 调休提示 */
.scene-note {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 11px;
  letter-spacing: 1px;
  color: #a9614a;
  background: #fbf1ec;
}