/* Theme-specific spatial layouts. Catalogue data and reading actions remain shared. */
[hidden] {display:none!important;}
.layout-caption {position:relative; z-index:1; margin-top:12px; font:11px/1.6 monospace; letter-spacing:.12em; color:var(--accent);}
.layout-status {position:relative; z-index:1; margin-top:18px; font:10px/1.8 monospace; color:var(--text-secondary); letter-spacing:.1em;}
.archive-card {position:relative;}
.reader-rail {display:none;}
body[class*="theme-"] :is(.book-header,.volume-header) {display:block;}
body[class*="theme-"] :is(.card-name,.vol-name,.ch-name,.book-title,.volume-title) {overflow-wrap:anywhere;}
body[class*="theme-"] button:focus-visible {outline:2px solid var(--accent);outline-offset:4px;}
body[class*="theme-"] .volume-directory-item {min-width:0;}
.volume-directory-item .vol-desc {line-height:1.8;}
body[class*="theme-"] .archive-grid:empty {display:none;}
body[class*="theme-"] .page-single :is(h1,h2,h3,h4) {line-height:1.7;}

/* 01 — An asymmetric museum exhibition: one major exhibit, four side panels. */
body.theme-midcentury .archive-home {max-width:1240px;}
body.theme-midcentury .archive-header {min-height:250px; border-left:8px solid #9b8962; padding-left:38px;}
body.theme-midcentury .archive-grid {grid-template-columns:1.25fr 1fr 1fr; grid-auto-rows:minmax(230px,auto);gap:18px;}
body.theme-midcentury .archive-card:nth-child(n) {grid-column:auto;min-height:230px;padding:24px;}
body.theme-midcentury .archive-card.primary-book {grid-column:1;grid-row:span 2;justify-content:flex-end;min-height:490px;background:linear-gradient(155deg,#d6ded3 0%,#f3ede1 72%);border-top:7px solid #a34d32;padding:35px;}
body.theme-midcentury .archive-card.primary-book .card-number {margin-bottom:auto;}
body.theme-midcentury .archive-card.primary-book .collection-graphic {width:170px;height:130px;top:85px;right:40px;transform:scale(1.5);transform-origin:top right;}
body.theme-midcentury .archive-card.primary-book .card-name {font-size:38px;margin-top:110px;}
body.theme-midcentury .archive-card:not(.primary-book) .card-number {margin-bottom:35px;}
body.theme-midcentury .archive-card:not(.primary-book) .collection-graphic {transform:scale(.7);transform-origin:top right;}
body.theme-midcentury .volume-directory {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;border:1px solid var(--border-light);}
body.theme-midcentury .volume-directory-item {grid-template-columns:1fr auto;align-content:start;min-height:200px;padding:24px;border-right:1px solid var(--border-light);background:var(--card-bg);}
body.theme-midcentury .volume-directory-item:nth-child(n) .vol-number {grid-column:1;grid-row:1;color:var(--accent);}
body.theme-midcentury .volume-directory-item:nth-child(n) .vol-name {grid-column:1/-1;grid-row:2;font-size:22px;margin:22px 0 8px;}
body.theme-midcentury .volume-directory-item:nth-child(n) .vol-desc {grid-column:1/-1;grid-row:3;}
body.theme-midcentury .volume-directory-item:nth-child(n) .vol-chapters {grid-column:1;grid-row:4;margin-top:14px;}
body.theme-midcentury .volume-directory-item:nth-child(n) .vol-arrow {grid-column:2;grid-row:4;}
body.theme-midcentury .volume-chapter-list {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 30px;}
body.theme-midcentury .page-single {border-top:5px solid var(--archive-metal);padding-inline:65px;}
body.theme-midcentury .page-single h1 {text-align:left;font-size:2em;border-bottom:1px solid var(--archive-metal);padding-bottom:25px;}

/* 02 — A central observatory screen flanked by instruments. */
body.theme-spacetech .archive-home {max-width:1320px;}
body.theme-spacetech .archive-header {min-height:240px;display:grid;grid-template-columns:1fr 300px;align-content:center;padding-right:34%;background:radial-gradient(ellipse at 80% 50%,#203e5e80,transparent 60%),#0e1b2c;border-top:1px solid #80b8df;}
body.theme-spacetech .archive-header>*:not(.archive-architecture) {grid-column:1/-1;}
body.theme-spacetech .archive-architecture {width:190px;height:190px;top:25px;right:7%;bottom:auto;opacity:.65;border-radius:50%;transform:none;background:repeating-linear-gradient(0deg,transparent 0 29px,#80b8df18 30px 31px);}
body.theme-spacetech .archive-architecture::before {inset:24px;}
body.theme-spacetech .archive-architecture::after {inset:55px;}
body.theme-spacetech .archive-title {margin-top:12px;}
body.theme-spacetech .archive-meta {margin-top:18px;}
body.theme-spacetech .archive-grid {grid-template-columns:1fr 1.65fr 1fr;gap:16px;grid-auto-rows:minmax(225px,auto);}
body.theme-spacetech .archive-card:nth-child(n) {grid-column:auto;min-height:225px;padding:23px;border-radius:0;}
body.theme-spacetech .archive-card.primary-book {grid-column:2;grid-row:1/span 2;min-height:475px;justify-content:flex-end;border:1px solid #80b8df88;background:radial-gradient(ellipse at 50% 35%,#28527680,transparent 65%),linear-gradient(#0d1a2a,#132a40);}
body.theme-spacetech .archive-card:nth-child(2) {grid-column:1;grid-row:1;}
body.theme-spacetech .archive-card:nth-child(3) {grid-column:3;grid-row:1;}
body.theme-spacetech .archive-card:nth-child(4) {grid-column:1;grid-row:2;}
body.theme-spacetech .archive-card:nth-child(5) {grid-column:3;grid-row:2;}
body.theme-spacetech .archive-card.primary-book .card-number {margin-bottom:auto;border-bottom:1px solid #80b8df55;padding-bottom:13px;}
body.theme-spacetech .archive-card.primary-book .collection-graphic {top:110px;right:calc(50% - 56px);transform:scale(1.9);opacity:.7;}
body.theme-spacetech .archive-card.primary-book .card-name {font-size:35px;}
body.theme-spacetech .archive-card:not(.primary-book) .card-number {margin-bottom:30px;}
body.theme-spacetech .archive-card:not(.primary-book) .card-name {font:22px/1.6 sans-serif;}
body.theme-spacetech .archive-card:not(.primary-book) .collection-graphic {transform:scale(.55);transform-origin:top right;}
body.theme-spacetech .archive-card .card-foot {border-top-style:dashed;}
body.theme-spacetech .volume-directory {border-top:2px solid var(--accent);}
body.theme-spacetech .volume-directory-item {grid-template-columns:100px 1fr auto 32px;border-left:1px solid var(--border-light);border-right:1px solid var(--border-light);background:#102034;min-height:76px;}
body.theme-spacetech .volume-directory-item:nth-child(even) {background:#0e1a29;}
body.theme-spacetech .volume-directory-item:nth-child(n) .vol-number {color:#80b8df;border-radius:0;width:auto;height:auto;border:0;display:block;text-align:left;}
body.theme-spacetech .volume-chapter-list {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
body.theme-spacetech .volume-chapter-item {background:#102034;border:1px solid var(--border-light);padding:22px;}
body.theme-spacetech .reader-view .main-content {max-width:1160px;display:grid;grid-template-columns:155px minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto;gap:0 24px;padding:0 38px;}
body.theme-spacetech .reader-rail {display:flex;grid-column:1;grid-row:1/-1;flex-direction:column;gap:20px;margin:22px 0;border-right:1px solid var(--border-light);padding:18px 20px 0 0;}
body.theme-spacetech :is(.reader-header,.page-container-single,.chapter-nav) {grid-column:2;min-width:0;}
body.theme-spacetech .page-single {background:#0e1b2b;border-left:2px solid #80b8df;padding:30px 40px 60px;}
body.theme-spacetech .page-single h1 {text-align:left;font-family:sans-serif;border-bottom:1px dashed #80b8df55;}
body.theme-spacetech .page-single h2 {font-family:sans-serif;border-left:0;border-bottom:1px solid var(--border-light);padding:0 0 12px;}
.rail-kicker {font:9px/1.7 monospace;letter-spacing:.1em;color:var(--accent);overflow-wrap:anywhere;}
.rail-title {font:16px/1.7 'Songti SC','SimSun',serif;}
.rail-code {font:10px/1.8 monospace;color:var(--text-secondary);overflow-wrap:anywhere;}
.reader-rail dl {font-size:11px;line-height:1.9;}
.reader-rail dt {color:var(--text-secondary);font:9px/1.8 monospace;letter-spacing:.1em;margin-top:16px;}
.reader-rail dd {margin-top:4px;overflow-wrap:anywhere;}
.rail-end {margin-top:auto;padding-block:20px;font:9px/1.8 monospace;color:var(--text-secondary);}

/* 03 — Recovered folders, drawers and an annotated document. */
body.theme-wasteland .archive-header {min-height:215px;border-left:12px solid #746c54;padding:24px 30px;}
body.theme-wasteland .archive-title {font-size:42px;margin-top:12px;}
body.theme-wasteland .archive-architecture {border-radius:0;transform:rotate(8deg);width:20%;right:8%;top:35px;bottom:-40px;border-style:dashed;}
body.theme-wasteland .archive-grid {grid-template-columns:repeat(12,minmax(0,1fr));gap:26px 24px;padding:14px 10px 25px;align-items:start;}
body.theme-wasteland .archive-card:nth-child(n) {grid-column:span 4;min-height:235px;border:1px solid #b6a68b;border-top:16px solid #baac8b;padding:25px 22px;overflow:visible;box-shadow:4px 5px 0 #746c5425;}
body.theme-wasteland .archive-card.primary-book {grid-column:span 7;min-height:275px;transform:rotate(-1deg);}
body.theme-wasteland .archive-card:nth-child(2) {grid-column:span 5;margin-top:30px;transform:rotate(1deg);}
body.theme-wasteland .archive-card:nth-child(3) {transform:rotate(.7deg);}
body.theme-wasteland .archive-card:nth-child(4) {margin-top:22px;transform:rotate(-.8deg);}
body.theme-wasteland .archive-card:nth-child(5) {margin-top:-8px;transform:rotate(1deg);}
body.theme-wasteland .archive-card:nth-child(n)::before {display:block;content:'';position:absolute;width:72px;height:9px;top:-25px;left:18px;background:#baac8b;border:1px solid #9e8d6b;border-bottom:0;border-radius:3px 3px 0 0;}
body.theme-wasteland .archive-card:hover {transform:translateY(-4px);}
body.theme-wasteland .archive-card .card-number {margin-bottom:25px;}
body.theme-wasteland .archive-card .collection-graphic {transform:scale(.7);transform-origin:top right;opacity:.25;}
body.theme-wasteland .volume-directory {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;border:0;}
body.theme-wasteland .volume-directory-item {grid-template-columns:1fr auto;background:#e7ddc6;border:1px solid #aa997a!important;padding:24px;min-height:175px;box-shadow:inset 0 4px #c0b394,2px 3px #746c5420;}
body.theme-wasteland .volume-directory-item:nth-child(n) .vol-number {grid-column:1;grid-row:1;color:#8f412c;border:0;border-radius:0;width:auto;height:auto;display:block;}
body.theme-wasteland .volume-directory-item:nth-child(n) .vol-name {grid-column:1/-1;grid-row:2;font-size:19px;margin-block:12px;}
body.theme-wasteland .volume-directory-item:nth-child(n) .vol-desc {grid-column:1/-1;grid-row:3;}
body.theme-wasteland .volume-directory-item:nth-child(n) .vol-chapters {grid-column:1;grid-row:4;margin-top:10px;}
body.theme-wasteland .volume-directory-item:nth-child(n) .vol-arrow {grid-column:2;grid-row:4;}
body.theme-wasteland .volume-chapter-item {background:#eee5d1;border-bottom-style:dashed;padding:17px 20px;}
body.theme-wasteland .reader-view .main-content {max-width:1110px;display:grid;grid-template-columns:minmax(0,1fr) 150px;grid-template-rows:auto minmax(0,1fr) auto;gap:0 28px;}
body.theme-wasteland .reader-rail {display:flex;flex-direction:column;grid-column:2;grid-row:1/-1;gap:15px;border-left:1px dashed #aa997a;margin-top:24px;padding-left:18px;}
body.theme-wasteland :is(.reader-header,.page-container-single,.chapter-nav) {grid-column:1;min-width:0;}
body.theme-wasteland .page-single {border:0;border-left:3px double #aa997a;background:repeating-linear-gradient(0deg,transparent 0 3px,#675d3a04 3px 4px),#eee5d1;padding:35px 45px 65px;}
body.theme-wasteland .page-single h1 {text-align:left;border-bottom:2px solid #8a7450;}

/* 04 — A quiet axial corridor with staggered reading-room doors. */
body.theme-poolcore .archive-header {min-height:320px;text-align:center;border:0;border-bottom:1px solid #adccc6;border-radius:0;background:linear-gradient(#e6f2ec,#d1e8df);padding:36px 15%;}
body.theme-poolcore .archive-title {font-size:43px;letter-spacing:.25em;margin-top:30px;}
body.theme-poolcore .archive-subtitle {max-width:100%;}
body.theme-poolcore .archive-meta {justify-content:center;}
body.theme-poolcore .archive-architecture {width:80px;top:12px;bottom:12px;right:20px;border-radius:50px 50px 0 0;opacity:.22;transform:none;}
body.theme-poolcore .archive-grid {position:relative;display:grid;grid-template-columns:1fr 100px 1fr;gap:42px 0;padding:20px 7% 60px;}
body.theme-poolcore .archive-grid::before {content:'';position:absolute;top:0;bottom:0;left:calc(50% - 22px);width:44px;background:linear-gradient(90deg,transparent,#91bcb318,transparent);border-inline:1px solid #adccc680;pointer-events:none;}
body.theme-poolcore .archive-card:nth-child(n) {grid-column:1;min-height:255px;padding:30px 28px;border-radius:55px 55px 0 0;border:1px solid #adccc6;border-bottom:6px solid #91bcb3;background:#eff7ef;overflow:hidden;}
body.theme-poolcore .archive-card:nth-child(even) {grid-column:3;margin-top:110px;}
body.theme-poolcore .archive-card .card-number {margin-bottom:38px;letter-spacing:.2em;}
body.theme-poolcore .archive-card .collection-graphic {opacity:.18;transform:scale(.65);transform-origin:top right;top:35px;}
body.theme-poolcore .archive-card .card-name {font-size:25px;}
body.theme-poolcore .archive-card:hover {transform:translateY(-4px);}
body.theme-poolcore .book-header,body.theme-poolcore .volume-header {text-align:center;padding:34px 0;}
body.theme-poolcore .book-epigraph {text-align:center;}
body.theme-poolcore .volume-directory {max-width:750px;margin:40px auto;border:0;padding-left:26px;border-left:1px solid #91bcb3;}
body.theme-poolcore .volume-directory-item {grid-template-columns:65px 1fr auto 24px;width:calc(100% - 40px);margin-bottom:26px;min-height:95px;padding:24px 20px;border:1px solid #adccc6;border-bottom:4px solid #91bcb3;background:#edf5ed;}
body.theme-poolcore .volume-directory-item:nth-child(3n+2) {margin-left:20px;}
body.theme-poolcore .volume-directory-item:nth-child(3n) {margin-left:40px;}
body.theme-poolcore .volume-chapter-list {max-width:720px;margin:35px auto;gap:18px;padding-left:24px;border-left:1px solid #91bcb3;}
body.theme-poolcore .volume-chapter-item {padding:24px;background:#f1f7ef;border-bottom:2px solid #adccc6;}
body.theme-poolcore .reader-view .main-content {max-width:800px;padding:0 36px;}
body.theme-poolcore .reader-header {text-align:center;padding-block:22px 15px;}
body.theme-poolcore .reader-breadcrumb {justify-content:center;}
body.theme-poolcore .page-single {padding:45px 65px 75px;border:0;border-inline:1px solid #adccc6;background:#f1f7ef;}
body.theme-poolcore .page-single h1 {text-align:center;letter-spacing:.16em;border-bottom:1px solid #adccc6;padding-bottom:30px;margin-bottom:30px;}
body.theme-poolcore .page-single h2 {text-align:center;border-left:0;padding-left:0;letter-spacing:.12em;margin-block:35px 22px;}
body.theme-poolcore .chapter-nav {border-top:1px solid #91bcb3;}

/* 05 — A field journal and narrow book spines, with a branching classification. */
body.theme-forest .archive-home:not([style*="none"]) {display:grid!important;grid-template-columns:260px minmax(0,1fr);gap:24px 36px;}
body.theme-forest .archive-header {grid-column:1;grid-row:1/span 5;align-self:start;min-height:530px;padding:35px 24px;border:0;border-left:2px solid #8c8860;border-radius:0 35px 0 0;background:linear-gradient(150deg,#c4d0b8,#e6ebdb 70%);}
body.theme-forest .archive-title {font-size:35px;letter-spacing:.18em;line-height:1.8;max-width:4em;margin-top:34px;}
body.theme-forest .archive-subtitle {max-width:100%;font-family:serif;line-height:2.3;margin-top:20px;}
body.theme-forest .archive-meta {flex-direction:column;gap:10px;margin-top:30px;}
body.theme-forest .archive-meta span+span {border:0;padding-left:0;}
body.theme-forest .archive-architecture {top:auto;bottom:16px;right:12px;width:75px;height:130px;opacity:.25;}
body.theme-forest :is(.archive-tools,.search-results,.reading-resume,.archive-grid,.archive-footer) {grid-column:2;min-width:0;}
body.theme-forest .archive-tools {flex-wrap:wrap;margin-bottom:0;gap:12px;}
body.theme-forest .archive-search {width:100%;}
body.theme-forest .archive-grid {display:flex;flex-direction:column;gap:15px;}
body.theme-forest .archive-card:nth-child(n) {display:grid;grid-template-columns:1fr auto;min-height:130px;padding:24px 25px 24px 38px;border:0;border-left:7px solid #8c8860;border-radius:0 12px 12px 0;background:#f1f2e6;box-shadow:0 4px 0 #b8c1a733;}
body.theme-forest .archive-card:nth-child(2n) {border-left-color:#6f8861;margin-left:18px;}
body.theme-forest .archive-card.primary-book {min-height:270px;padding:32px 30px 30px 40px;display:flex;background:linear-gradient(120deg,#f4f3e6,#dce5d0);border-left:10px double #8c8860;border-radius:0 24px 4px 0;}
body.theme-forest .archive-card .card-number {grid-column:1;margin-bottom:0;font-size:9px;}
body.theme-forest .archive-card .card-tag {display:none;}
body.theme-forest .archive-card .card-name {grid-column:1;font-size:24px;margin:8px 0;}
body.theme-forest .archive-card .card-subtitle {grid-column:1;font:12px/1.9 serif;margin-bottom:12px;}
body.theme-forest .archive-card:not(.primary-book) .card-foot {grid-column:2;grid-row:1/span 3;border:0;padding:0 0 0 18px;margin:0;flex-direction:column;justify-content:center;}
body.theme-forest .archive-card .collection-graphic {display:none;}
body.theme-forest .archive-card.primary-book .card-number {margin-bottom:30px;}
body.theme-forest .archive-card.primary-book .card-name {font-size:32px;}
body.theme-forest .volume-directory {margin:35px 0 0 30px;border:0;border-left:2px solid #8c8860;padding-left:28px;}
body.theme-forest .volume-directory-item {grid-template-columns:65px 1fr auto 22px;background:#f1f2e6!important;margin-bottom:18px;min-height:88px;border:0!important;border-bottom:1px solid #b8c1a7!important;padding:20px 24px!important;border-radius:0 14px 0 0;}
body.theme-forest .volume-directory-item:nth-child(even) {width:calc(100% - 28px);margin-left:28px;}
body.theme-forest .volume-directory-item:nth-child(n)::before {display:block;content:'';position:absolute;left:-30px;top:40px;width:28px;height:1px;background:#8c8860;}
body.theme-forest .volume-directory-item:nth-child(even)::before {left:-58px;width:56px;}
body.theme-forest .volume-directory-item:nth-child(n) .vol-number {border:0;border-radius:0;width:auto;height:auto;display:block;}
body.theme-forest .volume-chapter-list {border-left:1px solid #8c8860;margin-left:15px;padding-left:20px;gap:8px;}
body.theme-forest .volume-chapter-item {background:#f1f2e6;padding:20px;}
body.theme-forest .reader-view .main-content {max-width:1100px;display:grid;grid-template-columns:minmax(0,1fr) 135px;grid-template-rows:auto minmax(0,1fr) auto;gap:0 26px;}
body.theme-forest .reader-rail {display:flex;grid-column:2;grid-row:1/-1;flex-direction:column;gap:18px;margin-top:28px;border-left:1px solid #8c8860;padding-left:18px;}
body.theme-forest :is(.reader-header,.page-container-single,.chapter-nav) {grid-column:1;min-width:0;}
body.theme-forest .page-single {font-family:'Songti SC','SimSun',serif;border:0;border-left:6px double #8c8860;background:#f1f2e6;padding:35px 45px 65px;}
body.theme-forest .page-single h1 {text-align:left;border-bottom:1px solid #b8c1a7;letter-spacing:.12em;}
body.theme-forest .page-single h2 {border:0;padding-left:0;}

/* 06 — A real text directory: no collection cards or decorative diagrams. */
body:is(.theme-dos,.theme-analoghorror) .archive-header {min-height:0;padding:22px 0;border:0;border-bottom:1px dashed var(--accent);background:transparent;}
body:is(.theme-dos,.theme-analoghorror) :is(.archive-architecture,.collection-graphic,.card-tag,.card-subtitle) {display:none;}
body:is(.theme-dos,.theme-analoghorror) .archive-title {font:26px/1.6 'Courier New','Microsoft YaHei',monospace;letter-spacing:0;margin:15px 0;}
body:is(.theme-dos,.theme-analoghorror) .archive-subtitle {font:12px/1.8 monospace;max-width:100%;}
body:is(.theme-dos,.theme-analoghorror) .archive-meta {margin-top:15px;}
body:is(.theme-dos,.theme-analoghorror) .archive-tools {margin:15px 0;}
body:is(.theme-dos,.theme-analoghorror) .archive-tools h2 {font:16px/1.8 monospace;letter-spacing:0;}
body:is(.theme-dos,.theme-analoghorror) .archive-grid {display:block;border:1px solid var(--border-light);padding:0;}
body:is(.theme-dos,.theme-analoghorror) .archive-grid::before {content:'INDEX / NAME / FILES / TYPE';display:block;padding:12px 18px;background:var(--archive-tint,var(--card-bg));font:11px/1.7 monospace;letter-spacing:.08em;}
body:is(.theme-dos,.theme-analoghorror) .archive-card:nth-child(n) {display:grid;grid-template-columns:145px minmax(0,1fr) 155px;gap:15px;align-items:center;min-height:66px;width:100%;padding:17px 18px;background:transparent;border:0;border-bottom:1px dashed var(--border-light);border-radius:0;box-shadow:none;transform:none;font-family:monospace;}
body:is(.theme-dos,.theme-analoghorror) .archive-card:nth-child(n)::before,body:is(.theme-dos,.theme-analoghorror) .archive-card:nth-child(n)::after {display:none;}
body:is(.theme-dos,.theme-analoghorror) .archive-card .card-number {margin:0;font:10px/1.8 monospace;}
body:is(.theme-dos,.theme-analoghorror) .archive-card .card-name {font:17px/1.8 'Courier New','Microsoft YaHei',monospace;letter-spacing:0;margin:0;}
body:is(.theme-dos,.theme-analoghorror) .archive-card .card-foot {border:0;margin:0;padding:0;display:flex;gap:10px;}
body:is(.theme-dos,.theme-analoghorror) .archive-card .card-enter {font:11px monospace;letter-spacing:0;}
body:is(.theme-dos,.theme-analoghorror) .archive-card:hover {background:var(--archive-tint,#28101b);transform:none;}
body:is(.theme-dos,.theme-analoghorror) :is(.book-title,.volume-title) {font:24px/1.7 'Courier New','Microsoft YaHei',monospace;letter-spacing:0;}
body:is(.theme-dos,.theme-analoghorror) .book-epigraph-wrapper {display:none;}
body:is(.theme-dos,.theme-analoghorror) .volume-directory {border:1px solid var(--border-light);}
body:is(.theme-dos,.theme-analoghorror) .volume-directory-item {grid-template-columns:80px 1fr auto 20px;border:0!important;border-bottom:1px dashed var(--border-light)!important;padding:16px!important;background:transparent!important;min-height:58px;font-family:monospace;}
body:is(.theme-dos,.theme-analoghorror) .volume-directory-item:nth-child(n) .vol-number {border:0;border-radius:0;width:auto;height:auto;display:block;}
body:is(.theme-dos,.theme-analoghorror) .vol-number::before {content:'├─ ';}
body:is(.theme-dos,.theme-analoghorror) .volume-directory-item:last-child .vol-number::before {content:'└─ ';}
body:is(.theme-dos,.theme-analoghorror) .volume-directory-item .vol-name {font-size:15px;}
body:is(.theme-dos,.theme-analoghorror) .volume-directory-item .vol-desc {display:none;}
body:is(.theme-dos,.theme-analoghorror) .volume-chapter-list {margin-left:12px;padding-left:15px;border-left:1px solid var(--border-light);gap:0;}
body:is(.theme-dos,.theme-analoghorror) .volume-chapter-item {padding:16px 10px;border-bottom-style:dashed;font-family:monospace;}
body:is(.theme-dos,.theme-analoghorror) .ch-number::before {content:'> ';}
body:is(.theme-dos,.theme-analoghorror) .reader-view .main-content {max-width:1080px;padding:0 30px;}
body:is(.theme-dos,.theme-analoghorror) .reader-rail {display:flex;align-items:center;gap:18px;flex-shrink:0;border-bottom:1px dashed var(--border-light);padding:12px 0;}
body:is(.theme-dos,.theme-analoghorror) .reader-rail :is(dl,.rail-end) {display:none;}
body:is(.theme-dos,.theme-analoghorror) .rail-title {font:12px monospace;}
body:is(.theme-dos,.theme-analoghorror) .rail-code {margin-left:auto;}
body:is(.theme-dos,.theme-analoghorror) .reader-header {padding:14px 0 9px;}
body:is(.theme-dos,.theme-analoghorror) .page-single {background:transparent;border:0;border-left:1px solid var(--border-light);border-radius:0;padding:25px 30px 60px;font-family:'Consolas','Courier New','Microsoft YaHei',monospace;}
body:is(.theme-dos,.theme-analoghorror) .page-single :is(h1,h2,h3,h4) {font-family:inherit;text-align:left;letter-spacing:0;}
body:is(.theme-dos,.theme-analoghorror) .page-single h1 {border-bottom:1px dashed var(--accent);font-size:1.6em;}
body:is(.theme-dos,.theme-analoghorror) .page-single h2 {border:0;padding-left:0;}
body:is(.theme-dos,.theme-analoghorror) .page-single p {text-indent:0;}

/* 07 — A newspaper masthead and two-column bibliographic index. */
body.theme-ink .archive-header {padding:20px 0 24px;min-height:0;background:#fff;border:0;border-top:7px solid #171717;border-bottom:2px solid #171717;}
body.theme-ink .archive-header .archive-kicker {letter-spacing:.4em;}
body.theme-ink .archive-title {font-size:clamp(40px,6.3vw,73px);letter-spacing:.14em;font-weight:700;margin:20px 0 15px;}
body.theme-ink .archive-subtitle {max-width:100%;font-family:serif;}
body.theme-ink .archive-meta {margin-top:22px;justify-content:space-between;}
body.theme-ink .layout-status {display:none;}
body.theme-ink .archive-tools {margin-top:10px;border-bottom:1px solid #171717;padding-bottom:20px;}
body.theme-ink .archive-search {background:#fff;border-bottom:1px solid #171717;}
body.theme-ink .archive-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:0 35px;border-top:3px solid #171717;}
body.theme-ink .archive-card:nth-child(n) {grid-column:auto;min-height:215px;border:0;border-bottom:1px solid #777;padding:25px 0;box-shadow:none;}
body.theme-ink .archive-card.primary-book {grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:10px 35px;min-height:230px;border-bottom:2px solid #171717;padding-block:30px;}
body.theme-ink .archive-card.primary-book .card-number {grid-column:1;grid-row:1;margin:0;}
body.theme-ink .archive-card.primary-book .card-tag {grid-column:1;grid-row:2;}
body.theme-ink .archive-card.primary-book .card-name {grid-column:1;grid-row:3;font-size:38px;}
body.theme-ink .archive-card.primary-book .card-subtitle {grid-column:2;grid-row:1/span 3;padding-left:30px;border-left:1px solid #777;align-self:center;font:15px/2.1 serif;margin:0;}
body.theme-ink .archive-card.primary-book .card-foot {grid-column:1/-1;grid-row:4;}
body.theme-ink .archive-card .collection-graphic {display:none;}
body.theme-ink .archive-card .card-number {margin-bottom:12px;}
body.theme-ink .archive-card .card-name {font-weight:700;font-size:29px;}
body.theme-ink .archive-card:hover {transform:none;background:#f7f7f7;}
body.theme-ink .volume-directory {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 35px;border-top:3px solid #171717;}
body.theme-ink .volume-directory-item {grid-template-columns:55px 1fr auto;min-height:95px;padding:23px 0!important;border-left:0!important;background:transparent!important;}
body.theme-ink .volume-directory-item:nth-child(n) .vol-number {border:0;border-radius:0;width:auto;height:auto;display:block;}
body.theme-ink .volume-directory-item:nth-child(n) .vol-arrow {display:none;}
body.theme-ink .volume-directory-item:nth-child(n) .vol-desc {grid-column:2/-1;}
body.theme-ink .volume-chapter-list {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 35px;border-top:2px solid #171717;}
body.theme-ink .volume-chapter-item {padding:20px 0;border-bottom:1px dotted #777;}
body.theme-ink .volume-chapter-item .ch-name {font-family:'Songti SC','SimSun',serif;font-size:17px;}
body.theme-ink .ch-arrow {display:none;}
body.theme-ink .reader-view .main-content {max-width:900px;padding:0 35px;}
body.theme-ink .reader-header {border-bottom:2px solid #171717;padding-top:25px;}
body.theme-ink #chapterTitle {font-family:'Songti SC','SimSun',serif;font-size:22px;}
body.theme-ink .reading-track {height:1px;}
body.theme-ink .page-single {padding:40px 55px 70px;border:0;font-family:'Songti SC','Noto Serif SC','SimSun',serif;}
body.theme-ink .page-single h1 {font-size:2em;font-weight:700;text-align:center;letter-spacing:.12em;border-bottom:3px double #171717;padding-bottom:25px;margin-bottom:30px;}
body.theme-ink .page-single h2 {border:0;padding-left:0;font-weight:700;margin-top:35px;}
body.theme-ink .chapter-nav {border-top:2px solid #171717;}

/* Reading mode is a shared action; it removes theme rails and keeps a comfortable measure. */
body[data-focus="true"] .reader-rail {display:none;}
body[data-focus="true"] .reader-view .main-content {display:flex;flex-direction:column;max-width:840px;}

/* Tablet: preserve layout identity without squeezing the catalogue titles. */
@media(max-width:1000px) {
  body.theme-midcentury .archive-grid {grid-template-columns:1fr 1fr;}
  body.theme-midcentury .archive-card.primary-book {grid-column:1/-1;grid-row:auto;min-height:300px;}
  body.theme-midcentury .archive-card.primary-book .card-name {margin-top:35px;}
  body.theme-midcentury .archive-card.primary-book .collection-graphic {right:40px;top:60px;transform:scale(1.1);}
  body.theme-spacetech .archive-grid {grid-template-columns:1fr 1fr;}
  body.theme-spacetech .archive-card:nth-child(n) {grid-column:auto;grid-row:auto;}
  body.theme-spacetech .archive-card.primary-book {grid-column:1/-1;min-height:330px;}
  body.theme-spacetech .archive-card.primary-book .collection-graphic {right:40px;top:80px;transform:scale(1.3);}
  body.theme-spacetech .archive-card.primary-book .card-name {margin-top:60px;}
  body.theme-forest .archive-home:not([style*="none"]) {grid-template-columns:210px minmax(0,1fr);gap:24px;}
  body.theme-forest .archive-header {padding:24px 18px;}
  body.theme-forest .archive-card:not(.primary-book) .card-foot {grid-column:1;grid-row:auto;flex-direction:row;justify-content:space-between;border-top:1px solid #b8c1a7;margin-top:6px;padding:10px 0 0;}
  body.theme-poolcore .archive-grid {padding-inline:2%;grid-template-columns:1fr 70px 1fr;}
  body.theme-wasteland .volume-directory,body.theme-midcentury .volume-directory {grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media(max-width:760px) {
  body[class*="theme-"] .page-view {padding-inline:18px;}
  body.theme-spacetech .archive-header {padding:26px 24px;display:block;min-height:250px;}
  body.theme-spacetech .archive-architecture {width:150px;height:150px;right:-35px;top:35px;opacity:.25;}
  body.theme-spacetech .archive-title {font-size:36px;}
  body.theme-spacetech .archive-card:nth-child(n) {padding:20px;min-height:215px;}
  body.theme-spacetech .archive-card.primary-book {min-height:310px;}
  body.theme-spacetech .archive-card:not(.primary-book) .card-name {font-size:21px;}
  body.theme-spacetech .archive-card .card-subtitle {font-size:11px;margin-bottom:20px;}
  body.theme-spacetech .volume-directory-item {grid-template-columns:58px 1fr auto 18px;gap:8px;min-height:72px;padding:16px 10px;}
  body.theme-spacetech .volume-chapter-list {grid-template-columns:1fr;gap:10px;}
  body.theme-spacetech .reader-view .main-content {display:flex;flex-direction:column;padding:0 42px 0 12px;}
  body.theme-spacetech .reader-rail {display:flex;flex-direction:row;align-items:center;gap:12px;flex-shrink:0;margin:0;padding:12px 0 8px;border-right:0;border-bottom:1px dashed var(--border-light);}
  body.theme-spacetech .reader-rail :is(dl,.rail-end,.rail-title) {display:none;}
  body.theme-spacetech .rail-code {margin-left:auto;font-size:9px;}
  body.theme-spacetech .reader-header {padding-top:12px;}
  body.theme-spacetech .page-single {padding:24px 22px 45px;}
  body.theme-midcentury .archive-card:nth-child(n) {min-height:220px;padding:22px;}
  body.theme-midcentury .archive-card.primary-book {min-height:305px;}
  body.theme-midcentury .archive-card.primary-book .card-name {font-size:33px;}
  body.theme-midcentury .archive-header {min-height:260px;padding:28px 24px;}
  body.theme-midcentury .volume-chapter-list {grid-template-columns:1fr;}
  body.theme-midcentury .volume-directory-item {padding:20px;}
  body.theme-midcentury .volume-directory-item:nth-child(n) .vol-name {font-size:19px;}
  body.theme-midcentury .page-single {padding-inline:24px;}
  body.theme-wasteland .archive-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:25px 16px;padding-inline:3px;}
  body.theme-wasteland .archive-card:nth-child(n) {grid-column:auto;min-height:230px;padding:22px 20px;}
  body.theme-wasteland .archive-card.primary-book {grid-column:1/-1;min-height:250px;}
  body.theme-wasteland .archive-card:nth-child(2) {margin-top:0;}
  body.theme-wasteland .archive-card:nth-child(3) {margin-top:20px;}
  body.theme-wasteland .archive-card:nth-child(4) {margin-top:0;}
  body.theme-wasteland .archive-card:nth-child(5) {margin-top:20px;}
  body.theme-wasteland .archive-title {font-size:34px;}
  body.theme-wasteland .archive-header {padding:24px 22px;}
  body.theme-wasteland .reader-view .main-content,body.theme-forest .reader-view .main-content {display:flex;flex-direction:column;padding:0 42px 0 12px;}
  body.theme-wasteland .reader-rail,body.theme-forest .reader-rail {display:none;}
  body.theme-wasteland .page-single,body.theme-forest .page-single {padding:26px 22px 50px;}
  body.theme-poolcore .archive-header {padding:30px 20px;min-height:310px;}
  body.theme-poolcore .archive-title {font-size:33px;letter-spacing:.12em;}
  body.theme-poolcore .archive-meta {flex-direction:column;gap:10px;}
  body.theme-poolcore .archive-meta span+span {border:0;padding-left:0;}
  body.theme-poolcore .archive-grid {grid-template-columns:1fr 22px 1fr;gap:30px 0;padding:20px 0 45px;}
  body.theme-poolcore .archive-grid::before {width:8px;left:calc(50% - 4px);}
  body.theme-poolcore .archive-card:nth-child(n) {padding:25px 18px;min-height:270px;border-radius:40px 40px 0 0;}
  body.theme-poolcore .archive-card:nth-child(even) {margin-top:90px;}
  body.theme-poolcore .archive-card .card-name {font-size:23px;letter-spacing:.02em;}
  body.theme-poolcore .archive-card .card-subtitle {font-size:11px;}
  body.theme-poolcore .archive-card .card-number {font-size:9px;margin-bottom:30px;}
  body.theme-poolcore .archive-card .collection-graphic {display:none;}
  body.theme-poolcore .volume-directory {padding-left:15px;margin-top:28px;}
  body.theme-poolcore .volume-directory-item {grid-template-columns:48px 1fr auto 16px;gap:8px;padding:19px 12px;}
  body.theme-poolcore .reader-view .main-content {padding:0 42px 0 12px;}
  body.theme-poolcore .page-single {padding:32px 25px 55px;}
  body.theme-forest .archive-home:not([style*="none"]) {display:block!important;}
  body.theme-forest .archive-header {min-height:290px;padding:28px 26px;border-left-width:6px;}
  body.theme-forest .archive-title {max-width:none;font-size:35px;margin-top:22px;line-height:1.6;}
  body.theme-forest .archive-subtitle {max-width:85%;margin-top:8px;}
  body.theme-forest .archive-meta {margin-top:18px;}
  body.theme-forest .archive-tools {margin-bottom:20px;}
  body.theme-forest .archive-card:nth-child(n) {min-height:150px;padding:22px 22px 22px 28px;}
  body.theme-forest .archive-card.primary-book {min-height:250px;}
  body.theme-forest .volume-directory {margin-left:8px;padding-left:20px;}
  body.theme-forest .volume-directory-item {grid-template-columns:50px 1fr auto 18px;padding:17px 12px!important;gap:8px;}
  body.theme-forest .volume-directory-item:nth-child(n)::before {left:-22px;width:20px;}
  body.theme-forest .volume-directory-item:nth-child(even)::before {left:-50px;width:48px;}
  body:is(.theme-dos,.theme-analoghorror) .archive-card:nth-child(n) {grid-template-columns:100px 1fr;gap:8px 12px;padding:15px 13px;min-height:70px;}
  body:is(.theme-dos,.theme-analoghorror) .archive-card .card-name {font-size:16px;}
  body:is(.theme-dos,.theme-analoghorror) .archive-card .card-foot {grid-column:2;grid-row:2;justify-content:flex-start;gap:18px;}
  body:is(.theme-dos,.theme-analoghorror) .archive-card .card-number {grid-row:1/span 2;}
  body:is(.theme-dos,.theme-analoghorror) .volume-directory-item {grid-template-columns:68px 1fr auto 14px;gap:6px;padding:15px 10px!important;}
  body:is(.theme-dos,.theme-analoghorror) .reader-view .main-content {padding:0 42px 0 12px;}
  body:is(.theme-dos,.theme-analoghorror) .reader-rail {gap:8px;}
  body:is(.theme-dos,.theme-analoghorror) .rail-title {display:none;}
  body:is(.theme-dos,.theme-analoghorror) .page-single {padding:22px 16px 50px;}
  body.theme-ink .archive-title {font-size:42px;}
  body.theme-ink .archive-grid {gap:0 20px;}
  body.theme-ink .archive-card:nth-child(n) {padding:22px 0;min-height:220px;}
  body.theme-ink .archive-card.primary-book {grid-column:1/-1;display:block;min-height:240px;}
  body.theme-ink .archive-card.primary-book .card-subtitle {border:0;padding:0;margin:10px 0 20px;font-size:13px;}
  body.theme-ink .archive-card .card-name {font-size:25px;}
  body.theme-ink .archive-card.primary-book .card-name {font-size:33px;}
  body.theme-ink .volume-directory,body.theme-ink .volume-chapter-list {gap:0 18px;}
  body.theme-ink .volume-directory-item {grid-template-columns:1fr auto;gap:7px;}
  body.theme-ink .volume-directory-item:nth-child(n) .vol-number {grid-column:1;grid-row:1;}
  body.theme-ink .volume-directory-item:nth-child(n) .vol-name {grid-column:1/-1;grid-row:2;}
  body.theme-ink .volume-directory-item:nth-child(n) .vol-desc {grid-column:1/-1;grid-row:3;}
  body.theme-ink .volume-directory-item:nth-child(n) .vol-chapters {grid-column:2;grid-row:1;}
  body.theme-ink .volume-chapter-item {gap:8px;}
  body.theme-ink .volume-chapter-item .ch-name {font-size:15px;}
  body.theme-ink .reader-view .main-content {padding:0 42px 0 12px;}
  body.theme-ink .page-single {padding:28px 20px 55px;}
  body.theme-ink #chapterTitle {font-size:18px;}
}
/* Small phones keep the corridor's alternating rhythm and the printed two-column index. */
@media(max-width:480px) {
  body.theme-midcentury .archive-grid {grid-template-columns:1fr;gap:16px;}
  body.theme-midcentury .archive-card:nth-child(n) {grid-column:1;min-height:230px;}
  body.theme-midcentury .archive-card.primary-book {min-height:310px;}
  body.theme-midcentury .volume-directory {grid-template-columns:1fr;}
  body.theme-spacetech .archive-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
  body.theme-spacetech .archive-card:nth-child(n) {grid-column:auto;min-height:210px;padding:18px 14px;}
  body.theme-spacetech .archive-card.primary-book {grid-column:1/-1;min-height:300px;padding:25px;}
  body.theme-spacetech .archive-card:not(.primary-book) .card-name {font-size:20px;}
  body.theme-spacetech .archive-card:not(.primary-book) .card-number {font-size:9px;margin-bottom:24px;}
  body.theme-spacetech .archive-card:not(.primary-book) .collection-graphic {display:none;}
  body.theme-spacetech .archive-card .card-foot {gap:6px;}
  body.theme-wasteland .archive-grid {grid-template-columns:1fr;gap:28px;}
  body.theme-wasteland .archive-card:nth-child(n) {grid-column:1;width:calc(100% - 12px);min-height:215px;margin-top:0;}
  body.theme-wasteland .archive-card:nth-child(even) {margin-left:12px;}
  body.theme-wasteland .volume-directory {grid-template-columns:1fr;gap:18px;}
  body.theme-poolcore .archive-grid {grid-template-columns:minmax(0,1fr);gap:34px;padding:16px 0 45px;}
  body.theme-poolcore .archive-grid::before {left:50%;width:1px;border:0;background:#91bcb355;}
  body.theme-poolcore .archive-card:nth-child(n) {grid-column:1;width:87%;min-height:235px;margin:0;padding:28px 25px;border-radius:45px 45px 0 0;}
  body.theme-poolcore .archive-card:nth-child(even) {margin-left:auto;margin-top:0;}
  body.theme-poolcore .archive-card .card-name {font-size:26px;}
  body.theme-poolcore .archive-title {letter-spacing:.08em;font-size:33px;}
  body.theme-poolcore .volume-directory-item {grid-template-columns:45px 1fr auto 14px;width:calc(100% - 24px);padding-inline:10px;}
  body.theme-poolcore .volume-directory-item:nth-child(3n+2) {margin-left:12px;}
  body.theme-poolcore .volume-directory-item:nth-child(3n) {margin-left:24px;}
  body.theme-forest .archive-card:nth-child(n) {grid-column:auto;min-height:160px;}
  body.theme-forest .archive-card.primary-book {min-height:245px;}
  body.theme-forest .archive-card:not(.primary-book) .card-foot {grid-column:1/-1;}
  body.theme-forest .volume-directory-item:nth-child(even) {margin-left:15px;width:calc(100% - 15px);}
  body.theme-forest .volume-directory-item:nth-child(even)::before {left:-37px;width:35px;}
  body.theme-ink .archive-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:0 17px;}
  body.theme-ink .archive-card:nth-child(n) {grid-column:auto;min-height:240px;padding:22px 0;}
  body.theme-ink .archive-card.primary-book {grid-column:1/-1;min-height:250px;}
  body.theme-ink .archive-card .card-name {font-size:23px;letter-spacing:.02em;}
  body.theme-ink .archive-card .card-subtitle {font-size:11px;margin-bottom:18px;}
  body.theme-ink .archive-title {font-size:40px;letter-spacing:.08em;}
  body.theme-ink .volume-directory {grid-template-columns:repeat(2,minmax(0,1fr));}
  body.theme-ink .volume-chapter-list {grid-template-columns:1fr;}
  body:is(.theme-dos,.theme-analoghorror) .archive-card:nth-child(n) {grid-column:auto;min-height:78px;padding:14px 10px;grid-template-columns:85px 1fr;}
  body:is(.theme-dos,.theme-analoghorror) .archive-card .card-name {font-size:15px;}
  body:is(.theme-dos,.theme-analoghorror) .archive-card .card-number {font-size:9px;letter-spacing:0;}
  body:is(.theme-dos,.theme-analoghorror) .archive-title {font-size:26px;letter-spacing:0;}
}
