/* ============================================================
   我们的小空间
   奶油白 · 浅玫瑰粉 · 少量酒红
   ============================================================ */

:root {
  --cream: #fbf6ef;
  --cream-deep: #f4e9de;
  --paper: #fffaf4;
  --paper-soft: #f9f1e8;
  --rose: #cf9098;
  --rose-light: #efd6d8;
  --rose-pale: #f8e9e7;
  --wine: #6b2f39;
  --wine-deep: #4e2029;
  --ink: #40302c;
  --muted: #866e68;
  --gold: #b1875b;
  --line: rgba(107, 47, 57, 0.14);
  --line-strong: rgba(107, 47, 57, 0.25);
  --shadow: 0 24px 70px rgba(91, 48, 54, 0.12);
  --shadow-soft: 0 12px 34px rgba(91, 48, 54, 0.08);
  --radius-lg: 24px;
  --radius-md: 16px;
  --header-height: 72px;
  --serif: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "STSong", "SimSun", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--cream);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100svh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(1100px 760px at 12% -8%, rgba(228, 178, 180, 0.3), transparent 62%),
    radial-gradient(900px 680px at 104% 8%, rgba(244, 214, 203, 0.4), transparent 58%),
    linear-gradient(180deg, #fbf6ef 0%, #fbf6ef 46%, #faf4ed 100%);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

::selection {
  color: var(--wine-deep);
  background: var(--rose-light);
}

h1,
h2,
h3,
p,
figure {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-weight: 500;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
textarea,
select {
  color: inherit;
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--wine);
  outline-offset: 3px;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--cream);
  background: var(--wine-deep);
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* ---------- 背景装饰 ---------- */

.petal-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.petal {
  position: absolute;
  top: -8vh;
  left: var(--left, 10%);
  width: var(--size, 9px);
  height: calc(var(--size, 9px) * 1.4);
  border-radius: 64% 36% 58% 42%;
  opacity: 0;
  background:
    linear-gradient(145deg, rgba(255, 249, 243, 0.9), rgba(231, 172, 175, 0.7));
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.45);
  animation: petal-fall var(--duration, 18s) linear var(--delay, 0s) infinite;
}

@keyframes petal-fall {
  0% {
    opacity: 0;
    transform: translate3d(0, -8vh, 0) rotate(0deg);
  }
  10% {
    opacity: 0.55;
  }
  85% {
    opacity: 0.32;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift, 30px), 110vh, 0) rotate(440deg);
  }
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.22;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.075'/%3E%3C/svg%3E");
}

.auth-view,
.app {
  position: relative;
  z-index: 1;
}

/* ---------- 通用文字与按钮 ---------- */

.eyebrow {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  line-height: 1.5;
}

.kicker {
  margin: 0 0 10px;
  color: var(--wine);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  line-height: 1.6;
  opacity: 0.78;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.9rem;
  letter-spacing: 0.055em;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 0.22s ease,
    border-color 0.22s ease,
    color 0.22s ease,
    transform 0.22s ease,
    box-shadow 0.22s ease,
    opacity 0.22s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  color: #fff9f4;
  background: var(--wine);
  box-shadow: 0 10px 24px rgba(107, 47, 57, 0.18);
}

.btn--primary:hover {
  background: var(--wine-deep);
  box-shadow: 0 12px 28px rgba(78, 32, 41, 0.23);
}

.btn--quiet {
  color: var(--wine);
  background: rgba(255, 250, 244, 0.45);
  border-color: var(--line-strong);
}

.btn--quiet:hover {
  background: var(--rose-pale);
}

.btn--danger {
  color: #fff9f6;
  background: #8a3344;
}

.btn--danger:hover {
  background: #712735;
}

.btn--wide {
  width: 100%;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
  box-shadow: none;
}

.link-quiet {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0;
  color: var(--wine);
  background: none;
  border: 0;
  border-bottom: 1px solid rgba(107, 47, 57, 0.34);
  border-radius: 0;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  line-height: 1.4;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.link-quiet:hover {
  color: var(--wine-deep);
  border-bottom-color: var(--wine-deep);
}

.link-quiet--small {
  min-height: 36px;
  font-size: 0.74rem;
  border-bottom-color: transparent;
}

.link-quiet--small:hover {
  border-bottom-color: var(--wine);
}

.quiet-btn {
  min-height: 44px;
  padding: 0 8px;
  color: var(--muted);
  background: none;
  border: 0;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.quiet-btn:hover {
  color: var(--wine);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  color: var(--wine);
  background: rgba(255, 250, 244, 0.5);
  border: 1px solid var(--line);
  border-radius: 50%;
  line-height: 1;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.icon-btn:hover {
  background: var(--rose-pale);
  border-color: var(--line-strong);
}

.icon-btn.is-playing {
  color: var(--cream);
  background: var(--wine);
  border-color: var(--wine);
}

.icon-btn--close {
  width: 38px;
  height: 38px;
  border-color: transparent;
  font-family: var(--sans);
  font-size: 1.5rem;
  font-weight: 300;
}

.music-icon {
  display: block;
  font-family: Georgia, serif;
  font-size: 1.15rem;
  transform: translateY(-1px);
}

/* ---------- 表单 ---------- */

.field {
  margin-bottom: 18px;
}

.field label,
.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--wine-deep);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  color: var(--ink);
  background: rgba(255, 253, 249, 0.88);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 0.94rem;
  line-height: 1.6;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.field textarea {
  min-height: 132px;
  resize: vertical;
  line-height: 1.85;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  background: #fffdfa;
  border-color: var(--rose);
  box-shadow: 0 0 0 4px rgba(207, 144, 152, 0.13);
}

.field input::placeholder,
.field textarea::placeholder {
  color: #b6a29d;
}

.field-hint {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.65;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.check-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 18px;
  color: var(--ink);
  font-size: 0.86rem;
  cursor: pointer;
}

.check-field input {
  width: 18px;
  height: 18px;
  margin: 4px 0 0;
  accent-color: var(--wine);
  flex: none;
}

.form-error {
  margin: 14px 0;
  padding: 10px 12px;
  color: #822c3a;
  background: #fbeaec;
  border: 1px solid rgba(130, 44, 58, 0.16);
  border-radius: 10px;
  font-size: 0.82rem;
  line-height: 1.65;
}

.form-error__text {
  display: block;
}

.form-error .link-quiet {
  margin-top: 8px;
  color: #822c3a;
  border-bottom-color: rgba(130, 44, 58, 0.4);
}

.image-field {
  margin: 4px 0 20px;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: rgba(248, 233, 231, 0.24);
}

.image-preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 210px;
  margin-bottom: 12px;
  overflow: hidden;
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 40%, rgba(239, 214, 216, 0.8), transparent 65%),
    var(--paper-soft);
  display: grid;
  place-items: center;
}

.image-preview img {
  width: 100%;
  height: 100%;
  max-height: 210px;
  object-fit: cover;
}

.image-preview__empty {
  padding: 18px;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.image-field input[type="file"] {
  width: 100%;
  min-height: 44px;
  padding: 8px 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 0.8rem;
}

.image-field input[type="file"]::file-selector-button {
  min-height: 38px;
  margin-right: 10px;
  padding: 7px 14px;
  color: var(--wine);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
}

/* ---------- 登录前 ---------- */

.auth-view {
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: clamp(26px, 6vw, 64px) 20px;
}

.auth-shell {
  width: min(580px, 100%);
  text-align: center;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: clamp(32px, 7vh, 56px);
  color: var(--wine);
  font-family: var(--serif);
  font-size: 0.96rem;
  letter-spacing: 0.16em;
}

.brand-mark {
  display: inline-block;
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: var(--wine);
  box-shadow: 0 0 0 4px rgba(107, 47, 57, 0.08);
}

.auth-title {
  margin: 0 0 clamp(30px, 5vh, 44px);
  color: var(--wine-deep);
  font-family: var(--serif);
  font-size: clamp(2.35rem, 8vw, 3.75rem);
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.36;
}

.auth-title span {
  color: var(--wine);
}

.auth-title--small {
  margin-bottom: 14px;
  font-size: clamp(2rem, 6vw, 2.7rem);
  text-align: left;
}

.envelope-stage {
  transition: opacity 0.42s ease, transform 0.42s ease;
}

.envelope-stage.is-leaving {
  opacity: 0;
  transform: translateY(-14px) scale(0.985);
}

.envelope {
  position: relative;
  display: block;
  width: min(356px, calc(100vw - 72px));
  aspect-ratio: 1.55 / 1;
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  filter: drop-shadow(0 26px 32px rgba(91, 48, 54, 0.14));
  transition: transform 0.55s cubic-bezier(0.22, 0.8, 0.28, 1);
}

.envelope:hover {
  transform: translateY(-5px) rotate(-0.5deg);
}

.envelope__back,
.envelope__front,
.envelope__flap,
.envelope__letter {
  position: absolute;
  display: block;
}

.envelope__back {
  inset: 0;
  border-radius: 5px;
  background:
    linear-gradient(145deg, #f6e5dc 0%, #eed6cd 58%, #e7c8c2 100%);
  box-shadow:
    inset 0 0 0 1px rgba(107, 47, 57, 0.12),
    inset 0 -12px 28px rgba(107, 47, 57, 0.05);
}

.envelope__letter {
  top: 11%;
  right: 6.5%;
  bottom: 9%;
  left: 6.5%;
  z-index: 1;
  overflow: hidden;
  padding: 20px 22px;
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.99), rgba(252, 244, 235, 0.99));
  box-shadow: 0 2px 10px rgba(91, 48, 54, 0.08);
  transition: transform 0.6s cubic-bezier(0.22, 0.8, 0.28, 1);
}

.envelope:hover .envelope__letter {
  transform: translateY(-8px);
}

.envelope__line {
  display: block;
  width: 72%;
  height: 1px;
  margin-bottom: 11px;
  background: rgba(107, 47, 57, 0.14);
}

.envelope__line--short {
  width: 44%;
}

.envelope__sign {
  position: absolute;
  right: 20px;
  bottom: 14px;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 0.65rem;
  letter-spacing: 0.22em;
}

.envelope__front {
  inset: 0;
  z-index: 3;
  overflow: hidden;
  border-radius: 5px;
  background:
    linear-gradient(160deg, #f7e7df 0%, #efd5cc 54%, #e7c9c2 100%);
  clip-path: polygon(0 0, 50% 55%, 100% 0, 100% 100%, 0 100%);
  box-shadow: inset 0 0 0 1px rgba(107, 47, 57, 0.09);
}

/* 两条很淡的折线，让正面看起来像真正折过的信封。 */
.envelope__front::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(31deg, transparent 49.55%, rgba(107, 47, 57, 0.09) 49.8%, rgba(107, 47, 57, 0.09) 50.05%, transparent 50.3%),
    linear-gradient(-31deg, transparent 49.55%, rgba(107, 47, 57, 0.09) 49.8%, rgba(107, 47, 57, 0.09) 50.05%, transparent 50.3%);
}

.envelope__flap {
  top: 0;
  right: 0;
  left: 0;
  z-index: 4;
  height: 62%;
  border-radius: 5px 5px 0 0;
  background:
    linear-gradient(180deg, #faece5 0%, #f1d8ce 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: 50% 0;
  filter: drop-shadow(0 4px 5px rgba(91, 48, 54, 0.1));
  box-shadow: inset 0 0 0 1px rgba(107, 47, 57, 0.06);
  transition: transform 0.7s cubic-bezier(0.3, 0.8, 0.3, 1), z-index 0s linear 0.35s;
}

.envelope:hover .envelope__flap {
  transform: rotateX(9deg);
}

.wax-seal {
  position: absolute;
  top: 43%;
  left: 50%;
  z-index: 5;
  display: grid;
  place-items: center;
  width: clamp(44px, 12vw, 58px);
  height: clamp(44px, 12vw, 58px);
  transform: translate(-50%, -50%);
  color: #f7e4dd;
  background:
    radial-gradient(circle at 36% 28%, #8e4652 0%, #6f2f3a 48%, #56222b 100%);
  border: 1px solid rgba(255, 234, 225, 0.24);
  border-radius: 50%;
  box-shadow:
    0 8px 16px rgba(76, 30, 38, 0.25),
    inset 0 0 0 4px rgba(255, 239, 230, 0.08);
  font-family: var(--serif);
  font-size: clamp(1rem, 3vw, 1.24rem);
  letter-spacing: 0.04em;
  transition: opacity 0.35s ease, transform 0.45s ease;
}

.envelope:hover .wax-seal {
  transform: translate(-50%, -50%) scale(1.04);
}

.open-hint {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-top: 24px;
  padding: 4px 2px;
  color: var(--wine);
  background: none;
  border: 0;
  border-bottom: 1px solid rgba(107, 47, 57, 0.32);
  font-size: 0.86rem;
  letter-spacing: 0.12em;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.open-hint:hover {
  color: var(--wine-deep);
  border-bottom-color: var(--wine-deep);
}

.auth-foot {
  margin: 32px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
}

.auth-panel {
  width: min(430px, 100%);
  margin: 0 auto;
  padding: clamp(26px, 5vw, 40px);
  text-align: left;
  background: rgba(255, 250, 244, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  animation: auth-in 0.5s cubic-bezier(0.22, 0.8, 0.28, 1) both;
}

@keyframes auth-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-intro {
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.8;
}

.auth-form {
  margin-top: 6px;
}

.auth-form .btn {
  margin-top: 4px;
}

.auth-note {
  margin: 20px 0 16px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.75;
}

.auth-privacy {
  margin: 32px 0 0;
  color: #a18a84;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

/* ---------- 顶部导航 ---------- */

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(107, 47, 57, 0.1);
  background: rgba(251, 246, 239, 0.83);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 30px);
  width: min(1180px, 100%);
  min-height: var(--header-height);
  margin: 0 auto;
  padding: 0 clamp(18px, 3vw, 30px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  color: var(--wine-deep);
  font-family: var(--serif);
  font-size: 0.98rem;
  letter-spacing: 0.13em;
  line-height: 1.3;
  text-decoration: none;
}

.brand-text {
  white-space: nowrap;
}

.site-nav {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: clamp(13px, 2.2vw, 24px);
  min-width: 0;
}

.site-nav a {
  position: relative;
  padding: 8px 0;
  color: var(--muted);
  font-size: 0.79rem;
  letter-spacing: 0.07em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.site-nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 0;
  height: 1px;
  background: var(--wine);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.25s ease;
}

.site-nav a:hover {
  color: var(--wine);
}

.site-nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.avatar-stack {
  display: flex;
  align-items: center;
  padding-left: 8px;
}

.avatar-stack .avatar {
  width: 29px;
  height: 29px;
  margin-left: -8px;
  border: 2px solid var(--cream);
}

/* ---------- 头像 ---------- */

.avatar {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: none;
  width: 44px;
  height: 44px;
  color: var(--wine);
  background:
    radial-gradient(circle at 34% 25%, rgba(255, 255, 255, 0.8), transparent 45%),
    linear-gradient(145deg, var(--rose-light), #e6c4c2);
  border: 1px solid rgba(107, 47, 57, 0.16);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 1rem;
  letter-spacing: 0;
  line-height: 1;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar--sm {
  width: 32px;
  height: 32px;
  font-size: 0.8rem;
}

.avatar--lg {
  width: 66px;
  height: 66px;
  font-size: 1.35rem;
}

.avatar--hero {
  width: 42px;
  height: 42px;
  font-size: 0.96rem;
  box-shadow: 0 0 0 4px rgba(255, 250, 244, 0.65);
}

/* ---------- 加载 / 状态 ---------- */

.app-loading {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  min-height: calc(100svh - var(--header-height));
  padding: 40px;
  color: var(--muted);
  font-size: 0.84rem;
  letter-spacing: 0.06em;
}

.loading-seal {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(107, 47, 57, 0.14);
  border-top-color: var(--wine);
  border-radius: 50%;
  animation: spin 1.4s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.app-status {
  width: min(680px, calc(100% - 40px));
  margin: clamp(60px, 12vh, 130px) auto;
  padding: clamp(28px, 5vw, 48px);
  text-align: center;
  background: rgba(255, 250, 244, 0.7);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.app-status h1 {
  margin-bottom: 16px;
  color: var(--wine-deep);
  font-family: var(--serif);
  font-size: clamp(1.65rem, 4vw, 2.25rem);
  line-height: 1.5;
}

.status-text {
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.status-text code {
  padding: 2px 6px;
  color: var(--wine);
  background: var(--rose-pale);
  border-radius: 4px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.82em;
}

.status-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

/* ---------- 首屏 ---------- */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: calc(100svh - var(--header-height));
  padding: clamp(70px, 9vw, 120px) clamp(20px, 4vw, 48px) clamp(66px, 9vw, 100px);
  overflow: hidden;
  scroll-margin-top: var(--header-height);
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: min(960px, 100%);
  margin: 0 auto;
  text-align: center;
}

.hero-orbit {
  position: absolute;
  z-index: 0;
  border: 1px solid rgba(107, 47, 57, 0.08);
  border-radius: 50%;
  pointer-events: none;
}

.hero-orbit--one {
  top: 6%;
  right: -12vmin;
  width: min(72vmin, 640px);
  height: min(72vmin, 640px);
}

.hero-orbit--two {
  bottom: -28vmin;
  left: -18vmin;
  width: min(52vmin, 460px);
  height: min(52vmin, 460px);
  border-color: rgba(207, 144, 152, 0.15);
}

.hero-people {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 26px 0 30px;
}

.hero-person {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.hero-person__name {
  max-width: 180px;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.87rem;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-and {
  color: var(--gold);
  font-family: var(--serif);
  font-size: 1rem;
  letter-spacing: 0.1em;
}

.hero-quote {
  max-width: 900px;
  margin: 0 auto;
  color: var(--wine-deep);
  font-family: var(--serif);
  font-size: clamp(2.05rem, 5.6vw, 4.25rem);
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.43;
  overflow-wrap: anywhere;
  text-wrap: balance;
  animation: hero-rise 0.9s cubic-bezier(0.22, 0.8, 0.28, 1) both;
}

.hero-quote span {
  display: block;
}

.hero-quote span + span {
  color: var(--wine);
}

@keyframes hero-rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px 18px;
  margin-top: clamp(30px, 4vw, 40px);
}

.day-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  min-height: 38px;
  padding: 7px 16px;
  color: var(--wine);
  background: rgba(255, 250, 244, 0.58);
  border: 1px solid rgba(107, 47, 57, 0.18);
  border-radius: 999px;
  font-size: 0.79rem;
  letter-spacing: 0.04em;
  line-height: 1.6;
}

.day-pill strong {
  color: var(--wine-deep);
  font-family: var(--serif);
  font-size: 1.16rem;
  font-weight: 500;
}

.hero-since {
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.05em;
}

.scroll-cue {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin-top: clamp(44px, 7vh, 64px);
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-decoration: none;
  transition: color 0.2s ease;
}

.scroll-cue:hover {
  color: var(--wine);
}

.scroll-cue__line {
  width: 1px;
  height: 42px;
  background: linear-gradient(180deg, rgba(107, 47, 57, 0.5), transparent);
  animation: scroll-breathe 2.4s ease-in-out infinite;
  transform-origin: top;
}

@keyframes scroll-breathe {
  0%,
  100% {
    opacity: 0.35;
    transform: scaleY(0.55);
  }
  50% {
    opacity: 0.9;
    transform: scaleY(1);
  }
}

/* ---------- 通用区块 ---------- */

.section {
  position: relative;
  padding: clamp(72px, 9vw, 116px) 0;
  scroll-margin-top: calc(var(--header-height) + 12px);
}

.section-inner {
  width: min(1080px, calc(100% - 48px));
  margin: 0 auto;
}

.section-head {
  margin-bottom: clamp(34px, 5vw, 48px);
}

.section-head--row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 26px;
}

.section-head h2 {
  margin: 0 0 12px;
  color: var(--wine-deep);
  font-family: var(--serif);
  font-size: clamp(1.85rem, 4vw, 2.85rem);
  font-weight: 500;
  letter-spacing: 0.045em;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.section-lead {
  max-width: 600px;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.9;
}

.section-head--row > .btn {
  flex: none;
  margin-bottom: 4px;
}

.section--counter {
  background: linear-gradient(180deg, rgba(248, 233, 231, 0.22), rgba(251, 246, 239, 0));
}

.section--memories {
  background:
    linear-gradient(180deg, rgba(248, 233, 231, 0.34), rgba(251, 246, 239, 0.2)),
    radial-gradient(900px 420px at 88% 20%, rgba(239, 214, 216, 0.3), transparent 65%);
}

.section--album {
  background:
    linear-gradient(180deg, rgba(244, 233, 222, 0.58), rgba(251, 246, 239, 0.15));
  border-top: 1px solid rgba(107, 47, 57, 0.07);
  border-bottom: 1px solid rgba(107, 47, 57, 0.07);
}

.section--letter {
  background:
    radial-gradient(820px 480px at 50% 30%, rgba(239, 214, 216, 0.38), transparent 68%);
}

.section--surprise {
  background: linear-gradient(180deg, rgba(248, 233, 231, 0.4), rgba(251, 246, 239, 0.08));
}

.section--settings {
  background: rgba(244, 233, 222, 0.28);
  border-top: 1px solid rgba(107, 47, 57, 0.06);
}

/* ---------- 计时 ---------- */

.time-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 38px 0 18px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.time-unit {
  min-width: 0;
  padding: clamp(22px, 4vw, 34px) 8px;
  text-align: center;
}

.time-unit + .time-unit {
  border-left: 1px solid var(--line);
}

.time-value {
  display: block;
  color: var(--wine-deep);
  font-family: var(--serif);
  font-size: clamp(1.6rem, 6vw, 3.4rem);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  letter-spacing: 0.015em;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.time-label {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
}

.counter-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.8;
  text-align: center;
}

/* ---------- 空状态 ---------- */

.empty-state {
  padding: clamp(34px, 5vw, 56px) 24px;
  text-align: center;
  background: rgba(255, 250, 244, 0.52);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
}

.empty-state h3 {
  margin-bottom: 10px;
  color: var(--wine);
  font-family: var(--serif);
  font-size: clamp(1.2rem, 3vw, 1.45rem);
  line-height: 1.55;
}

.empty-state p {
  max-width: 480px;
  margin: 0 auto 20px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.85;
}

.empty-state--wide {
  grid-column: 1 / -1;
}

/* ---------- 日记 ---------- */

.diary-list {
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 860px;
  margin: 0 auto;
}

.diary-entry {
  padding: clamp(22px, 3.4vw, 34px);
  background: rgba(255, 250, 244, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.entry-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.entry-date {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
}

.entry-title {
  margin: 0;
  color: var(--wine-deep);
  font-family: var(--serif);
  font-size: clamp(1.28rem, 3.2vw, 1.65rem);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.entry-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
  margin: -4px -4px 0 0;
}

.mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 10px;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 8px;
  font-size: 0.73rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.mini-btn:hover {
  color: var(--wine);
  background: var(--rose-pale);
}

.mini-btn--danger:hover {
  color: #8a3344;
  background: #f9e6e9;
}

.entry-body {
  margin: 18px 0 0;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 2.05;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.entry-photo {
  margin-top: 20px;
}

.photo-button {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  background: var(--paper-soft);
  border: 0;
  border-radius: 14px;
  cursor: zoom-in;
}

.photo-button img {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.photo-button:hover img {
  transform: scale(1.018);
}

.entry-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 18px;
  margin-top: 20px;
  padding-top: 14px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.71rem;
  line-height: 1.7;
}

.entry-foot span {
  overflow-wrap: anywhere;
}

/* ---------- 回忆时间线 ---------- */

.timeline {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding-left: 40px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 10px;
  width: 1px;
  background: linear-gradient(180deg, rgba(107, 47, 57, 0.1), rgba(107, 47, 57, 0.34), rgba(107, 47, 57, 0.1));
}

.memory {
  position: relative;
  margin-bottom: 30px;
}

.memory:last-child {
  margin-bottom: 0;
}

.memory::before {
  content: "";
  position: absolute;
  top: 8px;
  left: -35px;
  width: 11px;
  height: 11px;
  border: 2px solid var(--cream);
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 0 1px rgba(107, 47, 57, 0.3);
}

.memory-date {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.73rem;
  letter-spacing: 0.13em;
}

.memory-card {
  position: relative;
  padding: clamp(22px, 3.5vw, 32px);
  background: rgba(255, 250, 244, 0.68);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

.memory-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.memory-title {
  margin: 0;
  color: var(--wine-deep);
  font-family: var(--serif);
  font-size: clamp(1.25rem, 3vw, 1.55rem);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.memory-desc {
  margin: 14px 0 0;
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 2;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.memory-photo {
  margin-top: 20px;
}

.memory-photo img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
}

/* ---------- 相册 ---------- */

.album-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 2.2vw, 22px);
}

.photo-card {
  min-width: 0;
}

.photo-open {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--paper-soft);
  border: 0;
  border-radius: 16px;
  cursor: zoom-in;
}

.photo-open img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s cubic-bezier(0.22, 0.8, 0.28, 1);
}

.photo-open:hover img {
  transform: scale(1.028);
}

.photo-open::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 65%, rgba(54, 27, 32, 0.2));
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.photo-open:hover::after {
  opacity: 1;
}

.photo-caption {
  margin: 10px 0 2px;
  color: var(--ink);
  font-size: 0.8rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.photo-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 8px;
  min-height: 36px;
}

.photo-meta time {
  color: var(--muted);
  font-size: 0.69rem;
}

.photo-actions {
  display: flex;
  margin-right: -8px;
}

.photo-actions .mini-btn {
  min-height: 36px;
  padding: 0 7px;
  font-size: 0.7rem;
}

.album-empty {
  grid-column: 1 / -1;
  position: relative;
  min-height: 300px;
  overflow: hidden;
  padding: clamp(30px, 5vw, 48px) 24px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 30%, rgba(239, 214, 216, 0.62), transparent 62%),
    rgba(255, 250, 244, 0.55);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
}

.album-empty__frames {
  position: relative;
  width: 180px;
  height: 120px;
  margin: 0 auto 20px;
}

.album-empty__frame {
  position: absolute;
  top: 10px;
  left: 50%;
  width: 92px;
  height: 112px;
  border: 1px solid rgba(107, 47, 57, 0.22);
  border-radius: 6px;
  background: rgba(255, 251, 246, 0.6);
  box-shadow: 0 10px 20px rgba(91, 48, 54, 0.06);
}

.album-empty__frame:nth-child(1) {
  transform: translateX(-62%) rotate(-9deg);
}

.album-empty__frame:nth-child(2) {
  z-index: 2;
  transform: translateX(-50%) translateY(-7px) rotate(1deg);
}

.album-empty__frame:nth-child(3) {
  transform: translateX(-37%) rotate(9deg);
}

.album-empty__frame::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(107, 47, 57, 0.1);
  border-radius: 3px;
}

.album-empty h3 {
  margin-bottom: 10px;
  color: var(--wine);
  font-family: var(--serif);
  font-size: clamp(1.25rem, 3vw, 1.55rem);
}

.album-empty p {
  max-width: 420px;
  margin: 0 auto 20px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.85;
}

.img-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 110px;
  padding: 18px;
  color: var(--muted);
  background:
    linear-gradient(145deg, rgba(248, 233, 231, 0.8), rgba(244, 233, 222, 0.8));
  font-family: var(--serif);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-align: center;
}

/* ---------- 纪念日 ---------- */

.anniversary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.anniversary-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: clamp(22px, 3.4vw, 30px);
  background: rgba(255, 250, 244, 0.66);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

.anniversary-card.is-today {
  background:
    linear-gradient(145deg, rgba(248, 233, 231, 0.92), rgba(255, 250, 244, 0.75));
  border-color: rgba(107, 47, 57, 0.28);
}

.anniversary-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.anniversary-title {
  margin: 0;
  color: var(--wine-deep);
  font-family: var(--serif);
  font-size: clamp(1.18rem, 3vw, 1.4rem);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.anniversary-days {
  margin: 8px 0 2px;
  color: var(--wine);
  font-family: var(--serif);
  font-size: clamp(1.9rem, 4.2vw, 2.55rem);
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

.anniversary-unit {
  margin-left: 2px;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.anniversary-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.7;
}

.anniversary-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 9px;
  color: var(--wine);
  background: var(--rose-pale);
  border-radius: 999px;
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* ---------- 情书 ---------- */

.letter-paper {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding: clamp(30px, 6vw, 66px);
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 250, 244, 0.93), rgba(255, 250, 244, 0.93)),
    repeating-linear-gradient(
      180deg,
      transparent 0,
      transparent 35px,
      rgba(107, 47, 57, 0.07) 35px,
      rgba(107, 47, 57, 0.07) 36px
    );
  border: 1px solid var(--line);
  border-radius: 4px 26px 26px 26px;
  box-shadow: var(--shadow);
}

.letter-paper::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: clamp(20px, 5vw, 40px);
  width: 1px;
  background: rgba(177, 135, 91, 0.22);
  pointer-events: none;
}

.letter-mark {
  margin: 0 0 12px;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 0.75rem;
  letter-spacing: 0.3em;
}

.letter-idle {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0 auto;
  padding: clamp(18px, 4vw, 34px) 0;
  text-align: center;
}

.letter-idle h3 {
  margin-bottom: 12px;
  color: var(--wine-deep);
  font-family: var(--serif);
  font-size: clamp(1.45rem, 3.6vw, 1.95rem);
  line-height: 1.55;
}

.letter-idle > p:not(.letter-mark) {
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.9;
}

.letter-reading {
  position: relative;
  z-index: 1;
  max-width: 660px;
  margin: 0 auto;
}

.letter-text {
  min-height: 12em;
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1rem, 2.3vw, 1.1rem);
  letter-spacing: 0.02em;
  line-height: 2.15;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.letter-text.is-typing::after {
  content: "";
  display: inline-block;
  width: 1px;
  height: 1.05em;
  margin-left: 3px;
  vertical-align: -0.12em;
  background: var(--wine);
  animation: caret-blink 0.9s steps(2, start) infinite;
}

@keyframes caret-blink {
  50% {
    opacity: 0;
  }
}

.letter-controls {
  margin-top: 26px;
  text-align: center;
}

.letter-controls .btn {
  min-height: 42px;
  font-size: 0.8rem;
}

/* ---------- 小惊喜 / 抱抱 ---------- */

.surprise-wrap {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 20px;
}

.surprise-panel,
.hug-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(26px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.surprise-panel {
  background:
    radial-gradient(circle at 100% 0, rgba(239, 214, 216, 0.7), transparent 55%),
    rgba(255, 250, 244, 0.72);
}

.hug-panel {
  background:
    radial-gradient(circle at 0 100%, rgba(207, 144, 152, 0.23), transparent 58%),
    rgba(248, 233, 231, 0.6);
}

.surprise-panel h2,
.hug-panel h2 {
  margin: 0 0 14px;
  color: var(--wine-deep);
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  line-height: 1.45;
}

.love-note-text {
  display: flex;
  align-items: center;
  min-height: 4.6em;
  margin: 8px 0 22px;
  color: var(--wine);
  font-family: var(--serif);
  font-size: clamp(1.18rem, 2.6vw, 1.5rem);
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.hug-copy {
  min-height: 3.4em;
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.9;
}

.hug-scene {
  position: relative;
  height: 78px;
  margin: 6px 0 8px;
}

.hug-arm {
  position: absolute;
  top: 20px;
  width: 76px;
  height: 42px;
  border: 2px solid var(--rose);
  border-radius: 50%;
  opacity: 0;
  transition: transform 0.5s ease, opacity 0.5s ease;
}

.hug-arm--left {
  left: calc(50% - 80px);
  border-right-color: transparent;
  transform: rotate(18deg) translateX(-8px);
}

.hug-arm--right {
  right: calc(50% - 80px);
  border-left-color: transparent;
  transform: rotate(-18deg) translateX(8px);
}

.hug-heart {
  position: absolute;
  top: 20px;
  left: 50%;
  color: var(--wine);
  font-size: 1.15rem;
  opacity: 0;
  transform: translateX(-50%) scale(0.8);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.hug-scene.is-hugging .hug-arm {
  opacity: 1;
}

.hug-scene.is-hugging .hug-arm--left {
  transform: rotate(26deg) translateX(7px);
}

.hug-scene.is-hugging .hug-arm--right {
  transform: rotate(-26deg) translateX(-7px);
}

.hug-scene.is-hugging .hug-heart {
  opacity: 1;
  animation: hug-beat 1.4s ease-in-out infinite;
}

@keyframes hug-beat {
  0%,
  100% {
    transform: translateX(-50%) scale(0.9);
  }
  45% {
    transform: translateX(-50%) scale(1.12);
  }
}

/* ---------- 愿望 ---------- */

.wish-list {
  max-width: 820px;
  margin: 0 auto;
  border-top: 1px solid var(--line-strong);
}

.wish-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--line);
}

.wish-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  cursor: pointer;
}

.wish-toggle input {
  position: absolute;
  width: 22px;
  height: 22px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.wish-box {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  color: transparent;
  background: rgba(255, 250, 244, 0.62);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 0.74rem;
  line-height: 1;
  transition: background-color 0.22s ease, border-color 0.22s ease, color 0.22s ease;
}

.wish-toggle input:checked + .wish-box {
  color: var(--cream);
  background: var(--wine);
  border-color: var(--wine);
}

.wish-toggle input:focus-visible + .wish-box {
  outline: 2px solid var(--wine);
  outline-offset: 3px;
}

.wish-toggle input:disabled + .wish-box {
  opacity: 0.55;
}

.wish-main {
  flex: 1;
  min-width: 0;
}

.wish-title {
  margin: 0;
  color: var(--ink);
  font-size: 0.94rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
  transition: color 0.2s ease;
}

.wish-row.is-done .wish-title {
  color: #9a827c;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(107, 47, 57, 0.35);
}

.wish-meta {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.6;
}

.wish-actions {
  display: flex;
  flex: none;
  margin-right: -4px;
}

.wish-actions .mini-btn {
  min-height: 38px;
  padding: 0 7px;
  font-size: 0.7rem;
}

/* ---------- 设置 ---------- */

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.settings-card {
  min-width: 0;
  padding: clamp(22px, 3.4vw, 30px);
  background: rgba(255, 250, 244, 0.68);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-card__body {
  flex: 1;
  min-width: 0;
}

.profile-card__role {
  margin: 0 0 2px;
  color: var(--gold);
  font-size: 0.68rem;
  letter-spacing: 0.13em;
}

.profile-card__name {
  margin: 0;
  color: var(--wine-deep);
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2.8vw, 1.35rem);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.profile-card .btn {
  flex: none;
  min-height: 40px;
  padding: 8px 16px;
  font-size: 0.78rem;
}

.couple-settings {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr) auto;
  align-items: center;
  gap: 20px;
}

.couple-settings__quote {
  margin: 0;
  color: var(--wine-deep);
  font-family: var(--serif);
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  line-height: 1.8;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.couple-settings__meta {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.8;
}

.couple-settings__meta strong {
  display: block;
  margin-top: 3px;
  color: var(--wine);
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 500;
}

.settings-note {
  margin-top: 24px;
  padding-top: 18px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  line-height: 1.9;
}

.settings-note > p {
  max-width: 760px;
  margin-bottom: 10px;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  overflow-wrap: anywhere;
}

.settings-actions .link-quiet {
  min-height: 32px;
  font-size: 0.75rem;
}

.dot-sep {
  color: var(--line-strong);
}

#settingsAccount {
  overflow-wrap: anywhere;
}

/* ---------- 结尾 ---------- */

.ending {
  padding: clamp(84px, 12vw, 150px) 24px;
  text-align: center;
  background:
    radial-gradient(720px 380px at 50% 80%, rgba(239, 214, 216, 0.45), transparent 70%),
    linear-gradient(180deg, rgba(251, 246, 239, 0), rgba(244, 233, 222, 0.5));
  border-top: 1px solid rgba(107, 47, 57, 0.08);
}

.ending-inner {
  width: min(820px, 100%);
  margin: 0 auto;
}

.ending-quote {
  margin: 0 auto;
  color: var(--wine-deep);
  font-family: var(--serif);
  font-size: clamp(1.7rem, 4vw, 2.7rem);
  letter-spacing: 0.035em;
  line-height: 1.65;
  text-wrap: balance;
}

.ending-people {
  margin: 34px 0 6px;
  color: var(--ink);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
}

.ending-date {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
}

.ending-seal {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-top: 30px;
  color: #f6e4dd;
  background: radial-gradient(circle at 36% 28%, #8e4652, #6c2d37 55%, #54212a);
  border-radius: 50%;
  box-shadow: 0 10px 22px rgba(76, 30, 38, 0.2);
  font-family: var(--serif);
  font-size: 1rem;
  letter-spacing: 0.05em;
}

/* ---------- 弹窗 ---------- */

dialog {
  color: var(--ink);
}

dialog::backdrop {
  background: rgba(55, 30, 35, 0.42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.settings-device-status {
  margin: 10px 0 0;
  color: var(--muted, #846d73);
  font-size: 0.82rem;
}

.device-unlock-dialog {
  width: min(430px, calc(100% - 28px));
  border: 0;
  padding: 0;
  border-radius: 24px;
  color: var(--ink, #533c40);
  background: var(--paper, #fffdf9);
  box-shadow: 0 24px 80px rgba(74, 34, 43, 0.22);
}

.device-unlock-dialog::backdrop {
  background: rgba(58, 26, 36, 0.62);
  backdrop-filter: blur(5px);
}

.device-unlock-panel {
  padding: 30px 28px 24px;
  text-align: center;
}

.device-unlock-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  border-radius: 50%;
  color: #fff8f1;
  background: var(--wine, #9a3e58);
  font-size: 1.7rem;
}

.device-unlock-panel h2 {
  margin: 5px 0 10px;
  font-size: 1.35rem;
}

.device-unlock-panel #deviceUnlockMessage {
  margin: 0 auto 18px;
  color: var(--muted, #846d73);
  font-size: 0.9rem;
}

.device-unlock-panel .form-error {
  margin: 0 0 14px;
}

.device-unlock-panel .modal-actions {
  justify-content: center;
  flex-wrap: wrap;
}
.modal {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 20px;
  background: transparent;
  border: 0;
}

.modal[open] {
  display: grid;
  place-items: center;
}

.modal-panel {
  display: flex;
  flex-direction: column;
  width: min(680px, 100%);
  max-height: min(88svh, 860px);
  margin: 0;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid rgba(107, 47, 57, 0.12);
  border-radius: 22px;
  box-shadow: 0 32px 90px rgba(54, 27, 32, 0.28);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex: none;
  padding: 22px 26px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0;
  color: var(--wine-deep);
  font-family: var(--serif);
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.modal-head .kicker {
  margin-bottom: 5px;
}

.modal-body {
  min-height: 0;
  padding: 22px 26px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-body .field:last-child {
  margin-bottom: 0;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  flex: none;
  padding: 16px 26px 22px;
  border-top: 1px solid var(--line);
}

.modal-actions .btn {
  min-width: 96px;
}

#editorError {
  margin: 0 26px 14px;
  flex: none;
}

.confirm-dialog {
  width: min(440px, calc(100% - 32px));
  max-width: calc(100% - 32px);
  padding: 0;
  background: transparent;
  border: 0;
}

.confirm-dialog[open] {
  display: block;
}

.confirm-panel {
  padding: 28px;
  background: var(--paper);
  border: 1px solid rgba(107, 47, 57, 0.12);
  border-radius: 20px;
  box-shadow: 0 32px 90px rgba(54, 27, 32, 0.28);
}

.confirm-panel h2 {
  margin-bottom: 10px;
  color: var(--wine-deep);
  font-family: var(--serif);
  font-size: 1.55rem;
  line-height: 1.45;
}

.confirm-panel > p:not(.kicker) {
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.confirm-panel .modal-actions {
  padding: 0;
  border-top: 0;
}

/* ---------- 看照片 ---------- */

.lightbox {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  color: #fff8f2;
}

.lightbox[open] {
  display: grid;
}

.lightbox::backdrop {
  background: rgba(31, 19, 22, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lightbox-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 2vw, 18px);
  width: 100%;
  height: 100%;
  padding: 58px clamp(10px, 4vw, 82px) 46px;
}

.lightbox-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: min(1120px, 100%);
  max-height: 100%;
  min-width: 0;
  margin: 0;
}

.lightbox-image-wrap {
  display: grid;
  place-items: center;
  max-width: 100%;
  max-height: calc(100svh - 170px);
  min-width: 0;
}

.lightbox-image-wrap img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100svh - 170px);
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.4);
}

.lightbox-image-wrap .img-placeholder {
  width: min(420px, 80vw);
  min-height: 240px;
  color: rgba(255, 248, 242, 0.72);
  background: rgba(255, 255, 255, 0.07);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 8px;
}

.lightbox-caption {
  max-width: 680px;
  margin: 0;
  color: rgba(255, 248, 242, 0.88);
  font-size: 0.87rem;
  line-height: 1.8;
  text-align: center;
  overflow-wrap: anywhere;
}

.lightbox-arrow {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: none;
  padding: 0;
  color: rgba(255, 248, 242, 0.9);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 2rem;
  line-height: 1;
  transition: background-color 0.2s ease, opacity 0.2s ease;
}

.lightbox-arrow:hover {
  background: rgba(255, 255, 255, 0.14);
}

.lightbox-arrow:disabled {
  opacity: 0;
  pointer-events: none;
}

.lightbox-close {
  position: absolute;
  top: 14px;
  right: 18px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: rgba(255, 248, 242, 0.9);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  font-size: 1.6rem;
  line-height: 1;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

.lightbox-counter {
  position: absolute;
  bottom: 14px;
  left: 50%;
  margin: 0;
  transform: translateX(-50%);
  color: rgba(255, 248, 242, 0.65);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
}

/* ---------- 提示 ---------- */

.toast {
  position: fixed;
  bottom: max(22px, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 300;
  max-width: calc(100vw - 32px);
  padding: 11px 20px;
  transform: translateX(-50%);
  color: #fff8f2;
  background: var(--wine-deep);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  box-shadow: 0 14px 36px rgba(54, 27, 32, 0.28);
  font-size: 0.82rem;
  line-height: 1.6;
  text-align: center;
  animation: toast-in 0.28s ease both;
}

.toast--error {
  background: #7d2c3a;
}

.toast--info {
  background: #4d3a35;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.heart-layer {
  position: fixed;
  inset: 0;
  z-index: 250;
  overflow: hidden;
  pointer-events: none;
}

.floating-heart {
  position: fixed;
  color: var(--rose);
  font-size: 13px;
  line-height: 1;
  opacity: 0;
  animation: heart-float var(--life, 1.4s) ease-out forwards;
  will-change: transform, opacity;
}

@keyframes heart-float {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.6) rotate(0deg);
  }
  18% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% - 92px)) scale(1.05) rotate(var(--spin, 16deg));
  }
}

.noscript {
  position: fixed;
  right: 20px;
  bottom: 20px;
  left: 20px;
  z-index: 500;
  padding: 14px 18px;
  color: var(--cream);
  background: var(--wine-deep);
  border-radius: 12px;
  text-align: center;
  font-size: 0.85rem;
}

/* ---------- 轻缓浮现 ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.8s cubic-bezier(0.22, 0.8, 0.28, 1),
    transform 0.8s cubic-bezier(0.22, 0.8, 0.28, 1);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- 响应式 ---------- */

@media (max-width: 980px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 6px 16px;
    min-height: auto;
    padding-top: 10px;
    padding-bottom: 0;
  }

  .brand {
    min-height: 44px;
  }

  .site-nav {
    order: 3;
    flex-basis: 100%;
    justify-content: flex-start;
    gap: 22px;
    overflow-x: auto;
    padding: 0 0 9px;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .header-tools {
    margin-left: auto;
  }

  .hero {
    min-height: calc(100svh - 112px);
  }

  .section {
    scroll-margin-top: 126px;
  }

  .hero {
    scroll-margin-top: 126px;
  }

  .couple-settings {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .couple-settings__meta {
    grid-column: 1;
    grid-row: 2;
  }

  .couple-settings > .btn {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}

@media (max-width: 820px) {
  .surprise-wrap {
    grid-template-columns: 1fr;
  }

  .anniversary-grid {
    grid-template-columns: 1fr;
  }

  .album-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .couple-settings {
    grid-column: 1;
  }

  .lightbox-image-wrap,
  .lightbox-image-wrap img {
    max-height: calc(100svh - 190px);
  }
}

@media (max-width: 640px) {
  :root {
    --header-height: 64px;
  }

  body {
    font-size: 15px;
  }

  .auth-view {
    padding: 24px 16px 34px;
  }

  .auth-brand {
    margin-bottom: 30px;
  }

  .auth-title {
    margin-bottom: 26px;
    font-size: clamp(2rem, 10.5vw, 2.8rem);
  }

  .auth-title--small {
    font-size: clamp(1.75rem, 8.5vw, 2.2rem);
  }

  .auth-panel {
    padding: 24px 20px;
  }

  .envelope {
    width: min(320px, calc(100vw - 64px));
  }

  .header-inner {
    padding: 6px 16px 0;
  }

  .brand {
    font-size: 0.9rem;
    letter-spacing: 0.09em;
  }

  .site-nav {
    gap: 18px;
  }

  .site-nav a {
    font-size: 0.76rem;
  }

  .header-tools {
    gap: 4px;
  }

  .avatar-stack {
    display: none;
  }

  .quiet-btn {
    padding: 0 4px;
    font-size: 0.76rem;
  }

  .icon-btn {
    width: 40px;
    height: 40px;
  }

  .hero {
    min-height: calc(100svh - 104px);
    padding: 58px 18px 64px;
  }

  .hero-people {
    gap: 10px;
    margin: 22px 0 26px;
  }

  .hero-person {
    gap: 8px;
  }

  .hero-person__name {
    max-width: 120px;
    font-size: 0.82rem;
  }

  .avatar--hero {
    width: 36px;
    height: 36px;
  }

  .hero-quote {
    font-size: clamp(1.9rem, 8.4vw, 2.8rem);
    line-height: 1.47;
  }

  .hero-meta {
    gap: 10px 12px;
  }

  .hero-since {
    flex-basis: 100%;
  }

  .scroll-cue {
    margin-top: 38px;
  }

  .section {
    padding: 64px 0;
  }

  .section-inner {
    width: calc(100% - 32px);
  }

  .section-head {
    margin-bottom: 28px;
  }

  .section-head--row {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .section-head--row > .btn {
    margin-bottom: 0;
  }

  .section-head h2 {
    margin-bottom: 9px;
    font-size: clamp(1.7rem, 7.4vw, 2.2rem);
  }

  .section-lead {
    font-size: 0.82rem;
  }

  .time-unit {
    padding: 20px 4px;
  }

  .time-value {
    font-size: clamp(1.42rem, 6.6vw, 2rem);
  }

  .time-label {
    font-size: 0.67rem;
  }

  .counter-note {
    font-size: 0.7rem;
  }

  .diary-entry {
    padding: 20px 18px;
    border-radius: 18px;
  }

  .entry-head {
    gap: 8px;
  }

  .entry-actions {
    margin-top: -8px;
    margin-right: -8px;
  }

  .mini-btn {
    min-height: 44px;
    padding: 0 8px;
    font-size: 0.72rem;
  }

  .entry-body {
    font-size: 0.87rem;
    line-height: 2;
  }

  .entry-foot {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .timeline {
    padding-left: 28px;
  }

  .timeline::before {
    left: 7px;
  }

  .memory::before {
    left: -27px;
    width: 11px;
    height: 11px;
  }

  .memory-card {
    padding: 20px 18px;
  }

  .memory-top {
    gap: 8px;
  }

  .memory-date {
    margin-bottom: 6px;
  }

  .album-grid {
    gap: 11px;
  }

  .photo-open {
    border-radius: 12px;
  }

  .photo-caption {
    margin-top: 7px;
    font-size: 0.76rem;
    line-height: 1.6;
  }

  .photo-actions .mini-btn {
    min-height: 40px;
    padding: 0 5px;
    font-size: 0.68rem;
  }

  .album-empty {
    min-height: 280px;
    padding: 28px 18px;
  }

  .album-empty__frames {
    width: 160px;
    height: 108px;
    margin-bottom: 14px;
  }

  .album-empty__frame {
    width: 82px;
    height: 100px;
  }

  .anniversary-card {
    padding: 20px 18px;
  }

  .letter-paper {
    padding: 30px 20px;
    border-radius: 3px 18px 18px 18px;
  }

  .letter-paper::before {
    left: 13px;
  }

  .letter-text {
    font-size: 1rem;
    line-height: 2.05;
  }

  .letter-idle {
    padding: 14px 0;
  }

  .surprise-panel,
  .hug-panel {
    padding: 24px 20px;
  }

  .love-note-text {
    font-size: 1.12rem;
  }

  .wish-row {
    gap: 8px;
    min-height: 62px;
    padding: 9px 0;
  }

  .wish-toggle {
    width: 42px;
    height: 42px;
  }

  .wish-title {
    font-size: 0.9rem;
  }

  .wish-actions .mini-btn {
    min-height: 42px;
    padding: 0 5px;
    font-size: 0.68rem;
  }

  .settings-card {
    padding: 20px 18px;
  }

  .profile-card {
    gap: 12px;
    flex-wrap: wrap;
  }

  .avatar--lg {
    width: 54px;
    height: 54px;
  }

  .profile-card .btn {
    min-height: 42px;
    margin-left: auto;
  }

  .couple-settings {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .couple-settings > .btn {
    margin-top: 2px;
  }

  .settings-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .dot-sep {
    display: none;
  }

  .ending {
    padding: 76px 18px 90px;
  }

  .settings-device-status {
  margin: 10px 0 0;
  color: var(--muted, #846d73);
  font-size: 0.82rem;
}

.device-unlock-dialog {
  width: min(430px, calc(100% - 28px));
  border: 0;
  padding: 0;
  border-radius: 24px;
  color: var(--ink, #533c40);
  background: var(--paper, #fffdf9);
  box-shadow: 0 24px 80px rgba(74, 34, 43, 0.22);
}

.device-unlock-dialog::backdrop {
  background: rgba(58, 26, 36, 0.62);
  backdrop-filter: blur(5px);
}

.device-unlock-panel {
  padding: 30px 28px 24px;
  text-align: center;
}

.device-unlock-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  border-radius: 50%;
  color: #fff8f1;
  background: var(--wine, #9a3e58);
  font-size: 1.7rem;
}

.device-unlock-panel h2 {
  margin: 5px 0 10px;
  font-size: 1.35rem;
}

.device-unlock-panel #deviceUnlockMessage {
  margin: 0 auto 18px;
  color: var(--muted, #846d73);
  font-size: 0.9rem;
}

.device-unlock-panel .form-error {
  margin: 0 0 14px;
}

.device-unlock-panel .modal-actions {
  justify-content: center;
  flex-wrap: wrap;
}
.modal {
    align-items: end;
    padding: 0;
  }

  .modal-panel {
    width: 100%;
    max-height: 92svh;
    border-radius: 22px 22px 0 0;
  }

  .modal-head {
    padding: 18px 18px 14px;
  }

  .modal-body {
    padding: 18px 18px 20px;
  }

  .modal-actions {
    padding: 14px 18px max(18px, env(safe-area-inset-bottom));
  }

  .modal-actions .btn {
    flex: 1;
    min-width: 0;
  }

  #editorError {
    margin: 0 18px 12px;
  }

  .field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .confirm-dialog {
    width: calc(100% - 28px);
  }

  .confirm-panel {
    padding: 22px;
  }

  .lightbox-inner {
    padding: 54px 8px 44px;
    gap: 2px;
  }

  .lightbox-arrow {
    width: 38px;
    height: 38px;
    font-size: 1.7rem;
  }

  .lightbox-image-wrap,
  .lightbox-image-wrap img {
    max-height: calc(100svh - 176px);
  }

  .lightbox-caption {
    padding: 0 10px;
    font-size: 0.8rem;
  }

  .lightbox-close {
    top: 8px;
    right: 10px;
    width: 40px;
    height: 40px;
  }

  .toast {
    bottom: max(14px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 380px) {
  .brand-text {
    letter-spacing: 0.03em;
  }

  .site-nav {
    gap: 15px;
  }

  .hero-person__name {
    max-width: 94px;
  }

  .hero-quote {
    font-size: 1.8rem;
  }

  .time-value {
    font-size: 1.32rem;
  }

  .time-label {
    font-size: 0.62rem;
    letter-spacing: 0.08em;
  }

  .photo-caption {
    font-size: 0.72rem;
  }
}

/* ---------- 减少动态 ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .js .reveal,
  .js .reveal.is-visible {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .petal {
    display: none;
  }

  .loading-seal {
    animation: none;
    border-color: var(--line-strong);
    border-top-color: var(--wine);
  }

  .scroll-cue__line {
    animation: none;
    opacity: 0.55;
    transform: none;
  }

  .hero-quote {
    animation: none;
  }
}


/* 日记封面：沿用原有纸张、圆角与玫瑰色，正文只在展开后显示。 */
.diary-entry {
  padding: 0;
  overflow: hidden;
  background: var(--diary-cover, #fffaf4);
}
.diary-cover-head {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px clamp(12px, 2vw, 22px) 8px 0;
  color: var(--diary-ink, #000);
}
.diary-heading { flex: 1; min-width: 0; margin: 0; }
.diary-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 130px;
  padding: 20px clamp(18px, 3.4vw, 34px);
  text-align: left;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: var(--radius-md);
}
.diary-cover-label { display: block; min-width: 0; }
.diary-cover-head .entry-date,
.diary-cover-preview .entry-date { display: block; color: inherit; letter-spacing: .08em; }
.diary-cover-head .entry-title,
.diary-cover-preview .entry-title { display: block; color: inherit; }
.diary-chevron { flex: none; font: 1.55rem var(--sans); transition: transform .28s ease; }
.is-expanded .diary-chevron { transform: rotate(180deg); }
.diary-cover-button { color: inherit; min-height: 44px; flex: none; }
.diary-cover-button:hover { color: inherit; background: rgba(128, 128, 128, .14); }
.diary-content {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  transition: grid-template-rows .28s ease, opacity .22s ease, visibility 0s .28s;
}
.is-expanded .diary-content {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  transition: grid-template-rows .28s ease, opacity .22s ease, visibility 0s;
}
.diary-content-inner { min-height: 0; overflow: hidden; }
.diary-sheet { padding: 24px clamp(18px, 3.4vw, 34px); background: var(--paper); border-top: 1px solid var(--line); }
.diary-sheet > .entry-body:first-child { margin-top: 0; }
.diary-meta { display: flex; flex-direction: column; gap: 4px; }
.diary-cover-preview { padding: 24px; background: var(--diary-cover); color: var(--diary-ink); border: 1px solid var(--line); border-radius: var(--radius-md); }
.diary-palette { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 22px 0; }
.diary-swatch { display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 76px; padding: 8px 2px; background: transparent; border: 2px solid transparent; border-radius: 12px; font-size: .76rem; }
.diary-swatch[aria-pressed="true"] { border-color: var(--wine); background: var(--paper); }
.diary-swatch-chip { width: 32px; height: 32px; border: 1px solid var(--line-strong); border-radius: 50%; }
.diary-custom-color { display: flex; align-items: center; gap: 18px; }
.diary-custom-color .field { margin: 0; }
.diary-color-input { width: 88px; min-height: 44px; padding: 4px; cursor: pointer; }
.diary-color-value { color: var(--muted); font-size: .85rem; }
@media (max-width: 600px) {
  .diary-toggle { gap: 10px; min-height: 118px; padding: 18px 12px 18px 18px; }
  .diary-cover-button { padding: 0 8px; font-size: .72rem; }
  .diary-palette { gap: 3px; }
  .diary-swatch { font-size: .7rem; }
}
@media (prefers-reduced-motion: reduce) {
  .diary-content, .is-expanded .diary-content, .diary-chevron { transition: none; }
}
