/* ===========================================================
   今天也很喜欢你 · 样式
   =========================================================== */

:root {
  --ink: #4a3b44;
  --ink-soft: #7d6b74;
  --ink-faint: #a5969e;
  --rose: #ff8fa3;
  --rose-deep: #ef6685;
  --cream: #fffaf6;
  --lav: #b9a7ef;

  --card: rgba(255, 255, 255, .74);
  --card-line: rgba(255, 255, 255, .92);
  --shadow-soft: 0 14px 30px -18px rgba(180, 120, 140, .55);
  --shadow-deep: 0 22px 46px -22px rgba(190, 110, 135, .55);

  --serif: "Songti SC", "Noto Serif SC", "STSong", "Source Han Serif SC", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background:
    radial-gradient(1100px 620px at 8% -8%, #ffe6ec 0%, rgba(255, 230, 236, 0) 62%),
    radial-gradient(900px 540px at 102% 4%, #ece5ff 0%, rgba(236, 229, 255, 0) 58%),
    linear-gradient(168deg, #fffaf6 0%, #fff1f1 46%, #f7f1ff 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* ---------- 背景装饰 ---------- */
.sky {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(46px);
  opacity: .55;
}
.b1 { width: 300px; height: 300px; background: #ffd3dd; top: -90px; left: -80px; }
.b2 { width: 260px; height: 260px; background: #ded2ff; top: 24%; right: -120px; opacity: .45; }
.b3 { width: 320px; height: 320px; background: #ffe3cc; bottom: -140px; left: 12%; opacity: .4; }

.bg-hearts { position: absolute; inset: 0; }

.bh {
  position: absolute;
  bottom: -40px;
  color: #ff9db4;
  line-height: 1;
  animation-name: drift;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform;
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) rotate(-8deg); }
  to   { transform: translate3d(26px, -116vh, 0) rotate(14deg); }
}

/* ---------- 进度点 ---------- */
.dots {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 18px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 5;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 20px -14px rgba(180, 120, 140, .7);
}
.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(190, 150, 165, .32);
  transition: background .35s ease, width .35s ease;
}
.dot.on { background: var(--rose); width: 18px; border-radius: 999px; }

/* ---------- 布局 ---------- */
.app {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 52px) 22px
           calc(env(safe-area-inset-bottom) + 40px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.step { display: none; }
.step.is-active {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: rise .58s cubic-bezier(.22, .8, .28, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 文字 ---------- */
.eyebrow {
  margin: 0;
  font-size: 12.5px;
  letter-spacing: .16em;
  color: var(--ink-faint);
  font-weight: 500;
}
.step[data-step="intro"] { text-align: center; align-items: center; }
.step[data-step="intro"] .primary { margin-top: 26px; }

.hero-title {
  font-family: var(--serif);
  font-size: clamp(30px, 8.6vw, 38px);
  line-height: 1.42;
  letter-spacing: .02em;
  font-weight: 600;
  margin: 2px 0 0;
}

.q {
  font-family: var(--serif);
  font-size: clamp(24px, 6.6vw, 29px);
  line-height: 1.5;
  font-weight: 600;
  letter-spacing: .01em;
  margin: 0;
}

.sub {
  margin: 0;
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-soft);
}

.step-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
  min-height: 28px;
}
.back {
  width: 30px; height: 30px;
  margin-left: -6px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-faint);
  font-size: 24px;
  line-height: 1;
  padding: 0 0 4px;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.back:active { background: rgba(255, 255, 255, .7); color: var(--ink); }

.comfort {
  margin: 0;
  font-size: 14.5px;
  color: var(--rose-deep);
  background: rgba(255, 255, 255, .6);
  border-radius: 14px;
  padding: 10px 14px;
  align-self: flex-start;
}

/* ---------- 按钮 ---------- */
.primary {
  width: 100%;
  margin-top: 6px;
  padding: 17px 20px;
  border: 0;
  border-radius: 20px;
  font-family: inherit;
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: .06em;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #ffa9b8 0%, #ff8fa3 48%, #f4738f 100%);
  box-shadow: 0 16px 30px -14px rgba(244, 115, 143, .85), inset 0 1px 0 rgba(255, 255, 255, .45);
  transition: transform .16s ease, box-shadow .22s ease, opacity .2s;
}
.primary:active { transform: scale(.982); box-shadow: 0 10px 20px -14px rgba(244, 115, 143, .8); }
.primary[disabled] { opacity: .55; cursor: default; transform: none; }

.ghost {
  padding: 11px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 143, 163, .35);
  background: rgba(255, 255, 255, .8);
  color: var(--rose-deep);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}

.skip {
  margin: 2px 0 0;
  align-self: center;
  border: 0;
  background: transparent;
  color: var(--ink-faint);
  font-family: inherit;
  font-size: 13px;
  text-decoration: underline;
  text-decoration-color: rgba(165, 150, 158, .4);
  text-underline-offset: 4px;
  cursor: pointer;
  padding: 8px;
}

/* ---------- 心情选项 ---------- */
.options { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }

.option {
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
  padding: 16px 18px;
  text-align: left;
  border-radius: 22px;
  border: 1px solid var(--card-line);
  background: var(--card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-soft);
  font-family: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: transform .18s cubic-bezier(.2, .8, .3, 1), box-shadow .22s, background .22s;
}
.option:active {
  transform: scale(.975);
  background: #fff;
  box-shadow: 0 8px 18px -14px rgba(190, 110, 135, .8);
}

.emo {
  flex: 0 0 auto;
  width: 46px; height: 46px;
  display: grid;
  place-items: center;
  font-size: 23px;
  border-radius: 15px;
  background: linear-gradient(150deg, #fff3f4, #ffe6ee);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .9);
}
.opt-text { display: flex; flex-direction: column; gap: 3px; }
.opt-text b { font-size: 16.5px; font-weight: 600; letter-spacing: .02em; }
.opt-text small { font-size: 12.5px; color: var(--ink-faint); }

/* ---------- 引用卡 ---------- */
.quote-card {
  position: relative;
  padding: 34px 26px 30px;
  border-radius: 26px;
  background: var(--card);
  border: 1px solid var(--card-line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-deep);
  text-align: center;
  margin: 6px 0 2px;
}
.quote-mark {
  position: absolute;
  top: 6px; left: 18px;
  font-family: var(--serif);
  font-size: 54px;
  line-height: 1;
  color: rgba(255, 143, 163, .28);
}
.quote {
  margin: 0;
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: .06em;
  font-weight: 600;
}
.quote-sub {
  margin: 14px 0 0;
  font-size: 14.5px;
  line-height: 1.9;
  color: var(--ink-soft);
}

/* ---------- 输入框 ---------- */
textarea {
  width: 100%;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, .9);
  background: rgba(255, 255, 255, .78);
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.75;
  resize: none;
  min-height: 132px;
  outline: none;
  box-shadow: inset 0 1px 2px rgba(190, 150, 165, .12);
  transition: box-shadow .22s, border-color .22s, background .22s;
}
textarea::placeholder { color: #c0b2ba; }
textarea:focus {
  border-color: rgba(255, 143, 163, .55);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 143, 163, .14);
}

/* ---------- 天气 ---------- */
.weather-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 4px;
}
.weather {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 6px 14px;
  border-radius: 18px;
  border: 1px solid var(--card-line);
  background: var(--card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-soft);
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink);
  cursor: pointer;
  transition: transform .18s cubic-bezier(.2, .8, .3, 1), background .2s, box-shadow .2s;
}
.weather span { font-size: 25px; line-height: 1; }
.weather:active {
  transform: scale(.95);
  background: #fff;
  box-shadow: 0 6px 14px -10px rgba(190, 110, 135, .75);
}

/* ---------- 建议卡 ---------- */
.advice-card {
  padding: 24px 22px 22px;
  border-radius: 26px;
  background: var(--card);
  border: 1px solid var(--card-line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-deep);
  margin-top: 4px;
}
.advice-top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px dashed rgba(190, 160, 175, .32);
}
.advice-emoji {
  flex: 0 0 auto;
  width: 54px; height: 54px;
  display: grid;
  place-items: center;
  font-size: 27px;
  border-radius: 18px;
  background: linear-gradient(150deg, #fff5f2, #ffe9f0);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .9);
}
.advice-label {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .04em;
}
.advice-line { margin-top: 4px; font-size: 13.5px; color: var(--ink-soft); line-height: 1.6; }

.advice-block { margin-top: 18px; }
.advice-block h3 {
  margin: 0 0 8px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .16em;
  color: var(--rose-deep);
}
.advice-block p, .advice-block li {
  margin: 0;
  font-size: 14.8px;
  line-height: 1.85;
  color: #5c4b53;
}
.advice-block ul { margin: 0; padding-left: 18px; }
.advice-block li + li { margin-top: 6px; }
.advice-block li::marker { color: var(--rose); }

/* ---------- 照片 ---------- */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 34px 20px;
  margin-top: 4px;
  border-radius: 24px;
  border: 1.6px dashed rgba(255, 143, 163, .55);
  background: rgba(255, 255, 255, .6);
  cursor: pointer;
  transition: background .22s, transform .18s, border-color .22s;
}
.dropzone:active { background: rgba(255, 255, 255, .9); transform: scale(.99); }
.dz-icon {
  width: 46px; height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(150deg, #fff2f5, #ffe2ea);
  color: var(--rose-deep);
  font-size: 22px;
  font-weight: 300;
  margin-bottom: 4px;
}
.dz-text { font-size: 15px; font-weight: 600; letter-spacing: .02em; }
.dz-hint { font-size: 12.5px; color: var(--ink-faint); }

.preview-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: rise .45s cubic-bezier(.22, .8, .28, 1) both;
}
.preview-wrap img,
.preview-wrap video {
  width: 100%;
  max-height: 46dvh;
  object-fit: cover;
  border-radius: 22px;
  box-shadow: var(--shadow-deep);
  border: 5px solid rgba(255, 255, 255, .9);
  background: #f3ecef;
}

.status {
  margin: 0;
  min-height: 20px;
  font-size: 13.5px;
  line-height: 1.6;
  text-align: center;
  color: var(--ink-soft);
}
.status.err { color: #d9566f; }

/* ---------- 结尾 ---------- */
.step.final {
  min-height: calc(100dvh - 120px);
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.final-hearts { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.fh {
  position: absolute;
  bottom: -50px;
  color: #ff9db4;
  line-height: 1;
  animation-name: drift;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform;
}

.final-inner {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.hero-heart {
  width: min(46vw, 176px);
  height: auto;
  filter: drop-shadow(0 24px 38px rgba(239, 102, 133, .38));
  animation: beat 2.6s cubic-bezier(.4, 0, .2, 1) .2s infinite;
  cursor: pointer;
  margin-bottom: 10px;
}
@keyframes beat {
  0%, 100% { transform: scale(1); }
  12%      { transform: scale(1.075); }
  24%      { transform: scale(1); }
  36%      { transform: scale(1.05); }
  58%      { transform: scale(1); }
}

.final-title {
  font-family: var(--serif);
  font-size: clamp(27px, 7.6vw, 34px);
  font-weight: 600;
  letter-spacing: .1em;
  line-height: 1.6;
  margin: 0;
  padding-left: .1em;
  opacity: 0;
  animation: titleIn 1.25s cubic-bezier(.2, .8, .25, 1) .55s forwards;
  background: linear-gradient(120deg, #4a3b44 20%, #d15876 55%, #4a3b44 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
@keyframes titleIn {
  from { opacity: 0; transform: translateY(12px); letter-spacing: .28em; }
  to   { opacity: 1; transform: none; letter-spacing: .1em; }
}

.final-date {
  margin: 10px 0 0;
  font-size: 12.5px;
  letter-spacing: .12em;
  color: var(--ink-faint);
  opacity: 0;
  animation: rise .9s ease 1.5s forwards;
}
.burst-heart {
  position: fixed;
  z-index: 9;
  pointer-events: none;
  font-size: 18px;
  color: #ff8fa3;
  line-height: 1;
  transform: translate(-50%, -50%);
}

/* ---------- 预览模式提示 ---------- */
.demo-banner {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 10px);
  transform: translateX(-50%);
  z-index: 8;
  max-width: min(92vw, 460px);
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(74, 59, 68, .78);
  color: #fff;
  font-size: 11.5px;
  letter-spacing: .02em;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ===========================================================
   查看页（给他的内容，只给你看）
   =========================================================== */
.view-app {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 40px) 20px
           calc(env(safe-area-inset-bottom) + 48px);
  min-height: 100dvh;
}

.view-title {
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: .04em;
  margin: 0 0 6px;
}
.view-sub { margin: 0 0 26px; font-size: 14px; color: var(--ink-soft); line-height: 1.7; }

.gate {
  padding: 26px 22px;
  border-radius: 24px;
  background: var(--card);
  border: 1px solid var(--card-line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-deep);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.gate input {
  width: 100%;
  padding: 15px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .9);
  background: rgba(255, 255, 255, .85);
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  outline: none;
  transition: box-shadow .22s;
}
.gate input:focus { box-shadow: 0 0 0 4px rgba(255, 143, 163, .16); }

.entry {
  padding: 20px;
  border-radius: 24px;
  background: var(--card);
  border: 1px solid var(--card-line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-soft);
  margin-bottom: 14px;
  animation: rise .5s cubic-bezier(.22, .8, .28, 1) both;
}
.entry-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.entry-date {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .03em;
}
.entry-time { font-size: 12px; color: var(--ink-faint); }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 143, 163, .14);
  color: #c4516c;
  font-size: 12.5px;
}
.entry-note {
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.85;
  color: #5c4b53;
  white-space: pre-wrap;
  word-break: break-word;
}
.entry-weather {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(190, 160, 175, .3);
  font-size: 13.5px;
  color: var(--ink-soft);
}
.entry img,
.entry-video {
  display: block;
  width: 100%;
  margin-top: 14px;
  border-radius: 18px;
  border: 4px solid rgba(255, 255, 255, .9);
  box-shadow: var(--shadow-soft);
  background: #f3ecef;
}
.empty {
  padding: 34px 20px;
  text-align: center;
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink-soft);
}

/* ---------- 减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .final-title, .final-date { opacity: 1; }
}
