:root {
  color-scheme: light;
  --paper: #f7f6f1;
  --ink: #202724;
  --green: #234538;
  --muted: #5b6259;
  --line: #d9dad0;
  --white: #fffef9;
  --serif: "Songti SC", "Noto Serif CJK SC", SimSun, "Microsoft YaHei", serif;
  --sans: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.65 var(--sans); }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: .24em; }
button, input, select { color: inherit; font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid #a34b30; outline-offset: 3px; }
.frame { width: min(1140px, 100% - 80px); margin-inline: auto; }
.topbar { border-bottom: 1px solid var(--line); }
.masthead { min-height: 71px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 1.3rem; font-weight: 700; white-space: nowrap; }
.seal { display: grid; place-items: center; width: 32px; height: 32px; color: #fff8e8; background: #934735; border-radius: 3px; font-size: 1.05rem; }
.masthead nav { display: flex; gap: 27px; align-items: center; font-size: .875rem; }
.outline { padding: 7px 13px; border: 1px solid #a7b0a3; border-radius: 3px; background: transparent; font-size: .875rem; }
.outline:hover { background: #e8ede4; }
.intro { min-height: 270px; padding-block: 46px 40px; display: flex; justify-content: space-between; align-items: end; gap: 30px; border-bottom: 1px solid var(--line); }
.eyebrow { font-size: .875rem; color: var(--green); letter-spacing: .14em; }
h1, h2, h3, p, dl { margin: 0; }
h1, h2 { font-family: var(--serif); }
h1 { font-size: clamp(3.5rem, 8vw, 6.4rem); line-height: 1.14; margin: .09em 0 .14em; letter-spacing: .025em; font-weight: 750; }
.intro p, .section-heading p { color: var(--muted); }
.stats { display: flex; gap: 0; flex-shrink: 0; }
.stats div { display: flex; flex-direction: column-reverse; align-items: start; padding-inline: clamp(13px, 2.5vw, 31px); border-left: 1px solid var(--line); }
.stats div:last-child { padding-right: 0; }
.stats dt { color: var(--muted); font-size: .88rem; margin-top: 3px; }
.stats dd { margin: 0; font: 2.25rem/1.1 Georgia, serif; color: var(--green); font-variant-numeric: lining-nums tabular-nums; }
.feature { padding: 28px 0 34px; border-bottom: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; gap: 12px; align-items: end; margin-bottom: 15px; }
.section-heading h2, dialog h2 { font-size: 1.75rem; line-height: 1.3; color: var(--green); }
.section-heading p { margin-top: 4px; font-size: .875rem; }
.text-button { border: 0; background: transparent; padding: 3px 0; color: var(--green); font-size: .875rem; text-decoration: underline; text-underline-offset: .28em; white-space: nowrap; }
.feature-books { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.feature-card { min-height: 119px; padding: 16px 17px; text-align: left; border: 1px solid var(--line); border-top: 3px solid #43634c; border-radius: 2px; background: var(--white); display: flex; flex-direction: column; gap: 5px; }
.feature-card:hover { border-color: #738773; background: #f0f2e9; }
.feature-card strong { font: 700 1.35rem/1.35 var(--serif); }
.feature-card small { font-size: .875rem; color: var(--muted); }
.feature-card .formats { margin-top: auto; color: var(--green); }
.catalog { padding-block: 34px 50px; }
.catalog-layout { display: grid; grid-template-columns: 215px minmax(0, 1fr); gap: 32px; align-items: start; }
.sidebar { border-top: 1px solid var(--line); padding-top: 13px; }
.sidebar h3 { font-size: .875rem; color: var(--muted); margin: 0 9px 6px; font-weight: 600; }
.category { width: 100%; text-align: left; display: flex; justify-content: space-between; align-items: baseline; padding: 8px 9px; border: 0; border-radius: 3px; gap: 9px; background: transparent; font-size: .94rem; }
.category:hover, .category[aria-pressed="true"] { background: #e7ece2; color: var(--green); }
.category[aria-pressed="true"] { font-weight: 650; }
.category small { color: var(--muted); font-size: .8rem; }
.collection-link { padding-top: 12px; margin-top: 13px; border-top: 1px solid var(--line); }
.filters { display: flex; gap: 10px; }
.search { flex: 1; position: relative; }
.search::before { content: ""; position: absolute; inset: 14px auto auto 14px; border: 1.5px solid var(--green); width: 10px; height: 10px; border-radius: 100%; pointer-events: none; }
.search::after { content: ""; position: absolute; inset: 25px auto auto 24px; width: 6px; height: 1.5px; background: var(--green); transform: rotate(45deg); pointer-events: none; }
.search input, .select select { width: 100%; min-height: 43px; border: 1px solid #adb5a9; border-radius: 3px; background: var(--white); }
.search input { padding: 6px 12px 6px 37px; }
.select { position: relative; }
.select::after { content: ""; width: 6px; height: 6px; border: solid var(--green); border-width: 0 1px 1px 0; transform: rotate(45deg); position: absolute; right: 12px; top: 16px; pointer-events: none; }
.select select { appearance: none; padding: 6px 27px 6px 11px; font-size: .875rem; }
.results-bar { display: flex; justify-content: space-between; min-height: 43px; align-items: center; color: var(--muted); font-size: .875rem; }
.results { border-top: 1px solid var(--line); }
.row { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 12px 8px; background: transparent; border: 0; border-bottom: 1px solid var(--line); text-align: left; }
.row:hover { background: #ecefe7; }
.row-title { display: block; font-size: 1.02rem; font-weight: 650; overflow-wrap: anywhere; }
.row-meta, .formats { font-size: .82rem; color: var(--muted); }
.row .formats { text-align: right; max-width: 145px; }
.more { padding-top: 18px; text-align: center; }
.empty { padding: 24px 8px; color: var(--muted); }
.footer { border-top: 1px solid var(--line); padding-block: 17px 25px; display: flex; justify-content: space-between; color: var(--muted); font-size: .875rem; }
dialog { width: min(780px, 100% - 30px); max-height: min(84vh, 900px); padding: 0; border: 1px solid #819182; border-radius: 4px; color: var(--ink); background: var(--paper); }
dialog::backdrop { background: #15231bcc; }
.dialog-inner { padding: 25px; }
.close-form { display: flex; justify-content: flex-end; margin-bottom: 6px; }
.dialog-note { color: var(--muted); margin: 6px 0 15px; }
.dialog-list { margin-top: 15px; border-top: 1px solid var(--line); }
.file { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.file-name { display: block; overflow-wrap: anywhere; }
.file-actions { display: flex; align-items: center; gap: 10px; }
.file-actions a { color: var(--green); }
.reader { white-space: pre-wrap; overflow-wrap: anywhere; font: 1.05rem/1.9 var(--serif); margin-top: 14px; }
.visually-hidden, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip-link:focus { position: absolute; z-index: 2; padding: 8px; background: var(--white); }
@media (max-width: 730px) {
  .frame { width: calc(100% - 38px); }
  .masthead nav { gap: 12px; }
  .intro { min-height: auto; align-items: start; flex-direction: column; padding-block: 28px; gap: 22px; }
  .stats div:first-child { padding-left: 0; border-left: 0; }
  .feature-books { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-layout { display: block; }
  .sidebar { margin-bottom: 14px; }
  #categories { display: flex; flex-wrap: wrap; gap: 3px; }
  .category { width: auto; padding-block: 5px; }
  .collection-link { display: flex; align-items: center; gap: 5px; padding-top: 7px; margin-top: 5px; }
  .collection-link h3 { margin-bottom: 0; }
}
@media (max-width: 430px) {
  .masthead nav a { display: none; }
  .feature-card { padding: 11px; }
  .row { gap: 8px; }
  .row .formats { max-width: 93px; }
  .dialog-inner { padding: 15px; }
  .file-actions { flex-wrap: wrap; justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
