:root {
  color-scheme: light;
  --ink: #18231f;
  --ink-soft: #5a6762;
  --paper: #f8f4ec;
  --paper-white: #fffdf8;
  --sage: #dce7e1;
  --sage-deep: #28584d;
  --coral: #e95e51;
  --sky: #8dbdca;
  --sun: #d6a625;
  --line: rgba(24, 35, 31, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--sage);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

button,
a {
  color: inherit;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

a {
  text-decoration: none;
}

img,
video {
  display: block;
  max-width: 100%;
}

.album-shell {
  position: relative;
  display: grid;
  grid-template-rows: 76px minmax(0, 1fr);
  width: 100%;
  height: 100svh;
  overflow: hidden;
  background-color: var(--sage);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.18)),
    repeating-linear-gradient(90deg, transparent 0, transparent 79px, rgba(40, 88, 77, 0.04) 80px),
    repeating-linear-gradient(0deg, transparent 0, transparent 79px, rgba(141, 189, 202, 0.035) 80px);
}

.album-shell::before,
.album-shell::after {
  position: absolute;
  z-index: 0;
  content: "";
  pointer-events: none;
}

.album-shell::before {
  top: 76px;
  right: 32px;
  width: 132px;
  height: 1px;
  background: var(--coral);
}

.album-shell::after {
  right: 32px;
  bottom: 24px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sage-deep);
}

.album-toolbar {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 0 32px;
  border-bottom: 1px solid rgba(24, 35, 31, 0.12);
  background: rgba(248, 244, 236, 0.88);
  backdrop-filter: blur(16px);
}

.album-identity {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.identity-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--paper-white);
  border-radius: 50%;
  background: var(--sage-deep);
}

.identity-mark svg {
  width: 19px;
  height: 19px;
  stroke-width: 1.7;
}

.album-identity strong,
.album-identity small {
  display: block;
}

.album-identity strong {
  font-family: "Songti SC", "STSong", serif;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
}

.album-identity small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
}

.album-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-button,
.player-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(24, 35, 31, 0.2);
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.76);
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.tool-button:hover,
.tool-button:focus-visible {
  color: var(--paper-white);
  border-color: var(--sage-deep);
  background: var(--sage-deep);
  transform: translateY(-1px);
}

.tool-button:disabled {
  color: rgba(24, 35, 31, 0.28);
  border-color: rgba(24, 35, 31, 0.1);
  background: rgba(255, 253, 248, 0.36);
  cursor: default;
  transform: none;
}

.tool-button svg,
.player-button svg,
.real-video-play svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.music-button {
  color: var(--coral);
  border-color: rgba(233, 94, 81, 0.3);
}

.music-button.is-playing svg {
  animation: musicBreathe 1.8s ease-in-out infinite;
}

.auto-button.is-active {
  color: var(--sage-deep);
  border-color: rgba(40, 88, 77, 0.34);
}

.auto-button.is-active svg {
  animation: autoPulse 2.4s ease-in-out infinite;
}

@keyframes musicBreathe {
  0%, 100% { transform: scale(0.9); }
  50% { transform: scale(1.1); }
}

@keyframes autoPulse {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 1; }
}

.page-counter {
  min-width: 72px;
  color: var(--ink-soft);
  font-family: Georgia, serif;
  font-size: 12px;
  text-align: center;
}

.overview-button {
  margin-left: 8px;
}

.book-stage {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 0;
  place-items: center;
  overflow: hidden;
  padding: 8px 24px 14px;
}

.book-stage::before {
  position: absolute;
  top: 32px;
  left: 32px;
  color: rgba(24, 35, 31, 0.42);
  content: "FAMILY ALBUM · 2026.09";
  font-size: 9px;
  font-weight: 700;
  writing-mode: vertical-rl;
}

.book-stage::after {
  position: absolute;
  z-index: 0;
  top: 2.5%;
  right: 2.5%;
  bottom: 2.5%;
  left: 2.5%;
  border: 1px solid rgba(40, 88, 77, 0.11);
  background: rgba(255, 253, 248, 0.08);
  content: "";
  pointer-events: none;
}

.book-shadow {
  position: absolute;
  bottom: 20px;
  left: 50%;
  width: min(74vw, 920px);
  height: 48px;
  border-radius: 50%;
  background: rgba(24, 35, 31, 0.2);
  filter: blur(22px);
  transform: translateX(-50%);
}

.book-viewport {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: min(1320px, calc(100vw - 64px));
  height: min(850px, calc(100svh - 100px));
}

.book {
  width: 100%;
  height: auto;
  align-self: center;
}

body[data-book-orientation="portrait"] .book {
  max-width: 620px !important;
}

.stf__parent {
  position: relative;
  display: block;
  box-sizing: border-box;
  transform: translateZ(0);
  touch-action: pan-y;
}

.stf__wrapper {
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.stf__parent canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.stf__block {
  position: absolute;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  perspective: 2000px;
}

.stf__item {
  position: absolute;
  display: none;
  transform-style: preserve-3d;
}

.book-page {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--paper-white);
  box-shadow: inset 0 0 0 1px rgba(24, 35, 31, 0.05);
  user-select: none;
  -webkit-user-select: none;
}

.book-page img {
  -webkit-user-drag: none;
  user-select: none;
}

.book-page::after {
  position: absolute;
  z-index: 20;
  top: 0;
  bottom: 0;
  left: 0;
  width: 12px;
  background: linear-gradient(90deg, rgba(24, 35, 31, 0.12), transparent);
  content: "";
  opacity: 0.45;
  pointer-events: none;
}

.paper-page {
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.22)),
    repeating-linear-gradient(0deg, transparent 0, transparent 5px, rgba(24, 35, 31, 0.016) 6px);
}

.cover-page,
.back-cover {
  color: var(--paper-white);
  background: var(--sage-deep);
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.08);
}

.cover-page > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.cover-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(14, 22, 20, 0.7), rgba(14, 22, 20, 0.04) 70%);
}

.cover-frame {
  position: absolute;
  right: 9%;
  bottom: 8%;
  left: 9%;
  padding: 7% 8%;
  border: 1px solid rgba(255, 255, 255, 0.66);
  background: rgba(25, 47, 41, 0.08);
  backdrop-filter: blur(1px);
}

.cover-kicker,
.cover-date {
  display: block;
  font-size: 9px;
  font-weight: 700;
}

.cover-kicker {
  margin-bottom: 18px;
  color: rgba(255, 255, 255, 0.7);
}

.cover-frame h1 {
  margin: 0 0 28px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 46px;
  font-weight: 400;
  line-height: 1.1;
}

.cover-date {
  color: rgba(255, 255, 255, 0.72);
}

.cover-spine,
.back-cover-spine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 18px;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(16, 34, 29, 0.28);
  box-shadow: 5px 0 18px rgba(11, 20, 18, 0.26);
}

.real-album-page {
  padding: 4%;
}

.page-folio {
  position: absolute;
  z-index: 4;
  top: 2.4%;
  right: 3.5%;
  color: var(--coral);
  font-family: Georgia, serif;
  font-size: 11px;
}

.page-theme-label {
  position: absolute;
  z-index: 4;
  top: 2.7%;
  left: 4%;
  color: var(--sage-deep);
  font-size: 8px;
  font-weight: 700;
}

.theme-christmas .page-theme-label {
  color: var(--coral);
}

.theme-sunshine .page-theme-label {
  color: #9a7418;
}

.theme-family .page-theme-label {
  color: #497785;
}

.photo-mat {
  display: block;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: #e8ece9;
  box-shadow: inset 0 0 0 1px rgba(24, 35, 31, 0.07);
  cursor: zoom-in;
}

.album-photo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #edf0ed;
}

.real-album-page figcaption {
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.55;
}

.single-feature,
.family-feature {
  position: absolute;
  top: 5.5%;
  right: 4%;
  bottom: 3.5%;
  left: 4%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  margin: 0;
}

.single-feature figcaption,
.family-feature figcaption {
  padding: 0 3px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 19px;
  line-height: 1.5;
}

.single-feature.photo-orientation-landscape,
.family-feature.photo-orientation-landscape {
  grid-template-rows: auto auto;
  align-content: center;
  gap: 18px;
}

.single-feature.photo-orientation-landscape .photo-mat,
.family-feature.photo-orientation-landscape .photo-mat {
  aspect-ratio: 3 / 2;
}

.single-feature.photo-orientation-portrait .photo-mat,
.family-feature.photo-orientation-portrait .photo-mat {
  width: min(88%, 470px);
  justify-self: center;
}

.family-feature .photo-mat {
  background: #e6ecee;
}

.family-feature figcaption {
  color: #355c68;
}

.landscape-stack {
  position: absolute;
  top: 5.5%;
  right: 3%;
  bottom: 3%;
  left: 3%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: 7px;
}

.stack-photo {
  position: relative;
  display: block;
  min-height: 0;
  margin: 0;
  overflow: hidden;
}

.stack-photo .photo-mat {
  width: 100%;
  height: 100%;
}

.stack-photo figcaption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 8px 10px;
  color: var(--ink);
  background: rgba(248, 244, 236, 0.9);
  backdrop-filter: blur(5px);
  font-size: 11px;
}

.portrait-pair {
  position: absolute;
  top: 5.5%;
  right: 3%;
  bottom: 3%;
  left: 3%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.pair-photo {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
}

.pair-photo .photo-mat {
  width: 100%;
  height: 100%;
}

.pair-photo figcaption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: 0;
  padding: 9px 9px;
  color: var(--ink);
  background: rgba(248, 244, 236, 0.9);
  backdrop-filter: blur(5px);
  font-size: 11px;
}

.mixed-pair {
  position: absolute;
  top: 8.5%;
  right: 7%;
  bottom: 5%;
  left: 7%;
  display: grid;
  grid-template-rows: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 13px;
}

.mixed-photo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 31%;
  gap: 12px;
  min-height: 0;
  margin: 0;
}

.mixed-photo figcaption {
  align-self: end;
  padding-bottom: 8px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 14px;
}

.mixed-photo.photo-orientation-portrait {
  grid-template-columns: 48% minmax(0, 1fr);
}

.mixed-photo.photo-orientation-portrait figcaption {
  order: -1;
  align-self: center;
}

.page-layout-video {
  padding: 0;
  color: var(--paper-white);
  background: #17211e;
}

.real-video-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  padding: 0;
  color: var(--paper-white);
  background: #17211e;
  cursor: pointer;
  text-align: left;
}

.real-video-poster > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #17211e;
}

.real-video-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(8, 13, 11, 0.82), transparent 62%);
}

.real-video-meta {
  position: absolute;
  z-index: 2;
  right: 8%;
  bottom: 7%;
  left: 8%;
}

.real-video-meta small,
.real-video-meta strong,
.real-video-meta > span {
  display: block;
}

.real-video-meta small {
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 8px;
  font-weight: 700;
}

.real-video-meta strong {
  font-family: "Songti SC", "STSong", serif;
  font-size: 25px;
  font-weight: 400;
  line-height: 1.3;
}

.real-video-meta > span {
  margin-top: 9px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  line-height: 1.55;
}

.real-video-play {
  position: absolute;
  z-index: 3;
  top: 48%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 50%;
  background: rgba(20, 27, 25, 0.2);
  backdrop-filter: blur(7px);
  transform: translate(-50%, -50%);
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.real-video-poster:hover .real-video-play,
.real-video-poster:focus-visible .real-video-play {
  color: var(--ink);
  background: var(--paper-white);
  transform: translate(-50%, -50%) scale(1.06);
}

.back-cover {
  display: grid;
  place-content: center;
  text-align: center;
}

.back-cover-mark {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  margin: 0 auto 34px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 50%;
}

.back-cover-mark svg {
  width: 30px;
  height: 30px;
  stroke-width: 1.4;
}

.back-cover p,
.back-cover small {
  margin: 0;
}

.back-cover p {
  font-family: "Songti SC", "STSong", serif;
  font-size: 19px;
}

.back-cover small {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 8px;
  font-weight: 700;
}

.back-cover-spine {
  right: 0;
  left: auto;
  border-right: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: -5px 0 18px rgba(11, 20, 18, 0.26);
}

.page-overview {
  position: absolute;
  z-index: 40;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 16px 24px 18px;
  border-top: 1px solid rgba(24, 35, 31, 0.14);
  background: rgba(248, 244, 236, 0.96);
  backdrop-filter: blur(18px);
}

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

.overview-track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  max-width: 1120px;
  margin: 0 auto;
  padding: 2px;
  scrollbar-width: thin;
}

.overview-item {
  position: relative;
  flex: 0 0 62px;
  width: 62px;
  height: 78px;
  overflow: hidden;
  padding: 0;
  color: var(--paper-white);
  border: 2px solid transparent;
  border-radius: 4px;
  background: var(--sage-deep);
  cursor: pointer;
}

.overview-item.is-current {
  border-color: var(--coral);
}

.overview-item img,
.overview-color {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.overview-item::after {
  position: absolute;
  inset: 0;
  background: rgba(18, 27, 24, 0.28);
  content: "";
}

.overview-item span:last-child {
  position: absolute;
  z-index: 2;
  right: 5px;
  bottom: 3px;
  font-size: 8px;
  font-weight: 700;
}

.overview-color.dark {
  background: var(--sage-deep);
}

.video-modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--paper-white);
  background: rgba(8, 13, 11, 0.97);
}

.video-modal[hidden] {
  display: none;
}

.photo-modal {
  position: fixed;
  z-index: 110;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 68px 32px 34px;
  color: var(--paper-white);
  background: rgba(8, 13, 11, 0.98);
}

.photo-modal[hidden] {
  display: none;
}

.photo-viewer {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 16px;
  width: 100%;
  height: 100%;
  margin: 0;
}

.photo-viewer img {
  align-self: center;
  justify-self: center;
  max-width: 100%;
  max-height: calc(100svh - 130px);
  object-fit: contain;
}

.photo-viewer figcaption {
  color: rgba(255, 255, 255, 0.78);
  font-family: "Songti SC", "STSong", serif;
  font-size: 17px;
  text-align: center;
}

.photo-viewer-close {
  position: absolute;
  top: 20px;
  right: 20px;
  color: var(--paper-white);
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(12, 18, 16, 0.32);
}

.real-video-player {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 76px 88px 56px;
}

.real-video-player video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #080d0b;
}

.real-video-player video.video-portrait {
  width: min(62vw, 560px);
}

.video-player-topline {
  position: absolute;
  z-index: 3;
  top: 30px;
  left: 32px;
  display: flex;
  gap: 20px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 700;
}

.player-button {
  position: absolute;
  z-index: 4;
  top: 24px;
  color: var(--paper-white);
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(12, 18, 16, 0.32);
}

.player-close {
  right: 24px;
}

.video-page-prev {
  right: 128px;
}

.video-page-next {
  right: 76px;
}

:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 3px;
}

@media (max-width: 760px) {
  .album-shell {
    grid-template-rows: 64px minmax(0, 1fr);
    background-image:
      linear-gradient(rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.14)),
      repeating-linear-gradient(90deg, transparent 0, transparent 47px, rgba(40, 88, 77, 0.04) 48px);
  }

  .album-toolbar {
    padding: 0 10px;
  }

  .identity-mark,
  .tool-button {
    width: 36px;
    height: 36px;
  }

  .album-identity strong {
    font-size: 15px;
  }

  .album-identity small,
  .overview-button {
    display: none;
  }

  .album-controls {
    gap: 3px;
  }

  .page-counter {
    min-width: 52px;
    font-size: 10px;
  }

  .book-stage {
    padding: 4px 4px 8px;
  }

  .book-stage::before,
  .book-stage::after,
  .album-shell::before,
  .album-shell::after {
    display: none;
  }

  .book-shadow {
    bottom: 10px;
    width: 78vw;
    height: 30px;
  }

  .book-viewport {
    width: calc(100vw - 8px);
    height: calc(100svh - 72px);
  }

  body[data-book-orientation="portrait"] .book {
    max-width: 100% !important;
  }

  .cover-frame h1 {
    font-size: 38px;
  }

  .single-feature figcaption,
  .family-feature figcaption {
    font-size: 17px;
  }

  .real-album-page figcaption {
    font-size: 13px;
    line-height: 1.45;
  }

  .real-album-page .single-feature figcaption,
  .real-album-page .family-feature figcaption {
    font-size: 17px;
  }

  .real-video-meta strong {
    font-size: 22px;
  }

  .real-video-player {
    padding: 68px 10px 16px;
  }

  .real-video-player video.video-portrait {
    width: 100%;
  }

  .video-player-topline {
    top: 22px;
    left: 16px;
  }

  .player-button {
    top: 14px;
    width: 38px;
    height: 38px;
  }

  .player-close { right: 12px; }
  .video-page-next { right: 58px; }
  .video-page-prev { right: 104px; }

  .photo-modal {
    padding: 58px 10px 22px;
  }

  .photo-viewer img {
    max-height: calc(100svh - 108px);
  }

  .photo-viewer figcaption {
    padding: 0 12px;
    font-size: 15px;
  }

  .photo-viewer-close {
    top: 12px;
    right: 12px;
  }
}

@media (max-width: 430px) {
  .album-identity > span:last-child {
    display: none;
  }

  .cover-frame h1 {
    font-size: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
