/* A tactile artbook for a child and family. Native CSS, original artwork.
   DESIGN_VARIANCE 7 / MOTION_INTENSITY 6 / VISUAL_DENSITY 3.
   Motion explains the book's depth; reading mode rests flat. */
:root { --studio-ink: #294e4c; --studio-muted: #64766d; --studio-paper: #fbfaf4; }
body { min-width: 0; background: #e7ece3; }
.stage { overflow: hidden; min-height: 100dvh; background: radial-gradient(ellipse at 45% 20%, #fffef7 0, #f1f2e8 40%, #d9e2d6 100%); }
.stage::before { opacity: .38; background: repeating-linear-gradient(112deg, transparent 0 90px, #ffffffa0 91px 145px, transparent 146px 230px); transform: skewX(-8deg); mask-image: linear-gradient(#0009, transparent 70%); }
.stage::after { width: 760px; bottom: 12%; height: 75px; background: #294e4c; opacity: .17; filter: blur(45px); }
.desk-heading { top: 31px; left: 42px; font-size: 16px; letter-spacing: .07em; color: var(--studio-ink); }
.color-marks { gap: 3px; }
.color-marks i { width: 5px; height: 22px; }
.color-marks i:nth-child(2) { height: 28px; }
.scene-tools { position: fixed; z-index: 200; top: 24px; right: 34px; display: flex; align-items: center; gap: 8px; }
.scene-tool, .scene-tools .close-button { position: static; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; width: auto; padding: 0 14px; border: 1px solid #536e5d26; border-radius: 9px; background: #ffffff85; color: #3c5c50; box-shadow: 0 2px 1px #ffffffb0, 0 3px 8px #294e4c06; font: 12px/1.3 -apple-system, BlinkMacSystemFont, 'PingFang SC', sans-serif; cursor: pointer; white-space: nowrap; transition: background .2s, transform .2s; }
.scene-tool:hover, .scene-tools .close-button:hover { background: #fffef8; transform: translateY(-2px); }
.scene-tool[aria-pressed='true'] { background: #315f58; color: #fffdf3; border-color: #315f58; }
button:focus-visible { outline: 2px solid #315f58; outline-offset: 4px; }
.scene-tool span[aria-hidden] { font-size: 19px; }
.desk-intro { position: absolute; left: max(7vw, 45px); top: 39%; z-index: 1; max-width: 300px; color: var(--studio-ink); transition: opacity .4s, transform .6s; }
.desk-intro h2 { font: 500 clamp(33px, 3vw, 46px)/1.65 'Songti SC', 'STSong', serif; letter-spacing: .07em; margin: 0 0 24px; }
.desk-intro h2 span { color: #ae7047; }
.desk-intro p { font: 13px/2 -apple-system, BlinkMacSystemFont, 'PingFang SC', sans-serif; color: var(--studio-muted); margin: 0; }
.stage.is-reading .desk-intro { opacity: 0; transform: translateX(-18px); pointer-events: none; }
.doodle-note { display: none; }
.doodle-star { right: 8%; top: 27%; font-size: 44px; color: #a9844e; opacity: .6; }
.desk-pencils { right: 7%; bottom: 18%; transform: rotate(36deg) scale(.78); filter: drop-shadow(7px 12px 5px #354b3b24); }
.book-wrap { --tilt-x: 0deg; --tilt-y: 0deg; perspective: 2400px; filter: none; transform: perspective(2200px) rotateX(calc(3deg + var(--tilt-x))) rotateY(var(--tilt-y)); transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.book-wrap[data-position='start'] { transform: translateX(125px) perspective(2200px) rotateX(calc(10deg + var(--tilt-x))) rotateY(calc(-13deg + var(--tilt-y))) rotateZ(-4deg); }
.book-wrap[data-position='end'] { transform: perspective(2200px) rotateX(8deg) rotateY(10deg) rotateZ(3deg); }
.book { filter: drop-shadow(12px 24px 16px #294e4c29); }
.book::before { content: ''; position: absolute; left: var(--page-width); top: 12px; bottom: -11px; width: var(--page-width); border-radius: 5px 12px 12px 5px; background: repeating-linear-gradient(0deg,#dad7c6 0 1px,#faf8e9 1px 3px); box-shadow: 0 4px 0 #9eaf99, 4px 8px 0 #48736e, 5px 12px 15px #243d3926; pointer-events: none; }
.book.open::before { left: 0; width: 100%; }
.book.closed-end::before { left: 0; }
.cover, .back-cover { background: repeating-linear-gradient(90deg,#ffffff0b 0 1px,transparent 1px 4px), repeating-linear-gradient(0deg,#152b2a0a 0 1px,transparent 1px 3px), #477c77; border-color: #477c77; box-shadow: inset 0 0 0 1px #dce4c363, inset 15px 0 20px #173e404d, 1px 1px 0 #b4c7b6, 7px 8px 0 #e4e0cf, 11px 14px 0 #355f5c; }
.cover::before { border: 1px solid #d7e4c03d; inset: 9px; box-shadow: inset 1px 1px 1px #18393626; }
.cover-art { inset: 26px 29px 123px 33px; width: calc(100% - 62px); height: calc(100% - 149px); padding: 8px; filter: none; transform: rotate(-1.2deg); border-radius: 2px; box-shadow: 1px 2px 1px #173b3b33, 4px 8px 12px #173b3b40; }
.cover-title { left: 34px; right: 23px; bottom: 43px; border: 0; border-radius: 3px; padding: 14px 12px 13px; background: #f1dfa0; color: #294e4c; box-shadow: inset 0 1px 0 #fff9d5, 0 2px 2px #173b3b33; transform: rotate(.5deg); font-size: clamp(24px,2.6vw,35px); gap: 12px; }
.cover-title strong { color: #294e4c; text-shadow: 0 1px #fff9da80; }
.cover-title span:first-child { color: #4e644e; }
.cover-author { color: #f2ebc9; right: 31px; bottom: 21px; font-size: 10px; letter-spacing: .16em; }
.cover-spark { right: 14px; bottom: 112px; font-size: 27px; }
.cover-tape { opacity: .86; height: 24px; }
.hard-edge { width: 7px; opacity: .85; }
.page { background-color: #fbf8ed; }
.cover, .back-cover { background-color: #477c77; }
.front:not(.cover) { box-shadow: inset 30px 0 32px -24px #695b3830, inset -1px 0 #d1cab75e, inset 0 -8px 12px -12px #57462d33; }
.back:not(.back-cover) { box-shadow: inset -30px 0 32px -24px #695b3830, inset 1px 0 #d1cab75e, inset 0 -8px 12px -12px #57462d33; }
.book.open .spine-shadow { opacity: .83; width: 34px; }
.page::after { background: radial-gradient(ellipse at 50% 104%,rgba(78,59,31,var(--curve-shade,0)) 0%,transparent 44%),linear-gradient(90deg,#ffffff1a,transparent 15%,transparent 85%,#584b3810); }
.gallery-page { padding: 33px 34px 22px; }
.paper-caption { flex: 0 0 82px; gap: 4px; }
.paper-caption strong { font-size: 18px; font-weight: 500; color: #3f6258; }
.paper-caption strong::after { display: none; }
.paper-caption span { color: #7b796b; font-size: 10px; }
.original-button { font-size: 11px; color: #4b6b5a; padding: 6px 9px; border-bottom-color: #6d857850; }
.paper-artwork.color-scan img { box-shadow: 0 2px 4px #62523912; }
.gallery-page .paper-artwork { cursor: zoom-in; }
.inside-cover { background-color: #e8eadb; }
.owner-label { border-style: solid; border-width: 1px; background: #fffdf2a6; box-shadow: 0 3px 8px #53674b0d; padding: 25px; }
.owner-label em { display: none; }
.owner-stars { margin-top: 25px; font-size: 25px; }
.inside-mark { opacity: .55; font-size: 10px; }
.title-page .tiny-label { display: none; }
.title-page h1 { font-size: 44px; }
.title-page h1 span { font-size: 19px; margin-bottom: 7px; }
.title-flower { margin-bottom: 35px; font-size: 42px; color: #b1874a; }
.child-quote { font-size: 12px; line-height: 2; color: #727364; max-width: 250px; }
.title-page .year strong { font-size: 23px; color: #a77949; }
.page-catalog { font-size: 12px; }
.controls { bottom: 34px; gap: 8px; padding: 7px; border: 1px solid #ffffffc7; border-radius: 17px; background: #fdfdf5d9; box-shadow: 0 6px 22px #344e3b0c, inset 0 1px #fff; }
.nav-button { min-width: 105px; height: 40px; border: 0; border-radius: 11px; background: transparent; box-shadow: none; font: 12px -apple-system, BlinkMacSystemFont, 'PingFang SC', sans-serif; }
.nav-button:last-child { background: #315f58; color: #fffdf3; border: 0; box-shadow: inset 0 1px #ffffff26, 0 2px 4px #315f5826; }
.nav-button:last-child:hover:not(:disabled) { background: #244e48; }
.nav-button:hover:not(:disabled) { transform: translateY(-1px); }
.counter { min-width: 88px; font: 11px -apple-system, BlinkMacSystemFont, 'PingFang SC', sans-serif; color: #69776c; }
.hint { bottom: 13px; font-size: 10px; color: #707c70; }
.catalog-launch { bottom: 42px; left: 42px; box-shadow: none; border-color: #637b582b; border-radius: 9px; background: #fffef794; font: 12px -apple-system, BlinkMacSystemFont, 'PingFang SC', sans-serif; }
.catalog-dialog { background: #f5f5ed; border: 1px solid #ffffff; border-radius: 19px; padding: 30px; box-shadow: 0 30px 100px #233e3b40; }
.catalog-card { border: 1px solid #a4b19830; background: #fdfbf4; box-shadow: 0 4px 9px #53634908; border-radius: 5px; transition: transform .18s, box-shadow .18s; }
.catalog-card:hover { transform: translateY(-4px) rotate(-.7deg); box-shadow: 0 9px 17px #53634918; background: #fffdf4; }
.catalog-card strong { font-size: 15px; }
.catalog-card .scan-frame { background: #eeeee5; }
.catalog-card small, .catalog-explain { font: 11px/1.7 -apple-system, BlinkMacSystemFont, 'PingFang SC', sans-serif; }
.original-viewer { border-radius: 17px; background: #f7f7ef; border: 1px solid #fff; }
.scene-status { position: fixed; left: 50%; bottom: 111px; z-index: 220; transform: translate(-50%,8px); margin: 0; padding: 10px 16px; color: #fbfaf2; background: #315f58; box-shadow: 0 6px 18px #294e4c20; border-radius: 9px; opacity: 0; pointer-events: none; font: 12px/1.5 -apple-system, BlinkMacSystemFont, 'PingFang SC', sans-serif; transition: opacity .2s, transform .2s; }
.scene-status.is-visible { opacity: 1; transform: translate(-50%,0); }
.focus-mode .desk-intro, .focus-mode .desk-doodle, .focus-mode .desk-pencils { opacity: 0; pointer-events: none; }
.focus-mode .stage::before { opacity: 0; }
.focus-mode .book-wrap { transform: none; }
.focus-mode .stage { background: #e9ece4; }
@media (max-width: 1250px) {
  .desk-intro { display: none; }
  .book-wrap[data-position='start'] { transform: perspective(2200px) rotateX(calc(8deg + var(--tilt-x))) rotateY(calc(-10deg + var(--tilt-y))) rotateZ(-3deg); }
}
@media (max-height: 720px) {
  .cover-art { inset: 19px 25px 103px 26px; width: calc(100% - 51px); height: calc(100% - 122px); padding: 5px; }
  .cover-title { left: 24px; right: 19px; bottom: 35px; font-size: 24px; gap: 6px; padding: 11px 8px; }
  .cover-author { bottom: 16px; }
  .cover-spark { bottom: 89px; }
  .title-flower { margin-bottom: 17px; font-size: 31px; }
  .title-page h1 { font-size: 31px; }
  .child-quote { margin-top: 18px; }
  .page-catalog { margin-top: 12px; }
}
@media (max-width: 780px) {
  body { overflow: hidden; }
  .desktop-only { display: none; }
  .stage { display: grid; height: 100dvh; min-height: 0; padding: 72px 0 105px; }
  .stage::after { bottom: 18%; width: 70%; }
  .desk-heading { top: 22px; left: 20px; font-size: 13px; gap: 9px; }
  .color-marks { transform: scale(.8) rotate(-9deg); }
  .scene-tools { top: 15px; right: 15px; gap: 5px; }
  .scene-tool, .scene-tools .close-button { padding: 0 10px; min-height: 36px; font-size: 11px; }
  #focusButton { display: none; }
  .scene-tool span[aria-hidden] { display: none; }
  .scene-tools .close-button svg { display: none; }
  .scene-tools .close-button span { font-size: 0; }
  .scene-tools .close-button span::after { content: '封面'; font-size: 11px; }
  .book-wrap, .book-wrap[data-position='start'], .book-wrap[data-position='end'] { width: var(--page-width); height: var(--page-height); transform: none; perspective: none; filter: drop-shadow(7px 14px 9px #294e4c26); }
  .book, .leaf { display: contents !important; }
  .book::before, .spine-shadow, .flip-shadow, .click-zone { display: none; }
  .page { display: none !important; inset: 0; transform: none !important; visibility: visible !important; border-radius: 5px 10px 10px 5px; }
  .page.mobile-current { display: flex !important; }
  .page.mobile-current.cover, .page.mobile-current.back-cover { display: block !important; }
  .page.mobile-enter { animation: mobile-page-in .3s ease-out both; }
  .gallery-page { padding: 22px 23px 15px; }
  .paper-caption { flex-basis: 77px; }
  .paper-caption strong { font-size: 17px; }
  .cover { border-left-width: 14px; }
  .cover-title { left: 23px; right: 18px; font-size: 27px; }
  .cover-art { left: 25px; right: 24px; width: calc(100% - 49px); }
  .title-page { padding: 26px; }
  .title-page h1 { font-size: 35px; }
  .title-page h1 span { font-size: 17px; }
  .owner-label { width: 73%; }
  .controls { bottom: 31px; padding: 5px; gap: 2px; }
  .nav-button { min-width: 84px; padding: 0 11px; font-size: 11px; }
  .counter { min-width: 66px; font-size: 10px; }
  .catalog-launch { left: 50%; bottom: 98px; transform: translateX(-50%); padding: 7px 13px; background: #fcfcf5ed; font-size: 11px; }
  .hint { bottom: 10px; font-size: 10px; }
  .scene-status { bottom: 138px; max-width: 90vw; white-space: nowrap; }
  .catalog-dialog, .original-viewer { width: calc(100vw - 20px); max-width: none; height: 92dvh; max-height: 92dvh; padding: 19px 15px; }
  .catalog-top { gap: 10px; }
  .catalog-top h2 { font-size: 23px; }
  .catalog-top p { font-size: 12px; }
  .catalog-tools { grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 17px; }
  .catalog-tools input, .catalog-tools select { font-size: 12px; padding: 10px 8px; }
  .catalog-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .catalog-card { padding: 7px 7px 10px; }
  .catalog-card strong { font-size: 14px; }
  .catalog-card small { font-size: 10px; }
  .viewer-bar h2 { font-size: 16px; }
  .viewer-close { font-size: 11px; padding: 8px 10px; white-space: nowrap; }
  .viewer-note { font-size: 10px; }
}
@keyframes mobile-page-in { from { opacity: .4; translate: 6px 0; } to { opacity: 1; translate: 0 0; } }
@media (prefers-reduced-motion: reduce) {
  .book-wrap, .book-wrap[data-position='start'], .book-wrap[data-position='end'] { transform: none; transition: none; }
  .scene-tool, .catalog-card, .scene-status, .desk-intro { transition: none; }
  .page.mobile-enter { animation: none; }
}
