/* 1984 图书馆 — paper, cloth bindings, walnut and reading-room green. */
:root {
  --bg:#f3efe5; --surface:#fcfaf4; --surface-2:#e9e3d5;
  --text:#302d26; --text-2:#655f51; --muted:#7a7161; --faint:#a89b86;
  --border:#d9d0be; --divider:#ddd4c2; --rule:#817354;
  --accent:#294b40; --accent-ink:#fffaf0; --accent-soft:#e4e9dd; --focus:#42664c;
  --st-r:#42624a; --st-n:#d1c7b5; --st-c:#ae755a;
  --tr-1:#42624a; --tr-2:#b07e41; --tr-3:#5c8290; --tr-4:#847297; --tr-5:#b06654;
  --topbar-h:82px; --side-w:218px;
  --wood:#8b6846; --wood-light:#b99970; --hero:#e8e1cf; --card:#fbf8ef;
  --shelf-shadow:rgba(72,51,30,.14);
}
:root[data-theme="dark"] {
  --bg:#1c251f; --surface:#263028; --surface-2:#323c31;
  --text:#e9e2d0; --text-2:#c2bca9; --muted:#a7a48e; --faint:#7c806e;
  --border:#455040; --divider:#3b4738; --rule:#8b9279;
  --accent:#b9c9a1; --accent-ink:#1c291e; --accent-soft:#354533; --focus:#c7d7a8;
  --st-r:#a4b68d; --st-n:#4a5545; --st-c:#cc9979;
  --tr-1:#b9c9a1; --tr-2:#d8ad79; --tr-3:#91b6be; --tr-4:#b3a2c9; --tr-5:#d49782;
  --wood:#806343; --wood-light:#ac8961; --hero:#303b2e; --card:#263028;
  --shelf-shadow:rgba(0,0,0,.28);
}
@media(prefers-color-scheme:dark) {
  :root:not([data-theme="light"]) {
    --bg:#1c251f; --surface:#263028; --surface-2:#323c31;
    --text:#e9e2d0; --text-2:#c2bca9; --muted:#a7a48e; --faint:#7c806e;
    --border:#455040; --divider:#3b4738; --rule:#8b9279;
    --accent:#b9c9a1; --accent-ink:#1c291e; --accent-soft:#354533; --focus:#c7d7a8;
    --st-r:#a4b68d; --st-n:#4a5545; --st-c:#cc9979;
    --tr-1:#b9c9a1; --tr-2:#d8ad79; --tr-3:#91b6be; --tr-4:#b3a2c9; --tr-5:#d49782;
    --wood:#806343; --wood-light:#ac8961; --hero:#303b2e; --card:#263028;
    --shelf-shadow:rgba(0,0,0,.28);
  }
}
body { background-image:radial-gradient(var(--border) .45px,transparent .45px); background-size:6px 6px; }
.topbar { padding:0 30px; gap:14px; background:#263f35; color:#f4edda; border-bottom:3px solid #9c8256; box-shadow:0 3px 12px #17261b12; }
.topbar .icon-btn,.topbar .search-btn { color:#d7dcc8; border-radius:5px; }
.topbar .icon-btn:hover,.topbar .search-btn:hover { color:#fff9e9; background:#ffffff12; }
.logo { gap:12px; margin:0 24px 0 0; color:#f5edd9; }
.library-emblem { width:36px; height:40px; flex:none; stroke:#c3af7f; fill:none; stroke-width:1.3; }
.logo-text { font:500 24px/1.2 var(--serif); letter-spacing:.1em; white-space:nowrap; }
.search { max-width:510px; min-height:42px; border:1px solid #b8b99c55; border-radius:5px; background:#142b2136; padding:0 8px 0 14px; }
.search:focus-within { border-color:#ccbc91; box-shadow:0 0 0 2px #c8b48720; }
.search input { color:#f5edda; font-size:14px; }
.search input::placeholder { color:#bdc4b0; }
.layout { max-width:1540px; margin:auto; }
.sidebar { padding:34px 22px 32px 24px; border-right:1px solid var(--border); background:var(--bg); }
.catalog-heading { margin:0 0 22px; padding-bottom:16px; border-bottom:3px double var(--border); color:var(--muted); font:500 13px/1.5 var(--serif); letter-spacing:.22em; }
.nav a,.nav-more { border-radius:4px; padding:9px 10px; margin:2px -10px; font-size:14px; }
.nav a:hover,.nav-more:hover { background:var(--surface-2); color:var(--accent); }
.nav a.active { color:var(--accent); background:var(--accent-soft); box-shadow:inset 3px 0 var(--accent); font-weight:600; }
.nav a:focus-visible { outline:2px solid var(--focus); outline-offset:2px; }
.nav a svg,.nav-more svg { width:17px; height:17px; stroke:currentColor; opacity:.75; }
.nav-h { font:500 13px/1.4 var(--serif); letter-spacing:.12em; padding-top:21px; margin-top:24px; }
.nav.topics a { padding:5px 10px; font-size:13px; }
.nav.topics .count { font:12px/1.5 var(--sans); font-variant-numeric:tabular-nums; }
main { padding:34px 38px 68px; }
.page-h { padding-top:0; margin-bottom:10px; }
.page-h h1 { font-weight:500; font-size:clamp(28px,3vw,38px); letter-spacing:.06em; }
.sub { font-size:14px; line-height:1.8; }
#chips { padding:14px 0 16px; margin:20px 0 0; border-top:1px solid var(--border); border-bottom:1px solid var(--border); }
.chips { margin:4px 0; gap:5px 15px; min-height:28px; }
.chips .lbl { font-size:12px; color:var(--muted); min-width:54px; }
.chip { font-size:12px; padding:3px 6px; border-radius:3px; }
.chip.on { color:var(--accent); background:var(--accent-soft); font-weight:600; }
.chip:hover { background:var(--surface-2); }
.chip.topic { padding:3px 9px; border-color:var(--border); }
.reading-room { min-height:302px; display:grid; grid-template-columns:minmax(240px,.9fr) minmax(300px,1.1fr); align-items:center; gap:20px; padding:38px 38px 30px; margin:0 0 32px; border:1px solid var(--border); border-radius:5px; background:var(--hero); position:relative; overflow:hidden; }
.reading-room::before { content:""; position:absolute; top:12px; left:12px; right:12px; bottom:12px; border:1px solid var(--border); pointer-events:none; }
.room-copy { position:relative; z-index:1; }
.room-copy h1 { font:500 clamp(32px,3.4vw,49px)/1.45 var(--serif); letter-spacing:.04em; }
.room-copy p { font-size:13px; line-height:1.9; color:var(--text-2); max-width:25em; margin:14px 0 20px; }
.room-link { font:500 13px/1.6 var(--sans); color:var(--accent); border-bottom:1px solid var(--accent); padding-bottom:5px; display:inline-flex; gap:20px; }
.room-link:hover { text-decoration:none; }
.room-shelf { position:relative; min-width:0; height:226px; display:flex; gap:15px; justify-content:center; align-items:flex-end; padding:0 16px 25px; }
.room-shelf::before { content:""; position:absolute; inset:3px 8% 20px; border:1px solid var(--border); border-radius:110px 110px 0 0; background:linear-gradient(120deg,var(--surface),transparent 65%); opacity:.55; }
.room-shelf::after { content:""; position:absolute; left:0; right:0; bottom:13px; height:10px; background:linear-gradient(var(--wood-light) 0 4px,var(--wood) 4px 10px); border-radius:2px; box-shadow:0 9px 15px var(--shelf-shadow); }
.room-book { width:clamp(64px,7vw,102px); flex:none; position:relative; z-index:1; transform:rotate(-5deg); transform-origin:center bottom; }
.room-book:nth-child(2) { transform:translateY(-7px); }
.room-book:nth-child(3) { transform:rotate(5deg); }
.room-book .cover { border-radius:2px 4px 4px 2px; box-shadow:4px 5px 8px #231a1930; }
.room-book .cover img { object-fit:contain; }
.room-book:hover { transform:translateY(-8px); }
.room-book:focus-visible { outline-offset:5px; }
.room-book .cover::after { content:""; position:absolute; inset:0; background:linear-gradient(90deg,#0003,transparent 5%,#fff2 7%,transparent 10%); pointer-events:none; }
.room-book-skeleton { aspect-ratio:2/3; background:var(--surface-2); border:1px solid var(--border); }
.reading-list-heading { display:flex; justify-content:space-between; align-items:baseline; gap:12px; margin:0; }
.reading-list-heading h2 { font:500 25px/1.5 var(--serif); letter-spacing:.06em; }
.reading-list-heading span { color:var(--muted); font-size:12px; font-variant-numeric:tabular-nums; }
/* Keep the original compact cover grid, with restrained library colors. */
.grid,.row { grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:28px 20px; margin-top:24px; }
.card { display:flex; flex-direction:column; gap:0; min-width:0; padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; container-type:inline-size; }
.card:hover { box-shadow:none; }
.card > .cover { width:100%; height:auto; flex:none; aspect-ratio:2/3; border-radius:1px 3px 3px 1px; box-shadow:2px 3px 6px var(--shelf-shadow); }
.card > .cover img { object-fit:contain; background:var(--surface-2); }
.card-copy { min-width:0; width:100%; min-height:147px; margin-top:10px; }
.card h3 { margin:0; height:44px; font:500 16px/22px var(--serif); color:var(--text); }
.card:hover h3 { color:var(--accent); }
.card .t-en { height:18px; margin:0; font:12px/18px var(--latin); }
.card .au { height:20px; margin:0; font:12px/20px var(--sans); color:var(--text-2); }
.card .rec { height:20px; font:11px/20px var(--sans); margin:4px 0 0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.card .rec b { font:500 12px/20px var(--sans); color:var(--accent); }
.card .why1 { height:36px; margin:5px 0 0; font:12px/18px var(--sans); color:var(--muted); }
.card .qv { background:var(--accent); color:var(--accent-ink); font-size:11px; min-width:20px; margin-right:4px; }
.card .badge { font:10px/1.2 var(--sans); padding:4px 5px; background:#263f35e8; color:#fff8e6; }
.card .wl { top:6px; left:6px; width:30px; height:32px; border-radius:2px; background:var(--surface); color:var(--accent); }
.cover.ph { background:var(--accent-soft); color:var(--accent); border-left:5px solid var(--wood); }
.ph-t { font:500 12px/1.5 var(--serif); }.ph-a { font:10px/1.5 var(--sans); color:var(--text-2); }
.card .loading-line { margin:4px 0 6px; height:20px; }
.card .loading-line.title { height:44px; margin:0; }
.card .loading-line.short { margin:0; }
.loading-filters { height:90px; margin:20px 0 0; padding:14px 0; border-block:1px solid var(--border); }
.reading-list-heading + #chips { height:96px; }
.reading-list-heading + #chips .chips { flex-wrap:nowrap; overflow-x:auto; white-space:nowrap; scrollbar-width:thin; }
.library-loading .loading-filters { height:96px; }
.loading-heading { font-size:25px!important; line-height:37.5px!important; }
.library-loading .reading-room { margin-bottom:32px; }
.btn { border-radius:4px; border-color:var(--border); font-size:13px; padding:7px 12px; }
.btn.primary { background:var(--accent); color:var(--accent-ink); border-color:var(--accent); }
.book { max-width:1100px; grid-template-columns:210px minmax(0,1fr); gap:36px; padding:28px; background:var(--surface); border:1px solid var(--border); border-radius:5px; }
.book > div:first-child { padding:16px; background:var(--hero); border-radius:3px; border-bottom:7px solid var(--wood); }
.book > div:first-child .cover { box-shadow:4px 5px 12px var(--shelf-shadow); }
.book h1 { font-family:var(--serif); line-height:1.4; font-size:clamp(27px,3vw,39px); }
.book .by { font-size:15px; }
.stats { gap:15px 28px; border-top:3px double var(--border); }
.stat b { font-size:28px; color:var(--accent); }
.stat span { font-size:12px; }
.whybox,.qbox { background:var(--bg); border-color:var(--border); border-radius:3px; }
.sec { border-top-color:var(--border); }.sec h2,.prose h2 { font-family:var(--serif); font-weight:500; }
.comment { padding:22px 0; }.comment-h { font-size:12px; }
.comment .c-zh { line-height:1.9; }.comment .c-en { color:var(--muted); }
.prose { background:var(--surface); padding:30px; border:1px solid var(--border); border-radius:5px; }
.update-card { background:var(--surface); border-color:var(--border); border-radius:4px; box-shadow:0 2px 3px var(--shelf-shadow); }
.update-card h2 { font-family:var(--serif); font-weight:500; }
.footer { max-width:1540px; margin:auto; padding:28px 38px 34px 256px; border-top:3px double var(--border); }
.foot-brand { color:var(--accent); font-weight:500; font-size:21px; }
.foot-cols { max-width:none; justify-content:space-between; }
.foot-about { flex-basis:300px; max-width:43em; }.foot-about p:not(.foot-brand) { line-height:1.9; font-size:12px; }
.foot-links { font-size:12px; gap:7px; }
#footer-meta { font:11px/1.6 var(--sans); color:var(--muted); }
dialog { border-radius:6px; border-color:var(--border); box-shadow:0 20px 80px #16241c44; }
.bpage,.apage { margin:32px auto; background:var(--surface); border:1px solid var(--border); border-radius:5px; }
.bpage .crumb,.apage .crumb { color:var(--accent); font-family:var(--serif); }
.bpage blockquote { color:var(--text-2); border-left-color:var(--wood-light); }
.apage .acard img { box-shadow:3px 4px 7px var(--shelf-shadow); }
.apage .acard .an,.bpage .stats span,.bpage blockquote cite { color:var(--muted); }
@media(min-width:900px) and (max-width:1190px) {
  :root { --side-w:190px; }
  main { padding:28px 24px 56px; }.sidebar { padding-inline:20px; }
  .reading-room { padding:28px; grid-template-columns:minmax(205px,1fr) minmax(230px,1fr); gap:6px; min-height:280px; }
  .room-copy h1 { font-size:34px; }.room-shelf { gap:10px; padding-inline:4px; }
  .footer { padding-left:214px; }
}
@media(max-width:899px) {
  .topbar { padding-inline:14px; gap:8px; }.logo { margin-right:8px; }.logo-text { font-size:22px; }
  .sidebar { background:var(--bg); width:240px; padding:26px; }.catalog-heading { margin-bottom:15px; }
  main { padding:24px 22px 44px; }.footer { padding:24px 22px; }
  .reading-room { padding:30px; min-height:280px; grid-template-columns:1fr 1fr; gap:8px; }
  .room-copy h1 { font-size:36px; }.room-shelf { gap:10px; }.room-book { width:85px; }
}
@media(max-width:640px) {
  :root { --topbar-h:116px; }
  .topbar { display:grid; grid-template-columns:36px 1fr 36px; grid-template-rows:52px 44px; padding:6px 16px 11px; gap:0 8px; }
  #menu-btn { grid-column:1;grid-row:1; }.logo { grid-column:2;grid-row:1;justify-self:center;margin:0;gap:8px; }
  .library-emblem { width:25px;height:29px; }.logo-text { font-size:21px; }
  #theme-btn { grid-column:3;grid-row:1; }.topbar .icon-btn { width:36px;height:36px; }
  .search { grid-column:1/-1;grid-row:2;width:100%;max-width:none;min-height:39px;margin:0; }
  .search input { height:36px;font-size:14px; }
  main { padding:20px 16px 40px; }
  .reading-room { grid-template-columns:1fr; padding:24px; gap:8px; min-height:356px; margin-bottom:25px; }
  .room-copy h1 { font-size:32px;line-height:1.4; }.room-copy h1 br { display:none; }
  .room-copy p { font-size:12px;max-width:none;margin:8px 0 12px; }.room-link { font-size:12px; }
  .room-shelf { height:174px;gap:18px;padding:0 0 24px; }.room-book { width:clamp(62px,20vw,88px); }
  .room-book:nth-child(2) { transform:translateY(-3px); }
  .room-shelf::before { inset:0 6% 20px; }.room-shelf::after { bottom:13px; }
  .reading-list-heading h2 { font-size:23px; }.reading-list-heading span { font-size:11px; }
  .grid,.row { gap:24px 16px;margin-top:20px; }
  .card h3 { font-size:15px; }
  #chips { margin-top:16px;padding:10px 0 13px; }.chips { gap:3px 8px; }
  .chips .lbl { font-size:11px;min-width:48px; }.chip { font-size:11px; }
  .book { display:block;padding:20px; }.book > div:first-child { width:112px;float:left;margin:0 18px 18px 0;padding:9px;border-bottom-width:5px; }
  .book h1 { font-size:25px; }.book .stats { padding-top:18px; }.book .stat b { font-size:25px; }
  .prose { padding:20px; }.footer { padding:24px 20px; }
  .bpage,.apage { margin:16px;padding:24px!important; }.bhead { gap:18px!important;grid-template-columns:100px minmax(0,1fr)!important; }
  .bpage .stats { gap:15px;flex-wrap:wrap; }
  .library-loading .reading-room { margin-bottom:25px; }
  .reading-list-heading + #chips,.library-loading .loading-filters { height:89px;margin-top:16px; }
}
@media(max-width:360px) {
  .room-shelf { gap:14px; }
  .grid,.row { grid-template-columns:repeat(2,minmax(0,1fr));gap:24px 14px; }
  .card h3 { font-size:14px; }
}
@media(prefers-reduced-motion:reduce) { .room-book,.card { transition:none; } }
@media print { body { background:white; }.reading-room { display:none; }.card,.book { box-shadow:none;break-inside:avoid; } }
