@charset "UTF-8";
.library-shell {
  --paper: #f4f1eb;
  --paper-light: #faf8f4;
  --ink: #202522;
  --wine: #6a2432;
  --wine-deep: #451721;
  --brass: #aa8b5c;
  --line: #d7d0c5;
  --serif: var(--tk-font-display, Georgia, "Noto Serif SC", "Songti SC", serif);
  --sans: var(--tk-font-ui, Inter, "Aptos", "Segoe UI", "Microsoft YaHei", sans-serif);
  --ease: cubic-bezier(.2,.72,.22,1);
  min-height: 100vh;
  overflow: hidden;
  background: #1d1c19;
  color: #f6f1e8;
  font-family: var(--sans);
}
.library-shell *, .library-shell *::before, .library-shell *::after { box-sizing: border-box; }
.library-shell a { color: inherit; text-decoration: none; }
.library-shell button, .library-shell select { font: inherit; }
.library-shell button, .library-shell a, .library-shell select { -webkit-tap-highlight-color: transparent; }
.library-shell :focus-visible, .library-unavailable :focus-visible, .library-loading :focus-visible { outline: 3px solid #d5b67b; outline-offset: 4px; }/* 2.5D library */
.library-shell { min-height: 100vh; overflow: hidden; background: #1d1c19; color: #f6f1e8; }
.library-topbar .menu-toggle--library { display: none; width: 44px; height: 44px; border: 1px solid rgba(232,221,200,.44); background: #211e1b; color: #f5ede0; font: 20px/1 var(--tk-font-ui, sans-serif); cursor: pointer; }
.library-shell .mobile-tabs { display: none; }
.library-topbar { position: relative; z-index: 30; display: flex; align-items: center; justify-content: space-between; min-height: 66px; padding: 0 clamp(18px,4vw,58px); border-bottom: 1px solid rgba(235,226,209,.15); background: #211e1b; }
.library-wordmark { display: flex; align-items: center; gap: 13px; }
.library-wordmark > span { color: #f5f0e8; font: 700 20px var(--serif); }
.library-wordmark small { padding-left: 13px; border-left: 1px solid rgba(230,217,193,.3); color: #d0c3ad; font-size: 9px; letter-spacing: .12em; }
.library-topbar__links { display: flex; align-items: center; gap: 25px; }
.library-topbar__links a { display: inline-flex; align-items: center; min-height: 44px; color: #e1dace; font-size: 12px; }
.library-topbar__links a:hover { color: #fff; }
.library-topbar__links a span { padding-left: 7px; color: #cbb88e; font-size: 15px; }
.library-topbar__links .exit-link { padding-left: 20px; border-left: 1px solid rgba(230,217,193,.26); color: #e0c8a3; }
.library-mobile-menu { position: absolute; top: 100%; right: 0; left: 0; padding: 12px 20px 20px; background: #211e1b; box-shadow: 0 15px 28px rgba(0,0,0,.35); }
.library-mobile-menu:not([hidden]) { display: grid; }
.library-mobile-menu a { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 56px; padding: 12px 2px; border-bottom: 1px solid rgba(230,217,193,.16); color: #f6f1e8; font-size: 15px; }
.library-mobile-menu a span { color: #d3c2a3; font-size: 12px; }
.library-main { width: min(1640px,100%); margin-inline: auto; padding: 16px clamp(0px,2vw,25px) 0; }
.library-scene { --parallax-x: 0px; --parallax-y: 0px; position: relative; min-height: 650px; height: min(76svh, 790px); overflow: hidden; isolation: isolate; background: #45382e; }
.scene-picture { position: absolute; z-index: -3; inset: -1.5%; overflow: hidden; }
.scene-image { width: 100%; height: 100%; object-fit: cover; object-position: center; transform: translate(var(--parallax-x),var(--parallax-y)) scale(1.04); transition: transform 1.1s var(--ease), filter .65s ease; }
.scene-vignette { position: absolute; z-index: -2; inset: 0; background: linear-gradient(90deg,rgba(21,23,22,.68),rgba(25,25,22,.26) 48%,transparent 82%), linear-gradient(0deg,rgba(19,18,16,.48),transparent 28%,rgba(21,20,18,.12)); pointer-events: none; }
.scene-depth-glow { position: absolute; z-index: -1; inset: -20%; background: radial-gradient(ellipse at 68% 42%,rgba(255,219,157,.16),transparent 47%); opacity: .7; mix-blend-mode: screen; pointer-events: none; transform: translate(calc(var(--parallax-x) * -.35),calc(var(--parallax-y) * -.35)); transition: transform 1.1s var(--ease), opacity .5s ease; }
.scene-title { position: absolute; z-index: 1; top: clamp(38px,7vh,84px); left: clamp(25px,6vw,92px); max-width: min(450px,60%); text-shadow: 0 2px 20px rgba(0,0,0,.32); }
.scene-title .scene-kicker { color: #f0dcba; }
.scene-title h1 { margin: 13px 0 12px; color: #fff9ef; font: 400 clamp(32px,4vw,58px)/1.22 var(--serif); letter-spacing: -.045em; }
.scene-title h1 em { color: #f0d5aa; font-weight: 400; }
.scene-title p { max-width: 440px; margin: 0; color: rgba(255,250,239,.92); font-size: 13px; line-height: 1.7; }
.scene-title--compact { top: 34px; max-width: 480px; }
.scene-title--compact h1 { margin: 8px 0 5px; font-size: clamp(26px,3vw,42px); }
.scene-title--compact h1 small { color: #e6c98d; font-size: .62em; }
.scene-title--compact p { font-size: 10px; }
.gate-actions { position: absolute; z-index: 2; bottom: clamp(40px,7vh,80px); left: clamp(25px,6vw,92px); display: flex; align-items: center; gap: 17px; }
.button--light { min-height: 48px; padding-inline: 20px; border-color: rgba(255,248,232,.72); background: #f7f1e6; color: var(--wine-deep); cursor: pointer; }
.gate-actions > span { color: rgba(255,250,239,.75); font-size: 9px; }
.subject-hotspot { position: absolute; z-index: 3; top: 47%; right: 16%; display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 7px; border: 0; background: transparent; color: #fff9ef; text-align: left; cursor: pointer; transform: translate(50%,-50%); }
.hotspot-pulse { position: relative; display: block; width: 24px; height: 24px; border: 1px solid rgba(255,241,208,.9); border-radius: 50%; background: rgba(248,224,177,.2); box-shadow: 0 0 0 7px rgba(247,229,196,.11), 0 0 20px rgba(255,226,170,.6); }
.hotspot-pulse::after { position: absolute; top: 50%; left: 50%; width: 6px; height: 6px; border-radius: 50%; background: #fff3d7; content: ""; transform: translate(-50%,-50%); }
.subject-hotspot__label { display: grid; gap: 5px; min-width: 175px; padding: 10px 13px; border-left: 1px solid rgba(244,224,192,.8); background: rgba(28,27,25,.59); backdrop-filter: blur(5px); }
.subject-hotspot__label b { font: 17px var(--serif); }
.subject-hotspot__label small { color: #f0e7d7; font-size: 10px; }
.subject-hotspot__label i { color: #f2d9aa; font-size: 10px; font-style: normal; }
.scene-caption { position: absolute; z-index: 2; bottom: 27px; left: clamp(25px,6vw,92px); display: flex; gap: 17px; color: rgba(255,248,232,.92); font-size: 10px; letter-spacing: .1em; }
.scene-caption span + span { padding-left: 17px; border-left: 1px solid rgba(248,239,219,.5); font-size: 11px; letter-spacing: .01em; }
.scene-caption--hall { bottom: 24px; }
.library-footnote { display: flex; justify-content: space-between; gap: 18px; padding: 13px 4px 19px; color: #c4b8a5; font-size: 10px; letter-spacing: .04em; }
.library-footnote button { min-height: 40px; border: 0; background: none; color: #f0d9ad; font-size: 11px; text-decoration: underline; cursor: pointer; }
.library-footnote span:nth-child(2) { color: #d4cbbd; letter-spacing: 0; }
.book-stage { position: absolute; z-index: 2; top: 31%; right: 19%; left: 25%; display: flex; align-items: flex-end; justify-content: space-between; height: 38%; perspective: 900px; }
.book-object { position: relative; display: flex; flex: 0 1 12%; flex-direction: column; align-items: center; justify-content: flex-end; width: 12%; max-width: 120px; min-width: 52px; height: 100%; padding: 0 1px 4px; border: 0; background: transparent; cursor: pointer; transform: translateY(var(--book-lift,0)) rotateY(-4deg); transform-style: preserve-3d; transition: transform .34s var(--ease), filter .34s ease; }
.book-object::after { position: absolute; right: -5%; bottom: 0; left: 5%; height: 6px; border-radius: 50%; background: rgba(16,10,7,.35); filter: blur(6px); content: ""; transition: opacity .3s, transform .3s; }
.book-object img { z-index: 1; width: 100%; height: calc(100% - 28px); object-fit: contain; object-position: center bottom; filter: drop-shadow(4px 8px 7px rgba(12,8,5,.4)); }
.book-object__title { z-index: 2; max-width: 100%; overflow: hidden; color: rgba(255,247,228,.92); font: 8px/1.1 var(--serif); text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 3px #251811; }
.book-object__type { position: absolute; z-index: 3; top: 7px; right: 0; min-width: 24px; padding: 3px 4px; background: rgba(249,243,230,.92); color: var(--wine); font-size: 7px; font-weight: 800; letter-spacing: .08em; opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s; }
.book-object:hover, .book-object:focus-visible { --book-lift: -13px; filter: brightness(1.08); }
.book-object:hover .book-object__type, .book-object:focus-visible .book-object__type, .book-object.is-selected .book-object__type { opacity: 1; transform: translateY(0); }
.book-object.is-selected { --book-lift: -24px; z-index: 5; filter: brightness(1.1) drop-shadow(0 0 11px rgba(239,205,141,.63)); }
.book-object.is-selected::after { opacity: .5; transform: scale(.72); }
.preview-panel { position: absolute; z-index: 8; top: 20px; right: 22px; bottom: 20px; display: flex; flex-direction: column; gap: 16px; width: min(410px,38%); overflow: auto; padding: 22px 24px 20px; border: 1px solid rgba(170,139,92,.46); border-top: 3px solid var(--brass); background: #f7f3eb; color: var(--ink); box-shadow: 0 18px 45px rgba(22,17,14,.32); }
.preview-panel__top { display: flex; justify-content: space-between; align-items: center; min-height: 42px; color: #61574a; font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.preview-panel__top > span { display: flex; align-items: center; gap: 10px; }
.preview-panel__top small { color: #7b7061; font: 11px var(--sans); letter-spacing: .04em; }
.preview-panel__controls { display: flex; gap: 6px; }
.preview-panel__controls button { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid #c8bba8; background: transparent; color: var(--wine); font-size: 18px; cursor: pointer; }
.preview-panel__controls button:disabled { color: #9f9a90; opacity: .55; cursor: default; }
.preview-panel__controls .preview-panel__close { border-color: #9e8d76; background: #eee7dc; font-size: 22px; }
.preview-identity { display: grid; grid-template-columns: 82px minmax(0,1fr); align-items: start; gap: 17px; }
.preview-panel__book { display: grid; width: 82px; height: 120px; place-items: center; overflow: hidden; border: 1px solid #ded4c6; background: #e9e1d5; box-shadow: 4px 7px 14px rgba(37,26,20,.11); }
.preview-panel__book img { width: 100%; height: 100%; object-fit: contain; }
.preview-type { display: inline-block; margin: 2px 0 7px; color: #6d5944; font-size: 10px; font-weight: 700; letter-spacing: .07em; }
.preview-panel h2 { margin: 0 0 7px; color: var(--ink); font: 28px/1.18 var(--serif); letter-spacing: -.025em; }
.preview-panel__summary { margin: 0; color: #514f49; font-size: 12px; line-height: 1.65; }
.preview-meta { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; margin: 0; }
.preview-meta > div { min-width: 0; padding: 9px 0 0; border-top: 1px solid #d5cabb; }
.preview-meta dt { color: #6d665c; font-size: 10px; }
.preview-meta dd { margin: 4px 0 0; color: var(--ink); font-size: 11px; font-weight: 700; line-height: 1.35; }
.pair-link { position: relative; display: grid; align-content: center; gap: 5px; min-height: 64px; padding: 9px 42px 9px 13px; border: 1px solid #d5c5b0; border-left: 3px solid var(--brass); background: #efe8dc; }
.pair-link span { color: #625747; font-size: 10px; font-weight: 700; letter-spacing: .06em; }
.pair-link strong { color: var(--wine-deep); font: 14px/1.35 var(--serif); }
.pair-link i { position: absolute; top: 50%; right: 13px; color: var(--wine); font: normal 18px var(--sans); transform: translateY(-50%); }
.preview-actions { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 9px; margin-top: 0; padding-top: 3px; }
.preview-actions .button { min-height: 50px; justify-content: center; padding-inline: 14px; font-size: 12px; }
.preview-actions .button--wine { justify-content: space-between; }
.preview-resource-id { color: #665f54; font-size: 10px; }
.preview-resource-id summary { width: fit-content; min-height: 32px; padding: 7px 0; cursor: pointer; }
.preview-resource-id code { display: inline-block; padding: 2px 0 8px; color: #51473c; font-size: 10px; overflow-wrap: anywhere; }
.transition-curtain { position: absolute; z-index: 20; inset: 0; display: flex; align-items: center; justify-content: center; gap: 16px; background: rgba(27,23,20,.22); color: white; animation: curtainIn .48s var(--ease) both; backdrop-filter: blur(2px); }
.transition-curtain span { font: 18px var(--serif); }
.transition-curtain button { min-height: 40px; padding: 0 13px; border: 1px solid rgba(255,255,255,.75); background: rgba(37,27,23,.4); color: white; font-size: 10px; cursor: pointer; }
.library-scene.is-travelling .scene-image { transform: translate(var(--parallax-x),var(--parallax-y)) scale(1.13); filter: saturate(.86); }
.library-scene.is-travelling .scene-title { transform: translateY(-7px); opacity: .7; transition: transform .48s, opacity .48s; }
@keyframes curtainIn { from { opacity: 0; clip-path: inset(0 50%); } to { opacity: 1; clip-path: inset(0 0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }


@media (max-width: 700px) {
  .library-shell .mobile-tabs { display: grid; grid-template-columns: repeat(3, 1fr); min-height: 62px; border-top: 1px solid rgba(230,217,193,.16); background: #211e1b; }
  .library-shell .mobile-tabs a { display: grid; align-content: center; justify-items: center; gap: 2px; min-height: 58px; font-size: 11px; text-decoration: none; }
  .library-shell .mobile-tabs a { color: #d7d0c4; }
  .library-shell .mobile-tabs a span { color: #d1b986; }
  .library-topbar { min-height: 60px; padding: 0 16px; }
  .library-wordmark { gap: 9px; }
  .library-wordmark > span { font-size: 19px; }
  .library-wordmark small { padding-left: 9px; font-size: 8px; letter-spacing: .08em; }
  .library-topbar__links { display: none; }
  .menu-toggle--library { display: grid !important; place-items: center; background: transparent; color: #f5ede0; }
  .library-main { padding: 8px 8px 0; }
  .library-scene { min-height: 0; height: min(78svh,680px); }
  .scene-picture { inset: 0; }
  .scene-image { object-position: center; transform: scale(1.015); }
  .scene-vignette { background: linear-gradient(180deg,rgba(23,22,20,.46),rgba(21,19,17,.08) 35%,rgba(20,18,16,.16) 65%,rgba(18,17,15,.43)); }
  .scene-depth-glow { inset: 0; }
  .scene-title { top: 20px; left: 17px; max-width: 84%; }
  .scene-title .scene-kicker { font-size: 9px; letter-spacing: .1em; }
  .scene-title h1 { margin: 7px 0; font-size: clamp(26px,7vw,35px); line-height: 1.18; }
  .scene-title p { max-width: 290px; font-size: 11px; line-height: 1.55; }
  .scene-title--compact { top: 16px; max-width: 84%; }
  .scene-title--compact h1 { font-size: clamp(23px,6vw,29px); }
  .scene-title--compact p { font-size: 10px; }
  .gate-actions { bottom: 52px; left: 16px; align-items: flex-start; flex-direction: column; gap: 8px; }
  .gate-actions .button { min-height: 48px; }
  .gate-actions > span { color: rgba(255,250,239,.92); font-size: 10px; }
  .subject-hotspot { top: 54%; right: 14%; gap: 7px; min-height: 54px; padding: 0; transform: translate(50%,-50%); }
  .subject-hotspot::before { position: absolute; z-index: -1; inset: -8px; content: ""; }
  .hotspot-pulse { width: 22px; height: 22px; flex: 0 0 auto; box-shadow: 0 0 0 5px rgba(247,229,196,.13),0 0 15px rgba(255,226,170,.6); }
  .subject-hotspot__label { min-width: 139px; gap: 5px; padding: 9px 10px; }
  .subject-hotspot__label b { font-size: 13px; }
  .subject-hotspot__label small, .subject-hotspot__label i { font-size: 9px; }
  .scene-caption { right: 14px; bottom: 18px; left: 14px; gap: 8px; font-size: 8px; }
  .scene-caption span + span { padding-left: 8px; font-size: 10px; }
  .scene-caption--hall { bottom: 18px; }
  .book-stage { top: 34%; right: 7%; left: 7%; height: 36%; }
  .book-object { flex: 0 1 14%; width: 14%; min-width: 0; height: 100%; }
  .book-object img { height: calc(100% - 21px); filter: drop-shadow(2px 5px 5px rgba(12,8,5,.38)); }
  .book-object__title { max-width: 94%; font-size: 8px; }
  .book-object__type { top: 0; right: -3px; min-width: 20px; padding: 3px 4px; font-size: 8px; }
  .book-object:hover, .book-object:focus-visible { --book-lift: -8px; }
  .book-object.is-selected { --book-lift: -16px; }
  .preview-panel { top: auto; right: 6px; bottom: 6px; left: 6px; width: auto; max-height: 75%; gap: 10px; padding: 12px 14px 14px; border-radius: 16px 16px 2px 2px; border-top: 3px solid var(--brass); box-shadow: 0 10px 30px rgba(18,13,10,.38); }
  .preview-panel::before { align-self: center; width: 36px; height: 3px; margin-top: -6px; border-radius: 2px; background: #c6b69f; content: ""; }
  .preview-panel__top { min-height: 42px; font-size: 10px; }
  .preview-panel__top > span { gap: 8px; }
  .preview-panel__top small { font-size: 11px; }
  .preview-panel__controls { gap: 5px; }
  .preview-panel__controls button { width: 44px; height: 44px; font-size: 19px; }
  .preview-identity { grid-template-columns: 56px minmax(0,1fr); gap: 12px; }
  .preview-panel__book { width: 56px; height: 82px; }
  .preview-type { margin: 0 0 5px; font-size: 9px; }
  .preview-panel h2 { margin-bottom: 5px; font-size: 20px; }
  .preview-panel__summary { display: -webkit-box; overflow: hidden; font-size: 11px; line-height: 1.45; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .preview-meta { gap: 7px; }
  .preview-meta > div { padding-top: 7px; }
  .preview-meta dt { font-size: 9px; }
  .preview-meta dd { margin-top: 3px; font-size: 10px; }
  .pair-link { min-height: 56px; gap: 4px; padding: 7px 34px 7px 10px; }
  .pair-link span { font-size: 9px; }
  .pair-link strong { font-size: 12px; }
  .preview-actions { grid-template-columns: minmax(0,1fr) auto; gap: 7px; margin-top: 0; }
  .preview-actions .button { min-height: 48px; gap: 7px; padding-inline: 11px; font-size: 11px; }
  .preview-resource-id { font-size: 10px; }
  .preview-resource-id summary { min-height: 34px; }
  .library-footnote { flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 9px 2px 2px; font-size: 10px; }
  .library-footnote span:nth-child(2) { order: 3; width: 100%; font-size: 10px; }
  .library-footnote button { min-height: 40px; font-size: 10px; }
  .transition-curtain { flex-direction: column; gap: 9px; }
  .transition-curtain span { font-size: 15px; }
  .transition-curtain button { min-height: 44px; font-size: 11px; }
  .subject-hotspot { left: var(--hotspot-x, 78%); right: auto; transform: translate(-50%, -50%); }
  .shelf-empty { width: min(80%, 360px); }
  .library-unavailable { min-height: 75svh; padding: 26px 18px 90px; }
}
/* Resource-bound book layers: align the six active hit targets with the display shelf plane. */
.shelf-controls {
  position: absolute;
  z-index: 4;
  top: 22px;
  right: 22px;
  display: flex;
  align-items: end;
  gap: 12px;
  padding: 9px 11px;
  border: 1px solid rgba(239, 224, 198, .44);
  background: rgba(26, 23, 20, .78);
  color: #f5eddf;
  backdrop-filter: blur(9px);
}
.shelf-controls label { display: grid; gap: 5px; min-width: 190px; }
.shelf-filter-toggle { display: none; }
.shelf-filters { display: flex; align-items: end; }
.shelf-filters__panel { display: flex; align-items: end; gap: 12px; }
.shelf-controls label > span { color: #e6d8c0; font-size: 9px; font-weight: 750; letter-spacing: .08em; }
.shelf-controls label small { color: #c6af83; font-size: 8px; }
.shelf-controls select { width: 100%; min-height: 36px; padding: 0 28px 0 9px; border: 1px solid rgba(230, 214, 186, .43); border-radius: 0; background: #302720; color: #fff8eb; font-size: 11px; }
.shelf-pagination { display: flex; align-items: center; gap: 7px; min-height: 36px; white-space: nowrap; }
.shelf-pagination button { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid rgba(229, 211, 181, .45); background: transparent; color: #f4e6cd; font-size: 15px; cursor: pointer; }
.shelf-pagination button:disabled { opacity: .4; cursor: default; }
.shelf-pagination span { color: #d0c1a8; font-size: 9px; }
.shelf-pagination strong { color: #fff9ed; font-size: 12px; }

.book-stage {
  top: 36%;
  right: 18%;
  bottom: 27%;
  left: 24%;
  display: block;
  height: auto;
  pointer-events: none;
  perspective: 1100px;
  perspective-origin: 50% 80%;
}
.book-object {
  position: absolute;
  bottom: 0;
  left: var(--slot-x);
  display: block;
  width: 14%;
  max-width: 138px;
  min-width: 0;
  height: 100%;
  padding: 0;
  overflow: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) rotateY(var(--book-yaw, 0deg));
  transform-origin: 50% 100%;
  transition: transform .32s var(--ease), filter .32s ease;
}
.book-object::before {
  position: absolute;
  right: 18%;
  bottom: 1px;
  left: 18%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(238, 209, 159, .58), transparent);
  content: "";
}
.book-object::after {
  right: 7%;
  bottom: -2px;
  left: 7%;
  height: 8px;
  border-radius: 50%;
  background: rgba(9, 7, 5, .58);
  filter: blur(5px);
  opacity: .83;
  transform: scaleX(.88);
}
.book-object img {
  position: absolute;
  right: auto;
  bottom: 8px;
  left: 50%;
  width: 146%;
  max-width: none;
  height: 146%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(2px 4px 3px rgba(11, 8, 6, .58)) drop-shadow(0 0 1px rgba(241, 216, 174, .25));
  transform: translateX(-50%);
  transform-origin: 50% 100%;
}
.book-object__title {
  position: absolute;
  right: -9%;
  bottom: -17px;
  left: -9%;
  overflow: hidden;
  color: rgba(255, 246, 226, .94);
  font: 700 8px/1.15 var(--sans);
  letter-spacing: .01em;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.book-object__type {
  top: 32%;
  right: -5px;
  min-width: 28px;
  padding: 4px 5px;
  border: 1px solid rgba(106, 77, 52, .34);
  background: #f5eddf;
  color: #6a2432;
  font-size: 8px;
  opacity: .94;
  transform: translateY(0);
}
.book-object:hover,
.book-object:focus-visible { z-index: 4; filter: brightness(1.08); transform: translateX(-50%) translateY(-8px) rotateY(var(--book-yaw, 0deg)) scale(1.025); }
.book-object.is-selected { z-index: 5; filter: brightness(1.1); transform: translateX(-50%) translateY(-16px) rotateY(var(--book-yaw, 0deg)) scale(1.045); }
.book-object.is-selected::after { opacity: .55; transform: scaleX(.68); }
.book-object:focus-visible { outline-offset: 4px; }

.preview-panel {
  width: min(372px, 34%);
  padding: 18px 20px 16px;
  gap: 12px;
  border-color: rgba(170, 139, 92, .55);
  background: #f8f5ee;
  box-shadow: 0 16px 36px rgba(22, 17, 14, .26);
}
.preview-panel__top { min-height: 38px; }
.preview-identity { grid-template-columns: 70px minmax(0, 1fr); gap: 14px; }
.preview-panel__book { width: 70px; height: 96px; border: 0; background: transparent; box-shadow: none; }
.preview-panel__book img { filter: drop-shadow(4px 6px 5px rgba(37, 26, 20, .2)); }
.preview-panel h2 { font-size: 25px; }
.preview-panel__summary { font-size: 11px; line-height: 1.5; }
.preview-meta { gap: 7px; }
.preview-meta dt { font-size: 9px; }
.preview-meta dd { font-size: 10px; }
.pair-link { min-height: 58px; }
.preview-actions .button { min-height: 46px; }

@media (max-width: 700px) {
  .shelf-controls {
    top: 114px;
    right: 12px;
    left: 12px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 8px;
  }
  .shelf-filter-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 76px; min-height: 40px; padding: 0 11px; border: 1px solid rgba(230,214,186,.43); background: #302720; color: #fff8eb; font-size: 12px; cursor: pointer; }
  .shelf-filter-toggle span { color: #d7bd8d; font-size: 15px; }
  .shelf-filters { position: absolute; top: calc(100% + 6px); left: 0; display: none; width: min(300px, calc(100vw - 40px)); padding: 12px; border: 1px solid rgba(239,224,198,.52); background: rgba(26,23,20,.96); box-shadow: 0 12px 28px rgba(0,0,0,.28); }
  .shelf-controls.filters-open .shelf-filters { display: block; }
  .shelf-filters__panel { display: grid; gap: 10px; }
  .shelf-controls label { min-width: 0; }
  .shelf-controls label > span { font-size: 10px; }
  .shelf-controls select { min-height: 40px; font-size: 12px; }
  .shelf-pagination { justify-content: flex-end; gap: 4px; }
  .shelf-pagination button { width: 34px; height: 38px; }
  .shelf-pagination span { font-size: 10px; }
  .book-stage { top: 52%; right: 5%; bottom: 29%; left: 5%; height: auto; }
  .book-object { width: 15%; max-width: none; height: 100%; }
  .book-object img { bottom: 7px; width: 156%; height: 156%; filter: drop-shadow(2px 4px 3px rgba(12, 8, 5, .6)); }
  .book-object__title { right: -23%; bottom: -15px; left: -23%; font-size: 7px; }
  .book-object__type { top: 32%; right: -5px; min-width: 24px; padding: 4px; font-size: 8px; }
  .book-object:hover,
  .book-object:focus-visible { transform: translateX(-50%) translateY(-6px) rotateY(var(--book-yaw, 0deg)) scale(1.02); }
  .book-object.is-selected { transform: translateX(-50%) translateY(-11px) rotateY(var(--book-yaw, 0deg)) scale(1.035); }
  .preview-panel { right: 8px; bottom: 8px; left: 8px; width: auto; max-height: 51%; gap: 8px; overflow-y: auto; padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px)); border-radius: 15px 15px 3px 3px; }
  .preview-panel::before { margin-top: -4px; }
  .preview-panel__top { min-height: 38px; font-size: 9px; }
  .preview-panel__controls button { width: 44px; height: 44px; }
  .preview-identity { grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 10px; }
  .preview-panel__book { width: 48px; height: 68px; }
  .preview-type { margin: 0 0 3px; font-size: 9px; }
  .preview-panel h2 { margin: 0 0 4px; font-size: 19px; }
  .preview-panel__summary { display: -webkit-box; overflow: hidden; font-size: 10px; line-height: 1.35; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .preview-meta > div { padding-top: 5px; }
  .preview-meta dt { font-size: 9px; }
  .preview-meta dd { margin-top: 2px; font-size: 10px; }
  .pair-link { min-height: 50px; padding-block: 6px; }
  .pair-link span { font-size: 8px; }
  .pair-link strong { font-size: 11px; }
  .preview-actions { grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
  .preview-actions .button { min-height: 44px; padding-inline: 10px; font-size: 10px; }
  .preview-resource-id { font-size: 9px; }
}
.subject-hotspot { left: var(--hotspot-x, 78%); right: auto; transform: translate(-50%, -50%); }
.hall-hotspots { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.hall-hotspots .subject-hotspot { pointer-events: auto; }
.library-shell .scene-title--preview { max-width: min(270px, 34%); }
.library-unavailable, .library-loading { display: grid; align-content: center; justify-items: start; gap: 14px; min-height: 75vh; padding: clamp(28px, 8vw, 100px); background: #211e1b; color: #f6f1e8; }
.library-unavailable h1 { margin: 0; font: 400 clamp(30px, 5vw, 48px)/1.2 var(--tk-font-display, Georgia, serif); }
.library-unavailable p { max-width: 620px; color: #d4cbbd; line-height: 1.7; }
.library-unavailable > div { display: flex; flex-wrap: wrap; gap: 10px; }
.library-unavailable .button { display: inline-flex; align-items: center; min-height: 48px; padding: 0 16px; border: 1px solid rgba(230, 217, 193, .4); }
.library-unavailable .button--outline { color: #f6f1e8; }
.library-loading { justify-items: center; text-align: center; }
.library-loading a { min-height: 44px; display: inline-flex; align-items: center; color: #f0d9ad; text-decoration: underline; }
.loading-mark { color: #e0c8a3; font-size: 32px; }
.skip-to-content { position: absolute; z-index: 80; top: 6px; left: 8px; padding: 10px 14px; transform: translateY(-150%); background: #faf8f4; color: #451721 !important; }
.skip-to-content:focus { transform: translateY(0); }
.shelf-empty { position: absolute; z-index: 3; top: 50%; left: 50%; padding: 24px; transform: translate(-50%, -50%); background: rgba(28,27,25,.86); color: #fff9ef; text-align: center; }
.shelf-empty h2 { margin: 0 0 8px; font: 22px var(--serif); }
.shelf-empty p, .pair-unavailable { margin: 0; color: #625747; font-size: 12px; line-height: 1.6; }
.pair-unavailable { padding: 12px; border-left: 3px solid var(--brass); background: #efe8dc; }

/* Browsing context: subject, filters, bookshelf page, then result position. */
.library-breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; color: rgba(255, 249, 239, .78); font: 600 11px/1.35 var(--sans); letter-spacing: .02em; }
.library-breadcrumb a { color: #f0d5aa; text-decoration-color: rgba(240, 213, 170, .58); text-underline-offset: 3px; }
.library-breadcrumb span:last-child { color: rgba(255, 249, 239, .9); }
.scene-title .shelf-scope,
.scene-title .preview-scope { max-width: 490px; margin-top: 8px; color: rgba(255, 249, 239, .9); font-size: 12px; line-height: 1.5; }
.scene-title .shelf-result-count { margin-top: 5px; color: #f0d5aa; font-size: 11px; font-weight: 650; }
.shelf-result-count strong { padding-inline: 3px; color: #fff9ef; font-size: 15px; font-variant-numeric: tabular-nums; }
.library-shell .scene-title--preview { max-width: min(480px, 43%); }
.scene-title--preview h1 { margin-block: 6px 2px; }
.scene-title--preview .preview-scope { margin-top: 4px; font-variant-numeric: tabular-nums; }
.shelf-page-label { display: grid; gap: 3px; text-align: center; }
.shelf-pagination strong { font-variant-numeric: tabular-nums; }
.shelf-resource-range { color: #d0c1a8; font-size: 10px; font-variant-numeric: tabular-nums; }
.preview-position { display: grid; gap: 2px; min-width: 116px; letter-spacing: .02em; }
.preview-position > span { color: #786b59; font-size: 9px; font-weight: 650; letter-spacing: .06em; }
.preview-position > strong { color: #30251f; font-size: 13px; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.preview-position > small { color: #786b59; font-size: 10px; font-weight: 550; letter-spacing: 0; }
.preview-classification { margin: 0 0 6px; color: #6d2432; font-size: 11px; font-weight: 700; line-height: 1.4; }
.preview-meta-disclosure { border-top: 1px solid #d9cdbb; border-bottom: 1px solid #d9cdbb; }
.preview-meta-disclosure summary { min-height: 36px; display: flex; align-items: center; color: #685b4d; font-size: 11px; font-weight: 700; cursor: pointer; }
.preview-meta-disclosure[open] { padding-bottom: 8px; }
.library-scene--preview .shelf-filter-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 76px; min-height: 44px; padding: 0 11px; border: 1px solid rgba(230, 214, 186, .43); background: #302720; color: #fff8eb; font-size: 12px; cursor: pointer; }
.library-scene--preview .shelf-filters { position: absolute; z-index: 6; top: calc(100% + 6px); left: 0; display: none; width: min(300px, calc(100vw - 40px)); padding: 12px; border: 1px solid rgba(239, 224, 198, .52); background: rgba(26, 23, 20, .96); box-shadow: 0 12px 28px rgba(0, 0, 0, .28); }
.library-scene--preview .shelf-controls.filters-open .shelf-filters { display: block; }
.library-scene--preview .shelf-filters__panel { display: grid; gap: 10px; }
.library-scene--preview .shelf-controls label { min-width: 0; }
@media (min-width: 1101px) {
  .library-scene--preview .shelf-controls { right: calc(min(372px, 34%) + 34px); }
}
@media (min-width: 701px) and (max-width: 1100px) {
  .library-scene--preview .shelf-controls { top: 132px; right: 12px; left: 12px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; justify-content: space-between; gap: 8px; padding: 7px 8px; }
  .library-scene--preview .shelf-pagination { justify-content: flex-end; }
}

@media (max-width: 700px) {
  .library-shell .scene-title--preview { max-width: 88%; }
  .library-breadcrumb { gap: 6px; margin-bottom: 5px; font-size: 10px; }
  .scene-title .shelf-scope,
  .scene-title .preview-scope { max-width: 100%; margin-top: 5px; font-size: 11px; line-height: 1.4; }
  .scene-title .shelf-result-count { margin-top: 3px; font-size: 10px; }
  .shelf-result-count strong { font-size: 14px; }
  .scene-title--preview .preview-scope { font-size: 11px; line-height: 1.4; }
  .shelf-controls { top: 132px; }
  .shelf-filter-toggle { min-width: 76px; min-height: 44px; }
  .shelf-pagination button { width: 44px; height: 44px; }
  .shelf-pagination span { font-size: 11px; }
  .shelf-resource-range { font-size: 10px; }
  .preview-position { min-width: 0; }
  .preview-position > span { font-size: 8px; }
  .preview-position > strong { font-size: 12px; }
  .preview-position > small { font-size: 9px; }
  .preview-classification { margin-bottom: 3px; font-size: 10px; }
  .preview-meta-disclosure summary { min-height: 40px; font-size: 11px; }
  .preview-panel { max-height: 50%; }
}

.library-module-error {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 14px;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(28px, 8vw, 100px);
  background: #211e1b;
  color: #f6f1e8;
}
.library-module-error h1,
.library-scene-asset-error h2 { margin: 0; font: 400 clamp(30px, 5vw, 48px)/1.2 var(--tk-font-display, Georgia, serif); }
.library-module-error > p:not(.scene-kicker),
.library-scene-asset-error > p:not(.scene-kicker) { max-width: 620px; color: #d4cbbd; line-height: 1.7; }
.library-module-error__actions,
.library-scene-asset-error__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.library-module-error .button,
.library-scene-asset-error .button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 16px; border: 1px solid rgba(230, 217, 193, .4); background: transparent; color: #f6f1e8; font: inherit; text-decoration: none; cursor: pointer; }
.library-module-error .button:first-child,
.library-scene-asset-error .button:first-child { background: #6d2432; border-color: #6d2432; }
.library-module-error :focus-visible,
.library-scene-asset-error :focus-visible { outline: 3px solid #d5b67b; outline-offset: 4px; }
.library-scene--asset-error { background: #211e1b; }
.library-scene--asset-error .scene-image { visibility: hidden; }
.library-scene--asset-error .gate-actions,
.library-scene--asset-error .hall-hotspots,
.library-scene--asset-error .book-stage { visibility: hidden; }
.library-scene-asset-error { position: absolute; z-index: 30; inset: 0; display: grid; align-content: center; justify-items: center; gap: 12px; overflow: auto; padding: clamp(20px, 5vw, 56px); background: rgba(33, 30, 27, .97); color: #f6f1e8; text-align: center; }
.library-scene-asset-error > p:not(.scene-kicker) { margin: 0; }
.library-scene-asset-error__actions { justify-content: center; }
.book-object--asset-error img,
.preview-panel__book--asset-error img { display: none; }
.book-object__cover-fallback { position: absolute; z-index: 1; bottom: 8px; left: 50%; width: 76%; height: 72%; border: 1px solid rgba(238, 220, 187, .65); border-left: 5px solid #8b6b4d; background: #493632; box-shadow: 5px 4px 9px rgba(9, 7, 5, .48); transform: translateX(-50%) rotateY(var(--book-yaw, 0deg)); }
.book-object__asset-warning { position: absolute; z-index: 3; top: 8px; right: 50%; width: max-content; padding: 3px 5px; transform: translateX(50%); background: #f5eddf; color: #6a2432; font-size: 8px; }
.preview-panel__book--asset-error { display: grid; place-items: center; padding: 4px; background: #ebe3d7; color: #6a2432; text-align: center; }
.preview-panel__book--asset-error span { font-size: 8px; line-height: 1.3; }
@media (max-width: 700px) {
  .library-module-error { min-height: 100svh; padding: 24px 18px calc(90px + env(safe-area-inset-bottom, 0px)); }
  .library-module-error__actions,
  .library-scene-asset-error__actions { width: 100%; flex-direction: column; }
  .library-module-error .button,
  .library-scene-asset-error .button { width: 100%; min-height: 48px; }
  .library-scene-asset-error { padding: 18px; }
}
