.game-modal.bookshop-modal {
  position: fixed; inset: 12px; width: auto; height: auto; max-width: none; max-height: none;
  margin: 0; padding: 0; overflow: hidden; border: 1px solid #596251; border-radius: 5px;
  background: #171e1a; color: #e7e0cd; box-shadow: 0 22px 100px #07140bc0; transform: none;
}
.bookshop-modal.is-open { display: grid; grid-template-rows: 64px minmax(0,1fr); }
.bookshop-modal::backdrop { background: #14231ce0; backdrop-filter: blur(6px); }
.bookshop-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 30px; border-bottom: 1px solid #c6bea324; }
.bookshop-brand,.bookshop-actions { display: flex; align-items: center; gap: 18px; }
.bookshop-brand strong { font: 21px 'KaiTi','STKaiti',serif; letter-spacing: .18em; }
.bookshop-brand small { color: #a4ab9c; font-size: 11px; letter-spacing: .12em; }
.bookshop-seal { display: grid; place-items: center; width: 29px; height: 30px; border: 1px solid #a67556; color: #ce9474; font: 19px 'KaiTi','STKaiti',serif; }
.bookshop-close,.bookshop-back,.bookshop-status button { min-height: 40px; padding: 8px 12px; border: 1px solid #bdb79f45; border-radius: 3px; background: transparent; color: inherit; font-size: 12px; cursor: pointer; }
.bookshop-close:hover,.bookshop-back:hover { background: #c1b89816; border-color: #b6af92; }
.bookshop-close span { margin-left: 12px; font-size: 19px; }
.bookshop-modal button:focus-visible,.bookshelf-scroll:focus-visible { outline: 2px solid #e3c68c; outline-offset: 5px; }
.bookshop-shelf { min-height: 0; width: 100%; max-width: 1600px; margin: 0 auto; overflow-y: auto; display: grid; grid-template-rows: auto auto minmax(290px,1fr) auto; padding: 28px 4.5% 0; background: radial-gradient(ellipse at 50% 65%,#66705b1f,transparent 64%); }
.bookshelf-heading { display: flex; justify-content: space-between; gap: 24px; }
.bookshelf-eyebrow { margin: 0 0 12px; font-size: 10px; letter-spacing: .3em; color: #bcaa81; }
.bookshelf-heading h2 { margin: 0; font: 32px 'KaiTi','STKaiti','Songti SC',serif; letter-spacing: .08em; font-weight: 400; }
.bookshelf-intro { margin: 12px 0 0; color: #9aab99; font-size: 12px; letter-spacing: .04em; }
.bookshelf-count { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 8px; color: #bfc2ad; }
.bookshelf-count strong { font: 30px 'KaiTi','STKaiti',serif; letter-spacing: .2em; }
.bookshelf-count span { font-size: 10px; letter-spacing: .12em; color: #8f9c8c; }
.bookshelf-navigation { display: flex; align-items: center; justify-content: space-between; margin-top: 25px; padding-bottom: 12px; border-bottom: 1px solid #c6bea31c; gap: 12px; }
.bookshelf-filters { display: flex; gap: 6px; }
.bookshelf-filters button { border: 1px solid transparent; border-radius: 2px; padding: 6px 12px; background: transparent; color: #a6af9e; font-size: 12px; cursor: pointer; }
.bookshelf-filters button[aria-pressed="true"] { background: #c0b39214; color: #e3d7b7; border-color: #a3a48c5c; }
.bookshelf-hint { font-size: 11px; color: #889783; letter-spacing: .05em; }
.bookshelf-hint b { padding-left: 10px; font-size: 16px; font-weight: 400; }
.bookshelf-scroll { min-width: 0; display: flex; align-items: flex-end; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: #647059 #1a231d; }
.bookshop-books { display: flex; align-items: flex-end; justify-content: center; gap: 5px; width: 100%; min-width: max-content; min-height: 100%; padding: 46px 18px 18px; position: relative; isolation: isolate; }
.bookshop-books::after { content: ''; position: absolute; z-index: -1; left: 0; right: 0; bottom: 7px; height: 10px; border-top: 1px solid #a392684f; background: linear-gradient(#6a5c432e,#161b16); box-shadow: 0 12px 18px #0008; }
.shelf-book { --scaled-height: calc(var(--book-height) * .84); display: block; position: relative; height: var(--scaled-height); width: var(--book-width); flex: 0 0 var(--book-width); border: 0; border-radius: 2px 3px 0 0; padding: 0; background: transparent; cursor: pointer; transform: perspective(700px) rotateY(-7deg); transform-origin: 50% 100%; transition: transform .28s ease,filter .28s ease; filter: brightness(.85); -webkit-tap-highlight-color: transparent; }
.shelf-book:nth-child(4n) { transform: perspective(700px) rotateY(-7deg) rotate(-2deg); margin-left: 2px; }
.shelf-book:nth-child(7n) { margin-right: 7px; }
.book-spine { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; overflow: hidden; border-radius: 2px 3px 0 0; border: 1px solid #ffffff19; background: linear-gradient(90deg,#0005,transparent 10%,#ffffff17 17%,transparent 26%,#0002 83%,#0005),repeating-linear-gradient(0deg,transparent,transparent 3px,#ffffff06 4px),var(--book-color); box-shadow: inset 2px 0 1px #ffffff22,3px 2px 5px #0009; color: #f9efd4; }
.book-category { flex-shrink: 0; margin-top: 12px; padding-bottom: 6px; border-bottom: 1px solid #f8e8bb55; font: 9px 'Songti SC','SimSun',serif; letter-spacing: .1em; }
.book-spine strong { flex-shrink: 0; writing-mode: vertical-rl; white-space: nowrap; font: 23px/1 'KaiTi','STKaiti','Songti SC','SimSun',serif; letter-spacing: .16em; margin-top: 12px; text-shadow: 0 1px 1px #0004; }
.book-imprint { flex-shrink: 0; margin-top: auto; border: 1px solid #eadfbd66; padding: 2px; font: 8px 'KaiTi','STKaiti',serif; writing-mode: vertical-rl; letter-spacing: .1em; }
.book-number { flex-shrink: 0; width: 100%; margin-top: 8px; padding: 4px 0 6px; border-top: 1px solid #e4d9b855; font: 9px Georgia,serif; letter-spacing: .08em; }
.book-pages { position: absolute; left: 100%; top: 3px; bottom: 1px; width: 5px; background: repeating-linear-gradient(0deg,#b9b39c,#b9b39c 1px,#ded8c0 2px,#ded8c0 3px); transform: skewY(-20deg); transform-origin: left; opacity: .6; }
.shelf-book.is-selected,.shelf-book:hover,.shelf-book:focus-visible { z-index: 3; filter: brightness(1.13); transform: perspective(700px) translateY(-20px) translateZ(18px) rotateY(-16deg); }
.bookshelf-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 124px; padding: 17px 0 14px; }
.bookshelf-preview { display: flex; align-items: center; gap: 20px; min-width: 0; }
.book-preview-cover { flex: 0 0 60px; height: 82px; display: flex; justify-content: space-between; padding: 9px 8px 8px 12px; background: linear-gradient(90deg,#0006,transparent 12%,#fff1 14%,transparent 17%),var(--book-color); box-shadow: 4px 6px 10px #0006; transform: rotate(-5deg); color: #eee6ce; }
.book-preview-cover > span { writing-mode: vertical-rl; font: 15px 'KaiTi','STKaiti',serif; letter-spacing: .13em; background: #ece5ce; color: #3c463d; padding: 4px 3px; }
.book-preview-cover i { align-self: flex-end; writing-mode: vertical-rl; font: 7px 'SimSun',serif; letter-spacing: .15em; }
.book-preview-copy { min-width: 0; max-width: 300px; }
.book-preview-copy p { margin: 0 0 5px; color: #a5ac94; font-size: 10px; letter-spacing: .07em; }
.book-preview-copy p span { padding: 0 7px; }
.book-preview-copy h3 { font: 22px 'KaiTi','STKaiti',serif; margin: 0 0 6px; color: #e4dfcb; }
.book-preview-copy small { display: block; color: #8e9b88; font-size: 11px; line-height: 1.5; }
.bookshelf-read { flex-shrink: 0; border: 0; border-bottom: 1px solid #a49d735c; background: transparent; color: #d1c59f; padding: 9px 0; margin-left: 12px; font-size: 12px; cursor: pointer; }
.bookshelf-read span { margin-left: 16px; }
.bookshelf-note { display: flex; flex-direction: column; gap: 8px; text-align: right; color: #a7ac98; font: 13px 'KaiTi','STKaiti',serif; letter-spacing: .1em; }
.bookshelf-note small { color: #7b8975; font: 10px sans-serif; letter-spacing: .05em; }
.bookshop-reader { position: relative; min-height: 0; background: #f4f1e9; color: #34463c; }
.bookshop-reader iframe { display: block; width: 100%; height: 100%; border: 0; background: #f4f1e9; }
.bookshop-status { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; background: #f4f1e9; }
.bookshop-status button { border-color: #69745b; }
.bookshop-modal.is-reading { background: #faf7ed; color: #34463c; }
.is-reading .bookshop-header { border-color: #d5d0c2; }
.is-reading .bookshop-brand small { color: #7a846f; }
.is-reading .bookshop-close,.is-reading .bookshop-back { border-color: #69745b66; }
.bookshop-modal [hidden] { display: none !important; }
.bookshop-reading .scene-tools,.bookshop-reading .journey-hud,.bookshop-reading .character-open,.bookshop-reading .walk-help,.bookshop-reading .touch-walk,.bookshop-reading .touch-run,.bookshop-reading .stage-caption,.bookshop-reading .scene-tooltip,.bookshop-reading .nearby-action,.bookshop-reading > .topbar { visibility: hidden; }
@media (min-height: 850px) and (min-width: 1000px) { .shelf-book { --scaled-height: var(--book-height); } .bookshop-shelf { padding-top: 48px; } .bookshelf-footer { min-height: 150px; } }
@media (min-width: 1800px) { .bookshop-shelf { height: min(100%,900px); align-self: center; padding-left: 60px; padding-right: 60px; } .shelf-book { --scaled-height: calc(var(--book-height) * 1.2); width: calc(var(--book-width) * 1.25); flex-basis: calc(var(--book-width) * 1.25); } .book-spine strong { font-size: 27px; } }
@media (max-width: 1050px) { .bookshop-brand small,.bookshelf-note { display: none; } .bookshop-shelf { padding-left: 24px; padding-right: 24px; } .bookshop-books { justify-content: flex-start; } }
@media (max-width: 680px) {
  .game-modal.bookshop-modal { inset: 0; border: 0; border-radius: 0; }
  .bookshop-modal.is-open { grid-template-rows: 58px minmax(0,1fr); }
  .bookshop-header { padding: 0 14px; gap: 6px; }
  .bookshop-brand,.bookshop-actions { gap: 8px; }
  .bookshop-brand strong { font-size: 17px; letter-spacing: .1em; }
  .bookshop-seal { width: 24px; height: 25px; font-size: 16px; }
  .bookshop-close,.bookshop-back { font-size: 11px; padding: 7px 9px; }
  .bookshop-close span { margin-left: 4px; }
  .is-reading .bookshop-seal { display: none; }
  .bookshop-shelf { padding: 32px 20px 0; grid-template-rows: auto auto minmax(310px,1fr) auto; }
  .bookshelf-heading h2 { font-size: 27px; }
  .bookshelf-intro { max-width: 240px; line-height: 1.9; font-size: 11px; }
  .bookshelf-count { display: none; }
  .bookshelf-navigation { margin-top: 22px; }
  .bookshelf-navigation::after { content: '左右滑动'; color: #9ca88e; font-size: 10px; white-space: nowrap; }
  .bookshelf-filters { gap: 2px; }
  .bookshelf-filters button { padding: 7px 9px; }
  .bookshelf-hint { display: none; }
  .bookshelf-scroll { margin: 0 -20px; }
  .bookshop-books { padding-left: 25px; padding-right: 30px; gap: 7px; }
  .shelf-book { --scaled-height: calc(var(--book-height) * .9); }
  .bookshelf-footer { min-height: 146px; padding-bottom: 26px; }
  .bookshelf-preview { width: 100%; gap: 15px; flex-wrap: wrap; }
  .book-preview-copy { max-width: calc(100% - 90px); flex: 1; }
  .bookshelf-read { margin-left: 75px; margin-top: -4px; }
  .book-preview-copy h3 { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) { .game-modal.bookshop-modal,.shelf-book { transition: none; } }
