/* ============================================================
   摄影集 · 翻页书 —— 纸质画册美学
   翻页引擎：StPageFlip（vendor/page-flip.browser.js，MIT）
   ============================================================ */

:root {
  color: #26251f;
  background: #c8c3b7;
  font-family: Georgia, "Times New Roman", "Songti SC", "SimSun", serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

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

body {
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.38), transparent 34rem),
    linear-gradient(145deg, #d4d0c7, #b5afa3);
}

button, .back {
  color: inherit;
  font: inherit;
}

.room {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 100dvh;
  padding: 22px clamp(16px, 3vw, 44px) 18px;
}

/* ---------------- 顶栏 ---------------- */

.book-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  width: min(100%, 1180px);
  margin: 0 auto;
}

.book-header .back {
  justify-self: start;
  font: 600 11px/1.2 Arial, sans-serif;
  letter-spacing: 0.14em;
  color: #4e4a41;
  text-decoration: none;
  border-bottom: 1px solid rgba(78, 74, 65, 0.35);
  padding-bottom: 2px;
}

.book-header .back:hover { color: #26251f; }

.book-header h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.08em;
}

#orientation {
  justify-self: end;
  color: #5c574d;
  font: 600 10px/1.2 Arial, sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ---------------- 书的舞台 ---------------- */

.stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 18px 0;
  perspective: 1800px;
}

/* 桌面上的柔影 */
.stage::after {
  position: absolute;
  bottom: 8%;
  left: 50%;
  z-index: -1;
  width: min(82vw, 1000px);
  height: 10%;
  border-radius: 50%;
  background: rgba(31, 28, 22, 0.3);
  content: "";
  filter: blur(28px);
  transform: translateX(-50%);
}

.book-rig {
  display: grid;
  place-items: center;
  width: min(100%, 960px);
  height: min(64dvh, 640px);
}

.book {
  position: relative;
  isolation: isolate;
  filter: drop-shadow(0 24px 26px rgba(31, 28, 22, 0.22));
}

/* ---------------- 纸页 ---------------- */

.book-page {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, transparent 96%, rgba(30, 27, 20, 0.05)),
    #f2eee4;
  color: #29271f;
}

/* 靠近书缝的凹痕阴影（StPageFlip 会给页面加 --left / --right 类） */
.book-page.--left::before,
.book-page.--right::before {
  position: absolute;
  inset-block: 0;
  z-index: 3;
  width: clamp(14px, 4%, 28px);
  content: "";
  pointer-events: none;
}

.book-page.--left::before {
  right: 0;
  background: linear-gradient(to left, rgba(27, 24, 20, 0.3), rgba(27, 24, 20, 0.08) 42%, transparent);
}

.book-page.--right::before {
  left: 0;
  background: linear-gradient(to right, rgba(27, 24, 20, 0.3), rgba(27, 24, 20, 0.08) 42%, transparent);
}

/* 纸张颗粒 */
.book-page::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E");
  content: "";
  mix-blend-mode: multiply;
}

/* ---------------- 封面 / 封底 ---------------- */

.cover, .back-cover {
  background: #243f39;
  color: #f0e9d8;
}

.cover {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
}

.cover-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(240, 233, 216, 0.65);
  border-radius: 50%;
  font: 400 15px Georgia, serif;
}

.cover h2 {
  margin: 12px 0 0;
  font-size: 58px;
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0.04em;
}

.cover .sub {
  margin: 14px 0 0;
  color: rgba(240, 233, 216, 0.75);
}

.kicker, .folio, .caption, .page-number, .cover .sub {
  font-family: Arial, sans-serif;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ---------------- 扉页 / 结尾页 ---------------- */

.title-page, .closing-page {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 56px;
}

.title-page .kicker { color: #7a715f; margin: 0 0 18px; }

.title-page h2, .closing-page > p:first-child {
  margin: 0;
  font-size: 34px;
  font-weight: 400;
  line-height: 1.25;
}

.title-page .stats {
  margin: 26px 0 0;
  color: #6d675b;
  font-family: Arial, sans-serif;
  font-size: 11px;
  letter-spacing: 0.14em;
}

.closing-page { text-align: left; }

.closing-page .mark {
  margin: 0 0 22px;
  font: 400 12px Georgia, serif;
  letter-spacing: 0.3em;
  color: #7a715f;
}

.inside-cover { background: #ded8ca; }

.back-cover { padding: 48px; }

.back-cover .mark {
  align-self: flex-end;
  color: rgba(240, 233, 216, 0.65);
  font-family: Arial, sans-serif;
  font-size: 10px;
  letter-spacing: 0.2em;
}

/* ---------------- 照片版式 ---------------- */

.photo-layout img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 满版照片 */
.photo-layout--full .photo {
  position: absolute;
  inset: 0;
}

/* 留白装裱 + 图注 */
.photo-layout--framed {
  display: flex;
  flex-direction: column;
  padding: 44px 44px 76px;
}

.photo-layout--framed .photo {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.photo-layout--framed .caption {
  margin: 16px 0 0;
  color: #55503f;
  line-height: 1.6;
  text-transform: none;
  font-size: 11px;
}

.photo-layout--framed .caption b {
  font-family: Georgia, serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.06em;
}

/* 上下双图 */
.photo-layout--split {
  display: grid;
  grid-template-rows: 1.2fr 0.8fr;
  gap: 14px;
  padding: 36px;
}

.photo-layout--split .photo { overflow: hidden; position: relative; }

.photo-layout--split .caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 18px 14px 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent);
  color: #fff;
  text-transform: none;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.page-number {
  position: absolute;
  right: 26px;
  bottom: 22px;
  z-index: 2;
  color: #6d675b;
}

.page-number--light { color: rgba(255, 255, 255, 0.9); }

/* ---------------- 控制条 ---------------- */

.controls {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 20px;
  max-width: 440px;
  margin: 0 auto;
}

.controls button {
  width: 48px;
  height: 42px;
  border: 1px solid rgba(38, 37, 31, 0.25);
  border-radius: 50%;
  background-color: rgba(242, 238, 228, 0.48);
  cursor: pointer;
  font-size: 16px;
}

.controls button:hover:not(:disabled) { background-color: rgba(242, 238, 228, 0.85); }

.controls button:disabled {
  cursor: default;
  opacity: 0.28;
}

.status {
  display: grid;
  gap: 4px;
  text-align: center;
}

.status span {
  font: 600 11px Arial, sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.status small {
  color: #655f55;
  font: 10px/1.4 Arial, sans-serif;
  letter-spacing: 0.04em;
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 700px) {
  .room { padding-inline: 10px; }

  .book-header { grid-template-columns: 1fr auto; }

  .book-header h1 { font-size: 15px; }

  #orientation { display: none; }

  .book-rig { height: min(60dvh, 640px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
