/* 📷 装修相册 — album.css（2026-09-28，27 号美化）
   一本布面相册：封面（贴着家的拍立得）→ 能走进去的旧房子（三张入场券）→ 目录（一章一条索引）→ 每一章：
   拍立得照片（白边、顶上一截纸胶带、字写在白边上）、澄澄说的话（绿便签，靠左）、小狗的小纸条（蜜色便签，靠右）。
   颜色：墨线和办公室同一支笔 #6b5138；封面是澄澄绿的布，标签是小狗的蜜色。字：霞鹜文楷（整套切片，按需下载）。 */

:root {
  --ink: #6b5138;
  --text: #5a4535;
  --muted: #9a8470;
  --page: #f5ead8;
  --paper: #fffbf3;
  --sage: #9bb893;
  --sage-d: #7c9c74;
  --honey: #f6d98a;
  --deer-paper: #e6f0de;
  --deer-ink: #5c7d55;
  --dog-paper: #fcefcd;
  --dog-ink: #9a6a26;
  --tape-g: rgba(158, 196, 150, .8);
  --tape-h: rgba(244, 208, 120, .85);
  --tape-p: rgba(234, 166, 152, .75);
  --hand: 'LXGW WenKai', -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh; min-height: 100dvh;
  font-family: var(--hand); color: var(--text); line-height: 1.6;
  background-color: var(--page);
  background-image:
    radial-gradient(rgba(140, 100, 55, .07) 1px, transparent 1.6px),
    radial-gradient(rgba(255, 255, 255, .55) 1px, transparent 1.6px);
  background-size: 11px 11px, 17px 17px;
  background-position: 0 0, 5px 8px;
}
body.lb-open { overflow: hidden; }
.wrap { max-width: 560px; margin: 0 auto; padding: 0 16px 64px; }
.loading { text-align: center; padding: 120px 0; color: var(--muted); }
a:focus-visible, button:focus-visible { outline: 3px solid rgba(224, 123, 57, .6); outline-offset: 2px; }

/* 翻页的时候淡进来（只动透明度，不碰 transform——照片自己有歪的角度） */
.wrap > section, .wrap > header, .items > * { animation: fadeIn .35s ease both; }
@keyframes fadeIn { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .wrap > section, .wrap > header, .items > * { animation: none; } }

/* ===== 顶上：回办公室 / 回目录 ===== */
.top { height: 52px; display: flex; align-items: center; }
.back { color: #b0703a; text-decoration: none; font-size: 15px; padding: 8px 4px; }

/* ===== 封面：布面相册 ===== */
.cover { padding: 4px 0 6px; text-align: center; }
.book {
  position: relative; width: min(290px, 84%); aspect-ratio: 5 / 6; margin: 8px auto 0;
  background-color: var(--sage);
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .09) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(50, 70, 40, .08) 0 1px, transparent 1px 3px);
  border: 3px solid var(--ink); border-radius: 6px 16px 16px 6px;
  box-shadow: 7px 8px 0 rgba(107, 81, 56, .2);
  transform: rotate(-1.5deg);
}
.book::before {   /* 书脊 */
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 26px;
  background: var(--sage-d); border-right: 3px solid var(--ink); border-radius: 3px 0 0 3px;
}
.book::after {    /* 书脊上的缝线 */
  content: ''; position: absolute; left: 11px; top: 12px; bottom: 12px; border-left: 2px dashed rgba(255, 250, 235, .75);
}
.snap {           /* 封面上贴的拍立得：家 */
  position: absolute; left: 21%; right: 9%; top: 8%;
  background: #fff; padding: 7px 7px 24px; transform: rotate(3deg);
  box-shadow: 1px 3px 7px rgba(60, 40, 20, .3);
}
.snap svg { display: block; width: 100%; height: auto; }
.snap::before {
  content: ''; position: absolute; top: -9px; left: 50%; width: 58px; height: 18px; margin-left: -29px;
  background: var(--tape-h); transform: rotate(-5deg);
}
.label {
  position: absolute; left: 17%; right: 6%; bottom: 7%;
  background: var(--honey); border: 3px solid var(--ink); border-radius: 6px;
  padding: 7px 10px 8px; transform: rotate(-2deg); box-shadow: 0 3px 0 rgba(107, 81, 56, .35);
}
.label h1 { font-size: 26px; font-weight: 700; color: var(--ink); letter-spacing: 4px; line-height: 1.25; }
.label p { font-size: 12px; color: #8a6a3e; letter-spacing: 1px; }
.stats { margin-top: 18px; font-size: 13px; color: var(--muted); letter-spacing: 1px; }

/* ===== 小标题 ===== */
.sec { margin-top: 30px; }
.sec-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 16px; font-weight: 700; color: var(--ink); }
.sec-title::after { content: ''; flex: 1; border-top: 2px dashed rgba(107, 81, 56, .25); }

/* ===== 能走进去的旧房子：入场券（上半截画门，虚线撕口，下半截写字） ===== */
.museums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ticket {
  position: relative; display: flex; flex-direction: column; align-items: center;
  text-align: center; text-decoration: none; color: var(--text);
  background: var(--paper); border: 2.5px solid var(--ink); border-radius: 10px;
  padding: 10px 6px 10px; box-shadow: 0 3px 0 rgba(107, 81, 56, .25);
  -webkit-tap-highlight-color: transparent; transition: transform .12s;
}
.ticket::before, .ticket::after {   /* 撕口两边的半圆缺口，和下面的虚线对齐 */
  content: ''; position: absolute; top: 55px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--page); border: 2.5px solid var(--ink);
}
.ticket::before { left: -7.5px; clip-path: inset(0 0 0 50%); }
.ticket::after { right: -7.5px; clip-path: inset(0 50% 0 0); }
.ticket svg { width: 28px; height: 36px; }
.ticket .stub { align-self: stretch; margin: 10px 6px 8px; border-top: 2px dashed rgba(107, 81, 56, .35); }
.ticket .dr { fill: #f3c795; }
.ticket.k1 .dr { fill: #cfe0b8; }
.ticket.k2 .dr { fill: #eeaa9c; }
.ticket b { font-size: 13px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.ticket small { font-size: 10.5px; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.ticket .t-note { color: #b0703a; white-space: pre-line; }
.ticket:active { transform: translateY(2px); }

/* ===== 目录：一章一条，左边是日期索引签 ===== */
.toc { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.toc a {
  display: flex; align-items: stretch; text-decoration: none; color: var(--text);
  background: var(--paper); border: 2.5px solid var(--ink); border-radius: 12px; overflow: hidden;
  box-shadow: 0 3px 0 rgba(107, 81, 56, .22); -webkit-tap-highlight-color: transparent; transition: transform .12s;
}
.toc a:active { transform: translateY(2px); }
.toc-date {
  flex: 0 0 auto; display: flex; align-items: center; padding: 0 10px;
  background: var(--honey); border-right: 2.5px solid var(--ink);
  font-size: 14px; font-weight: 700; color: var(--ink); letter-spacing: .5px;
}
.toc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: 10px 12px; }
.toc-main b { font-size: 17px; color: var(--ink); line-height: 1.35; }
.toc-main small { font-size: 12px; color: var(--muted); line-height: 1.45; }
.toc-main .toc-n { color: #b0703a; margin-top: 2px; }
.toc-thumb {
  flex: 0 0 auto; align-self: center; width: 58px; height: 62px; margin-right: 12px;
  background: #fff; padding: 3px 3px 8px; transform: rotate(3deg); box-shadow: 1px 2px 5px rgba(60, 40, 20, .28);
}
.toc-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; background: #f3ece2; }
.empty { color: var(--muted); font-size: 13px; }
.fine { margin-top: 28px; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.7; }

/* ===== 一章的开头 ===== */
.ch-head { text-align: center; padding: 4px 0 6px; }
.stamp {
  display: inline-block; font-size: 13px; font-weight: 700; color: #c0584a; letter-spacing: 1px;
  border: 2px solid #c0584a; border-radius: 6px; padding: 0 10px; transform: rotate(-4deg); opacity: .85;
}
.ch-head h1 {
  display: inline; font-size: 30px; font-weight: 700; color: var(--ink); letter-spacing: 4px; line-height: 1.9;
  background-image: linear-gradient(transparent 60%, rgba(246, 210, 120, .7) 60%, rgba(246, 210, 120, .7) 88%, transparent 88%);
}
.ch-head h1::before { content: ''; display: block; }
.ch-sub { font-size: 14px; color: #8a6a3e; }
.ch-by { font-size: 12px; color: var(--muted); margin-top: 2px; }

.items { display: flex; flex-direction: column; gap: 24px; margin-top: 22px; }

/* ===== 拍立得 ===== */
.ph {
  position: relative; margin: 0 2px; background: #fff; padding: 8px 8px 10px;
  transform: rotate(var(--r, 0deg));
  box-shadow: 0 2px 3px rgba(60, 40, 20, .1), 0 8px 18px rgba(60, 40, 20, .14);
}
.ph::before {     /* 纸胶带 */
  content: ''; position: absolute; z-index: 2; top: -10px; left: 50%; width: 78px; height: 20px; margin-left: -39px;
  background: var(--tape-g); transform: rotate(-3deg);
}
.ph.tape-h::before { background: var(--tape-h); transform: rotate(2deg); }
.ph.tape-p::before { background: var(--tape-p); transform: rotate(-1.5deg); }
.ph-frame {
  position: relative; display: block; width: 100%; padding: 0; border: 0; background: #f3ece2;
  cursor: zoom-in; -webkit-tap-highlight-color: transparent; font: inherit; color: inherit;
}
.ph-frame img { display: block; width: 100%; height: auto; }
.ph-frame.tall { height: 460px; overflow: hidden; }
.ph-frame.tall img { height: 100%; object-fit: cover; object-position: 50% var(--focus, 0%); }   /* --focus：露哪一截（album.json 的 focus，0 = 最上面，100 = 最下面） */
.ph-frame.tall::after {   /* 很长的截图：先露上面一截，下面渐渐变白 */
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 110px;
  background: linear-gradient(rgba(255, 255, 255, 0), #fff 82%);
}
.more {
  position: absolute; z-index: 1; left: 50%; bottom: 12px; transform: translateX(-50%);
  font-size: 12.5px; color: var(--ink); background: var(--paper); border: 2px solid var(--ink);
  border-radius: 999px; padding: 1px 12px; white-space: nowrap;
}
.ph figcaption { padding: 9px 4px 0; font-size: 14.5px; color: var(--text); text-align: center; line-height: 1.5; word-break: break-word; }

/* 两张并排（装修前 / 装修后） */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.pair .ph { padding: 6px 6px 8px; margin: 0; }
.pair .ph-frame.tall { height: 330px; }
.pair .ph figcaption { font-size: 13px; }
.ph-label {
  position: absolute; z-index: 3; top: -12px; left: 6px; font-size: 12px; font-weight: 700; color: var(--ink);
  background: var(--honey); border: 2px solid var(--ink); border-radius: 6px; padding: 0 7px; transform: rotate(-4deg);
}
.pair-cap { margin-top: -12px; text-align: center; font-size: 14px; }

/* ===== 便签：澄澄说的话（绿，靠左）/ 小狗的小纸条（蜜色，靠右） ===== */
.say {
  position: relative; padding: 12px 14px 13px; border-radius: 3px;
  transform: rotate(var(--r, 0deg)); box-shadow: 1px 3px 7px rgba(60, 40, 20, .15);
}
.say::before {    /* 贴便签的一小截透明胶 */
  content: ''; position: absolute; top: -8px; left: 20px; width: 44px; height: 15px;
  background: rgba(255, 255, 255, .62); transform: rotate(-6deg); box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
}
.say.deer { background: var(--deer-paper); margin: 0 38px 0 6px; }
.say.dog { background: var(--dog-paper); margin: 0 6px 0 38px; }
.say.dog::before { left: auto; right: 20px; transform: rotate(5deg); }
.who { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; }
.deer .who { color: var(--deer-ink); }
.dog .who { color: var(--dog-ink); }
.who i {
  font-style: normal; display: inline-flex; align-items: center; justify-content: center;
  width: 25px; height: 25px; border-radius: 50%; background: #fff; border: 2px solid currentColor; font-size: 13px;
}
.say p { margin-top: 5px; font-size: 15.5px; line-height: 1.7; color: #4f3d2e; white-space: pre-line; word-break: break-word; }

/* ===== 翻页 ===== */
.pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin-top: 36px; }
.pager a {
  min-width: 0; padding: 8px 12px; font-size: 14px; color: var(--ink); text-decoration: none; text-align: center;
  background: var(--paper); border: 2px solid var(--ink); border-radius: 999px; box-shadow: 0 2px 0 rgba(107, 81, 56, .25);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pager a:first-child { justify-self: start; }
.pager a:last-child { justify-self: end; }
.pager .pager-toc { background: var(--honey); }

/* ===== 没登录：请去办公室敲门 ===== */
.door-card {
  margin: 18vh auto 0; max-width: 300px; text-align: center;
  background: rgba(255, 255, 255, .7); border: 2.5px solid var(--ink); border-radius: 18px;
  padding: 26px 20px 28px; box-shadow: 6px 7px 0 #d9b98a;
}
.door-card svg { width: 58px; height: auto; }
.door-card p { margin: 10px 0 16px; color: var(--ink); }
.door-go {
  display: inline-block; padding: 10px 18px; color: #fff8ec; text-decoration: none; text-shadow: 0 1px 0 var(--ink);
  background: #e07b39; border: 2.5px solid var(--ink); border-radius: 10px; box-shadow: 0 3px 0 #a9553f;
}

/* ===== 灯箱 ===== */
.lb { position: fixed; inset: 0; z-index: 50; background: rgba(38, 28, 20, .95); }
.lb[hidden] { display: none; }
.lb-scroll {
  position: absolute; inset: 0; display: flex; overflow: auto; padding: 60px 0 88px;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-x pan-y;
}
.lb-scroll img { display: block; flex: 0 0 auto; margin: auto; width: 100%; max-width: none; height: auto; background: #fff; cursor: zoom-in; }
.lb-x {
  position: fixed; top: 10px; right: 12px; z-index: 2; width: 44px; height: 44px; border-radius: 50%;
  border: 2.5px solid #fff8ec; background: rgba(0, 0, 0, .35); color: #fff8ec; font-size: 26px; line-height: 1;
  font-family: var(--hand); cursor: pointer;
}
.lb-foot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1; pointer-events: none; text-align: center;
  padding: 18px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(rgba(38, 28, 20, 0), rgba(38, 28, 20, .92) 45%);
}
.lb-cap { color: #fff8ec; font-size: 15px; }
.lb-hint { margin-top: 2px; color: rgba(255, 248, 236, .55); font-size: 12px; }
