/* =========================================================
   手账本视觉层
   保留原有交互，只覆盖页面、照片与批注的呈现。
   ========================================================= */

:root {
  --journal-ink: #514752;
  --journal-muted: #8f818d;
  --journal-paper: #f7f0e5;
  --journal-paper-2: #fffaf1;
  --journal-line: rgba(126, 111, 126, .13);
  --journal-pink: #e7b6c8;
  --journal-violet: #b7a1c7;
  --journal-sage: #aebca8;
  --journal-tape: rgba(242, 218, 179, .76);
  --font-hand: "Kaiti SC", "STKaiti", "KaiTi", "Songti SC", serif;
}

body {
  background:
    radial-gradient(circle at 20% 15%, rgba(231, 182, 200, .16), transparent 32%),
    radial-gradient(circle at 82% 78%, rgba(183, 161, 199, .13), transparent 34%),
    #332c35;
}

body::after {
  opacity: .03;
}

#deck {
  color: var(--journal-ink);
}

.page {
  isolation: isolate;
  width: min(100%, 760px);
  margin-inline: auto;
  background:
    linear-gradient(90deg, transparent 0 30px, rgba(222, 151, 161, .20) 30px 31px, transparent 31px),
    repeating-linear-gradient(0deg, transparent 0 27px, var(--journal-line) 27px 28px),
    var(--journal-paper);
  box-shadow: 0 18px 60px rgba(16, 10, 18, .28);
}

.page::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 8%, rgba(255,255,255,.72), transparent 24%),
    linear-gradient(110deg, transparent 75%, rgba(93,72,89,.05));
  mix-blend-mode: multiply;
}

/* ---------- 封面与章节：像手账内页，而不是深色海报 ---------- */
.page--cover,
.page--chapter,
.page--ending,
.page--record-player {
  background:
    linear-gradient(90deg, transparent 0 30px, rgba(222, 151, 161, .20) 30px 31px, transparent 31px),
    repeating-linear-gradient(0deg, transparent 0 27px, var(--journal-line) 27px 28px),
    var(--journal-paper);
  color: var(--journal-ink);
}

.page--cover::before,
.page--chapter::before,
.page--ending::before,
.page--record-player::before {
  content: "";
  position: absolute;
  width: 132px;
  height: 34px;
  inset: auto;
  left: 50%;
  top: 34px;
  transform: translateX(-50%) rotate(-2deg);
  background: var(--journal-tape);
  opacity: .84;
  aspect-ratio: auto;
  animation: none;
  clip-path: polygon(3% 10%, 98% 0, 95% 94%, 0 100%);
  box-shadow: 0 2px 5px rgba(91, 68, 62, .08);
}

.cover-glow {
  background:
    radial-gradient(circle, rgba(231,182,200,.30), rgba(183,161,199,.13) 43%, transparent 68%);
}

.cover-kicker,
.ch-no {
  color: #987f98;
}

.cover-title {
  width: min(100%, 520px);
  font-family: var(--font-hand);
  font-size: clamp(36px, 10.8vw, 58px);
  line-height: 1.2;
  letter-spacing: .02em;
  word-break: keep-all;
  background: linear-gradient(155deg, #5e4e5b 8%, #b2748e 62%, #7c6891);
  -webkit-background-clip: text;
  background-clip: text;
}

.cover-sub,
.ch-sub,
.end-lines {
  color: var(--journal-muted);
}

.cover-enter,
.end-replay {
  color: var(--journal-ink);
  border-color: rgba(178, 116, 142, .34);
  background: rgba(255,250,241,.72);
  box-shadow: 0 8px 24px rgba(93, 70, 86, .08);
}

.ch-title,
.end-title {
  font-family: var(--font-hand);
  color: #645360;
}

.end-title {
  white-space: pre-line;
}

.page--postscript .end-lines {
  margin-top: 28px;
  color: #645360;
  font-family: var(--font-hand);
  font-size: clamp(28px, 8.5vw, 38px);
  line-height: 1.8;
}

.page--postscript .end-lines p + p {
  margin-top: 8px;
}

/* ---------- 唱片机页 ---------- */
.page--record-player {
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.record-player {
  --record-wood: #9b654f;
  --record-wood-dark: #714637;
  position: relative;
  width: min(78vw, 320px);
  aspect-ratio: .9;
  padding: 0;
  border: 0;
  appearance: none;
  color: inherit;
  background: transparent;
  cursor: pointer;
  filter: drop-shadow(0 22px 22px rgba(70, 45, 45, .18));
  -webkit-tap-highlight-color: transparent;
}

.record-player:focus-visible {
  outline: 2px solid rgba(178, 116, 142, .72);
  outline-offset: 9px;
  border-radius: 22px;
}

.record-player:active {
  transform: translateY(2px) rotate(-.25deg);
}

.record-lid,
.record-case {
  display: block;
  position: absolute;
  left: 0;
  width: 100%;
  box-sizing: border-box;
}

.record-lid {
  top: 1%;
  left: 4%;
  width: 92%;
  height: 39%;
  z-index: 0;
  border: 3px solid var(--record-wood-dark);
  border-radius: 15px 15px 7px 7px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.13), transparent 38%),
    repeating-linear-gradient(90deg, rgba(82,48,36,.05) 0 2px, transparent 2px 11px),
    #ad745a;
  box-shadow:
    inset 0 0 0 5px rgba(255, 240, 220, .10),
    0 7px 0 rgba(85, 52, 41, .20);
  transform: perspective(420px) rotateX(-17deg);
  transform-origin: 50% 100%;
}

.record-lid::after {
  content: "";
  position: absolute;
  inset: 13px;
  border: 1px solid rgba(84, 49, 38, .22);
  border-radius: 8px;
}

.record-case {
  bottom: 3%;
  height: 67%;
  z-index: 1;
  border: 3px solid var(--record-wood-dark);
  border-radius: 18px 18px 22px 22px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.13), transparent 32%),
    repeating-linear-gradient(100deg, rgba(70,42,35,.045) 0 2px, transparent 2px 12px),
    var(--record-wood);
  box-shadow:
    inset 0 0 0 5px rgba(255, 235, 211, .08),
    inset 0 -9px 0 rgba(91, 51, 42, .10);
}

.record-platter {
  position: absolute;
  left: 8%;
  top: 13%;
  width: 68%;
  z-index: 2;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #c1aaa1;
  box-shadow:
    0 3px 0 #6f544d,
    0 8px 13px rgba(47, 27, 27, .28);
}

.record-platter::after {
  content: "";
  position: absolute;
  inset: -7%;
  border: 2px solid rgba(244, 213, 179, .72);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.record-disc {
  position: absolute;
  inset: 4%;
  z-index: 2;
  display: block;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 2px, #f4d5b3 2.5px 17%, transparent 17.5%),
    repeating-radial-gradient(circle, #211d21 0 2px, #353036 2px 4px);
  box-shadow:
    inset 0 0 15px rgba(255,255,255,.06),
    0 2px 5px rgba(25,17,20,.45);
  transform: translate(-17%, -12%) scale(.82);
  transform-origin: 50% 50%;
  transition: transform .72s cubic-bezier(.2,.78,.22,1);
  will-change: transform;
}

.record-disc::before {
  content: "";
  position: absolute;
  inset: 35%;
  border-radius: 50%;
  background:
    radial-gradient(circle, #4c3b45 0 4%, transparent 5%),
    linear-gradient(135deg, #e9b6c5, #d5aa80);
  box-shadow: 0 0 0 1px rgba(255,255,255,.12);
}

.record-disc::after {
  content: "✦";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding-top: 15%;
  box-sizing: border-box;
  color: rgba(92, 63, 73, .58);
  font-size: 10px;
}

.record-arm {
  position: absolute;
  right: 12%;
  top: 13%;
  width: 10px;
  height: 56%;
  z-index: 3;
  border-radius: 999px;
  background: linear-gradient(90deg, #d4c7bb, #867b74 54%, #eee7df);
  box-shadow: 1px 2px 3px rgba(47,29,29,.28);
  transform: rotate(-17deg);
  transform-origin: 50% 10px;
  transition: transform .65s cubic-bezier(.2,.8,.2,1);
}

.record-arm::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -7px;
  width: 28px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #d4bda8;
  border: 3px solid #725348;
  box-shadow: 0 3px 5px rgba(54,31,29,.27);
  transform: translateX(-50%);
}

.record-arm i {
  position: absolute;
  left: 50%;
  bottom: -10px;
  width: 23px;
  height: 34px;
  border-radius: 4px 4px 8px 8px;
  background: linear-gradient(90deg, #5f4d49, #9b8075);
  transform: translateX(-50%);
}

.record-knob {
  position: absolute;
  right: 11%;
  bottom: 10%;
  width: 27px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #f0dac0, #8e6c5d 68%);
  border: 2px solid #68483f;
  box-shadow: 0 2px 3px rgba(54,31,29,.25);
}

.record-switch {
  position: absolute;
  right: 25%;
  bottom: 13%;
  width: 25px;
  height: 9px;
  border-radius: 999px;
  background: #66483f;
  box-shadow: inset 8px 0 0 #e5cdb6;
}

.record-sleeve {
  position: absolute;
  left: 3%;
  bottom: -7%;
  z-index: 5;
  width: 57%;
  aspect-ratio: 1;
  border: 2px solid rgba(104, 76, 69, .30);
  border-radius: 4px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.35), transparent 34%),
    repeating-linear-gradient(25deg, rgba(131,94,94,.045) 0 3px, transparent 3px 10px),
    #ead6cc;
  box-shadow:
    0 11px 18px rgba(57, 34, 35, .22),
    inset 0 0 0 6px rgba(255,255,255,.16);
  transform: rotate(-4deg);
  transform-origin: 50% 100%;
  transition: opacity .58s ease, transform .76s cubic-bezier(.2,.8,.2,1);
}

.record-sleeve::before {
  content: "";
  position: absolute;
  inset: 24%;
  border-radius: 50%;
  background:
    radial-gradient(circle, #735867 0 5%, transparent 6%),
    linear-gradient(145deg, #e7b6c8, #c9b2d3);
  box-shadow:
    0 0 0 9px rgba(255,255,255,.24),
    0 0 0 10px rgba(111,78,96,.10);
}

.record-sleeve::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -2px;
  width: 35%;
  height: 9%;
  border-radius: 0 0 999px 999px;
  background: rgba(111, 80, 87, .15);
  transform: translateX(-50%);
}

.record-sleeve i {
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 12%;
  height: 2px;
  background: rgba(114, 82, 91, .16);
  box-shadow:
    0 -7px 0 rgba(114, 82, 91, .12),
    0 -14px 0 rgba(114, 82, 91, .08);
}

.record-player.is-taking-out .record-disc {
  transform: translate(-17%, -40%) scale(.9) rotate(-8deg);
}

.record-player.is-taking-out .record-sleeve {
  transform: translateY(5px) rotate(-4deg);
}

.record-player.is-placing .record-disc,
.record-player.is-ready .record-disc {
  transform: translate(0, 0) scale(1) rotate(0);
}

.record-player.is-placing .record-disc {
  transition-duration: .9s;
  transition-timing-function: cubic-bezier(.24,.8,.2,1);
}

.record-player.is-placing .record-sleeve,
.record-player.is-ready .record-sleeve {
  opacity: 0;
  transform: translate(-34px, 46px) rotate(-13deg) scale(.94);
}

.record-player.is-placing .record-platter::after {
  animation: record-land .9s .38s ease-out both;
}

.record-player.is-playing .record-disc {
  animation: record-spin 3.6s linear infinite;
}

.record-player.is-playing .record-arm {
  transform: rotate(10deg);
}

.record-prompt {
  position: absolute;
  left: 50%;
  bottom: calc(var(--safe-b) + 38px);
  z-index: 4;
  width: max-content;
  max-width: calc(100% - 56px);
  margin: 0;
  padding: 10px 17px;
  border: 1px solid rgba(112, 83, 96, .13);
  border-radius: 999px;
  color: #6d5966;
  background: rgba(255, 250, 241, .94);
  box-shadow: 0 8px 24px rgba(72, 48, 61, .13);
  font-family: var(--font-hand);
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity .24s ease, transform .24s ease;
}

.record-prompt.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.page--continuation[hidden] {
  display: none;
}

.page--continuation .end-title {
  width: min(100%, 330px);
  font-size: clamp(34px, 10vw, 50px);
  line-height: 1.55;
  letter-spacing: .04em;
}

@keyframes record-spin {
  to { transform: rotate(360deg); }
}

@keyframes record-land {
  0% { opacity: 0; transform: scale(.72); }
  36% { opacity: .82; }
  100% { opacity: 0; transform: scale(1.08); }
}

/* ---------- 日期页 ---------- */
.journal-page {
  padding:
    calc(var(--safe-t) + 46px)
    clamp(24px, 7vw, 46px)
    calc(var(--safe-b) + 24px);
}

.journal-page::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  width: 12px;
  opacity: .42;
  background:
    radial-gradient(circle, #8f818d 0 2px, transparent 2.5px)
    center 14px / 12px 27px repeat-y;
}

.journal-head {
  z-index: 8;
  margin: 0 0 12px;
  min-height: 48px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 5px 13px;
}

.journal-head .day-date {
  color: #5e505c;
}

.journal-head .day-date b {
  font-family: var(--font-hand);
  font-size: clamp(28px, 8vw, 38px);
}

.journal-head .day-date span {
  color: var(--journal-muted);
}

.journal-head .day-place {
  margin: 0 0 3px;
  color: #8a7685;
  font-family: var(--font-hand);
  font-size: 13px;
}

.journal-head .day-place::before {
  background: var(--ch-tone, var(--journal-pink));
}

.journal-head .day-mood {
  position: relative;
  inset: auto;
  margin: 0 0 2px auto;
  padding: 4px 9px;
  color: #745d6c;
  border: 1px dashed rgba(116,93,108,.28);
  background: rgba(255,250,241,.72);
  font-family: var(--font-hand);
  transform: rotate(2deg);
}

.journal-layout {
  position: relative;
  z-index: 3;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 7px 18px;
  scrollbar-width: none;
}

.journal-layout::-webkit-scrollbar {
  display: none;
}

.journal-layout::before,
.journal-layout::after {
  position: absolute;
  z-index: 1;
  color: color-mix(in srgb, var(--ch-tone, var(--journal-pink)) 64%, #8d7284);
  font-family: var(--font-hand);
  line-height: 1;
  pointer-events: none;
}

.journal-layout::before {
  content: "✦";
  right: 3px;
  top: 2px;
  font-size: 18px;
  transform: rotate(12deg);
}

.journal-layout::after {
  content: "♡";
  left: 0;
  bottom: 2px;
  font-size: 24px;
  transform: rotate(-12deg);
}

.journal-collage {
  position: relative;
  z-index: 2;
  width: 100%;
}

/* ---------- 照片：永远按真实宽高比显示 ---------- */
.ph.scrapbook-photo {
  position: relative;
  inset: auto;
  display: block;
  flex: none;
  min-width: 0;
  height: auto;
  margin: 0;
  padding: 7px 7px 10px;
  overflow: visible;
  border: 0;
  border-radius: 2px;
  background: var(--journal-paper-2);
  box-shadow:
    0 8px 16px rgba(73, 55, 69, .16),
    0 1px 2px rgba(73, 55, 69, .18);
  transform-origin: 50% 20%;
}

.ph.scrapbook-photo::before {
  content: "";
  position: absolute;
  z-index: 6;
  left: 50%;
  top: -10px;
  width: 58px;
  height: 21px;
  transform: translateX(-50%) rotate(-2deg);
  background: var(--journal-tape);
  opacity: .86;
  clip-path: polygon(5% 8%, 96% 0, 100% 85%, 0 100%);
  box-shadow: 0 1px 2px rgba(74, 55, 62, .08);
  pointer-events: none;
}

.ph-media {
  position: relative;
  width: 100%;
  aspect-ratio: var(--photo-ratio, 1);
  min-height: 0;
  overflow: hidden;
  border-radius: 1px;
  background: var(--tone, #d9d1ca);
}

.ph.scrapbook-photo img,
.ph.scrapbook-photo video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.ph.scrapbook-photo img.ready,
.ph.scrapbook-photo video.ready {
  opacity: 1;
}

.ph-caption {
  display: block;
  padding: 8px 5px 2px;
  color: rgba(75, 60, 72, .78);
  font-family: var(--font-hand);
  font-size: clamp(13px, 2.6vw, 17px);
  line-height: 1.45;
  letter-spacing: 0;
  text-align: center;
  word-break: break-word;
}

.journal-collage .scrapbook-photo:nth-child(6n+1) {
  transform: rotate(-2.4deg);
}

.journal-collage .scrapbook-photo:nth-child(6n+2) {
  transform: rotate(2.1deg);
}

.journal-collage .scrapbook-photo:nth-child(6n+3) {
  transform: rotate(-1.2deg);
}

.journal-collage .scrapbook-photo:nth-child(6n+4) {
  transform: rotate(2.8deg);
}

.journal-collage .scrapbook-photo:nth-child(6n+5) {
  transform: rotate(-1.7deg);
}

.journal-collage .scrapbook-photo:nth-child(6n+6) {
  transform: rotate(.8deg);
}

.journal-collage .scrapbook-photo:nth-child(3n+2)::before {
  background: rgba(211, 207, 172, .78);
  transform: translateX(-50%) rotate(3deg);
}

.journal-collage .scrapbook-photo:nth-child(4n+3)::before {
  background: rgba(222, 194, 207, .78);
}

.page.is-active .ph--motion img {
  animation: journal-breathe 13s ease-out both;
}

@keyframes journal-breathe {
  from { transform: scale(1.012); }
  to { transform: scale(1); }
}

/* ---------- 批注便签：内容全部来自现有数据 ---------- */
.journal-annotations {
  position: relative;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  margin: 15px 2px 0;
}

.journal-note {
  position: relative;
  max-width: min(100%, 340px);
  padding: 10px 13px 11px;
  color: #665762;
  border: 1px solid rgba(116, 93, 108, .10);
  background: rgba(255, 247, 202, .82);
  box-shadow: 3px 5px 10px rgba(76, 55, 70, .08);
  font-family: var(--font-hand);
  font-size: clamp(12px, 3.4vw, 15px);
  line-height: 1.65;
  white-space: pre-line;
}

.journal-note::after {
  content: "";
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, transparent 49%, rgba(111,91,105,.11) 50%);
}

.journal-note:nth-child(3n+1) {
  transform: rotate(-1deg);
}

.journal-note:nth-child(3n+2) {
  background: rgba(238, 221, 231, .88);
  transform: rotate(1.2deg);
}

.journal-note:nth-child(3n+3) {
  background: rgba(223, 232, 216, .88);
  transform: rotate(-.6deg);
}

.journal-note--title {
  font-size: clamp(15px, 4.1vw, 19px);
}

/* ---------- 按照片数量变化的拼贴 ---------- */
.journal-focus .journal-layout {
  justify-content: center;
}

.journal-focus .journal-collage {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 0;
}

.journal-focus .scrapbook-photo {
  width: min(94%, 520px);
}

.journal-focus .scrapbook-photo.is-portrait {
  width: min(72%, 330px);
}

.journal-focus--left .scrapbook-photo {
  margin-right: auto;
}

.journal-focus--right .scrapbook-photo {
  margin-left: auto;
}

.journal-focus .journal-layout:has(.scrapbook-photo.is-portrait):has(.journal-annotations) {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(108px, .65fr);
  align-items: center;
  gap: 9px;
}

.journal-focus .journal-layout:has(.scrapbook-photo.is-portrait) .journal-annotations {
  align-content: center;
  margin: 0;
}

.journal-focus .journal-layout:has(.scrapbook-photo.is-portrait) .scrapbook-photo {
  width: min(94%, 330px);
}

.journal-duo .journal-collage {
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  align-items: center;
  gap: clamp(7px, 3vw, 18px);
  padding: 10px 0 8px;
}

.journal-duo .scrapbook-photo:nth-child(2) {
  margin-top: 34px;
}

.journal-duo--reverse .scrapbook-photo:first-child {
  order: 2;
  margin-top: 31px;
}

.journal-duo--reverse .scrapbook-photo:nth-child(2) {
  margin-top: 0;
}

.journal-duo .journal-annotations {
  align-self: flex-end;
  width: min(78%, 360px);
  margin-top: -3px;
}

.journal-trio .journal-collage {
  display: grid;
  grid-template-columns: 1.18fr .82fr;
  grid-template-rows: auto auto;
  gap: clamp(7px, 2.5vw, 15px);
  align-items: center;
}

.journal-trio .scrapbook-photo:first-child {
  grid-row: 1 / 3;
}

.journal-trio .scrapbook-photo:nth-child(3) {
  margin-left: -14px;
}

.journal-trio--reverse .scrapbook-photo:first-child {
  grid-column: 2;
}

.journal-trio--reverse .scrapbook-photo:nth-child(2),
.journal-trio--reverse .scrapbook-photo:nth-child(3) {
  grid-column: 1;
}

.journal-trio .journal-annotations {
  width: min(84%, 390px);
  margin: 10px auto 0;
}

.journal-grid .journal-collage {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(9px, 3vw, 18px);
  align-items: start;
  padding: 8px 0;
}

.journal-grid .scrapbook-photo:nth-child(even) {
  margin-top: 22px;
}

.journal-grid--dense .journal-collage {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(7px, 2vw, 12px);
}

.journal-grid--dense .scrapbook-photo {
  padding: 4px 4px 7px;
}

.journal-grid--dense .scrapbook-photo::before {
  top: -7px;
  width: 38px;
  height: 15px;
}

/* 04.05：把竖长图当主贴，左边错落放小图 */
.page[data-date="2026-04-05"] .journal-collage {
  grid-template-columns: minmax(0, .82fr) minmax(0, 1.08fr);
  grid-auto-flow: dense;
  gap: clamp(7px, 2.2vw, 12px);
  align-items: center;
}

.page[data-date="2026-04-05"] .scrapbook-photo {
  padding-bottom: 7px;
}

.page[data-date="2026-04-05"] .scrapbook-photo:nth-child(2) {
  grid-column: 2;
  grid-row: 1 / span 3;
  width: 88%;
  justify-self: center;
  margin-top: 0;
  transform: rotate(2.2deg);
  z-index: 3;
}

.page[data-date="2026-04-05"] .scrapbook-photo:nth-child(1),
.page[data-date="2026-04-05"] .scrapbook-photo:nth-child(3),
.page[data-date="2026-04-05"] .scrapbook-photo:nth-child(4) {
  grid-column: 1;
}

.page[data-date="2026-04-05"] .scrapbook-photo:nth-child(5) {
  grid-column: 1 / -1;
  width: 78%;
  justify-self: end;
  margin-top: -8px;
  transform: rotate(-1.6deg);
}

/* 04.10：两张图各自独立一行，像一页里贴了两张大相片 */
.page[data-date="2026-04-10"] .journal-layout {
  justify-content: center;
}

.page[data-date="2026-04-10"] .journal-collage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(16px, 4vw, 24px);
  padding: 6px 0 10px;
}

.page[data-date="2026-04-10"] .scrapbook-photo {
  width: min(92%, 350px);
  justify-self: center;
}

.page[data-date="2026-04-10"] .scrapbook-photo:nth-child(1) {
  transform: rotate(-1.7deg);
}

.page[data-date="2026-04-10"] .scrapbook-photo:nth-child(2) {
  margin-top: 0;
  transform: rotate(1.5deg);
}

/* 04.12：两张照片分别独立成行并放大，便利贴留在照片下方 */
.page[data-date="2026-04-12"] .journal-layout {
  justify-content: flex-start;
}

.page[data-date="2026-04-12"] .journal-collage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(16px, 4vw, 24px);
  padding: 8px 0 10px;
}

.page[data-date="2026-04-12"] .scrapbook-photo {
  width: min(96%, 370px);
  justify-self: center;
}

.page[data-date="2026-04-12"] .scrapbook-photo:nth-child(1) {
  transform: rotate(-1.5deg);
}

.page[data-date="2026-04-12"] .scrapbook-photo:nth-child(2) {
  margin-top: 0;
  transform: rotate(1.3deg);
}

.page[data-date="2026-04-12"] .journal-annotations {
  width: fit-content;
  max-width: 92%;
  margin: 14px auto 0;
  justify-content: center;
}

/* 04.11：竖图保持居中，便利贴独立放在照片下方 */
.page[data-date="2026-04-11"].journal-focus .journal-layout:has(.scrapbook-photo.is-portrait):has(.journal-annotations) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
}

.page[data-date="2026-04-11"] .journal-collage {
  display: flex;
  justify-content: center;
}

.page[data-date="2026-04-11"] .scrapbook-photo {
  margin-inline: auto;
}

.page[data-date="2026-04-11"].journal-focus .journal-layout:has(.scrapbook-photo.is-portrait) .journal-annotations {
  width: fit-content;
  max-width: 86%;
  margin: 14px auto 0;
  justify-content: center;
}

/* 04.13：照片居中，便利贴放在照片下方 */
.page[data-date="2026-04-13"].journal-focus .journal-layout:has(.scrapbook-photo.is-portrait):has(.journal-annotations) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
}

.page[data-date="2026-04-13"] .journal-collage {
  display: flex;
  justify-content: center;
}

.page[data-date="2026-04-13"] .scrapbook-photo {
  margin-inline: auto;
}

.page[data-date="2026-04-13"].journal-focus .journal-layout:has(.scrapbook-photo.is-portrait) .journal-annotations {
  width: fit-content;
  max-width: 86%;
  margin: 14px auto 0;
  justify-content: center;
}

/* 04.18：移除便利贴后，竖图保持页面正中 */
.page[data-date="2026-04-18"] .scrapbook-photo {
  margin-inline: auto;
}

/* 05.20：单张长图放在页面正中 */
.page[data-date="2026-05-20"] .scrapbook-photo {
  margin-inline: auto;
}

/* 06.07：照片居中，便利贴独立放在照片下方 */
.page[data-date="2026-06-07"].journal-focus .journal-layout:has(.scrapbook-photo.is-portrait):has(.journal-annotations) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
}

.page[data-date="2026-06-07"] .journal-collage {
  display: flex;
  justify-content: center;
}

.page[data-date="2026-06-07"] .scrapbook-photo {
  margin-inline: auto;
}

.page[data-date="2026-06-07"].journal-focus .journal-layout:has(.scrapbook-photo.is-portrait) .journal-annotations {
  width: fit-content;
  max-width: 86%;
  margin: 14px auto 0;
  justify-content: center;
}

/* 06.14：图片居中，便利贴独立放在照片下方 */
.page[data-date="2026-06-14"].journal-focus .journal-layout:has(.scrapbook-photo.is-portrait):has(.journal-annotations) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
}

.page[data-date="2026-06-14"] .journal-collage {
  display: flex;
  justify-content: center;
}

.page[data-date="2026-06-14"] .scrapbook-photo {
  margin-inline: auto;
}

.page[data-date="2026-06-14"].journal-focus .journal-layout:has(.scrapbook-photo.is-portrait) .journal-annotations {
  width: fit-content;
  max-width: 86%;
  margin: 14px auto 0;
  justify-content: center;
}

/* 06.29：照片居中，便利贴独立放在照片下方 */
.page[data-date="2026-06-29"].journal-focus .journal-layout:has(.scrapbook-photo.is-portrait):has(.journal-annotations) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
}

.page[data-date="2026-06-29"] .journal-collage {
  display: flex;
  justify-content: center;
}

.page[data-date="2026-06-29"] .scrapbook-photo {
  margin-inline: auto;
}

.page[data-date="2026-06-29"].journal-focus .journal-layout:has(.scrapbook-photo.is-portrait) .journal-annotations {
  width: fit-content;
  max-width: 86%;
  margin: 14px auto 0;
  justify-content: center;
}

/* 07.15：照片居中，便利贴独立放在照片下方 */
.page[data-date="2026-07-15"].journal-focus .journal-layout:has(.scrapbook-photo.is-portrait):has(.journal-annotations) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
}

.page[data-date="2026-07-15"] .journal-collage {
  display: flex;
  justify-content: center;
}

.page[data-date="2026-07-15"] .scrapbook-photo {
  margin-inline: auto;
}

.page[data-date="2026-07-15"].journal-focus .journal-layout:has(.scrapbook-photo.is-portrait) .journal-annotations {
  width: fit-content;
  max-width: 86%;
  margin: 14px auto 0;
  justify-content: center;
}

/* 07.16：照片居中，便利贴独立放在照片下方 */
.page[data-date="2026-07-16"].journal-focus .journal-layout:has(.scrapbook-photo.is-portrait):has(.journal-annotations) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
}

.page[data-date="2026-07-16"] .journal-collage {
  display: flex;
  justify-content: center;
}

.page[data-date="2026-07-16"] .scrapbook-photo {
  margin-inline: auto;
}

.page[data-date="2026-07-16"].journal-focus .journal-layout:has(.scrapbook-photo.is-portrait) .journal-annotations {
  width: fit-content;
  max-width: 86%;
  margin: 14px auto 0;
  justify-content: center;
}

/* 07.17：单张照片放在页面正中 */
.page[data-date="2026-07-17"] .scrapbook-photo {
  margin-inline: auto;
}

/* 所有日期统一：便利贴靠左排列，每张独占一行 */
.journal-page .journal-annotations {
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  align-self: stretch !important;
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.journal-page .journal-note {
  display: block;
  flex: 0 0 auto;
  align-self: flex-start;
  width: fit-content;
  max-width: 100%;
  text-align: left;
}

/* ---------- 视频和结尾 ---------- */
.ph-media .play {
  z-index: 8;
}

.live-badge {
  z-index: 7;
}

.end-sign {
  color: #806778;
}

.petals {
  opacity: .55;
}

#hud {
  color: #f4eaf0;
  text-shadow: 0 1px 8px rgba(34,22,32,.48);
}

#hud-chapter {
  color: #f4eaf0;
}

#music {
  color: #f4eaf0;
  background: rgba(51,44,53,.40);
  backdrop-filter: blur(8px);
}

#rail b {
  background: rgba(255,255,255,.24);
}

#rail b.on {
  background: var(--journal-pink);
}

/* ---------- 小屏与桌面 ---------- */
@media (max-width: 360px) {
  .journal-page {
    padding-inline: 21px;
  }

  .journal-grid--dense .journal-collage {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .journal-grid--dense .scrapbook-photo:nth-child(even) {
    margin-top: 12px;
  }

  .journal-focus .journal-layout:has(.scrapbook-photo.is-portrait):has(.journal-annotations) {
    grid-template-columns: minmax(0, 1.35fr) minmax(92px, .65fr);
  }
}

@media (min-width: 820px) and (min-height: 640px) {
  .page {
    width: min(430px, 100%);
    border-radius: 0;
  }

  #deck {
    width: min(430px, 100%);
    margin-inline: auto;
    box-shadow: 0 0 80px rgba(15, 10, 16, .44);
  }
}

@media (prefers-reduced-motion: reduce) {
  .page.is-active .ph--motion img {
    animation: none;
  }

  .record-player.is-playing .record-disc {
    animation-duration: 12s;
  }
}

/* ------------------------------------------------------------------
   翻页修复（2026-07-28）：journal-layout 不能是内层滚动区。
   外层 #deck 是 y 向强制 snap 的翻页容器；iOS 上手指落在内层
   overflow:auto 的元素上时，同一次手势滚完内层不会传给外层，
   只会橡皮筋回弹——每个单日页都超高 4~57px，于是整本翻不动。
   这里改为 hidden，超出的部分由 app.js 的 fitJournalPages() 缩排版消化。
   ------------------------------------------------------------------ */
.journal-layout {
  overflow-y: hidden;
}
