:root {
  --paper:#faf9f5; --panel:#fdfcf8; --ink:#203f33; --body:#303a33; --muted:#5c6a61;
  --rule:#c8ccc1; --outline:#879688; --accent:#a45431; --accent-fill:#a45d3a; --tint:#eef0e8;
  --serif: "Iowan Old Style","Palatino Linotype",Georgia,"Songti SC","Noto Serif CJK SC","Noto Serif SC","STSong",SimSun,serif;
  --sans: "Inter",-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Noto Sans CJK SC","Microsoft YaHei",sans-serif;
  font-family:var(--sans); color:var(--ink); background:var(--paper); font-synthesis:weight style;
}
* {box-sizing:border-box}
[hidden] {display:none!important}
body {margin:0; padding:0 clamp(14px,2.25vw,42px) 22px; max-width:1780px; margin-inline:auto}
a {color:inherit; text-underline-offset:3px}
button,input,select {font:inherit; color:inherit}
button {cursor:pointer; background:none; border:0}
button:disabled {opacity:.4; cursor:default}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,svg [role=button]:focus-visible {outline:2px solid var(--accent); outline-offset:3px}
.skip {position:fixed; z-index:10; top:-100px; background:var(--panel); padding:10px}.skip:focus {top:8px}
.topbar {display:flex; align-items:center; justify-content:space-between; min-height:62px; border-bottom:1px solid #657769; gap:12px}
.brand {display:inline-flex; align-items:center; gap:12px; text-decoration:none; white-space:nowrap}
.brand span {font:italic 600 clamp(24px,2.4vw,33px)/1 var(--serif); letter-spacing:-1.3px}
.topbar nav {align-self:stretch; display:flex; align-items:stretch; gap:clamp(10px,2.6vw,40px)}
.nav-item,.nav-info {font:600 clamp(13px,1.12vw,17px)/1.3 var(--serif); padding:2px 3px 0; position:relative}
.nav-item.current {color:var(--accent)}
.nav-item.current:after {content:""; height:2px; position:absolute; bottom:0; left:0; right:0; background:var(--accent)}
.nav-info {align-self:center; display:flex; align-items:center; gap:8px; border-left:1px solid var(--outline); padding:0 0 0 clamp(13px,2.3vw,34px)}
.info-icon {font:italic 600 13px/16px Georgia,serif; width:18px; height:18px; border:1.4px solid currentColor; border-radius:50%; text-align:center}
.masthead {display:flex; gap:30px; align-items:center; justify-content:space-between; padding:clamp(21px,2.5vh,35px) clamp(2px,1.1vw,18px) clamp(19px,2.4vh,32px)}
h1,h2,h3,p {margin:0}
h1 {font:750 clamp(37px,3.8vw,65px)/1.18 var(--serif); letter-spacing:.025em}
.dek {font:500 clamp(15px,1.38vw,22px)/1.65 var(--serif); margin-top:4px; color:var(--body); letter-spacing:.035em}
.totals {display:flex; align-items:baseline; flex-wrap:wrap; gap:clamp(11px,2.35vw,36px); margin-top:11px; font-size:clamp(11px,.95vw,14px); color:var(--muted); min-height:19px}
.totals strong {font:600 1.24em/1 var(--serif); color:var(--ink); font-variant-numeric:lining-nums tabular-nums; margin-right:5px}
.search-area {width:min(33%,440px); position:relative; z-index:5}
.search-area input {width:100%; height:43px; border:1px solid var(--outline); border-radius:5px; background:transparent; padding:0 40px 0 43px; font-size:14px}
.search-area input::placeholder {color:var(--muted)}
.search-area input::-webkit-search-cancel-button {cursor:pointer}
.search-icon {width:15px; height:15px; border:1.6px solid var(--ink); position:absolute; top:12px; left:16px; border-radius:50%; pointer-events:none}
.search-icon:after {content:""; position:absolute; background:var(--ink); height:1.6px; width:7px; transform:rotate(45deg); top:12px; left:10px}
.search-area kbd {position:absolute; right:10px; top:10px; color:#78837a; font:12px/20px var(--sans); border:1px solid var(--rule); border-radius:3px; width:19px; text-align:center; pointer-events:none}
.search-area:focus-within kbd {display:none}
.suggestions {position:absolute; top:calc(100% + 5px); right:0; width:max(100%,330px); max-width:calc(100vw - 28px); border:1px solid var(--outline); border-radius:5px; background:var(--panel); box-shadow:0 8px 20px #203e3314; overflow:auto; max-height:55svh}
.suggestion {width:100%; text-align:left; padding:9px 14px; display:block; border-bottom:1px solid var(--rule)}
.suggestion:is(:hover,[aria-selected=true]) {background:var(--tint)}
.suggestion .suggest-title {font:600 15px/1.3 var(--serif); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden}
.suggestion small {font-size:11px; color:var(--muted); display:block; margin-top:3px}
.suggestion:last-child {border-bottom:0}.suggest-extra {font-size:13px; color:var(--accent)}
.workbench {border:1px solid var(--outline); border-radius:8px; overflow:hidden; background:var(--panel)}
.toolbar {display:flex; justify-content:space-between; align-items:center; gap:15px; padding:10px clamp(14px,1.6vw,24px); min-height:54px; border-bottom:1px solid var(--outline)}
.toolbar h2,.dialog-header h2 {font:700 clamp(19px,1.55vw,25px)/1.25 var(--serif); letter-spacing:.05em}
.filters {display:flex; align-items:center; gap:clamp(12px,1.6vw,24px)}
.segmented {display:flex; border:1px solid var(--outline); border-radius:5px; overflow:hidden}
.segmented button {padding:5px clamp(9px,1.2vw,18px); font:500 14px/1.4 var(--sans)}
.segmented button:first-child {border-right:1px solid var(--outline)}
.segmented button[aria-pressed=true] {color:#fff; background:var(--accent-fill)}
.select-wrap {position:relative; padding-left:clamp(12px,1.6vw,24px); border-left:1px solid var(--rule)}
select {font:500 14px/1.4 var(--sans); appearance:none; background:transparent; border:1px solid var(--outline); border-radius:5px; padding:5px 31px 5px 12px; min-width:125px; cursor:pointer}
.select-wrap:after {content:""; width:7px; height:7px; border:solid var(--ink); border-width:0 1.4px 1.4px 0; transform:rotate(45deg); position:absolute; right:13px; top:10px; pointer-events:none}
.workspace-body {display:grid; grid-template-columns:minmax(0,1.98fr) minmax(310px,1fr); height:clamp(470px,calc(100svh - 316px),930px)}
.map {min-height:0; display:flex; flex-direction:column; background:#fbfaf5}
.drawing {position:relative; flex:1; min-height:0; overflow:hidden; background-image:radial-gradient(circle,#b2b7a754 .8px,transparent .85px); background-size:16px 16px}
.network {position:absolute; inset:0; width:100%; height:100%; display:block; touch-action:none; user-select:none; cursor:grab}
.network.dragging {cursor:grabbing}.network [role=button] {cursor:pointer; outline-offset:1px}
.node-dot,.edge {vector-effect:non-scaling-stroke}
.graph-label {font-family:var(--serif); paint-order:stroke fill; stroke:#fbfaf5; stroke-width:3.7px; stroke-linejoin:round; fill:#263c31; pointer-events:none}
.map-tools {position:absolute; bottom:12px; left:15px; display:grid; z-index:1; gap:0}
.map-tools button {height:30px; width:31px; padding:0; background:var(--panel); border:1px solid var(--outline); color:var(--ink); font:22px/1 var(--sans); display:grid; place-items:center}
.map-tools button:first-child {border-radius:4px 4px 0 0}.map-tools button:nth-child(2) {border-top:0; border-radius:0 0 4px 4px}
.map-tools button:last-child {margin-top:4px; border-radius:4px}
.map-tools button:hover,.entry:hover,.page-controls button:not(:disabled):hover {background:var(--tint)}
.graph-tip {position:absolute; pointer-events:none; max-width:min(280px,86%); padding:7px 10px; border-radius:4px; background:#203f33f5; color:white; font:13px/1.38 var(--serif); z-index:2}
.legend {display:flex; align-items:center; flex-wrap:wrap; column-gap:clamp(10px,1.5vw,24px); row-gap:5px; padding:11px 17px 13px; font-size:12px; color:var(--body)}
.legend span {display:inline-flex; align-items:center; gap:7px}.legend i,.paper-type i,.topic-dot {display:inline-block; flex:none; width:12px; height:12px; border-radius:50%}
.key-core {background:#456553}.key-ref {background:#cdc6b0; border:1px solid #9e9c86}
.legend b {font:22px/12px var(--serif)}.legend .direction {border-left:1px solid var(--rule); padding-left:clamp(12px,1.5vw,25px)}
#inspector {min-width:0; overflow:auto; overscroll-behavior:contain; border-left:1px solid var(--outline); padding:clamp(15px,1.45vw,24px); scrollbar-width:thin; scrollbar-color:#b8c0b4 transparent; scroll-padding:16px}
.paper-type {display:flex; align-items:center; gap:8px; font-size:13px; font-weight:600}.paper-type i {width:11px; height:11px}
.paper-title {font:600 clamp(23px,1.95vw,34px)/1.13 var(--serif); letter-spacing:-.035em; margin:11px 0 10px; overflow-wrap:anywhere}
.paper-meta {color:var(--muted); font:500 14px/1.46 var(--serif); overflow-wrap:anywhere}
.reading-note {font:500 clamp(14px,1.02vw,17px)/1.72 var(--serif); margin:12px 0; color:var(--body)}
.paper-links {display:flex; flex-wrap:wrap; align-items:center; gap:10px 16px; margin:13px 0 17px}
.primary-link {display:inline-flex; gap:9px; align-items:center; background:var(--ink); color:white; border-radius:4px; padding:6px 13px; text-decoration:none; font:600 14px/1.5 var(--sans)}.primary-link:hover {background:#355844}
.quiet-link {color:var(--muted); font-size:12px; text-decoration:underline; text-decoration-color:#9baba0}
.ref-tabs {border-block:1px solid var(--rule); display:flex; gap:17px; align-items:stretch}
.ref-tabs button {position:relative; padding:9px 1px 8px; font-size:14px; font-weight:600}
.ref-tabs button[aria-pressed=true] {color:var(--accent)}
.ref-tabs button[aria-pressed=true]:after {content:""; height:2px; background:var(--accent); position:absolute; bottom:-1px; left:0; right:0}
.ref-tabs small {font:500 12px var(--sans); margin-left:3px}
.entry {display:grid; grid-template-columns:26px minmax(0,1fr) 12px; align-items:start; width:100%; text-align:left; border-bottom:1px solid var(--rule); padding:11px 0; gap:6px}
.entry .num {font:12px/1.6 var(--sans); color:var(--accent); font-variant-numeric:tabular-nums}
.entry .entry-title,.catalog-row .ct {display:block; font:600 15px/1.28 var(--serif); overflow-wrap:anywhere}
.entry .entry-meta {display:block; font-size:11px; line-height:1.4; margin-top:4px; color:var(--muted)}
.go {align-self:center; font:17px var(--serif); color:var(--muted)}
.ref-more,.page-controls button {font-size:13px; border:1px solid var(--outline); border-radius:4px; padding:6px 11px}
.ref-more {margin-top:12px}.empty,.waiting,.load-error {font-size:14px; line-height:1.7; color:var(--muted); padding:16px 0}
.library {min-width:0; overflow:auto; padding:14px clamp(16px,1.7vw,30px); scrollbar-width:thin}
.library-head,.page-controls {display:flex; align-items:center; justify-content:space-between; gap:10px; font-size:12px; color:var(--muted)}
.library-head {padding-bottom:9px; border-bottom:1px solid var(--rule)}
.catalog-row {text-align:left; width:100%; padding:13px 5px; border-bottom:1px solid var(--rule); display:grid; grid-template-columns:43px minmax(0,1fr) 19px; gap:8px; align-items:center}
.catalog-row:hover,.catalog-row.selected {background:var(--tint)}
.catalog-row .year {font:600 14px/1.2 var(--serif); color:var(--muted); align-self:start}
.catalog-row .ct {font-size:17px}.catalog-row small {display:block; color:var(--muted); font-size:12px; line-height:1.5; margin-top:4px}
.page-controls {padding:14px 0}.page-controls span {margin-right:auto}
.mobile-return {display:none}
dialog {color:var(--ink); background:var(--panel); border:1px solid var(--outline); border-radius:8px; padding:0; width:min(580px,calc(100vw - 30px)); max-height:85svh}
dialog::backdrop {background:#17251b66}
.dialog-header {display:flex; align-items:center; justify-content:space-between; padding:16px 23px; position:sticky; top:0; background:var(--panel); border-bottom:1px solid var(--rule)}
.dialog-header button {font:24px/1 var(--sans); width:30px; height:30px}
.source-body {padding:19px 23px; font-size:14px; color:var(--body); line-height:1.65}
.source-body h3 {font:700 18px/1.5 var(--serif); color:var(--ink); margin:14px 0 4px}.source-body h3:first-child {margin-top:0}
.source-body p+p {margin-top:7px}.source-body a {color:var(--ink); text-underline-offset:2px}
.source-foot {border-top:1px solid var(--rule); margin-top:18px; padding-top:12px; display:flex; flex-wrap:wrap; justify-content:space-between; gap:8px; color:var(--muted); font-size:12px}
@media(min-width:1550px){.workspace-body {height:clamp(550px,calc(100svh - 300px),1030px)}}
@media(max-width:900px) and (min-width:721px){.workspace-body {grid-template-columns:minmax(0,1.55fr) minmax(280px,1fr)}.search-area {width:36%}.legend {font-size:11px; gap:10px}.legend .direction {padding-left:8px}}
@media(max-width:720px) {
  body {padding:0 12px 16px}.topbar {min-height:51px}.brand {gap:6px}.brand img {width:26px;height:26px}.brand span {font-size:24px}
  .topbar nav {gap:11px}.nav-item,.nav-info {font-size:13px}.nav-info {padding-left:10px; gap:5px}
  .masthead {display:block; padding:21px 3px 16px}.dek {margin-top:3px}.totals {gap:16px; margin-top:8px}
  .search-area {width:100%; margin-top:13px}.search-area input {height:38px; font-size:14px}.search-icon {top:10px}.search-area kbd {top:8px}
  .toolbar {padding:9px 10px; gap:6px; min-height:47px}.toolbar h2 {font-size:17px}.filters {gap:6px}
  .segmented button,select {padding:5px 7px; font-size:12px}.select-wrap {padding-left:6px}.select-wrap:after {top:9px; right:9px; width:6px; height:6px}select {min-width:78px; padding-right:20px}
  .workspace-body {display:flex; flex-direction:column; height:auto}.map {height:clamp(325px,48svh,460px)}.legend {padding:8px 9px; font-size:10px; column-gap:11px; row-gap:3px}
  .legend span {gap:4px}.legend i {width:9px; height:9px}.legend .direction {padding-left:8px}.legend b {display:none}
  .map-tools {left:8px; bottom:6px}.map-tools button {width:28px; height:27px}
  #inspector {border-left:0; border-top:1px solid var(--outline); padding:16px 16px 20px; overflow:visible}.paper-title {font-size:25px; max-width:33ch}
  .library {max-height:52svh; min-height:215px; overflow:auto}.entry {padding:11px 0}.reading-note {font-size:15px}
  .mobile-return {display:inline-block; float:right; font-size:12px; color:var(--muted); text-decoration:underline}
}
@media(max-width:390px){.nav-info span:last-child {display:none}.topbar nav {gap:12px}.toolbar h2 {font-size:15px}.segmented button {padding-inline:5px}.totals {gap:10px}}
@media(prefers-reduced-motion:reduce){* {scroll-behavior:auto!important}}
.citation-trail {padding:0 0 12px; margin-top:-5px}
.nav-item {white-space:nowrap}.short-nav {display:none}
.focus-paper {padding:0; text-underline-offset:3px}
@media(max-width:525px){.wide-nav {display:none}.short-nav {display:inline}}
@media(max-width:525px){.nav-info span:last-child {display:none}.nav-info {height:24px}.topbar nav {gap:clamp(7px,2.1vw,11px)}}
@media(max-width:355px){.brand span {font-size:21px}.brand img {width:23px}.brand {gap:4px}.nav-item {font-size:12px}.toolbar {flex-wrap:wrap}.nav-info {padding-left:6px}}
