:root {
  --bg: #fff4ef;
  --ink: #3a2a2e;
  --muted: #9b8489;
  --line: #f1dedd;
  --card: #fff;
  --rose: #ff5c7c;
  --rose-2: #ff8d6b;
  --rose-soft: #ffe3e6;
  --radius: 18px;
  --shadow: 0 6px 24px rgba(186, 92, 104, .14);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(120% 60% at 50% -10%, #ffe1e4 0%, transparent 60%),
    radial-gradient(80% 50% at 100% 110%, #ffe6d6 0%, transparent 60%),
    var(--bg);
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.app {
  position: relative;
  z-index: 1;
  max-width: 460px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(12px + var(--safe-t)) 20px 0;
}

/* ---------- 屏幕切换 ---------- */
.screen { display: none; flex-direction: column; min-height: calc(100vh - 12px - var(--safe-t)); min-height: calc(100dvh - 12px - var(--safe-t)); }
.screen.active { display: flex; animation: screen-in .4s cubic-bezier(.2, .8, .3, 1); }
@keyframes screen-in { from { opacity: 0; transform: translateY(14px); } }

h1 { font-size: 26px; line-height: 1.3; margin: 14px 0 6px; font-weight: 800; letter-spacing: .5px; }
h2 { font-size: 22px; margin: 18px 0 12px; font-weight: 800; }
h3 { font-size: 16px; margin: 22px 0 10px; font-weight: 700; }
.sub { color: var(--muted); margin: 0 0 8px; font-size: 15px; }

.sticker { font-size: 92px; line-height: 1; animation: bob 2.4s ease-in-out infinite; user-select: none; }
.sticker.small { font-size: 56px; }
.sticker.pop { animation: pop .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-3deg); } }
@keyframes pop { 0% { transform: scale(.4); } 100% { transform: scale(1); } }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 52px; padding: 0 30px; border-radius: 999px;
  font-size: 17px; font-weight: 700; white-space: nowrap;
  transition: transform .25s cubic-bezier(.3, 1.4, .5, 1), opacity .2s, box-shadow .2s;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.btn:active { transform: scale(.96); }
.btn-yes, .btn-next {
  color: #fff;
  background: linear-gradient(135deg, var(--rose), var(--rose-2));
  box-shadow: 0 8px 22px rgba(255, 92, 124, .35);
}
.btn-no { background: #fff; color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-next { width: 100%; }
.btn-next:disabled { opacity: .35; box-shadow: none; }
.btn.loading { pointer-events: none; opacity: .7; }

.link { color: var(--muted); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; padding: 10px; }

/* ---------- 信封 ---------- */
.envelope-wrap { margin: auto; text-align: center; padding-bottom: 8vh; }
.env-from { font-size: 18px; font-weight: 700; margin: 0 0 28px; }
.env-tip { color: var(--muted); font-size: 14px; margin-top: 30px; animation: blink 1.8s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }

.envelope {
  position: relative; display: block; margin: 0 auto;
  width: 270px; height: 176px; perspective: 800px;
  animation: wiggle 3s ease-in-out infinite;
}
.envelope > span { position: absolute; left: 0; right: 0; }
.env-back { inset: 0; background: #ffc9c4; border-radius: 10px; }
.env-letter {
  left: 14px !important; right: 14px !important; top: 10px; height: 150px;
  background: #fff; border-radius: 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
  padding: 22px 20px; display: flex; flex-direction: column; gap: 10px;
  transition: transform .6s cubic-bezier(.2, .8, .3, 1) .35s;
}
.env-letter-line { height: 8px; border-radius: 4px; background: var(--rose-soft); }
.env-letter-line.short { width: 60%; }
.env-front {
  inset: 0; border-radius: 10px;
  background: linear-gradient(160deg, #ffd7d1, #ffbfb8);
  clip-path: polygon(0 0, 50% 52%, 100% 0, 100% 100%, 0 100%);
}
.env-flap {
  top: 0; height: 60%;
  background: #ffb3ab; border-radius: 10px 10px 0 0;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top; transition: transform .45s ease-in, z-index 0s .2s;
  z-index: 3;
}
.env-seal {
  top: 44% !important; left: 50% !important; right: auto !important;
  transform: translate(-50%, -50%); font-size: 34px; z-index: 4;
  transition: opacity .2s;
}
.env-to { bottom: 16px; font-size: 14px; color: #a2575f; font-weight: 600; z-index: 2; }
.envelope.open { animation: none; }
.envelope.open .env-flap { transform: rotateX(180deg); z-index: 0; }
.envelope.open .env-seal { opacity: 0; }
.envelope.open .env-letter { transform: translateY(-62%); }
@keyframes wiggle { 0%, 80%, 100% { transform: rotate(0); } 84% { transform: rotate(-3deg); } 88% { transform: rotate(3deg); } 92% { transform: rotate(-2deg); } }

/* ---------- 提问 ---------- */
.ask { margin: auto 0; padding: 0 0 12vh; text-align: center; }
.ask h1 { font-size: 28px; }
.choices { display: flex; gap: 14px; justify-content: center; align-items: center; margin-top: 34px; min-height: 60px; }
.btn-yes#yes { transform-origin: center; }
.no-slot { display: inline-block; }
.btn-no.loose { position: fixed; z-index: 30; transition: left .32s cubic-bezier(.3, 1.3, .5, 1), top .32s cubic-bezier(.3, 1.3, .5, 1), transform .3s; }
.btn-no.leaving { transition: transform .9s cubic-bezier(.5, 0, .9, .4), opacity .9s; opacity: 0; }
.hint { min-height: 24px; margin-top: 26px; color: var(--muted); font-size: 15px; }
.hint.flash { animation: flash .4s; }
@keyframes flash { from { opacity: 0; transform: translateY(4px); } }

/* ---------- 顶栏 ---------- */
.bar { display: flex; align-items: center; gap: 10px; height: 44px; }
.back { width: 36px; height: 36px; margin-left: -8px; font-size: 30px; line-height: 1; color: var(--muted); border-radius: 50%; }
.progress { flex: 1; display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.progress li { flex: 1; height: 5px; border-radius: 3px; background: var(--line); transition: background .3s; }
.progress li.on { background: linear-gradient(90deg, var(--rose), var(--rose-2)); }

/* ---------- 选日期 / 时间 ---------- */
.days { display: flex; gap: 10px; overflow-x: auto; margin: 0 -20px; padding: 2px 20px 8px; scroll-snap-type: x proximity; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.day {
  flex: none; width: 64px; height: 76px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; scroll-snap-align: start;
}
.day b { font-size: 15px; }
.day small { font-size: 13px; color: var(--muted); }
.day.weekend b { color: var(--rose); }

.times { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.slot {
  height: 62px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.slot b { font-size: 15px; }
.slot small { font-size: 12px; color: var(--muted); }
.slot:disabled { opacity: .35; box-shadow: none; }

.day.on, .slot.on, .kind.on, .chip.on {
  background: linear-gradient(135deg, var(--rose), var(--rose-2)); color: #fff; box-shadow: 0 6px 18px rgba(255, 92, 124, .3);
}
.day.on small, .slot.on small, .kind.on small, .day.on.weekend b { color: rgba(255, 255, 255, .85); }

.custom-time { margin-top: 14px; }
.custom-time label { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--card); border-radius: 14px; padding: 10px 16px; box-shadow: var(--shadow); font-weight: 600; }
.custom-time input { border: 0; background: var(--rose-soft); border-radius: 10px; padding: 8px 12px; font-size: 17px; min-width: 120px; }

/* ---------- 做什么 ---------- */
.kinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kind {
  aspect-ratio: 1 / 1.02; border-radius: 18px; background: var(--card); box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px;
}
.kind .e { font-size: 34px; line-height: 1.2; }
.kind b { font-size: 15px; }
.kind small { font-size: 12px; color: var(--muted); }

/* ---------- 地点 ---------- */
.search { display: flex; gap: 8px; align-items: flex-start; }
.city {
  flex: none; width: 4.6em; height: 48px; border: 0; border-radius: 14px; text-align: center; font-weight: 700;
  background: var(--rose-soft); color: #c2475f; outline: none;
}
.search-box { position: relative; flex: 1; }
#q {
  width: 100%; height: 48px; border: 0; border-radius: 14px; padding: 0 14px; font-size: 16px;
  background: var(--card); box-shadow: var(--shadow); outline: none; -webkit-appearance: none; appearance: none;
}
#q:focus { box-shadow: 0 0 0 2px var(--rose), var(--shadow); }
.tips {
  position: absolute; z-index: 10; left: 0; right: 0; top: 54px; margin: 0; padding: 6px 0; list-style: none;
  background: var(--card); border-radius: 14px; box-shadow: 0 12px 36px rgba(120, 60, 70, .2);
  max-height: 52vh; overflow-y: auto;
}
.tips li { padding: 10px 14px; cursor: pointer; }
.tips li + li { border-top: 1px solid #f7eceb; }
.tips li b { display: block; font-size: 15px; font-weight: 600; }
.tips li small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tips li.free b { color: var(--rose); }
.tips li.state { color: var(--muted); font-size: 14px; cursor: default; }

.quick { display: flex; gap: 10px; margin: 12px 0 4px; }
.chip { height: 38px; padding: 0 14px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); font-size: 14px; font-weight: 600; }
.chip.busy { opacity: .6; pointer-events: none; }

.place {
  margin-top: 14px; border-radius: var(--radius); overflow: hidden; background: var(--card); box-shadow: var(--shadow);
  animation: screen-in .35s;
}
.place .map { display: block; width: 100%; aspect-ratio: 600 / 220; object-fit: cover; background: #f3ecea; }
.place .info { display: flex; gap: 12px; align-items: center; padding: 12px 16px 14px; }
.place .info div { flex: 1; min-width: 0; }
.place b { display: block; font-size: 17px; }
.place small { display: block; color: var(--muted); font-size: 13px; }
.place .ok { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--rose), var(--rose-2)); font-size: 16px; }
.place.you { padding: 18px 16px; display: flex; gap: 14px; align-items: center; }
.place.you .e { font-size: 38px; }

.recs { display: flex; gap: 12px; overflow-x: auto; margin: 0 -20px; padding: 2px 20px 10px; scroll-snap-type: x proximity; scrollbar-width: none; }
.recs::-webkit-scrollbar { display: none; }
.rec {
  flex: none; width: 148px; text-align: left; border-radius: 16px; overflow: hidden; background: var(--card); box-shadow: var(--shadow);
  scroll-snap-align: start; display: flex; flex-direction: column;
}
.rec .ph { width: 100%; height: 92px; object-fit: cover; background: linear-gradient(135deg, #ffe3e6, #ffeede); display: grid; place-items: center; font-size: 30px; }
.rec .t { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.rec b { font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rec small { font-size: 12px; color: var(--muted); }
.rec small .star { color: #f2a33a; font-weight: 700; }
.rec.on { box-shadow: 0 0 0 2.5px var(--rose), var(--shadow); }
.recs .state { color: var(--muted); font-size: 14px; padding: 8px 0; }

/* ---------- 密室 ---------- */
/* 四个筛选一行放下，屏幕再窄就横着滑 */
.moods { gap: 8px; margin: 6px -20px 0; padding: 2px 20px 6px; overflow-x: auto; scrollbar-width: none; }
.moods::-webkit-scrollbar { display: none; }
.moods .chip { flex: none; padding: 0 12px; }
.rooms { display: flex; flex-direction: column; gap: 16px; margin-top: 12px; }
.room { border-radius: var(--radius); overflow: hidden; background: var(--card); box-shadow: var(--shadow); transition: box-shadow .2s; }
.room.on { box-shadow: 0 0 0 2.5px var(--rose), var(--shadow); }
.room-top { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2)); }
.room-e { font-size: 34px; line-height: 1; }
.room-top div { flex: 1; min-width: 0; }
.room-top b { display: block; font-size: 19px; }
.room-top small { display: block; font-size: 13px; opacity: .9; }
.room-n { font-size: 26px; font-weight: 800; }
.room-body { padding: 12px 16px 16px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--rose-soft); color: #b5455c; font-weight: 600; }
.room-intro { margin: 10px 0 8px; font-size: 15px; line-height: 1.6; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 13px; color: var(--muted); }
.room blockquote { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: #fbf6f2; font-size: 14px; line-height: 1.55; }
.room cite { display: block; margin-top: 4px; font-style: normal; font-size: 12px; color: var(--muted); }
.room details { margin-top: 10px; font-size: 14px; }
.room summary { display: inline-block; padding: 4px 0; color: var(--rose); font-weight: 600; cursor: pointer; list-style: none; }
.room summary::-webkit-details-marker { display: none; }
.room summary::after { content: ' ▾'; }
.room details[open] summary::after { content: ' ▴'; }
.room h4 { margin: 10px 0 4px; font-size: 13px; color: var(--muted); }
.room details ul { margin: 0; padding-left: 18px; line-height: 1.6; }
.room-addr { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.room-pick { width: 100%; height: 44px; margin-top: 14px; font-size: 15px; background: var(--rose-soft); color: #c2475f; }
.room.on .room-pick { color: #fff; background: linear-gradient(135deg, var(--rose), var(--rose-2)); }
.rooms .state { color: var(--muted); font-size: 14px; }
.picked {
  display: table; margin: 0 auto 10px; padding: 5px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .95); box-shadow: var(--shadow); font-size: 13px; color: var(--muted);
}

/* ---------- 确认 ---------- */
.summary { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px 16px; text-align: left; }
.row { display: flex; gap: 12px; align-items: center; padding: 14px 0; }
.row + .row { border-top: 1px solid #f7eceb; }
.row .e { font-size: 24px; width: 30px; text-align: center; }
.row div { flex: 1; min-width: 0; }
.row small { display: block; font-size: 12px; color: var(--muted); }
.row b { display: block; font-size: 16px; }
.row .addr { font-weight: 400; font-size: 13px; color: var(--muted); }
.row .edit { flex: none; font-size: 14px; color: var(--rose); padding: 6px 2px 6px 10px; }

.note { display: block; margin-top: 18px; }
.note span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.note textarea {
  width: 100%; border: 0; border-radius: 14px; padding: 12px 14px; font-size: 16px; resize: none;
  background: var(--card); box-shadow: var(--shadow); outline: none;
}
.note textarea:focus { box-shadow: 0 0 0 2px var(--rose), var(--shadow); }

/* ---------- 完成 ---------- */
.done { margin: auto 0; padding: 20px 0 calc(28px + var(--safe-b)); text-align: center; }
.done .summary { margin-top: 22px; }
.done-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 20px 0 6px; }
.done-actions .btn { height: 46px; padding: 0 20px; font-size: 15px; }
.done-actions .btn-no { color: var(--ink); }
.done .tip { font-size: 13px; color: var(--muted); margin: 6px 0 0; }

/* ---------- 底部按钮 ---------- */
.next-bar {
  position: sticky; bottom: 0; margin-top: auto; z-index: 5;
  padding: 22px 0 calc(16px + var(--safe-b));
  background: linear-gradient(to bottom, rgba(255, 244, 239, 0), var(--bg) 40%);
}

/* ---------- 弹窗 / 提示 ---------- */
.dialog {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px;
  background: rgba(58, 42, 46, .35); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: fade .2s;
}
.dialog-card { width: 100%; max-width: 320px; background: var(--card); border-radius: 24px; padding: 24px 20px 20px; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .2); animation: pop .35s cubic-bezier(.3, 1.5, .5, 1); }
.dialog-title { font-size: 19px; font-weight: 800; margin: 12px 0 20px; }
.dialog-actions { display: flex; flex-direction: column; gap: 10px; }
.dialog-actions .btn { width: 100%; }
.dialog-actions .btn-no { font-variant-numeric: tabular-nums; }
@keyframes fade { from { opacity: 0; } }

.toast {
  position: fixed; left: 50%; bottom: calc(110px + var(--safe-b)); z-index: 60; transform: translateX(-50%);
  max-width: calc(100vw - 48px); padding: 10px 18px; border-radius: 999px;
  background: rgba(58, 42, 46, .9); color: #fff; font-size: 14px; text-align: center;
  animation: fade .2s;
}

/* ---------- 背景小心心 / 撒花 ---------- */
.bg-hearts { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.bg-hearts span { position: absolute; bottom: -40px; opacity: .16; animation: rise linear infinite; }
@keyframes rise { to { transform: translateY(-115vh) rotate(25deg); } }
.confetti { position: fixed; z-index: 70; pointer-events: none; font-size: 22px; left: 0; top: 0; will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (min-width: 600px) {
  .app { padding-top: 40px; }
}
