:root {
  --rose-950: #4c152b;
  --rose-800: #812747;
  --rose-600: #c44871;
  --rose-500: #df648b;
  --rose-300: #f4a9c0;
  --rose-200: #f9c9d8;
  --rose-100: #fde4ec;
  --cream: #fffaf7;
  --ink: #552238;
  --muted: #94697a;
  --shadow: 0 28px 80px rgba(126, 45, 76, 0.2);
  font-family: "Noto Serif SC", "Songti SC", "STSong", Georgia, serif;
  color: var(--ink);
  background: #fbd5e1;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; margin: 0; }

body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 255, 255, 0.92), transparent 25%),
    radial-gradient(circle at 82% 15%, rgba(255, 226, 237, 0.9), transparent 28%),
    radial-gradient(circle at 50% 95%, rgba(255, 245, 239, 0.85), transparent 36%),
    linear-gradient(145deg, #f9cbd9 0%, #fce1e8 48%, #f5c2d3 100%);
}

button, input, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(196, 72, 113, 0.35);
  outline-offset: 3px;
}

.ambient-hearts {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.ambient-hearts::before,
.ambient-hearts::after {
  content: "";
  position: absolute;
  width: 42vw;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  filter: blur(1px);
}

.ambient-hearts::before { left: -20vw; top: 8vh; }
.ambient-hearts::after { right: -24vw; bottom: -12vh; }

.ambient-hearts span {
  position: absolute;
  left: var(--left);
  bottom: -50px;
  color: var(--rose-600);
  font-size: var(--size);
  opacity: var(--opacity);
  animation: heart-rise var(--duration) linear var(--delay) infinite;
  filter: blur(0.2px);
}

@keyframes heart-rise {
  0% { transform: translate3d(0, 0, 0) rotate(-12deg) scale(0.7); }
  45% { transform: translate3d(var(--drift), -52vh, 0) rotate(10deg) scale(1); }
  100% { transform: translate3d(0, -112vh, 0) rotate(-8deg) scale(0.82); }
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--rose-600);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.26em;
}

.primary-button, .secondary-button, .text-button, .back-button, .modal-close, .reveal-button {
  border: 0;
  cursor: pointer;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 16px 24px;
  color: white;
  border-radius: 18px;
  background: linear-gradient(135deg, #d95782, #bd345f);
  box-shadow: 0 14px 32px rgba(188, 52, 95, 0.27), inset 0 1px rgba(255, 255, 255, 0.32);
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.primary-button:hover { transform: translateY(-2px); box-shadow: 0 18px 38px rgba(188, 52, 95, 0.34); }
.primary-button:active { transform: translateY(0); }
.primary-button:disabled { cursor: not-allowed; opacity: 0.55; transform: none; }

.login-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-card {
  position: relative;
  width: min(440px, 100%);
  padding: 64px 48px 36px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 36px;
  background: rgba(255, 250, 248, 0.74);
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(24px);
}

.lock-heart {
  position: absolute;
  top: -34px;
  left: 50%;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  color: white;
  font-size: 27px;
  border: 7px solid #f8d2dd;
  border-radius: 50%;
  background: linear-gradient(145deg, #e17194, #bd345f);
  box-shadow: 0 12px 30px rgba(157, 48, 82, 0.28);
  transform: translateX(-50%);
}

.login-card h1 { margin: 0; color: var(--rose-950); font-size: clamp(2rem, 7vw, 2.7rem); font-weight: 600; letter-spacing: 0.04em; }
.login-intro { margin: 16px auto 32px; max-width: none; color: var(--muted); font-size: clamp(0.68rem, 3vw, 0.92rem); line-height: 1.8; white-space: nowrap; }
.login-card form { text-align: left; }
.login-card label { display: block; margin: 0 0 9px 5px; color: #774154; font-size: 0.8rem; font-weight: 700; }
.password-field { position: relative; }
.password-field input {
  width: 100%;
  padding: 15px 70px 15px 17px;
  color: var(--ink);
  border: 1px solid rgba(188, 92, 124, 0.2);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 2px 7px rgba(95, 30, 54, 0.04);
}
.password-field input::placeholder { color: #c7a2b0; }
.reveal-button { position: absolute; top: 50%; right: 14px; padding: 6px; color: var(--rose-600); font: 700 0.75rem ui-sans-serif, system-ui, sans-serif; background: transparent; transform: translateY(-50%); }
.form-error { min-height: 22px; margin: 7px 5px; color: #b1284f; font: 0.78rem/1.4 ui-sans-serif, system-ui, sans-serif; }
.login-button { width: 100%; margin-top: 4px; }
.privacy-note { margin: 26px 0 0; color: #b38c9a; font-size: 0.74rem; }

#main-content { position: relative; z-index: 1; }
.view { display: none; min-height: 100vh; }
.view.is-active { display: flex; }

.home-view { position: relative; flex-direction: column; padding: 0 clamp(22px, 5vw, 72px); overflow: hidden; }
.home-header, .hero, .home-footer { position: relative; z-index: 3; }
.home-header { display: flex; align-items: center; justify-content: space-between; min-height: 82px; }
.home-memories { position: absolute; z-index: 1; inset: 76px 0 28px; pointer-events: none; }
.home-memory {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: clamp(105px, 11vw, 165px);
  aspect-ratio: 0.82;
  padding: 7px 7px 21px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 10px;
  background: #fffaf6;
  box-shadow: 0 18px 38px rgba(104, 37, 63, 0.18);
  opacity: 0.76;
  pointer-events: none;
  transform: rotate(var(--r));
  transition: transform 220ms ease, opacity 220ms ease, box-shadow 220ms ease;
}
.home-memory::after { content: "♥"; position: absolute; right: 9px; bottom: 3px; color: #e58aa7; font-size: 10px; }
.home-memory img { width: 100%; height: 100%; display: block; border-radius: 5px; object-fit: cover; }
.brand { color: var(--rose-950); font-size: 1rem; font-weight: 700; letter-spacing: 0.06em; }
.brand span, .home-footer span { color: var(--rose-600); }
.text-button { padding: 8px 4px; color: var(--muted); background: transparent; font: 600 0.78rem ui-sans-serif, system-ui, sans-serif; }
.hero { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 25px 0 35px; text-align: center; }
.hero h1 { margin: 0; color: var(--rose-950); font-size: clamp(2.3rem, 5.5vw, 4.5rem); font-weight: 500; line-height: 1.18; letter-spacing: 0.03em; }
.hero h1 em { position: relative; color: var(--rose-600); font-style: normal; }
.hero h1 em::after { content: ""; position: absolute; left: 5%; right: 5%; bottom: -8px; height: 7px; border-top: 2px solid rgba(196, 72, 113, 0.48); border-radius: 50%; }
.hero-subtitle { margin: 22px 0 30px; color: var(--muted); font-size: clamp(0.85rem, 2vw, 1rem); letter-spacing: 0.08em; }

.love-counter {
  position: relative;
  isolation: isolate;
  width: min(520px, 100%);
  margin-bottom: 28px;
  padding: 25px 25px 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 30px;
  background: linear-gradient(145deg, rgba(255, 253, 249, 0.82), rgba(255, 239, 243, 0.68));
  box-shadow: 0 20px 54px rgba(116, 42, 68, 0.14), inset 0 1px rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}
.counter-glow { position: absolute; z-index: -1; top: -110px; left: 50%; width: 280px; height: 180px; border-radius: 50%; background: rgba(248, 164, 190, 0.34); filter: blur(35px); transform: translateX(-50%); }
.counter-label { margin: 0; color: var(--rose-800); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.18em; }
.counter-label span { color: var(--rose-500); }
.total-days { display: flex; align-items: baseline; justify-content: center; gap: 9px; margin: 6px 0 2px; color: var(--rose-950); }
.total-days strong { font-family: Georgia, "Times New Roman", serif; font-size: clamp(4rem, 10vw, 6.3rem); font-weight: 400; line-height: 1; letter-spacing: -0.05em; }
.total-days span { color: var(--rose-600); font-size: 1.2rem; }
.calendar-duration { display: inline-block; padding: 8px 18px; color: #8a3f59; border-radius: 999px; background: rgba(248, 199, 214, 0.4); font-size: 0.9rem; letter-spacing: 0.12em; }
.counter-since { margin-top: 12px; color: #bd9aa6; font: 700 0.58rem ui-sans-serif, system-ui, sans-serif; letter-spacing: 0.25em; }
.gallery-entry { min-width: min(360px, 100%); text-align: left; }
.gallery-entry > span:nth-child(2) { display: flex; flex: 1; flex-direction: column; }
.gallery-entry b { font-size: 0.95rem; letter-spacing: 0.08em; }
.gallery-entry small { margin-top: 4px; color: #ffdce7; font-size: 0.68rem; }
.button-icon { font-size: 1.4rem; transform: rotate(-4deg); }
.home-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; width: min(940px, 100%); }
.home-actions .gallery-entry { min-width: 0; width: 100%; }
.message-entry { background: linear-gradient(135deg, #b7587c, #8e3658); }
.todo-entry { background: linear-gradient(135deg, #c66a7f, #a84663); }
.home-footer { padding: 17px; color: #aa7d8e; text-align: center; font: 0.66rem ui-sans-serif, system-ui, sans-serif; letter-spacing: 0.09em; }

.gallery-view { position: relative; flex-direction: column; overflow: hidden; }
.gallery-header { position: relative; z-index: 10; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 108px; padding: 17px clamp(18px, 4vw, 55px); border-bottom: 1px solid rgba(255, 255, 255, 0.4); background: linear-gradient(to bottom, rgba(255, 240, 245, 0.86), rgba(255, 240, 245, 0.3)); backdrop-filter: blur(14px); }
.gallery-header > div { text-align: center; }
.gallery-header .eyebrow { margin-bottom: 5px; }
.gallery-header h1 { margin: 0; color: var(--rose-950); font-size: clamp(1.55rem, 4vw, 2.15rem); font-weight: 500; letter-spacing: 0.12em; }
.back-button { justify-self: start; display: inline-flex; align-items: center; justify-content: center; min-width: 66px; min-height: 43px; padding: 0 17px; color: var(--rose-800); border: 1px solid rgba(255, 255, 255, 0.8); border-radius: 999px; background: rgba(255, 255, 255, 0.5); box-shadow: 0 7px 18px rgba(92, 30, 54, 0.09); font: 700 0.76rem ui-sans-serif, system-ui, sans-serif; letter-spacing: 0.08em; }
.gallery-tools { position: relative; justify-self: end; }
.upload-button { display: inline-flex; align-items: center; justify-content: center; padding: 11px 18px; color: #a6355b; border: 1px solid rgba(202, 80, 119, 0.2); border-radius: 999px; background: rgba(255, 255, 255, 0.66); box-shadow: 0 8px 22px rgba(111, 36, 64, 0.1); cursor: pointer; font: 700 0.74rem ui-sans-serif, system-ui, sans-serif; transition: transform 180ms ease, background 180ms ease; }
.upload-button:hover { background: rgba(255, 255, 255, 0.92); transform: translateY(-1px); }
.upload-button:disabled { cursor: wait; opacity: 0.6; transform: none; }
.upload-status { position: absolute; top: calc(100% + 7px); right: 0; width: max-content; max-width: 260px; margin: 0; padding: 6px 10px; color: var(--rose-800); border-radius: 10px; background: rgba(255, 250, 248, 0.92); box-shadow: 0 6px 16px rgba(91, 32, 55, 0.1); opacity: 0; pointer-events: none; font: 0.68rem ui-sans-serif, system-ui, sans-serif; transition: opacity 150ms ease; }
.upload-status:not(:empty) { opacity: 1; }
.gallery-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.gallery-stage::before { content: ""; position: absolute; z-index: 1; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(250, 209, 222, 0.85), transparent 7%, transparent 93%, rgba(250, 209, 222, 0.85)); }
.gallery-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--rose-800); font-size: 0.9rem; letter-spacing: 0.08em; }
.gallery-loading span { color: var(--rose-500); }

.flying-photo {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  margin: 0;
  padding: 6px 6px 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 9px;
  background: #fffaf5;
  box-shadow: 0 12px 27px rgba(92, 33, 57, 0.2), 0 2px 4px rgba(92, 33, 57, 0.08);
  cursor: pointer;
  will-change: transform;
  transition: box-shadow 180ms ease, filter 180ms ease;
}
.flying-photo::after { content: "♥"; position: absolute; right: 7px; bottom: 2px; color: #e89ab2; font-size: 9px; }
.flying-photo img { display: block; width: 100%; height: 100%; border-radius: 5px; object-fit: cover; pointer-events: none; }
.flying-photo.is-paused { z-index: 5; filter: saturate(1.08); box-shadow: 0 18px 42px rgba(92, 33, 57, 0.34), 0 0 0 4px rgba(255, 255, 255, 0.48); }

.message-view { position: relative; flex-direction: column; min-height: 100vh; }
.message-header {
  position: sticky;
  z-index: 15;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 108px;
  padding: 17px clamp(18px, 4vw, 55px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
  background: linear-gradient(to bottom, rgba(255, 240, 245, 0.94), rgba(255, 240, 245, 0.72));
  backdrop-filter: blur(16px);
}
.message-header > div { text-align: center; }
.message-header .eyebrow { margin-bottom: 5px; }
.message-header h1 { margin: 0; color: var(--rose-950); font-size: clamp(1.55rem, 4vw, 2.15rem); font-weight: 500; letter-spacing: 0.12em; }
.write-message-button {
  justify-self: end;
  min-height: 43px;
  padding: 0 20px;
  color: white;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #d95782, #bd345f);
  box-shadow: 0 10px 25px rgba(157, 42, 79, 0.24);
  cursor: pointer;
  font: 700 0.76rem ui-sans-serif, system-ui, sans-serif;
}
.wall-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 38px clamp(25px, 6vw, 95px) 14px; }
.wall-heading p { margin: 0; color: var(--rose-950); font-size: clamp(1rem, 2.2vw, 1.35rem); letter-spacing: 0.06em; }
.wall-heading span { color: var(--muted); font: 0.72rem ui-sans-serif, system-ui, sans-serif; }
.message-wall {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  align-items: start;
  gap: 35px 30px;
  min-height: calc(100vh - 190px);
  padding: 24px clamp(25px, 6vw, 95px) 90px;
}
.message-wall::before { content: ""; position: absolute; z-index: -1; inset: 0; opacity: 0.28; background-image: radial-gradient(rgba(180, 84, 116, 0.25) 1px, transparent 1px); background-size: 24px 24px; }
.wall-loading, .empty-wall { grid-column: 1 / -1; display: grid; place-items: center; min-height: 42vh; color: var(--muted); text-align: center; letter-spacing: 0.08em; }
.empty-wall span { display: block; margin-bottom: 10px; color: var(--rose-400, #dc7898); font-size: 2rem; }
.message-note {
  position: relative;
  min-height: 218px;
  padding: 28px 25px 22px;
  overflow: hidden;
  color: #663148;
  text-align: left;
  border: 0;
  border-radius: 3px 3px 14px 3px;
  background: #fff1a9;
  box-shadow: 0 16px 30px rgba(91, 38, 59, 0.14), inset 0 1px rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transform: rotate(-1.2deg);
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.message-note:nth-child(5n+2) { background: #ffd4df; transform: rotate(1.1deg); }
.message-note:nth-child(5n+3) { background: #dcefcf; transform: rotate(-0.5deg); }
.message-note:nth-child(5n+4) { background: #d7e8fb; transform: rotate(1.4deg); }
.message-note:nth-child(5n+5) { background: #ead9f5; transform: rotate(-1deg); }
.message-note::before { content: ""; position: absolute; top: -5px; left: 50%; width: 66px; height: 20px; background: rgba(255, 255, 255, 0.48); box-shadow: 0 2px 4px rgba(91, 38, 59, 0.05); transform: translateX(-50%) rotate(-2deg); }
.message-note:hover { z-index: 2; box-shadow: 0 22px 40px rgba(91, 38, 59, 0.22); transform: translateY(-5px) rotate(0); }
.note-route { display: flex; align-items: center; gap: 7px; color: var(--rose-800); font: 800 0.72rem ui-sans-serif, system-ui, sans-serif; letter-spacing: 0.08em; }
.note-route span { color: rgba(105, 47, 68, 0.52); font-size: 0.58rem; }
.note-preview { display: -webkit-box; margin: 19px 0 22px; overflow: hidden; font-size: 1rem; line-height: 1.85; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.note-reply-mark { display: block; margin: 11px 0 0; overflow: hidden; color: rgba(105, 47, 68, 0.55); text-overflow: ellipsis; white-space: nowrap; font: 0.65rem/1.45 ui-sans-serif, system-ui, sans-serif; }
.note-reply-mark + .note-preview { margin-top: 12px; }
.note-time { position: absolute; right: 22px; bottom: 16px; color: rgba(105, 47, 68, 0.52); font: 0.62rem ui-sans-serif, system-ui, sans-serif; }
.message-note.is-target { animation: note-highlight 1.4s ease; }
@keyframes note-highlight { 0%, 100% { box-shadow: 0 16px 30px rgba(91, 38, 59, 0.14); } 45% { box-shadow: 0 0 0 7px rgba(215, 77, 121, 0.3), 0 22px 42px rgba(91, 38, 59, 0.25); } }

.note-overlay { position: fixed; z-index: 60; inset: 0; display: grid; place-items: center; padding: 24px; opacity: 0; background: rgba(73, 24, 43, 0.3); backdrop-filter: blur(15px) saturate(0.75); transition: opacity 200ms ease; }
.note-overlay[hidden] { display: none; }
.note-overlay.is-open { opacity: 1; }
.note-close { position: fixed; z-index: 61; top: max(20px, 3vh); right: max(20px, 3vw); display: grid; place-items: center; width: 45px; height: 45px; color: white; border: 0; border-radius: 50%; background: #c7355e; box-shadow: 0 10px 25px rgba(82, 16, 37, 0.3); cursor: pointer; font: 300 2rem/1 ui-sans-serif, system-ui, sans-serif; }
.note-dialog { width: min(590px, 94vw); max-height: 90vh; overflow-y: auto; padding: 40px; border: 1px solid rgba(255, 255, 255, 0.76); border-radius: 26px; background: rgba(255, 250, 245, 0.96); box-shadow: 0 34px 90px rgba(70, 20, 40, 0.34); transform: translateY(13px) scale(0.98); transition: transform 220ms ease; }
.note-overlay.is-open .note-dialog { transform: translateY(0) scale(1); }
.note-dialog[hidden] { display: none; }
.note-dialog h2 { margin: 0 0 25px; color: var(--rose-950); font-size: 1.8rem; font-weight: 500; }
.message-selects { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 13px; }
.message-selects label, .message-content-label { display: block; color: #774154; font: 700 0.76rem ui-sans-serif, system-ui, sans-serif; }
.message-selects select { width: 100%; margin-top: 8px; padding: 12px 13px; color: var(--ink); border: 1px solid rgba(188, 92, 124, 0.24); border-radius: 12px; background: white; }
.to-mark { padding-bottom: 14px; color: var(--rose-500); font: 800 0.6rem ui-sans-serif, system-ui, sans-serif; letter-spacing: 0.16em; }
.message-content-label { margin-top: 21px; }
#message-content { width: 100%; min-height: 180px; margin-top: 8px; padding: 15px; resize: vertical; color: var(--ink); border: 1px solid rgba(188, 92, 124, 0.24); border-radius: 13px; background: white; line-height: 1.75; }
.compose-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 13px; }
.message-form-status { flex: 1; margin: 0; color: var(--rose-600); font: 0.72rem ui-sans-serif, system-ui, sans-serif; }
.reply-reference { width: 100%; margin: -8px 0 20px; padding: 12px 14px; overflow: hidden; color: #875066; text-align: left; text-overflow: ellipsis; white-space: nowrap; border: 1px solid rgba(191, 83, 118, 0.15); border-radius: 12px; background: #fff2f5; cursor: pointer; font: 0.72rem ui-sans-serif, system-ui, sans-serif; }
.reply-reference::before { content: "回复："; color: var(--rose-600); font-weight: 700; }
.detail-dialog { position: relative; min-height: 420px; background: #fff1a9; }
.detail-dialog::before { content: ""; position: absolute; top: -3px; left: 50%; width: 90px; height: 25px; background: rgba(255, 255, 255, 0.52); transform: translateX(-50%) rotate(-2deg); }
.detail-dialog h2 span { margin: 0 7px; color: var(--rose-500); font: 800 0.6rem ui-sans-serif, system-ui, sans-serif; }
.detail-content { min-height: 175px; margin: 22px 0; color: #5e3042; font-size: 1.08rem; line-height: 1.9; white-space: pre-wrap; word-break: break-word; }
.detail-time { display: block; color: rgba(105, 47, 68, 0.55); text-align: right; font: 0.68rem ui-sans-serif, system-ui, sans-serif; }
.detail-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
.danger-button { padding: 11px 24px; color: #b52e55; border: 1px solid rgba(181, 46, 85, 0.24); border-radius: 13px; background: rgba(255, 255, 255, 0.42); cursor: pointer; }
.note-modal-open #main-content { filter: blur(2px); }

.todo-view { position: relative; flex-direction: column; min-height: 100vh; padding-bottom: 90px; }
.todo-header {
  position: sticky;
  z-index: 15;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 108px;
  padding: 17px clamp(18px, 4vw, 55px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
  background: linear-gradient(to bottom, rgba(255, 240, 245, 0.94), rgba(255, 240, 245, 0.72));
  backdrop-filter: blur(16px);
}
.todo-header > div { text-align: center; }
.todo-header .eyebrow { margin-bottom: 5px; }
.todo-header h1 { margin: 0; color: var(--rose-950); font-size: clamp(1.55rem, 4vw, 2.15rem); font-weight: 500; letter-spacing: 0.12em; }
.add-todo-button {
  justify-self: end;
  min-height: 43px;
  padding: 0 21px;
  color: white;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #d95782, #bd345f);
  box-shadow: 0 10px 25px rgba(157, 42, 79, 0.24);
  cursor: pointer;
  font: 700 0.76rem ui-sans-serif, system-ui, sans-serif;
}
.todo-summary { display: flex; align-items: center; justify-content: center; gap: clamp(22px, 5vw, 70px); padding: 38px 20px 30px; }
.summary-card { min-width: 145px; color: var(--muted); text-align: center; }
.summary-card span, .summary-card small { display: block; font: 0.7rem ui-sans-serif, system-ui, sans-serif; letter-spacing: 0.08em; }
.summary-card strong { display: block; margin: 2px 0; color: var(--rose-950); font: 400 clamp(2.7rem, 6vw, 4.2rem)/1 Georgia, serif; }
.completed-summary strong { color: #638b67; }
.pending-summary strong { color: var(--rose-600); }
.summary-divider { color: var(--rose-400, #dc7898); font-size: 1.3rem; }
.love-notebook {
  position: relative;
  width: min(980px, calc(100% - 40px));
  min-height: 480px;
  margin: 0 auto;
  padding: 58px clamp(25px, 5vw, 68px) 55px;
  border: 1px solid rgba(197, 124, 146, 0.22);
  border-radius: 8px 22px 22px 8px;
  background-color: rgba(255, 252, 244, 0.93);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 43px, rgba(210, 126, 151, 0.14) 44px, transparent 45px);
  box-shadow: 0 25px 70px rgba(100, 37, 61, 0.17), inset 17px 0 24px rgba(147, 78, 101, 0.05);
}
.love-notebook::before { content: ""; position: absolute; top: 0; bottom: 0; left: 42px; width: 1px; background: rgba(218, 91, 127, 0.22); box-shadow: 4px 0 rgba(218, 91, 127, 0.08); }
.notebook-rings { position: absolute; z-index: 2; top: 28px; bottom: 28px; left: -17px; display: flex; flex-direction: column; justify-content: space-around; }
.notebook-rings i { display: block; width: 35px; height: 11px; border: 3px solid #b998a4; border-right-color: transparent; border-radius: 12px 0 0 12px; box-shadow: -3px 3px 6px rgba(83, 41, 56, 0.12); }
.todo-section + .todo-section { margin-top: 45px; padding-top: 34px; border-top: 2px dashed rgba(190, 95, 124, 0.18); }
.todo-section-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 13px; }
.todo-section-heading h2 { margin: 0; color: var(--rose-950); font-size: 1.16rem; font-weight: 600; letter-spacing: 0.08em; }
.todo-section-heading span { color: #bd93a2; font: 800 0.58rem ui-sans-serif, system-ui, sans-serif; letter-spacing: 0.2em; }
.todo-list { display: flex; flex-direction: column; }
.todo-loading, .todo-empty { margin: 14px 0 17px; color: #ae8795; text-align: center; font-size: 0.82rem; }
.todo-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 66px;
  padding: 8px 4px;
}
.todo-number { display: grid; place-items: center; width: 28px; height: 28px; color: var(--rose-600); border: 1px solid rgba(199, 77, 116, 0.22); border-radius: 50%; font: 0.68rem Georgia, serif; }
.todo-copy { min-width: 0; }
.todo-copy p { margin: 0; color: #633247; font-size: 0.98rem; line-height: 1.55; word-break: break-word; }
.todo-meta { display: flex; flex-wrap: wrap; gap: 5px 15px; margin-top: 4px; color: #ae8795; font: 0.62rem ui-sans-serif, system-ui, sans-serif; }
.completed-section .todo-copy p { color: #94747f; text-decoration: line-through; text-decoration-color: rgba(170, 71, 101, 0.48); text-decoration-thickness: 1.5px; }
.todo-actions { display: flex; gap: 8px; }
.todo-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 37px;
  height: 37px;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  font: 700 1rem/1 ui-sans-serif, system-ui, sans-serif;
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.todo-action:hover { transform: translateY(-2px); }
.complete-todo { color: #3f8651; border: 1px solid rgba(63, 134, 81, 0.2); background: #e3f3e6; box-shadow: 0 5px 13px rgba(63, 134, 81, 0.1); }
.delete-todo { color: #bd3c5d; border: 1px solid rgba(189, 60, 93, 0.18); background: #fde8ed; box-shadow: 0 5px 13px rgba(189, 60, 93, 0.09); }
.completed-section .complete-todo { color: white; background: linear-gradient(135deg, #68a975, #4d8d5b); }

.todo-celebration { position: fixed; z-index: 75; inset: 0; overflow: hidden; pointer-events: none; }
.todo-celebration span { position: absolute; bottom: -80px; color: #e73567; opacity: 0; text-shadow: 0 5px 16px rgba(155, 26, 65, 0.25); animation: celebration-heart var(--duration) cubic-bezier(.18,.75,.2,1) var(--delay) forwards; }
@keyframes celebration-heart { 0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(-12deg) scale(.4); } 18% { opacity: .95; } 100% { opacity: 0; transform: translate3d(var(--drift), -115vh, 0) rotate(18deg) scale(1.15); } }

.todo-overlay { position: fixed; z-index: 80; inset: 0; display: grid; place-items: center; padding: 24px; opacity: 0; background: rgba(73, 24, 43, 0.31); backdrop-filter: blur(15px) saturate(.78); transition: opacity 200ms ease; }
.todo-overlay[hidden] { display: none; }
.todo-overlay.is-open { opacity: 1; }
.todo-close { position: fixed; z-index: 81; top: max(20px, 3vh); right: max(20px, 3vw); display: grid; place-items: center; width: 45px; height: 45px; color: white; border: 0; border-radius: 50%; background: #c7355e; box-shadow: 0 10px 25px rgba(82, 16, 37, 0.3); cursor: pointer; font: 300 2rem/1 ui-sans-serif, system-ui, sans-serif; }
.todo-dialog { width: min(620px, 94vw); max-height: 90vh; overflow-y: auto; padding: 40px; border: 1px solid rgba(255,255,255,.76); border-radius: 26px; background: rgba(255,250,247,.97); box-shadow: 0 34px 90px rgba(70,20,40,.34); transform: translateY(13px) scale(.98); transition: transform 220ms ease; }
.todo-overlay.is-open .todo-dialog { transform: translateY(0) scale(1); }
.todo-dialog[hidden] { display: none; }
.todo-dialog h2 { margin: 0 0 25px; color: var(--rose-950); font-size: 1.8rem; font-weight: 500; }
.todo-dialog label { display: block; color: #774154; font: 700 .76rem ui-sans-serif, system-ui, sans-serif; }
#todo-content, #todo-detail-text { width: 100%; margin-top: 9px; padding: 15px; resize: vertical; color: var(--ink); border: 1px solid rgba(188,92,124,.24); border-radius: 13px; background: white; line-height: 1.75; }
.todo-form-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; }
.todo-form-footer p { flex: 1; margin: 0; color: var(--rose-600); font: .72rem ui-sans-serif, system-ui, sans-serif; }
.todo-memory-subject { margin: -13px 0 22px; padding: 12px 15px; color: #754256; border-left: 3px solid var(--rose-400, #dc7898); background: #fff1f4; line-height: 1.6; }
.todo-photo-picker { position: relative; min-height: 150px; display: grid; place-items: center; margin-bottom: 21px; overflow: hidden; border: 1px dashed rgba(190, 72, 111, .3); border-radius: 15px; background: #fff7f8; }
.todo-photo-picker img { display: block; width: 100%; max-height: 310px; object-fit: contain; background: #2f1821; }
.todo-photo-picker img[hidden] { display: none; }
.todo-photo-picker label { position: absolute; z-index: 2; padding: 10px 16px; color: var(--rose-800); border-radius: 999px; background: rgba(255,255,255,.9); box-shadow: 0 7px 19px rgba(82,30,50,.14); cursor: pointer; }
.todo-photo-picker img:not([hidden]) + label { right: 12px; bottom: 12px; font-size: .68rem; }
.todo-detail-label { margin-top: 4px; }
.todo-modal-open #main-content { filter: blur(2px); }

.memory-modal { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 24px; opacity: 0; background: rgba(73, 24, 43, 0.35); backdrop-filter: blur(14px) saturate(0.7); transition: opacity 220ms ease; }
.memory-modal[hidden] { display: none; }
.memory-modal.is-open { opacity: 1; }
.modal-card { width: min(930px, 94vw); max-height: 90vh; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(290px, 0.75fr); overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.72); border-radius: 25px; background: rgba(255, 250, 248, 0.94); box-shadow: 0 35px 100px rgba(66, 18, 37, 0.38); transform: translateY(15px) scale(0.98); transition: transform 240ms ease; }
.memory-modal.is-open .modal-card { transform: translateY(0) scale(1); }
.modal-image-wrap { min-height: 420px; display: grid; place-items: center; padding: 14px; background: #321824; }
.modal-image-wrap img { display: block; max-width: 100%; max-height: calc(90vh - 28px); width: 100%; height: 100%; object-fit: contain; }
.memory-copy { display: flex; flex-direction: column; padding: 42px 34px 30px; }
.memory-copy h2 { margin: 0 0 25px; color: var(--rose-950); font-size: 1.65rem; font-weight: 500; line-height: 1.45; }
.memory-copy textarea { flex: 1; min-height: 150px; padding: 15px; resize: vertical; color: var(--ink); border: 1px solid rgba(184, 77, 112, 0.2); border-radius: 13px; background: white; line-height: 1.75; }
.memory-copy textarea[readonly] { color: #775261; background: #fff9f7; cursor: default; }
.save-status { min-height: 22px; margin: 8px 3px; color: var(--rose-600); font: 0.74rem ui-sans-serif, system-ui, sans-serif; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; }
.secondary-button { padding: 11px 24px; color: var(--rose-800); border: 1px solid rgba(190, 64, 103, 0.22); border-radius: 13px; background: #fff4f6; }
.primary-button.compact { padding: 11px 26px; border-radius: 13px; }
.modal-close { position: fixed; z-index: 51; top: max(20px, 3vh); right: max(20px, 3vw); display: grid; place-items: center; width: 45px; height: 45px; color: white; border-radius: 50%; background: #c7355e; box-shadow: 0 10px 25px rgba(82, 16, 37, 0.3); font: 300 2rem/1 ui-sans-serif, system-ui, sans-serif; }
.modal-open #main-content { filter: blur(2px); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 720px) {
  .login-card { padding: 58px 25px 30px; border-radius: 28px; }
  .home-header { min-height: 68px; }
  .hero { justify-content: flex-start; padding-top: 5vh; }
  .hero-subtitle { margin-bottom: 23px; }
  .home-actions { grid-template-columns: 1fr; width: min(360px, 100%); }
  .home-view { overflow-y: auto; }
  .love-counter { padding: 22px 18px 20px; border-radius: 24px; }
  .total-days strong { font-size: 4.5rem; }
  .gallery-header { grid-template-columns: 1fr auto 1fr; min-height: 91px; padding: 12px 14px; }
  .gallery-tools { position: relative; z-index: 12; right: auto; bottom: auto; }
  .upload-button { padding: 12px 15px; color: white; background: linear-gradient(135deg, #d95782, #bd345f); box-shadow: 0 12px 28px rgba(157, 42, 79, 0.3); }
  .upload-button:hover { background: linear-gradient(135deg, #d95782, #bd345f); }
  .upload-label { font-size: 0; }
  .upload-label::after { content: "上传照片"; font-size: 0.74rem; }
  .upload-status { top: calc(100% + 8px); right: 0; bottom: auto; }
  .home-memories { inset: 70px 0 20px; opacity: 0.45; }
  .home-memory { width: 86px; opacity: 0.52; pointer-events: none; }
  .home-memory:nth-child(n+4) { display: none; }
  .modal-card { max-height: 88vh; grid-template-columns: 1fr; overflow-y: auto; }
  .modal-image-wrap { min-height: 0; height: 48vh; padding: 9px; }
  .modal-image-wrap img { max-height: 47vh; }
  .memory-copy { padding: 25px 22px 22px; }
  .memory-copy h2 { margin-bottom: 17px; font-size: 1.35rem; }
  .memory-copy textarea { min-height: 105px; }
  .modal-close { top: 12px; right: 12px; width: 41px; height: 41px; }
  .message-header { grid-template-columns: 1fr auto 1fr; min-height: 91px; padding: 12px 14px; }
  .message-header h1 { font-size: 1.5rem; }
  .message-header .eyebrow { display: none; }
  .write-message-button { min-height: 41px; padding: 0 13px; font-size: 0.7rem; }
  .message-header .back-button { min-width: 57px; min-height: 41px; padding: 0 13px; }
  .wall-heading { align-items: start; flex-direction: column; padding: 28px 20px 8px; }
  .message-wall { grid-template-columns: 1fr; gap: 28px; padding: 18px 24px 70px; }
  .message-note { min-height: 205px; }
  .note-overlay { padding: 14px; }
  .note-close { top: 12px; right: 12px; width: 41px; height: 41px; }
  .note-dialog { padding: 34px 22px 23px; border-radius: 21px; }
  .message-selects { gap: 8px; }
  .compose-footer { align-items: stretch; flex-direction: column; }
  .compose-footer .primary-button { width: 100%; }
  .todo-header { grid-template-columns: 1fr auto 1fr; min-height: 91px; padding: 12px 14px; }
  .todo-header h1 { font-size: 1.38rem; white-space: nowrap; }
  .todo-header .eyebrow { display: none; }
  .add-todo-button { min-height: 41px; padding: 0 13px; font-size: .7rem; }
  .todo-header .back-button { min-width: 57px; min-height: 41px; padding: 0 13px; }
  .todo-summary { gap: 19px; padding: 27px 12px 23px; }
  .summary-card { min-width: 105px; }
  .love-notebook { width: calc(100% - 31px); padding: 50px 18px 42px 34px; border-radius: 7px 15px 15px 7px; }
  .love-notebook::before { left: 25px; }
  .notebook-rings { left: -13px; }
  .notebook-rings i { width: 28px; }
  .todo-row { grid-template-columns: auto minmax(0,1fr); gap: 10px; padding: 10px 1px; }
  .todo-actions { grid-column: 2; justify-content: flex-end; }
  .todo-dialog { padding: 34px 22px 23px; border-radius: 21px; }
  .todo-close { top: 12px; right: 12px; width: 41px; height: 41px; }
  .todo-form-footer { align-items: stretch; flex-direction: column; }
  .todo-form-footer .primary-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  .ambient-hearts span { display: none; }
}
