:root {
  color-scheme: light;
  --paper: #f7f2e8;
  --white: #fffdf9;
  --sand: #f1e7d2;
  --red: #a33b28;
  --gold: #d4b06a;
  --ink: #2b2623;
  --text: #4b4038;
  --muted: #685d53;
  --line: #ddd2bf;
  --mobile-height: 65px;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 20px; }
body { margin: 0; background: var(--paper); color: var(--text); font: 16px/1.75 system-ui, "Microsoft YaHei", "PingFang SC", sans-serif; overflow-wrap: anywhere; }
h1, h2, h3 { color: var(--ink); line-height: 1.28; margin: 0 0 .55em; font-family: "Songti SC", "Noto Serif CJK SC", "SimSun", serif; }
h1 { font-size: clamp(2rem, 5vw, 3.7rem); letter-spacing: -.035em; }
h2 { font-size: clamp(1.35rem, 2.8vw, 2rem); }
h3 { font-size: 1.18rem; }
p { margin: 0 0 .9em; }
p:last-child { margin-bottom: 0; }
a { color: var(--red); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #a33b28; outline-offset: 3px; }
.dark :focus-visible, .site-footer :focus-visible { outline-color: var(--gold); }
button, input, select, textarea { font: inherit; }
button, .button { min-height: 44px; padding: .42rem .8rem; border: 1px solid var(--line); border-radius: 7px; background: var(--white); color: var(--ink); cursor: pointer; }
button:hover, .button:hover { border-color: var(--red); }
button:disabled { opacity: .55; cursor: default; }
.button { display: inline-flex; align-items: center; text-decoration: none; }
.primary { background: var(--red); color: white; border-color: var(--red); }
.primary:hover { background: #8b3020; }
input, select, textarea { width: 100%; min-width: 0; min-height: 44px; padding: .5rem .7rem; border: 1px solid #bdb09b; border-radius: 7px; background: var(--white); color: var(--ink); }
textarea { resize: vertical; }
.wrap { width: min(1220px, 100% - 48px); margin-inline: auto; }
.glyph { display: inline-block; font-family: system-ui, sans-serif; font-size: .8em; line-height: 1; margin-inline-end: .35em; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; left: 12px; top: 12px; z-index: 10; background: var(--white); padding: 10px; }
.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.topbar { display: flex; align-items: center; gap: clamp(8px, 1.4vw, 24px); min-height: 74px; }
.brand, .desktop-nav a, .tools a, .bottom-nav a { color: var(--ink); text-decoration: none; }
.brand { display: flex; align-items: center; font-weight: 850; font-size: 1.12rem; white-space: nowrap; }
.picture-logo { width: 156px; height: 44px; object-fit: contain; }
.desktop-nav { display: flex; flex: 1; justify-content: center; }
.desktop-nav a, .tools a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .44rem; white-space: nowrap; font-size: .92rem; }
[aria-current="page"] { color: var(--red) !important; font-weight: 750; }
.desktop-nav [aria-current="page"] { box-shadow: inset 0 -2px var(--red); }
.tools { margin-left: auto; display: flex; align-items: center; gap: 5px; }
.mobile-menu, .bottom-nav { display: none; }
.secondary, .genre-nav { border-top: 1px solid var(--line); padding-block: .25rem; }
.secondary .chips a, .genre-nav .chips a { background: transparent; border-color: transparent; }
.genre-dropdown { position: relative; display: inline-block; border: 0; }
.genre-dropdown summary { color: var(--red); }
.genre-dropdown .chips { position: absolute; inset: 100% auto auto 0; width: min(400px, 90vw); z-index: 5; padding: 10px; background: var(--white); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgb(43 38 35 / 15%); }
.genre-dropdown .chips a:hover { border-color: var(--red); }
main { padding-block: 26px 48px; }
main section { margin-block: 0 30px; }
.crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: .88rem; margin-bottom: 16px; }
.crumb a { display: inline-flex; align-items: center; min-height: 44px; }
.home-hero, .channel-hero, .home-block { padding: clamp(18px, 3.1vw, 38px); border: 1px solid var(--line); border-radius: 13px; background: var(--white); }
.home-hero { background: linear-gradient(116deg, #fffaf0, #f1e2c5); border-top: 4px solid var(--red); }
.home-hero p, .channel-hero p { max-width: 54em; font-size: 1.06rem; }
.channel-hero { margin-bottom: 28px; border-left: 4px solid var(--red); }
.split { display: grid; align-items: center; gap: 24px; }
.split.illustrated { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.hero-split.illustrated { grid-template-columns: minmax(0, 56fr) minmax(0, 44fr); }
.home-channel.picture-left.illustrated { grid-template-columns: minmax(280px, 336px) minmax(0, 1fr); }
.picture-left .visual { grid-column: 1; grid-row: 1; }
.picture-left .split-copy { grid-column: 2; grid-row: 1; }
.split:not(.illustrated) .split-copy { grid-column: 1; }
.picture:not(.picture-logo) { width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; display: block; border-radius: 8px; }
.picture.picture-category, .picture.picture-authors { aspect-ratio: 4/3; }
.search-form { display: flex; align-items: stretch; gap: 8px; max-width: 650px; margin-block: .7rem; }
.search-form input { flex: 1; }
.search-form button { flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.chips a, .quick-links a { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: .35rem .65rem; display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.chips a:hover, .quick-links a:hover { border-color: var(--red); }
.quick-links, .definition-grid, .list-cards, .topic-cards, .footer-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.quick-links a { justify-content: center; }
.ruled { border-top: 3px solid var(--gold); }
.feature, .compare, .columns { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.feature { grid-template-columns: minmax(0,1.8fr) minmax(0,1fr); }
.feature > article { background: var(--sand); padding: 24px; border-radius: 8px; }
.feature aside { border-left: 1px solid var(--line); padding-left: 20px; }
.serial-band { background: var(--sand); }
.text-link { display: block; min-height: 44px; }
.work-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(min(100%, 235px),1fr); gap: 14px; overflow-x: auto; scroll-snap-type: x proximity; padding: 5px 4px 13px; }
.work-strip article, .topic-cards article, .list-cards article { padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); scroll-snap-align: start; }
.eyebrow { color: var(--muted); font-size: .86rem; }
.dark, .site-footer { background: var(--ink); color: #f4e9d5; }
.dark h2, .site-footer h2 { color: #fff8ea; }
.dark .chips a { color: #f8e6c4; background: #483b30; border-color: #74614f; }
.compare > article { border-left: 3px solid var(--gold); padding: 8px 14px; background: var(--white); }
.definition-grid > div { border-bottom: 1px solid var(--line); padding: .45rem .4rem; }
dt { font-weight: 750; color: var(--ink); }
dd { margin: .35rem 0 0; }
.timeline { border-left: 2px solid var(--gold); margin-left: 14px; padding-left: 25px; }
.timeline li { margin-bottom: 8px; padding-inline-start: 5px; }
details { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; min-height: 44px; padding-block: .45rem; font-weight: 700; color: var(--ink); }
details p { padding: .3rem .4rem .8rem; }
.rights { background: #f3e8d5; }
.filters { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,155px),1fr)); gap: 12px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.filters label, .correction label { display: grid; gap: 4px; font-weight: 650; }
.filter-actions { grid-column: 1/-1; display: flex; flex-wrap: wrap; gap: 8px; }
.results { border-top: 1px solid var(--line); }
.results article { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,2fr) auto; gap: 18px; align-items: start; border-bottom: 1px solid var(--line); padding: 16px 8px; }
.results h3 { margin-bottom: .3rem; }
.reading-layout { display: grid; grid-template-columns: minmax(170px,1fr) minmax(0,4fr); gap: 20px; align-items: start; }
.reading-layout aside { position: sticky; top: 20px; }
.reading-layout aside nav { display: grid; padding: 12px; border-left: 2px solid var(--gold); }
.reading-layout aside a { display: flex; align-items: center; min-height: 44px; }
.reading-layout aside h2 { font-size: 1.1rem; }
.prose, .booklists section, .faq-group, #personal { background: var(--white); padding: clamp(16px,3vw,34px); border: 1px solid var(--line); border-radius: 10px; }
.prose p { max-width: 68ch; }
.prose h3 { margin-top: .9em; }
.prose section:last-child { margin-bottom: 0; }
.facts { display: grid; grid-template-columns: max-content 1fr; margin: 0 0 1rem; }
.facts dt, .facts dd { padding: .5rem .65rem; border-bottom: 1px solid var(--line); margin: 0; }
.booklists { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.booklists section { margin: 0; }
.booklists + #personal { margin-top: 24px; }
.booklists li { margin-block: 8px; }
.booklists li button { margin-left: .45rem; }
.pill { color: var(--muted); font-size: .85rem; }
.faq-group details:last-child { border-bottom: none; }
.correction { display: grid; gap: 12px; margin-bottom: 24px; }
.correction button { justify-self: start; }
.site-footer { padding-block: 30px; }
.site-footer a { display: flex; align-items: center; min-height: 44px; color: #f8e6c4; }
.site-footer h2 { font-size: 1.05rem; }
.dialog { color: var(--text); background: var(--white); border: 1px solid var(--line); border-radius: 12px; width: min(640px, 100% - 28px); max-height: min(88dvh, 740px); padding: 18px; }
.dialog::backdrop { background: rgb(43 38 35 / 60%); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); margin-bottom: 14px; padding-bottom: 9px; }
.dialog-head h2 { margin: 0; }
body:has(dialog[open]) { overflow: hidden; }
.menu-row { display: grid; grid-template-columns: minmax(90px,1fr) minmax(0,2fr); border-bottom: 1px solid var(--line); }
.menu-row > a { display: flex; align-items: center; min-height: 44px; }
.menu-row details { border: 0; }
.library-item { display: grid; gap: 7px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.library-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.library-area h3 { margin-top: 1em; }
@media (max-width: 1040px) {
  .desktop-nav, .tools .desktop-favorite { display: none; }
  .mobile-menu { display: inline-flex; align-items: center; }
}
@media (max-width: 710px) {
  .wrap { width: calc(100% - 28px); }
  .topbar { min-height: 62px; }
  main { padding-top: 16px; }
  .split.illustrated, .home-channel.picture-left.illustrated { grid-template-columns: minmax(0,1fr); gap: 14px; }
  .picture-left .visual, .picture-left .split-copy { grid-column: auto; grid-row: auto; }
  .feature, .compare, .columns, .reading-layout, .booklists { grid-template-columns: minmax(0,1fr); }
  .feature aside { border: 0; padding-left: 0; }
  .reading-layout aside { position: static; }
  .reading-layout aside nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
  .reading-layout aside h2 { width: 100%; }
  .results article { grid-template-columns: minmax(0,1fr); gap: 6px; }
  .results button { justify-self: start; }
  .picture-logo { width: 124px; height: 36px; }
  .brand { font-size: .98rem; }
  body { padding-bottom: calc(var(--mobile-height) + env(safe-area-inset-bottom)); }
  .bottom-nav { position: fixed; z-index: 3; inset: auto 0 0; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); padding-bottom: env(safe-area-inset-bottom); min-height: var(--mobile-height); background: var(--white); border-top: 1px solid var(--line); }
  .bottom-nav a { display: grid; align-content: center; justify-items: center; gap: 4px; min-height: 50px; font-size: .82rem; }
  .bottom-nav .glyph { margin: 0; font-size: 1em; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
