/* Existing Chinese font and theme tokens are the design authority. Wood and
   cloth are material roles, confined to the shelf; one blue UI accent remains. */
.library-catalog { min-width: 0; scroll-margin-top: 125px; }
.catalog-views,.history-tools,.catalog-pager { display:flex;flex-wrap:wrap;gap:8px;align-items:center; }
.catalog-views { margin-bottom:14px; }
.library-catalog button,.library-catalog select,.library-catalog input { min-height:44px; }
.catalog-views button[aria-pressed="true"] { background:var(--accent-soft);border-color:var(--accent);color:var(--ink); }
.catalog-filters { display:grid;grid-template-columns:minmax(180px,2fr) repeat(4,minmax(100px,1fr));gap:10px; }
.catalog-filters label { font-size:.8rem;color:var(--ink-2);display:flex;flex-direction:column;gap:5px;min-width:0; }
.catalog-filters input,.catalog-filters select { width:100%;min-width:0;max-width:100%; }
.catalog-note { font-size:.8rem;color:var(--ink-2);line-height:1.65;margin:10px 0; }
.catalog-layout { display:grid;grid-template-columns:minmax(0,1fr) minmax(220px,290px);gap:20px;align-items:start; }
.catalog-display { min-width:0; }
.catalog-books { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:22px 13px;padding:18px 14px 24px;background:var(--bg-subtle);border:1px solid var(--line);border-radius:6px;position:relative; }
.catalog-books[data-mode="shelf"] { background:repeating-linear-gradient(0deg,transparent 0,transparent 218px,rgba(112,83,59,.1) 219px,rgba(112,83,59,.1) 221px),var(--bg-subtle); }
.catalog-book { --cloth:#294b64;position:relative;text-align:left;display:flex;flex-direction:column;align-items:flex-start;justify-content:space-between;gap:8px;min-width:0;min-height:192px;padding:15px 12px 13px 19px;border:1px solid rgba(23,37,50,.25);border-radius:3px 7px 7px 3px;background:var(--cloth);color:#f1f3ed;box-shadow:4px 4px 0 #d7d3c9,6px 6px 0 #b9b5ac,7px 10px 14px rgba(20,33,48,.16);transition:transform .18s,box-shadow .18s;overflow-wrap:anywhere;isolation:isolate; }
.catalog-book::before { content:"";position:absolute;inset:0;z-index:-1;background:repeating-linear-gradient(90deg,rgba(232,237,241,.05) 0,rgba(232,237,241,.05) 1px,transparent 1px,transparent 4px);border-left:6px solid rgba(20,33,48,.2);border-radius:inherit; }
.catalog-book::after { content:"";position:absolute;left:-15px;right:-15px;bottom:-13px;height:9px;background:linear-gradient(#967d67,#6e5747);box-shadow:0 5px 5px rgba(37,32,29,.16);z-index:-2; }
.library-catalog .catalog-book:hover { background:var(--cloth);border-color:var(--accent);transform:translateY(-3px);color:#f1f3ed; }
.catalog-book[aria-pressed="true"] { outline:3px solid var(--accent);outline-offset:6px; }
.book-number { font-family:var(--font-mono);font-size:.75rem;line-height:1.4; }
.book-title { font-size:.93rem;line-height:1.6;font-weight:650;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden; }
.book-foot { font-size:.72rem;opacity:.95; }
.catalog-selected { background:var(--bg-subtle);border:1px solid var(--line);border-radius:6px;padding:17px;overflow-wrap:anywhere;min-width:0; }
.catalog-selected h3 { font-size:1rem;line-height:1.65;margin:0 0 8px; }
.catalog-selected p,.library-summary p { line-height:1.8; }
.catalog-selected ul,.library-summary ul { padding-left:20px;font-size:.82rem;color:var(--ink-2); }
.catalog-selected .btn-link { display:inline-flex;align-items:center;min-height:44px; }
.catalog-selected .summary-method,.library-summary .summary-method { font-size:.77rem;color:var(--ink-2); }
.catalog-pager { justify-content:center;margin-top:16px;min-height:44px; }
.catalog-pager span { font-variant-numeric:tabular-nums;font-size:.8rem; }
.catalog-books[data-mode="list"],.catalog-books[data-mode="history"] { display:flex;flex-direction:column;gap:0;padding:0;background:transparent;border:none; }
.catalog-books[data-mode="list"] .catalog-book,.catalog-books[data-mode="history"] .catalog-book { min-height:68px;padding:12px;box-shadow:none;border:0;border-bottom:1px solid var(--line);border-radius:0;background:var(--bg-elev);color:var(--ink);gap:4px; }
.catalog-books[data-mode="list"] .catalog-book::before,.catalog-books[data-mode="list"] .catalog-book::after,.catalog-books[data-mode="history"] .catalog-book::before,.catalog-books[data-mode="history"] .catalog-book::after { display:none; }
.catalog-books[data-mode="list"] .book-title,.catalog-books[data-mode="history"] .book-title { display:block; }
.catalog-books[data-mode="list"] .book-foot,.catalog-books[data-mode="history"] .book-foot { color:var(--ink-2); }
.catalog-books[data-mode="list"] .catalog-book:hover,.catalog-books[data-mode="history"] .catalog-book:hover { background:var(--bg-hover);color:var(--ink);transform:none; }
.history-tools { margin-bottom:10px; }
.history-stage { height:360px;width:100%;max-width:100%;border-radius:6px;border:1px solid var(--line);overflow:hidden;background:var(--bg-inset); }
.history-stage canvas { display:block;width:100%;height:100%;touch-action:pan-y; }
.history-years { display:flex;flex-wrap:wrap;gap:6px;margin:10px 0;font-size:.78rem;color:var(--ink-2); }
.history-years span { padding:4px 8px;border:1px solid var(--line);border-radius:4px; }
.library-summary { margin-bottom:16px; }
.library-catalog :focus-visible { outline:3px solid var(--accent);outline-offset:3px; }
.library-catalog [hidden] { display:none!important; }
@media(prefers-color-scheme:dark) { .catalog-book { box-shadow:4px 4px 0 #8e938e,6px 6px 0 #555b57,7px 10px 14px rgba(9,16,24,.4); }.catalog-book::after { background:linear-gradient(#726053,#44392f); } }
@media(max-width:1100px) { .catalog-filters { grid-template-columns:repeat(3,minmax(0,1fr)); }.catalog-filters label:first-child { grid-column:span 2; }.catalog-layout { grid-template-columns:minmax(0,1fr); }.catalog-selected { order:2; }.catalog-books { grid-template-columns:repeat(4,minmax(0,1fr)); } }
@media(max-width:600px) { .catalog-filters { grid-template-columns:repeat(2,minmax(0,1fr)); }.catalog-filters label:first-child { grid-column:span 2; }.catalog-books { grid-template-columns:repeat(2,minmax(0,1fr));padding:14px 10px 24px; }.catalog-book { min-height:192px; }.history-stage { height:300px; }.library-catalog .panel-head { flex-wrap:wrap;gap:5px; } }
@media(prefers-reduced-motion:reduce) { .catalog-book { transition:none; }.library-catalog .catalog-book:hover { transform:none; } }

.history-years button { min-height:44px;font-size:.78rem;padding:8px 10px; }
.history-years button[aria-pressed="true"] { background:var(--accent-soft);border-color:var(--accent);color:var(--ink); }
/* Thin cloth covers replace the rejected thick spine and stacked page offsets. */
.catalog-book { border-radius:2px 4px 4px 2px;padding-left:14px;box-shadow:2px 1px 0 #d7d3c9,3px 2px 0 #aaa99f,0 5px 9px rgba(25,38,44,.13); }
.catalog-book::before { border-left-width:2px; }
.catalog-book::after { display:none; }
.catalog-books[data-mode="shelf"] { background:var(--bg-subtle); }
.history-stage { height:320px;overflow-x:auto;overflow-y:hidden;background:var(--bg-subtle); }
.history-canvas-content { height:100%;position:relative;min-width:100%; }
.history-axis-overlay { position:absolute;inset:0;pointer-events:none;color:var(--ink);font-variant-numeric:tabular-nums; }
.history-dom-line { position:absolute;height:1px;background:var(--ink-2);transform-origin:left center; }
.history-dom-year { position:absolute;transform:translateX(-50%);padding-top:13px;font-size:13px;font-weight:600;line-height:1.3; }
.history-dom-year::before { content:"";position:absolute;top:-4px;left:50%;height:9px;width:1px;background:var(--ink-2); }
.history-paperline { overflow-x:auto;max-width:100%;border:1px solid var(--line);border-radius:6px;padding:20px 12px 12px;background:var(--bg-subtle); }
.paperline-rail { display:flex;min-width:max-content;align-items:flex-end; }
.paperline-slot { width:110px;flex:none;position:relative;display:flex;align-items:center;flex-direction:column;justify-content:flex-end;min-height:195px; }
.paperline-slot::after { content:"";position:absolute;left:0;right:0;bottom:50px;height:1px;background:var(--ink-2); }
.paperline-book { --cloth:#294b64;display:flex;flex-direction:column;gap:12px;justify-content:flex-start;text-align:left;color:#ecf0e9!important;background:var(--cloth)!important;width:82px;min-height:116px!important;height:116px;padding:9px 7px 8px 10px!important;border-radius:2px!important;border:1px solid rgba(32,45,52,.22)!important;box-shadow:1px 1px 0 #d3d5cb,2px 2px 0 #a4aba2,0 4px 7px rgba(25,38,44,.12);margin-bottom:12px;position:relative; }
.paperline-book::before { content:"";position:absolute;inset:0;border-left:2px solid rgba(22,39,48,.25);background:repeating-linear-gradient(90deg,rgba(233,236,228,.05) 0,rgba(233,236,228,.05) 1px,transparent 1px,transparent 3px);pointer-events:none; }
.paperline-book .book-number { font-size:9px; }.paperline-book .book-title { font-size:10px;line-height:1.45;-webkit-line-clamp:4; }
.paperline-year { font-size:13px;font-weight:600;min-height:44px;padding:9px 5px 0;border:0;background:transparent;position:relative; }
.paperline-year::before { content:"";height:8px;width:1px;background:var(--ink-2);position:absolute;top:0;left:50%; }
@media(prefers-color-scheme:dark) { .catalog-book { box-shadow:2px 1px 0 #8e938e,3px 2px 0 #555b57,0 5px 9px rgba(9,16,24,.3); } }
@media(max-width:600px) { .history-stage { height:300px; }.history-tools { gap:6px; }.history-tools button { font-size:.78rem; } }
.paperline-book[aria-pressed="true"] { outline:2px solid var(--accent);outline-offset:3px;transform:translateY(-3px); }
