:root {
  --ink: #536d65;
  --heading: #739784;
  --rose: #b67b83;
  --heart: #df8894;
  --mint-surface: #eff9f1;
  --cream-surface: #fbf4df;
  --paper: #fffffc;
  --line: #dcecdf;
}
body { background-color: #fcfefa; color: var(--ink); }
h1, h2 { color: var(--heading); }
h1 { font-weight: 700; }
.title-ring { color: var(--rose); }
.title-ring::after { border-color: #ebc7cb; }
.topbar { background: #fcfefaeF; border-color: #e7f0e7; }
.brand { color: #6d8c7d; }
.round-note { background: #fbf4e6; border-color: #e5d4b7; color: #927f64; }
.primary-link { color: var(--ink); }
.heart-accent,
.brand > span,
.primary-link span,
.chapter-divider > span:first-child,
.chapter-divider > span:last-child,
.side-note span,
.pull-tab > span:last-child,
.daily-card .extra-title > span:last-child,
.footer-heart,
.heart,
button[type="submit"] span { color: var(--heart); }
.title-star, .star-two, .mini-star { color: #d9c593; }
.star-one { color: #bdc7de; }
.daily-card { background: #fff5f4; border-color: #f0dfe0; }
.little-card, .meal-box { background: #fbf7e8; border-color: #e9e4d0; }
.scrapbook-board, .chapter-divider, footer { background-color: var(--mint-surface); }
.photo-caption { color: #647e71; }
.door { background: var(--paper); }
.door h1 { color: var(--heading); }
.door input { color: var(--ink); }
/* 自写文案保留换行，长文字在纸张内自然折行。 */
.copy-lines,.chapter-heading h2,.contents-title,#viewer-caption{white-space:pre-line;overflow-wrap:anywhere}
.local-editor-link{display:none}
.local-editor-link.is-local{display:inline-flex}
.local-editor-link{padding:6px 14px;border:1px solid #e0ebe2;border-radius:20px;font-size:13px;position:absolute;right:24px;bottom:24px;background:#fcfefa;letter-spacing:0}
footer{position:relative}

/* A single keepsake from the beginning, with the whole photograph in view. */
.cover-keepsake{height:auto;min-height:550px;display:grid;place-items:center;padding:20px 38px 42px 46px;isolation:isolate}
.keepsake-wash{position:absolute;inset:25px 8px 45px 12px;background:radial-gradient(ellipse at 22% 35%,#eef8eb 0,transparent 66%),radial-gradient(ellipse at 80% 72%,#faf0ea 0,transparent 70%);border-radius:48% 48% 43% 40%;z-index:-2}
.cover-memory{position:relative;width:min(100%,354px);padding:13px 13px 0;transform:rotate(2deg);border-color:#e9e7dd;border-radius:4px;box-shadow:0 18px 45px #58634b12,0 3px 9px #58634b0d;z-index:2}
.cover-memory::before{content:"";position:absolute;inset:-12px 8px 8px -12px;z-index:-1;border:1px solid #dbe7d9;background:#eef5e9;transform:rotate(-5deg);border-radius:3px}
.cover-memory img{width:100%;height:auto;aspect-ratio:1080/1409;object-fit:contain;border-radius:2px}
.keepsake-caption{min-height:47px;display:flex;align-items:center;justify-content:center;gap:12px;padding:9px 6px;font:16px/1.7 "KaiTi","Kaiti SC",var(--font);color:#7b8e79}
.keepsake-caption>[data-copy]:empty{display:none}
.keepsake-caption .heart-accent{font:25px/1 Georgia,serif}
.keepsake-tape{position:absolute;top:14px;left:calc(50% - 49px);width:108px;height:29px;background:repeating-linear-gradient(90deg,#d7e7cf99 0 8px,#f1f7ecb3 8px 10px);border-inline:2px dotted #c3d5bb;transform:rotate(-4deg);z-index:4;pointer-events:none}
.keepsake-thread{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;z-index:3;color:#dca1a5}
.keepsake-thread path{stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.keepsake-thread .thread-heart{fill:#f9e9e5;stroke-width:1.8}
.keepsake-note{width:85px;min-height:85px;height:auto;padding:15px 9px;top:69px;left:0;z-index:4;font-size:16px;border-color:#e2d8bd;background:#fbf6e8;box-shadow:0 3px 9px #8d826709;transform:rotate(-8deg);overflow-wrap:anywhere}
.keepsake-flower{position:absolute;bottom:85px;right:8px;font:45px/1 Georgia,serif;color:#d8cfa9;transform:rotate(13deg);z-index:3}
.keepsake-corner{right:35px;bottom:2px;font-size:15px;max-width:80%;transform:rotate(-3deg);text-align:right;color:#97a58c}
@media(max-width:1050px){
  .cover-keepsake{min-height:500px;padding:20px 25px 42px 30px}
  .keepsake-note{width:73px;min-height:73px;left:-5px;top:70px;font-size:15px}
  .keepsake-flower{right:-4px;bottom:85px}
}
@media(max-width:720px){
  .cover-keepsake{width:min(100%,390px);height:auto;min-height:0;padding:20px 25px 38px;margin:4px auto 0}
  .cover-memory{width:100%;max-width:310px;padding:10px 10px 0}
  .cover-memory::before{inset:-9px 6px 6px -9px;transform:rotate(-4deg)}
  .keepsake-caption{min-height:41px;font-size:14px;padding:7px 5px}
  .keepsake-tape{top:11px;width:86px;height:25px;left:calc(50% - 43px)}
  .keepsake-note{top:55px;left:-7px;width:66px;min-height:66px;padding:12px 7px;font-size:14px}
  .keepsake-flower{right:-1px;bottom:64px;font-size:34px}
  .keepsake-corner{right:27px;bottom:0;font-size:14px}
}
@media(prefers-reduced-motion:reduce){.cover-memory{transition:none}}

/* Small secrets, a memory jar, and a letter at the end. */
.cover-flip-turn{position:relative;transform-style:preserve-3d;transition:transform .65s cubic-bezier(.2,.7,.25,1)}
.cover-memory{perspective:1200px;background:var(--paper);border:1px solid #e9e7dd}
.cover-memory.is-flipped .cover-flip-turn{transform:rotateY(180deg)}
.cover-photo-front{display:block;width:100%;padding:0;border:0;background:transparent;border-radius:2px;backface-visibility:hidden}
.cover-photo-back{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:25px;padding:25px 20px;backface-visibility:hidden;transform:rotateY(180deg);border:1px dashed #e9d4d0;border-radius:2px;background:#fff7f0;background-image:repeating-linear-gradient(0deg,transparent 0 29px,#f0e6d94d 29px 30px);text-align:center}
.cover-photo-back p{font:clamp(22px,2vw,27px)/1.9 "KaiTi","Kaiti SC",var(--font);color:#ad7680;overflow-wrap:anywhere}
.secret-heart{font:60px/1 Georgia,serif;color:var(--heart)}
.secret-flower{font:24px Georgia,serif;color:#d5c595}
.cover-secret-toggle{display:inline-flex;align-items:center;justify-content:center;gap:7px;border:0;background:transparent;padding:4px 9px;min-height:30px;border-radius:20px;font-size:12px;line-height:1.5;color:#9a7f80}
.cover-secret-toggle:hover{background:#fbf0eb}
.random-memory{margin:30px auto 34px;max-width:340px}
.random-memory h3{font-size:15px;font-weight:500;letter-spacing:2px;color:#809782;margin-bottom:12px}
.memory-jar{display:inline-flex;flex-direction:column;align-items:center;gap:10px;background:none;border:0;border-radius:15px;padding:5px 24px;font-size:13px;color:#829682}
.memory-jar:disabled{opacity:.4;cursor:default}
.jar-drawing{display:block;position:relative;width:88px;height:90px;border:1.5px solid #c4d9c6;border-radius:12px 12px 22px 22px;background:#fffffc6e;box-shadow:inset 5px 0 0 #fff9}
.jar-lid{position:absolute;left:-4px;right:-4px;top:-5px;height:13px;background:#e2eddb;border:1px solid #c4d9c6;border-radius:5px}
.jar-roll{position:absolute;width:39px;height:15px;border-radius:5px;border:1px solid #dce4d3;box-shadow:0 2px 2px #68745008}
.roll-mint{background:#e4f2e1;left:8px;bottom:20px;transform:rotate(-15deg)}
.roll-rose{background:#f7e5e4;border-color:#e8d5d4;right:8px;bottom:13px;transform:rotate(18deg)}
.roll-cream{background:#f7edcf;border-color:#e6ddc0;left:27px;bottom:34px;transform:rotate(-28deg)}
.jar-heart{position:absolute;left:0;right:0;top:15px;font:27px/1 Georgia,serif;color:#dda3aa}
.memory-jar:hover .jar-drawing{transform:rotate(-5deg)}
.jar-drawing{transition:transform .2s}
.ending-envelope{max-width:500px;margin:0 auto 28px}
.ending-envelope summary{list-style:none;cursor:pointer;display:flex;flex-direction:column;align-items:center;gap:10px;width:fit-content;margin:0 auto;font-size:13px;color:#879784;border-radius:8px}
.ending-envelope summary::-webkit-details-marker{display:none}
.envelope-drawing{display:block;position:relative;width:146px;height:91px;background:#fff8e9;border:1px solid #e6dfc9;border-radius:4px;box-shadow:0 4px 8px #7b866908;overflow:hidden}
.envelope-drawing::before{content:"";position:absolute;width:112px;height:112px;left:16px;top:-78px;background:#fbf0db;border:1px solid #e4d9bc;transform:rotate(45deg);border-radius:5px}
.envelope-drawing::after{content:"";position:absolute;left:7px;right:7px;bottom:-28px;height:70px;border-top:1px solid #eadfc9;transform:rotate(-30deg);opacity:.65}
.envelope-seal{position:absolute;left:calc(50% - 14px);top:29px;display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:#f4dfe0;border:1px solid #edcace;color:#c5838b;font:21px/1 Georgia,serif;z-index:1}
.letter-open-label{display:none}
.ending-envelope[open] .letter-closed-label{display:none}
.ending-envelope[open] .letter-open-label{display:inline}
.ending-envelope[open] .envelope-seal{background:#fff7ed}
.letter-paper{margin-top:18px;padding:26px 30px 18px;text-align:left;background:#fffdf6;border:1px solid #e9e5d5;border-radius:3px;box-shadow:0 4px 12px #7d8b6d09;animation:letter-unfold .4s ease-out}
.letter-paper .ending-note{margin:0;max-width:none;font-size:16px;line-height:2.1;color:#71866f}
.letter-sign{display:block;text-align:right;font:28px Georgia,serif;color:var(--heart);margin-top:12px}
@keyframes letter-unfold{from{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:720px){.cover-photo-back{gap:18px;padding:20px 12px}.cover-photo-back p{font-size:22px}.letter-paper{padding:23px 20px 16px}.random-memory{margin:25px auto 30px}.local-editor-link{position:static;margin-bottom:18px}}
@media(prefers-reduced-motion:reduce){.cover-flip-turn,.jar-drawing{transition:none}.letter-paper{animation:none}}

.together-clock{width:fit-content;max-width:100%;margin-top:24px;padding:13px 17px 15px;border:1px solid #e0ebdc;border-radius:15px 5px 15px 5px;background:linear-gradient(120deg,#f1f8ec,#fbf9ee);box-shadow:0 3px 0 #edf3e9}
.together-clock-label{display:flex;align-items:center;gap:8px;color:#869982;font-size:12px;letter-spacing:1px;margin-bottom:5px}
.together-clock-label>span:first-child{color:var(--heart);font:20px/1 Georgia,serif}
.together-elapsed{display:flex;flex-wrap:wrap;gap:4px 11px;align-items:baseline;color:#84947d}
.elapsed-part{display:inline-flex;align-items:baseline;gap:3px;white-space:nowrap;font-size:12px}
.elapsed-part strong{font:500 26px/1.35 Georgia,serif;font-variant-numeric:tabular-nums;color:#9f7d83;min-width:.55em}
.together-clock+.primary-link{margin-top:23px}
@media(max-width:720px){.together-clock{margin-top:20px;padding:12px 13px}.together-elapsed{gap:4px 9px}.elapsed-part strong{font-size:24px}.elapsed-part{font-size:11px}.together-clock-label{font-size:11px}}
