*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --paper: #faf9f6;
  --paper-warm: #f3efe7;
  --ink: #171614;
  --ink-sub: #4b4741;
  --ink-soft: #8d877f;
  --accent: #9b7a4b;
  --seal: #9c4a3c;
  --line: rgba(23, 22, 20, 0.1);
  --line-strong: rgba(23, 22, 20, 0.22);
  --danger: #b2423a;
  --display: "ZCOOL XiaoWei", "Noto Serif SC", "Songti SC", Georgia, serif;
  --serif: "Noto Serif SC", "Songti SC", "STSong", Georgia, serif;
  --sans: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", Consolas, monospace;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  cursor: pointer;
}

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* =========================================================
   RAZOR-THIN TOP READING PROGRESS THREAD
   ========================================================= */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 55;
  background: rgba(23, 22, 20, 0.04);
  transition: opacity 0.3s ease;
}

body.on-cover .reading-progress {
  opacity: 0;
}

.reading-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #b6976a, #8b6a42);
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* =========================================================
   OPENING COVER PAGE (《少年不再》)
   ========================================================= */
.cover-screen {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: radial-gradient(circle at 70% 44%, #ffffff 0%, #faf9f6 54%, #f1ede4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 5vw, 72px);
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.012);
  transition: opacity 0.48s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.48s cubic-bezier(0.22, 1, 0.36, 1);
}

body.on-cover .cover-screen {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

body.on-cover .gallery-topbar,
body.on-cover .side-nav {
  opacity: 0;
  pointer-events: none;
}

.cover-inner {
  width: 100%;
  max-width: 1180px;
  display: grid;
  grid-template-columns: 0.94fr 1.06fr;
  gap: clamp(40px, 7vw, 104px);
  align-items: center;
}

.cover-editorial {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 440px;
}

/* Bespoke Staggered Editorial Title: 少 年 / 不 再 */
.cover-title {
  margin: 0 0 12px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3.3rem, 5.4vw, 4.9rem);
  line-height: 1.12;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  outline: none;
  letter-spacing: 0.06em;
}

.title-row {
  display: inline-flex;
  align-items: baseline;
  background: linear-gradient(180deg, #151412 0%, #3d3832 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.title-row.row-2 {
  padding-left: 1.12em;
  margin-top: 0.04em;
  background: linear-gradient(180deg, #322e29 0%, #6d655b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.title-gap {
  display: inline-block;
  width: 0.32em;
}

.title-brush-rule {
  width: 156px;
  height: 12px;
  color: var(--accent);
  margin: 0 0 38px 2px;
}

/* Minimal Hairline Year Index */
.cover-toc {
  width: min(320px, 100%);
  border-top: 1px solid var(--line);
  margin-bottom: 40px;
}

.toc-row {
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 13px 2px;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  color: var(--ink-sub);
  transition: color 0.2s ease, padding-left 0.24s ease, border-color 0.2s ease;
}

.toc-row:hover {
  color: var(--ink);
  padding-left: 8px;
  border-bottom-color: var(--line-strong);
}

.toc-year { font-size: 0.9rem; color: var(--ink); letter-spacing: 0.14em; }
.toc-count { font-size: 0.74rem; color: var(--ink-soft); transition: color 0.2s ease; }
.toc-row:hover .toc-count { color: var(--accent); }

/* Minimal Literary Entry Row */
.cover-entry-row {
  display: flex;
  align-items: center;
  gap: 28px;
}

.cover-open-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border: none;
  border-bottom: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1rem;
  letter-spacing: 0.2em;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.open-line {
  width: 34px;
  height: 1px;
  background: currentColor;
  transition: width 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.open-arrow { font-family: var(--sans); font-size: 0.95rem; }

.cover-open-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.cover-open-link:hover .open-line { width: 52px; }

.cover-subtle-link {
  border: none;
  background: transparent;
  padding: 6px 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 0.84rem;
  letter-spacing: 0.12em;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.cover-subtle-link:hover {
  color: var(--ink);
  border-bottom-color: var(--line-strong);
}

/* Right Side: Physical Print Stack */
.cover-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.print-stack {
  position: relative;
  width: min(480px, 42vw);
  aspect-ratio: 4 / 4.25;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stack-card {
  position: absolute;
  background: #ffffff;
  border: 1px solid rgba(22, 21, 19, 0.07);
  border-radius: 2px;
  box-shadow: 0 20px 54px rgba(28, 24, 18, 0.14), 0 3px 10px rgba(28, 24, 18, 0.07);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.45s ease;
}

.stack-back-left {
  width: 78%;
  padding: 14px 14px 12px;
  transform: translate(-15%, 4%) rotate(-5.5deg);
  opacity: 0.86;
  z-index: 1;
}

.stack-back-right {
  width: 78%;
  padding: 14px 14px 12px;
  transform: translate(15%, -3%) rotate(5deg);
  opacity: 0.88;
  z-index: 2;
}

.print-stack:hover .stack-back-left { transform: translate(-18%, 5%) rotate(-7deg); }
.print-stack:hover .stack-back-right { transform: translate(18%, -4%) rotate(6.5deg); }

.stack-front {
  position: relative;
  z-index: 4;
  width: 86%;
  padding: 18px 18px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stack-front:hover {
  transform: translateY(-5px);
  box-shadow: 0 28px 70px rgba(28, 24, 18, 0.2), 0 6px 16px rgba(28, 24, 18, 0.1);
}

.stack-mat {
  width: 100%;
  aspect-ratio: 4 / 3.35;
  background: #f2efe9;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.stack-mat img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.38s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.stack-front:hover .stack-mat img { transform: scale(1.022); }

.stack-front.is-native-frame { padding: 10px; }
.stack-front.is-native-frame .stack-mat { aspect-ratio: 3 / 3.6; background: #ffffff; box-shadow: none; }
.stack-front.is-native-frame .stack-mat img { object-fit: contain; }
.stack-front.is-native-frame .stack-front-chin { display: none; }

.stack-mini-chin {
  padding-top: 10px;
  text-align: center;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: 0.62rem;
  letter-spacing: 0.24em;
  color: rgba(22, 21, 19, 0.45);
}

.stack-front-chin {
  width: 100%;
  padding-top: 15px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.stack-front-brand {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: 0.84rem;
  letter-spacing: 0.26em;
  color: #111111;
}

.stack-front-meta {
  font-size: 0.72rem;
  color: var(--ink-sub);
  letter-spacing: 0.04em;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stack-front-author { font-size: 0.66rem; color: var(--ink-soft); letter-spacing: 0.1em; }

.cover-dots { display: inline-flex; align-items: center; gap: 7px; }
.cover-dot {
  width: 6px;
  height: 6px;
  border: none;
  border-radius: 999px;
  padding: 0;
  background: rgba(22, 21, 19, 0.2);
  transition: all 0.25s ease;
}
.cover-dot:hover { background: rgba(22, 21, 19, 0.48); }
.cover-dot.active { width: 22px; background: var(--ink); }

.cover-footer {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
  opacity: 0.72;
  white-space: nowrap;
}

/* =========================================================
   WHISPER-MINIMAL EXHIBITION TOP BAR (ZERO WRAP!)
   ========================================================= */
.gallery-topbar {
  position: fixed;
  top: 2px;
  left: 0;
  right: 0;
  z-index: 40;
  height: 52px;
  padding: 0 clamp(16px, 3.2vw, 44px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  background: transparent;
  transition: opacity 0.25s ease;
}

body.mode-cropping .gallery-topbar,
body.mode-cropping .side-nav,
body.mode-cropping .poem-margin,
body.mode-cropping .mood-margin {
  opacity: 0;
  pointer-events: none;
}

.topbar-left, .topbar-center, .topbar-right {
  display: flex;
  align-items: center;
  white-space: nowrap;
  min-width: 0;
}

.topbar-left { gap: 10px; }
.topbar-center { justify-content: center; gap: 8px; }
.topbar-right { justify-content: flex-end; gap: 16px; }

.bar-link {
  border: none;
  background: transparent;
  padding: 4px 2px;
  font-family: var(--serif);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.18s ease;
}

.bar-link:hover { color: var(--ink); }
.bar-link.active { color: var(--seal); }
.bar-arrow { font-family: var(--sans); }
.bar-slash { color: rgba(23, 22, 20, 0.2); font-size: 0.78rem; }

.bar-book-title {
  font-family: var(--display);
  font-size: 0.92rem;
  letter-spacing: 0.18em;
  color: var(--ink-sub);
  white-space: nowrap;
}

.bar-nav-arrow {
  border: none;
  background: transparent;
  width: 24px;
  height: 24px;
  color: rgba(23, 22, 20, 0.35);
  font-size: 1.05rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: color 0.16s ease;
}

.bar-nav-arrow:hover { color: var(--ink); }

.bar-folio {
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  color: var(--ink-sub);
  white-space: nowrap;
}

.bar-date-chip {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  padding-left: 8px;
  border-left: 1px solid var(--line);
  white-space: nowrap;
}

.mobile-only-item { display: none; }

/* Overflow Menu */
.more-menu-wrap { position: relative; flex-shrink: 0; }
body.read-only .more-menu-wrap { display: none; }
body.read-only .meta-caption,
body.read-only .poem-text { cursor: default; }
body.read-only .meta-caption:hover { border-bottom-color: transparent; }

@media (max-width: 720px) {
  body.read-only .more-menu-wrap { display: block; }
}

.bar-icon-more {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  font-size: 1rem;
  display: grid;
  place-items: center;
  transition: background 0.16s ease, color 0.16s ease;
}

.bar-icon-more:hover { background: rgba(23, 22, 20, 0.05); color: var(--ink); }

.more-dropdown {
  position: absolute;
  top: 34px;
  right: 0;
  min-width: 176px;
  padding: 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(23, 22, 20, 0.1);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.1);
  display: none;
  flex-direction: column;
  gap: 2px;
}

.more-dropdown.open { display: flex; }

.dropdown-item {
  width: 100%;
  border: none;
  background: transparent;
  padding: 7px 10px;
  border-radius: 5px;
  font-size: 0.78rem;
  color: var(--ink-sub);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  white-space: nowrap;
  transition: background 0.14s ease, color 0.14s ease;
}

.dropdown-item:hover { background: rgba(23, 22, 20, 0.05); color: var(--ink); }
.dropdown-item.danger:hover { background: rgba(178, 66, 58, 0.08); color: var(--danger); }
.dropdown-item .mono { font-size: 0.68rem; color: var(--ink-soft); }
.dropdown-sep { height: 1px; background: var(--line); margin: 4px 6px; }
.dropdown-badge { padding: 1px 6px; border-radius: 999px; background: rgba(23, 22, 20, 0.06); }

/* Side Edge Navigation Arrows */
.side-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 25;
  width: 40px;
  height: 76px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: rgba(22, 21, 19, 0.22);
  font-size: 1.9rem;
  font-weight: 300;
  display: grid;
  place-items: center;
  transition: all 0.2s ease;
}

.side-nav:hover {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(22, 21, 19, 0.07);
  color: var(--ink);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

.side-nav.prev { left: 10px; }
.side-nav.next { right: 10px; }

/* =========================================================
   3-COLUMN SPREAD: LEFT COLOR MOOD · CENTER FRAME · RIGHT POEM
   ========================================================= */
.frame-canvas {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(58px, 7.5vh, 76px) clamp(52px, 5vw, 80px) clamp(18px, 3vh, 32px);
  background: var(--paper);
  user-select: none;
}

.spread-layout {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto minmax(140px, 1fr);
  align-items: center;
  gap: clamp(18px, 3.2vw, 48px);
}

/* =========================================================
   LEFT COLUMN: YEARLY COLOR MOOD (CURRENT YEAR ONLY)
   ========================================================= */
.mood-margin {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: clamp(4px, 1.4vw, 22px);
  padding-bottom: 56px;
  transition: opacity 0.3s ease;
}

.mood-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.mood-year {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--accent);
}

.mood-ribbon-shell {
  padding: 6px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mood-ribbon {
  display: flex;
  flex-direction: column;
  width: 14px;
  height: clamp(185px, 32vh, 270px);
  border-radius: 2px;
  background: rgba(23, 22, 20, 0.04);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  position: relative;
}

.mood-slice {
  flex: 1 1 0;
  width: 100%;
  min-height: 1px;
  cursor: pointer;
  position: relative;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.mood-slice:first-child { border-radius: 2px 2px 0 0; }
.mood-slice:last-child { border-radius: 0 0 2px 2px; }

.mood-slice:hover {
  transform: scaleX(1.65);
  z-index: 3;
}

.mood-slice.is-active {
  transform: scaleX(1.9);
  z-index: 4;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.92), 0 0 0 2px var(--ink);
}

/* =========================================================
   CENTER COLUMN: SONY FINE-ART PHOTO FRAME
   ========================================================= */
.frame-column {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.photo-mount {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-stage {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
}

.photo-stage img {
  display: block;
  max-width: min(60vw, 880px);
  max-height: calc(100vh - clamp(194px, 25vh, 255px));
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(0, 0, 0, 0.06);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.photo-stage img.loaded { opacity: 1; }

.frame-chin {
  flex: 0 0 auto;
  padding-top: clamp(18px, 3vh, 32px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 84px;
}

.chin-brand {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: clamp(0.95rem, 1.35vw, 1.2rem);
  letter-spacing: 0.26em;
  color: #111111;
  line-height: 1;
}

.chin-meta {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55em;
  font-size: clamp(0.74rem, 0.96vw, 0.86rem);
  color: var(--ink-sub);
  letter-spacing: 0.05em;
  line-height: 1.45;
}

.meta-sep { opacity: 0.42; }

.meta-caption {
  cursor: text;
  user-select: text;
  border-bottom: 1px solid transparent;
  padding: 0 3px;
  min-width: 1ch;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.meta-caption:hover { border-bottom-color: rgba(22, 21, 19, 0.28); }

.meta-caption.is-editing {
  color: #111111;
  border-bottom: 1.5px solid #111111;
  background: #ffffff;
  border-radius: 3px;
  padding: 1px 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.meta-caption.is-empty { color: transparent; }
.chin-meta:hover .meta-caption.is-empty { color: rgba(60, 57, 53, 0.36); }
.chin-meta:hover .meta-caption.is-empty::before { content: "添加描述"; }
.meta-caption.is-empty.is-editing { color: #111111; }
.meta-caption.is-empty.is-editing::before { content: none; }

.chin-author {
  font-size: clamp(0.68rem, 0.86vw, 0.76rem);
  color: var(--ink-soft);
  letter-spacing: 0.1em;
}

.frame-canvas.is-editing-caption .chin-author { display: none; }

.caption-edit-bar {
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.frame-canvas.is-editing-caption .caption-edit-bar { display: inline-flex; }

.frame-canvas.is-native-frame:not(.is-cropping) .photo-stage img {
  max-height: calc(100vh - clamp(106px, 13vh, 134px));
  box-shadow: none;
}

.frame-canvas.is-native-frame:not(.is-cropping) .frame-chin { display: none; }

/* =========================================================
   RIGHT COLUMN: VERTICAL POETRY (SHIFTED DOWN 10%, NO RED BOX)
   ========================================================= */
.poem-margin {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-top: 10vh;
  padding-left: clamp(4px, 1.4vw, 22px);
  transition: opacity 0.3s ease;
}

.poem-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.42s ease, transform 0.42s ease;
}

.poem-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.poem-hairline {
  width: 1px;
  height: 30px;
  background: linear-gradient(to bottom, transparent, var(--accent));
  opacity: 0.55;
}

.poem-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(0.94rem, 1.12vw, 1.08rem);
  letter-spacing: 0.28em;
  line-height: 2.35;
  color: var(--ink-sub);
  max-height: 48vh;
  white-space: pre-line;
  user-select: text;
  outline: none;
  padding: 6px 4px;
  border-radius: 3px;
  transition: color 0.2s ease, background 0.2s ease;
}

.poem-text:hover { color: var(--ink); }

.poem-text.is-editing {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
  outline: 1px solid var(--line-strong);
}

.poem-season {
  writing-mode: vertical-rl;
  font-family: var(--serif);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  color: var(--ink-soft);
}

/* =========================================================
   INLINE DRAG-TO-CROP MODE
   ========================================================= */
.crop-overlay {
  display: none;
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
}

.frame-canvas.is-cropping .crop-overlay { display: block; }
.frame-canvas.is-cropping .chin-brand,
.frame-canvas.is-cropping .chin-meta,
.frame-canvas.is-cropping .chin-author,
.frame-canvas.is-cropping .caption-edit-bar { display: none; }

.crop-box {
  position: absolute;
  border: 1.5px solid #ffffff;
  box-shadow: 0 0 0 9999px rgba(14, 14, 16, 0.58);
  cursor: move;
}

.crop-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to right, transparent 33.2%, rgba(255, 255, 255, 0.34) 33.3%, transparent 33.6%, transparent 66.5%, rgba(255, 255, 255, 0.34) 66.6%, transparent 67%),
    linear-gradient(to bottom, transparent 33.2%, rgba(255, 255, 255, 0.34) 33.3%, transparent 33.6%, transparent 66.5%, rgba(255, 255, 255, 0.34) 66.6%, transparent 67%);
}

.crop-handle { position: absolute; z-index: 3; }
.h-nw, .h-ne, .h-sw, .h-se { width: 20px; height: 20px; }
.h-nw { top: -3px; left: -3px; cursor: nwse-resize; border-top: 3px solid #fff; border-left: 3px solid #fff; }
.h-ne { top: -3px; right: -3px; cursor: nesw-resize; border-top: 3px solid #fff; border-right: 3px solid #fff; }
.h-sw { bottom: -3px; left: -3px; cursor: nesw-resize; border-bottom: 3px solid #fff; border-left: 3px solid #fff; }
.h-se { bottom: -3px; right: -3px; cursor: nwse-resize; border-bottom: 3px solid #fff; border-right: 3px solid #fff; }
.h-n, .h-s { left: 22px; right: 22px; height: 12px; cursor: ns-resize; }
.h-n { top: -6px; }
.h-s { bottom: -6px; }
.h-w, .h-e { top: 22px; bottom: 22px; width: 12px; cursor: ew-resize; }
.h-w { left: -6px; }
.h-e { right: -6px; }

.crop-bar { display: none; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.frame-canvas.is-cropping .crop-bar { display: inline-flex; }
.crop-ratios, .crop-actions { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.crop-divider { width: 1px; height: 16px; background: rgba(22, 21, 19, 0.16); }

.mini-btn {
  border: 1px solid rgba(22, 21, 19, 0.16);
  background: #ffffff;
  color: var(--ink-sub);
  font-size: 0.78rem;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
  transition: all 0.16s ease;
}

.mini-btn:hover { border-color: var(--ink); color: var(--ink); }
.mini-btn.active, .mini-btn.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.mini-btn.primary:hover { opacity: 0.88; }
.mini-btn:disabled { opacity: 0.4; cursor: default; }

/* =========================================================
   TOAST NOTIFICATION & DRAWERS
   ========================================================= */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 75;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(22, 21, 19, 0.92);
  color: #faf9f6;
  font-size: 0.8rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.toast-undo {
  display: none;
  border: none;
  background: rgba(255, 255, 255, 0.16);
  color: #f3d8a8;
  font-size: 0.76rem;
  padding: 3px 10px;
  border-radius: 999px;
}
.toast-undo:hover { background: rgba(255, 255, 255, 0.26); }
.toast.with-undo .toast-undo { display: inline-block; }

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(14, 14, 16, 0.26);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.side-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  background: #ffffff;
  border-left: 1px solid rgba(22, 21, 19, 0.1);
  box-shadow: -16px 0 48px rgba(0, 0, 0, 0.12);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
}

.side-drawer.open { transform: translateX(0); }
.catalog-drawer { width: min(560px, 94vw); }
.trash-drawer { width: min(390px, 92vw); }

.drawer-head {
  padding: 20px 22px 16px;
  border-bottom: 1px solid rgba(22, 21, 19, 0.08);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.drawer-title { margin: 0 0 4px; font-family: var(--serif); font-size: 1.05rem; font-weight: 500; letter-spacing: 0.08em; }
.drawer-sub { margin: 0; font-size: 0.76rem; color: var(--ink-soft); }

.drawer-close {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(22, 21, 19, 0.12);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-sub);
  display: grid;
  place-items: center;
}

.drawer-close:hover { background: rgba(22, 21, 19, 0.06); color: var(--ink); }

.catalog-year-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-bottom: 1px solid rgba(22, 21, 19, 0.07);
}

.cat-year-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.78rem;
  padding: 4px 12px;
  border-radius: 999px;
  transition: all 0.16s ease;
}

.cat-year-btn:hover { color: var(--ink); }
.cat-year-btn.active { border-color: var(--ink); color: var(--ink); background: var(--paper); }

.catalog-grid {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 28px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-content: start;
}

.cat-thumb-card {
  background: var(--paper);
  border: 1px solid rgba(22, 21, 19, 0.08);
  border-radius: 2px;
  padding: 8px 8px 7px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.cat-thumb-card:hover { transform: translateY(-2px); border-color: var(--ink-soft); }
.cat-thumb-card.is-current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cat-thumb-box { width: 100%; aspect-ratio: 4 / 3; background: #ece9e2; overflow: hidden; }
.cat-thumb-box img { width: 100%; height: 100%; object-fit: cover; }
.cat-thumb-title { font-size: 0.74rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-thumb-meta { font-family: var(--mono); font-size: 0.64rem; color: var(--ink-soft); }

.drawer-list { flex: 1; overflow-y: auto; padding: 16px 18px 28px; display: flex; flex-direction: column; gap: 12px; }
.drawer-empty { padding: 56px 16px; text-align: center; font-size: 0.84rem; color: var(--ink-soft); }
.trash-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 8px; border: 1px solid rgba(22, 21, 19, 0.08); background: #faf9f6; }
.trash-thumb { width: 64px; height: 48px; border-radius: 3px; object-fit: cover; background: #ece9e2; flex-shrink: 0; }
.trash-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.trash-title { font-size: 0.84rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trash-meta { font-family: var(--mono); font-size: 0.7rem; color: var(--ink-soft); }
.trash-restore-btn { border: 1px solid rgba(22, 21, 19, 0.16); background: #ffffff; color: var(--ink); font-size: 0.74rem; padding: 5px 11px; border-radius: 999px; flex-shrink: 0; }
.trash-restore-btn:hover { background: var(--ink); color: #ffffff; border-color: var(--ink); }

/* =========================================================
   TABLET & MOBILE RESPONSIVE ADAPTATION
   ========================================================= */
@media (max-width: 1040px) {
  .spread-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto auto;
    gap: 10px;
    align-items: center;
  }

  .frame-column {
    order: 1;
    height: auto;
    max-height: 100%;
    min-height: 0;
  }

  .photo-stage img {
    max-width: calc(100vw - 44px);
    max-height: calc(100dvh - 305px);
  }

  .frame-chin {
    padding-top: 16px;
    min-height: auto;
    gap: 5px;
  }

  /* Poem becomes clean centered 2-line caption below frame */
  .poem-margin {
    order: 2;
    height: auto;
    justify-content: center;
    padding: 4px 12px 2px;
  }

  .poem-card {
    flex-direction: column;
    gap: 6px;
  }

  .poem-hairline { display: none; }

  .poem-text {
    writing-mode: horizontal-tb;
    letter-spacing: 0.1em;
    line-height: 1.75;
    font-size: 0.86rem;
    text-align: center;
    max-height: none;
    padding: 0;
  }

  .poem-season {
    writing-mode: horizontal-tb;
    font-size: 0.68rem;
    letter-spacing: 0.16em;
  }

  /* Yearly Color Mood becomes slim horizontal ribbon at bottom */
  .mood-margin {
    order: 3;
    height: auto;
    justify-content: center;
    padding: 6px 12px 4px;
  }

  .mood-panel {
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }

  .mood-ribbon-shell {
    padding: 0;
  }

  .mood-ribbon {
    flex-direction: row;
    width: min(220px, 58vw);
    height: 8px;
  }

  .mood-slice:first-child { border-radius: 2px 0 0 2px; }
  .mood-slice:last-child { border-radius: 0 2px 2px 0; }
  .mood-slice:hover { transform: scaleY(1.8); }
  .mood-slice.is-active { transform: scaleY(2.1); }
}

@media (max-width: 920px) {
  .cover-screen {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 36px 24px 32px;
  }

  .cover-footer {
    position: static;
    transform: none;
    margin-top: 32px;
  }

  .cover-inner {
    grid-template-columns: 1fr;
    gap: 32px;
    margin: auto 0;
  }

  .cover-editorial {
    max-width: 100%;
  }

  .cover-visual {
    order: -1;
    gap: 14px;
  }

  .print-stack {
    width: min(300px, 74vw);
    aspect-ratio: 4 / 4.1;
  }

  .stack-front { padding: 12px 12px 10px; }
  .stack-back-left, .stack-back-right { padding: 10px 10px 8px; }
  .stack-front-chin { padding-top: 10px; gap: 3px; }
  .stack-front-brand { font-size: 0.72rem; }
  .stack-front-meta { font-size: 0.64rem; }
  .stack-front-author { font-size: 0.6rem; }

  .cover-title { font-size: clamp(2.4rem, 11vw, 3.2rem); }
  .title-brush-rule { margin-bottom: 24px; }
  .cover-toc { width: 100%; margin-bottom: 26px; }
}

@media (max-width: 720px) {
  .gallery-topbar {
    height: 48px;
    padding: 0 12px;
  }

  .bar-book-title,
  .bar-slash,
  .bar-date-chip,
  .desktop-only-btn {
    display: none;
  }

  .mobile-only-item {
    display: flex;
  }

  .topbar-right { gap: 10px; }
  .bar-link { font-size: 0.8rem; }
  .bar-folio { font-size: 0.74rem; }

  .side-nav { display: none; }

  .frame-canvas {
    padding: 54px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  }

  .photo-stage img {
    max-width: calc(100vw - 28px);
    max-height: calc(100dvh - 290px);
  }

  .chin-meta {
    font-size: 0.72rem;
    gap: 0.45em;
  }

  .poem-text {
    font-size: clamp(0.76rem, 3.4vw, 0.84rem);
    letter-spacing: 0.04em;
    line-height: 1.8;
  }

  .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px 14px 24px;
  }

  .toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
    justify-content: space-between;
  }
}
