:root {
  color-scheme: light;
  --paper: #edf2f6;
  --surface: #f7f9fb;
  --ink: #1b2636;
  --muted: #596879;
  --line: #cbd6e0;
  --blue: #315f86;
  --blue-dark: #193e63;
  --blue-soft: #dfe9f2;
  --copy: #3f4f62;
  --nav-bg: rgba(237, 242, 246, .96);
  --focus: #2e6699;
  --selection: #c6dcec;
  --max: 1180px;
  --gutter: clamp(20px, 4vw, 56px);
}
html[data-theme='dark'] {
  color-scheme: dark;
  --paper: #121a24;
  --surface: #182330;
  --ink: #e3eaf1;
  --muted: #a5b2bf;
  --line: #30404f;
  --blue: #8bb5d6;
  --blue-dark: #afd0e8;
  --blue-soft: #1b2c3b;
  --copy: #c5d0da;
  --nav-bg: rgba(18, 26, 36, .96);
  --focus: #9bc8ea;
  --selection: #2d536f;
}
* { box-sizing: border-box; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { background: var(--paper); color: var(--ink); font-family: Arial, 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', sans-serif; margin: 0; -webkit-font-smoothing: antialiased; }
::selection { background: var(--selection); color: var(--ink); }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:hover { color: var(--blue-dark); }
a, button, input, select, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; }
section[id], article[id], #main-content { scroll-margin-top: 95px; }
#main-content:focus { outline: none; }
.skip-link { background: var(--ink); color: var(--paper); position: fixed; top: -80px; left: 20px; padding: 12px 16px; z-index: 100; }
.skip-link:focus { top: 12px; }
.container { max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.site-nav { position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--line); background: var(--nav-bg); }
.nav-inner { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.wordmark { color: var(--ink); text-decoration: none; display: flex; flex-direction: column; gap: 5px; }
.wordmark strong { font: 600 18px Georgia, 'Times New Roman', serif; }
.wordmark span { font-size: 10px; letter-spacing: .025em; color: var(--muted); }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a { color: var(--copy); font-size: 12px; text-decoration: none; }
.nav-links a:hover { text-decoration: underline; }
.theme-toggle { border: 1px solid var(--line); background: transparent; border-radius: 50%; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; color: var(--blue-dark); flex-shrink: 0; }
.theme-toggle:hover { background: var(--blue-soft); }
.theme-icon { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; width: 15px; height: 15px; }
.sun { display: none; }
html[data-theme='dark'] .moon { display: none; }
html[data-theme='dark'] .sun { display: block; }
.intro { padding-top: 60px; padding-bottom: 42px; border-bottom: 1px solid var(--line); }
.context { color: var(--blue); font-size: 11px; letter-spacing: .06em; margin: 0 0 17px; }
h1 { font: 500 clamp(30px, 4vw, 43px)/1.3 Georgia, 'Times New Roman', 'Songti SC', 'STSong', serif; margin: 0 0 20px; letter-spacing: -.025em; }
.intro-body { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: end; }
.intro-description { max-width: 700px; color: var(--copy); font-size: 15px; line-height: 1.9; margin: 0; }
.edition { color: var(--muted); font-size: 11px; line-height: 1.9; text-align: right; white-space: nowrap; margin: 0; }
.edition strong { color: var(--copy); font-weight: 400; }
.directory { display: grid; grid-template-columns: 208px minmax(0, 1fr); gap: 46px; padding-top: 36px; padding-bottom: 64px; }
.sidebar { align-self: start; position: sticky; top: 103px; }
.sidebar h2 { font-size: 13px; margin: 0 0 15px; }
.category-nav { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.category-nav a { display: flex; gap: 8px; align-items: center; justify-content: space-between; color: var(--copy); text-decoration: none; font-size: 13px; padding: 13px 8px; border-bottom: 1px solid var(--line); }
.category-nav a:hover { color: var(--blue-dark); background: var(--surface); }
.category-nav a[aria-current] { color: var(--blue-dark); background: var(--blue-soft); font-weight: 600; }
.category-nav span { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sidebar-note { color: var(--muted); font-size: 12px; line-height: 1.9; margin: 24px 0 0; }
.sidebar-note a { display: inline-block; margin-top: 6px; }
.catalog-main { min-width: 0; }
.toolbar { display: grid; grid-template-columns: minmax(0, 1fr) 154px; gap: 14px; align-items: end; }
.toolbar label { display: block; color: var(--muted); font-size: 11px; margin-bottom: 8px; }
.toolbar input, .toolbar select { width: 100%; min-width: 0; height: 42px; border: 1px solid var(--line); border-radius: 2px; background: var(--surface); color: var(--ink); padding: 0 11px; font-size: 13px; }
.toolbar input::placeholder { color: var(--muted); opacity: 1; }
.result-line { display: flex; align-items: center; gap: 20px; min-height: 46px; font-size: 11px; color: var(--muted); }
.result-line p { margin: 0; }
.text-button { background: none; border: 0; padding: 8px 0; text-decoration: underline; text-underline-offset: 3px; color: var(--blue); font-size: 12px; }
.category-group { margin-bottom: 36px; }
.group-heading { border-top: 2px solid var(--blue-dark); border-bottom: 1px solid var(--line); padding: 16px 0 15px; }
.group-heading > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.group-heading h2 { font-size: 17px; font-weight: 600; margin: 0; }
.group-heading span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.group-heading p { font-size: 12px; line-height: 1.7; margin: 8px 0 0; color: var(--muted); }
.resource { padding: 24px 0 21px; border-bottom: 1px solid var(--line); }
.resource-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
.resource h3 { font: 500 24px/1.3 Georgia, 'Times New Roman', serif; margin: 0; }
.resource h3 a { color: var(--ink); text-decoration: none; }
.resource h3 a:hover { color: var(--blue); text-decoration: underline; }
.resource-type { color: var(--muted); font-size: 11px; flex-shrink: 0; }
.resource-description { color: var(--copy); font-size: 14px; line-height: 1.85; margin: 10px 0; }
.resource-meta { color: var(--muted); font-size: 11px; line-height: 1.8; margin: 0 0 12px; }
.resource-meta span + span::before { content: ' · '; padding: 0 5px; }
.resource-actions { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; line-height: 1.8; }
.resource details { margin-top: 14px; }
.resource summary { color: var(--blue); font-size: 12px; cursor: pointer; width: fit-content; padding: 5px 0; }
.resource details[open] summary { margin-bottom: 10px; }
.resource-notes { border-left: 2px solid var(--line); padding-left: 16px; }
.resource-notes dl { margin: 0; font-size: 12px; line-height: 1.9; }
.resource-notes dt { color: var(--ink); font-weight: 600; margin-top: 10px; }
.resource-notes dd { color: var(--copy); margin: 2px 0 0; }
.resource-notes p { color: var(--muted); font-size: 11px; line-height: 1.8; margin-bottom: 0; }
.resource-notes a { overflow-wrap: anywhere; }
.empty { padding: 40px 0; border-top: 1px solid var(--line); }
.empty h2 { font-size: 18px; }
.empty p { color: var(--muted); font-size: 14px; line-height: 1.8; }
.notes { border-top: 1px solid var(--ink); padding-top: 30px; padding-bottom: 48px; display: grid; grid-template-columns: 208px minmax(0, 1fr); gap: 46px; }
.notes h2 { font: 500 23px Georgia, 'Songti SC', serif; margin: 0; }
.notes h3 { font-size: 13px; margin: 0 0 9px; }
.notes p { color: var(--copy); font-size: 13px; line-height: 1.9; margin: 0 0 21px; }
.notes p:last-child { margin-bottom: 0; }
.related { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.site-footer { border-top: 1px solid var(--line); padding-top: 22px; padding-bottom: 28px; display: flex; justify-content: space-between; gap: 18px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.site-footer p { margin: 0; }
@media (max-width: 850px) {
  .directory, .notes { grid-template-columns: 175px minmax(0, 1fr); gap: 28px; }
  .intro-body { grid-template-columns: 1fr; gap: 16px; }
  .edition { text-align: left; }
}
@media (max-width: 640px) {
  .nav-inner { gap: 10px; min-height: 65px; }
  .wordmark strong { font-size: 16px; }
  .wordmark span { font-size: 9px; }
  .nav-links { gap: 14px; }
  .nav-secondary { display: none; }
  .intro { padding-top: 34px; padding-bottom: 28px; }
  h1 { font-size: 30px; }
  .intro-description { font-size: 14px; }
  .directory { display: block; padding-top: 24px; padding-bottom: 30px; }
  .sidebar { position: static; margin-bottom: 26px; }
  .category-nav { flex-direction: row; flex-wrap: wrap; border-top: 0; gap: 6px 16px; }
  .category-nav a { padding: 9px 5px; font-size: 12px; border-bottom: 0; gap: 7px; }
  .sidebar-note { display: none; }
  .toolbar { grid-template-columns: minmax(0, 1fr) 132px; gap: 10px; }
  .resource-heading { gap: 10px; }
  .resource h3 { font-size: 23px; }
  .resource-type { font-size: 10px; }
  .notes { display: block; padding-top: 25px; padding-bottom: 30px; }
  .notes h2 { margin-bottom: 22px; }
  .site-footer { flex-direction: column; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
