:root {
  --book-ratio: 2.82842712;
  --paper: #f6f2eb;
  --paper-back: #ece4d8;
  --turn-duration: 850ms;
  --shadow-duration: 1080ms;
  --turn-ease: cubic-bezier(0.24, 0.72, 0.18, 1);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.82), transparent 22%),
    linear-gradient(180deg, #f5efe6 0%, #f7f3ed 100%);
  overscroll-behavior: none;
}

body.book-dragging,
body.book-dragging * {
  user-select: none;
  -webkit-user-select: none;
}

a {
  color: inherit;
  text-decoration: none;
}

.book-back-link,
.book-download-link {
  position: absolute;
  top: 34px;
  z-index: 20;
  display: inline-block;
  color: #25232b;
  letter-spacing: 0.01em;
  font-size: 0.58rem;
  font-weight: 700;
  white-space: nowrap;
}

.book-back-link {
  top: 40px;
  left: 40px;
}

.book-download-link {
  right: 34px;
}

.book-back-link::before,
.book-download-link::before {
  content: "";
  position: absolute;
  inset: 5px -5px -5px 5px;
  background: #3c3844;
  pointer-events: none;
}

.book-back-link:hover,
.book-back-link:focus-visible,
.book-download-link:hover,
.book-download-link:focus-visible {
  color: #25232b;
}

.book-back-face {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 14px;
  border: 2px solid #3c3844;
  background: #ffffff;
  transition: transform 180ms ease;
}

.book-back-link:focus-visible .book-back-face,
.book-download-link:hover .book-back-face,
.book-download-link:focus-visible .book-back-face {
  transform: translate(6px, 6px);
}

.book-back-link:active .book-back-face {
  transform: translate(6px, 6px);
}

@keyframes back-link-mobile-tap {
  0% {
    transform: translate(0, 0);
  }

  45% {
    transform: translate(6px, 6px);
  }

  100% {
    transform: translate(0, 0);
  }
}

@keyframes page-hit-mobile-tap {
  0% {
    transform: translate(0, 0);
  }

  45% {
    transform: translate(6px, 6px);
  }

  100% {
    transform: translate(0, 0);
  }
}

.portfolio-book-stage {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100dvh;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 96px 44px 44px;
  overflow: hidden;
}

.book-viewport {
  position: relative;
  width: 1680px;
  aspect-ratio: var(--book-ratio);
  flex: 0 0 auto;
  margin-top: -26px;
  overflow: visible;
  touch-action: none;
  cursor: default;
  z-index: 10;
}

.book-transform {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.book-viewport.is-zoomed {
  cursor: grab;
  z-index: 50;
  touch-action: none;
}

.book-viewport.is-dragging {
  cursor: grabbing;
  z-index: 50;
}

.book {
  position: relative;
  width: 100%;
  height: 100%;
  perspective: 2000px;
  perspective-origin: 50% 45%;
  isolation: isolate;
  overflow: visible;
  outline: none;
}

.book::before,
.book::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 0;
  filter: blur(6px);
}

.book::before {
  left: 1.8%;
  right: -20px;
  bottom: -20px;
  height: 20px;
  background: linear-gradient(
    180deg,
    rgba(40, 31, 23, 0.22) 0%,
    rgba(40, 31, 23, 0.13) 52%,
    rgba(40, 31, 23, 0) 100%
  );
}

.book::after {
  top: 1.2%;
  right: -20px;
  bottom: -20px;
  width: 20px;
  background: linear-gradient(
    90deg,
    rgba(40, 31, 23, 0) 0%,
    rgba(40, 31, 23, 0.13) 48%,
    rgba(40, 31, 23, 0.22) 100%
  );
}

.book:focus-visible {
  box-shadow: 0 0 0 3px rgba(138, 111, 84, 0.18);
}

.book-shadow {
  display: none;
}

.book-thickness {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.book-thickness::before {
  content: none;
}

.book-thickness::after {
  content: none;
}

.spread {
  position: absolute;
  inset: 0;
}

.spread::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: none;
}

.spread-next {
  z-index: 2;
}

.spread-current {
  z-index: 4;
}

.spread-page {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  overflow: hidden;
  background-color: var(--paper);
  background-repeat: no-repeat;
  background-size: 200% 100%;
}

.spread-page-left {
  left: 0;
  background-position: left center;
  box-shadow: none;
}

.spread-page-right {
  right: 0;
  background-position: right center;
  box-shadow: none;
}

.spread-page::after,
.page-front::after,
.page-back::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.spread-page-left::after {
  display: none;
}

.spread-page-right::after {
  display: none;
}

.spread-page.is-hidden {
  visibility: hidden;
}

.page-flip {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  display: none;
  z-index: 8;
  pointer-events: none;
  transform-style: preserve-3d;
  will-change: transform;
}

.page-flip.is-active {
  display: block;
}

.page-flip.is-active .page-front,
.page-flip.is-active .page-back {
  box-shadow: none;
}

.page-flip.is-active .page-front::before,
.page-flip.is-active .page-front::after,
.page-flip.is-active .page-back::before,
.page-flip.is-active .page-back::after {
  display: none;
}

.page-flip.is-next {
  right: 0;
  transform-origin: left center;
  transform: rotateY(0deg);
}

.page-flip.is-prev {
  left: 0;
  transform-origin: right center;
  transform: rotateY(0deg);
}

.page-flip.is-active.is-animating {
  transition: transform var(--turn-duration) var(--turn-ease);
}

.page-flip.is-next.is-animating {
  transform: rotateY(-180deg);
}

.page-flip.is-prev.is-animating {
  transform: rotateY(180deg);
}

.page-front,
.page-back {
  position: absolute;
  inset: 0;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
}

.page-front {
  transform: translateZ(1px);
  background-color: var(--paper);
  background-repeat: no-repeat;
  background-size: 200% 100%;
  box-shadow: none;
}

.page-flip.is-next .page-front {
  background-position: right center;
}

.page-flip.is-prev .page-front {
  background-position: left center;
}

.page-front::after {
  display: none;
}

.page-flip.is-next .page-front::before,
.page-flip.is-prev .page-front::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 18px;
  pointer-events: none;
  opacity: 0.38;
}

.page-flip.is-next .page-front::before {
  display: none;
}

.page-flip.is-prev .page-front::before {
  display: none;
}

.page-back {
  transform: rotateY(180deg) translateZ(1px);
  background-color: var(--paper-back);
  background-repeat: no-repeat;
  background-size: 200% 100%;
  background-image: none;
  box-shadow: none;
}

.page-flip.is-next .page-back {
  background-position: left center;
}

.page-flip.is-prev .page-back {
  background-position: right center;
}

.page-back::before {
  display: none;
}

.page-back::after {
  display: none;
}

.book-gutter {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.book-gutter::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(50% - 7px);
  width: 14px;
  background:
    linear-gradient(
      90deg,
      rgba(98, 79, 63, 0.05) 0%,
      rgba(255, 255, 255, 0.26) 24%,
      rgba(89, 70, 54, 0.16) 50%,
      rgba(255, 255, 255, 0.16) 76%,
      rgba(98, 79, 63, 0.04) 100%
    );
  filter: blur(0.2px);
}

.book-gutter::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(50% - 30px);
  width: 60px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(107, 88, 69, 0.04) 38%,
    rgba(70, 53, 39, 0.08) 50%,
    rgba(107, 88, 69, 0.04) 62%,
    rgba(255, 255, 255, 0) 100%
  );
}

.book.is-turning-next .spread-next::before,
.book.is-turning-prev .spread-next::before {
  display: none;
  opacity: 0;
  animation: none;
  background: none;
  filter: none;
}

.book.is-turning-next .spread-next::before {
  top: 0;
  bottom: 0;
  left: calc(50% - 6px);
  width: 25%;
  background:
    linear-gradient(
      90deg,
      rgba(67, 51, 38, 0.1) 0%,
      rgba(67, 51, 38, 0.065) 18%,
      rgba(67, 51, 38, 0.03) 44%,
      rgba(67, 51, 38, 0.012) 68%,
      rgba(67, 51, 38, 0) 100%
    );
  animation-name: cast-shadow-next;
}

.book.is-turning-prev .spread-next::before {
  top: 0;
  bottom: 0;
  right: calc(50% - 6px);
  width: 25%;
  background:
    linear-gradient(
      270deg,
      rgba(67, 51, 38, 0.1) 0%,
      rgba(67, 51, 38, 0.065) 18%,
      rgba(67, 51, 38, 0.03) 44%,
      rgba(67, 51, 38, 0.012) 68%,
      rgba(67, 51, 38, 0) 100%
    );
  animation-name: cast-shadow-prev;
}

.page-hit {
  position: absolute;
  bottom: -60px;
  z-index: 20;
  display: inline-flex;
  appearance: none;
  -webkit-appearance: none;
  opacity: 1;
  color: #25232b;
  letter-spacing: 0.01em;
  font-size: 0.58rem;
  font-weight: 700;
  white-space: nowrap;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.page-hit::before {
  content: "";
  position: absolute;
  inset: 5px -5px -5px 5px;
  background: #3c3844;
  pointer-events: none;
}

.page-hit::after {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 14px;
  border: 2px solid #3c3844;
  background: #ffffff;
  transition: transform 180ms ease;
}

.page-hit:not(:disabled):active {
  opacity: 1;
}

.page-hit:not(:disabled):active::after {
  opacity: 1;
  filter: none;
}

.page-hit-left {
  left: 0;
}

.page-hit-left::after {
  content: "\2190  Previous Page";
}

.page-hit-right {
  right: 0;
}

.page-hit-right::after {
  content: "Next Page  \2192";
}

.page-hit:disabled {
  pointer-events: none;
}

.page-hit.is-boundary-disabled {
  opacity: 0.42;
}

.page-hit:hover::after,
.page-hit:focus-visible::after {
  transform: translate(6px, 6px);
}

.page-hit:focus-visible {
  outline: none;
}

@media (min-width: 721px) {
  body[data-work-folder="work-01"] .portfolio-book-stage {
    padding: 78px 40px 78px;
    overflow: hidden;
  }

  body[data-work-folder="work-01"] .book-viewport {
    width: min(1680px, calc(100vw - 92px));
    margin-top: 0;
  }

  body[data-work-folder="work-01"] .book-back-link {
    position: fixed;
    top: 26px;
    left: 52px;
    font-size: 0.54rem;
  }

  body[data-work-folder="work-01"] .book-back-link::before {
    inset: 4px -4px -4px 4px;
  }

  body[data-work-folder="work-01"] .book-back-face {
    min-height: 28px;
    padding: 0 12px;
  }

  body[data-work-folder="work-01"] .page-hit {
    position: fixed;
    bottom: calc(-12px - 1cm);
    font-size: 0.54rem;
    z-index: 20;
  }

  body[data-work-folder="work-01"] .page-hit::before {
    inset: 4px -4px -4px 4px;
  }

  body[data-work-folder="work-01"] .page-hit::after {
    min-height: 28px;
    padding: 0 12px;
  }

  body[data-work-folder="work-01"] .page-hit-left {
    left: 16px;
  }

  body[data-work-folder="work-01"] .page-hit-right {
    right: 16px;
  }
}

@media (max-width: 1200px) {
  body {
    overflow: auto;
  }

  .portfolio-book-stage {
    justify-content: flex-start;
    overflow: auto;
    height: auto;
    min-height: 100vh;
    padding: 84px 20px 44px;
  }

  .book-viewport {
    width: 1180px;
    min-width: 0;
    margin-top: 0;
  }
}

@media (max-width: 720px) {
  .book-viewport,
  .book-transform,
  .book,
  .spread,
  .spread-page,
  .page-front,
  .page-back {
    touch-action: none;
  }

  .book-back-link:active .book-back-face {
    transform: none;
  }

  .book-back-link.is-tap-animating .book-back-face {
    animation: back-link-mobile-tap 180ms ease-out;
  }

  .page-hit:active::after {
    transform: none;
  }

  .page-hit:hover::after,
  .page-hit:focus-visible::after {
    transform: none;
  }

  .page-hit.is-tap-animating::after {
    animation: page-hit-mobile-tap 180ms ease-out;
  }

  .book-back-link,
  .book-download-link {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 0.75rem);
    font-size: 0.6rem;
    z-index: 140;
  }

  .book-back-link {
    left: 12px;
  }

  .book-download-link {
    right: 12px;
  }

  .book-back-face {
    min-height: 38px;
    max-width: min(10.5rem, calc(100vw - 5rem));
    padding: 0 13px;
    white-space: normal;
    line-height: 1.15;
    text-align: center;
  }

  .portfolio-book-stage {
    align-items: flex-start;
    justify-content: flex-start;
    height: 100svh;
    min-height: 100svh;
    padding: calc(env(safe-area-inset-top) + 4.25rem) 12px calc(env(safe-area-inset-bottom) + 7rem);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  .book-viewport {
    width: max(940px, min(1120px, 270vw));
    min-width: 0;
    margin-top: 0.65cm;
    touch-action: none;
  }

  .page-hit {
    bottom: -82px;
    z-index: 90;
  }

  .page-hit::after {
    min-height: 38px;
    max-width: min(10.5rem, calc(50vw - 1.25rem));
    padding: 0 13px;
    white-space: normal;
    line-height: 1.15;
    text-align: center;
    font-size: 0.58rem;
  }

  .page-hit-left {
    left: 12px;
  }

  .page-hit-right {
    right: 12px;
  }
}

@media (max-width: 720px) and (orientation: portrait) {
  body {
    overflow: hidden;
  }

  .book-back-link,
  .book-download-link {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 0.9rem);
    transform: rotate(90deg) translateY(-100%);
    transform-origin: top left;
    z-index: 180;
    will-change: transform;
    backface-visibility: hidden;
  }

  .book-back-link {
    left: auto;
    right: calc(env(safe-area-inset-right) + 0.4rem - 1cm);
    top: calc(env(safe-area-inset-top) + 2.5rem);
  }

  .book-back-link.is-book-bound {
    position: absolute;
    top: calc(-74px + 0.2cm);
    left: 12px;
    right: auto;
    transform: none;
    transform-origin: center center;
    z-index: 95;
    will-change: auto;
    backface-visibility: visible;
  }

  .book-download-link {
    right: auto;
    left: calc(env(safe-area-inset-left) + 4.9rem);
  }

  .book-download-link.is-book-bound {
    position: absolute;
    top: calc(-74px + 0.2cm);
    bottom: auto;
    left: auto;
    right: 12px;
    transform: none;
    transform-origin: center center;
    z-index: 95;
    will-change: auto;
    backface-visibility: visible;
  }

  .portfolio-book-stage {
    position: relative;
    align-items: center;
    justify-content: center;
    height: 100svh;
    min-height: 100svh;
    padding:
      calc(env(safe-area-inset-top) + 3.35rem)
      12px
      calc(env(safe-area-inset-bottom) + 5.8rem);
    overflow: hidden;
    -webkit-overflow-scrolling: auto;
    overscroll-behavior: none;
  }

  .book-viewport {
    margin-top: 0;
  }

  .book-viewport.is-portrait-landscape {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(90deg);
    transform-origin: center center;
    touch-action: none;
  }

  .book-viewport.is-portrait-landscape .page-hit {
    z-index: 95;
  }

  .book-viewport.is-portrait-landscape .page-hit {
    bottom: -74px;
  }
}

@media (max-width: 420px) {
  .book-back-link,
  .book-download-link {
    font-size: 0.56rem;
  }

  .book-back-link {
    left: 10px;
  }

  .book-download-link {
    right: 10px;
  }

  .book-back-face {
    min-height: 36px;
    max-width: min(8.25rem, calc(50vw - 0.95rem));
    padding: 0 10px;
  }

  .page-hit {
    bottom: -78px;
  }

  .page-hit::after {
    min-height: 36px;
    max-width: min(8.85rem, calc(50vw - 0.95rem));
    padding: 0 10px;
    font-size: 0.54rem;
  }
}

@media (max-width: 420px) and (orientation: portrait) {
  .book-back-link {
    left: auto;
    right: calc(env(safe-area-inset-right) + 0.3rem - 1cm);
  }

  .book-back-link.is-book-bound {
    top: calc(-78px + 0.2cm);
    left: 12px;
    right: auto;
  }

  .book-download-link.is-book-bound {
    top: calc(-78px + 0.2cm);
    bottom: auto;
    right: 12px;
    left: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-flip {
    transition: none;
  }

  .book-back-face {
    transition: none;
  }
}

@keyframes cast-shadow-next {
  0% {
    opacity: 0.008;
    filter: blur(8px);
  }
  28% {
    opacity: 0.035;
    filter: blur(9px);
  }
  58% {
    opacity: 0.09;
    filter: blur(11px);
  }
  84% {
    opacity: 0.05;
    filter: blur(10px);
  }
  100% {
    opacity: 0.012;
    filter: blur(8px);
  }
}

@keyframes cast-shadow-prev {
  0% {
    opacity: 0.008;
    filter: blur(8px);
  }
  28% {
    opacity: 0.035;
    filter: blur(9px);
  }
  58% {
    opacity: 0.09;
    filter: blur(11px);
  }
  84% {
    opacity: 0.05;
    filter: blur(10px);
  }
  100% {
    opacity: 0.012;
    filter: blur(8px);
  }
}
