:root {
  color-scheme: light;
  --paper: #faf9f5;
  --surface: #fffefa;
  --ink: #192a24;
  --muted: #52645b;
  --green: #245440;
  --line: #dce2d9;
  --pale: #edf3eb;
  --gold: #ead597;
  --sans: "Inter", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  --serif: "Noto Serif CJK SC", "Songti SC", "SimSun", serif;
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 1rem; }
button, input, select { font: inherit; }
button { cursor: pointer; color: inherit; }
a { color: var(--green); text-underline-offset: .22em; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #548964; outline-offset: 4px; }
.shell { width: min(100% - 3.5rem, 68rem); margin-inline: auto; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: absolute; top: .5rem; left: .5rem; z-index: 5; background: white; padding: .65rem; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.navigation { min-height: 4.25rem; display: flex; justify-content: space-between; align-items: center; gap: .8rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--ink); text-decoration: none; font-size: .95rem; font-weight: 700; }
.brand-mark { display: grid; place-items: center; background: #204234; border-radius: .52rem; color: var(--gold); font-family: var(--serif); font-size: 1.14rem; width: 2.05rem; height: 2.05rem; }
.brand-divider { display: inline-block; margin: 0 .62rem; height: .85em; width: 1px; vertical-align: -.06em; background: #cbd5c9; }
.source-menu { position: relative; font-size: .88rem; color: var(--green); z-index: 2; }
.source-menu summary { cursor: pointer; display: flex; align-items: center; gap: .65rem; padding: .55rem 0 .55rem .4rem; }
.source-menu summary::-webkit-details-marker { display: none; }
.chevron { display: inline-block; width: .49rem; height: .49rem; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-.12rem) rotate(45deg); }
.source-menu[open] .chevron, .entry[open] .row-toggle .chevron { transform: translateY(.12rem) rotate(225deg); }
.source-menu div { position: absolute; right: 0; min-width: 9rem; padding: .3rem; background: var(--surface); border: 1px solid var(--line); border-radius: .55rem; box-shadow: 0 .3rem 1rem #112c2020; }
.source-menu a { display: block; padding: .55rem .6rem; text-decoration: none; border-radius: .3rem; }
.source-menu a:hover { background: var(--pale); }
.hero {
  background: linear-gradient(90deg, #112c24fa 0%, #112c24f0 29%, #142e25a6 57%, #162e2670 100%), #244236 url("forest.webp") center 50% / cover no-repeat;
  color: #fcfbf5;
  border-bottom: 1px solid #1f4236;
}
.hero-inner { padding-block: 3.1rem 3.3rem; }
.eyebrow { margin: 0 0 .85rem; color: var(--gold); font-size: .93rem; letter-spacing: .14em; }
h1 { margin: 0; font-family: var(--serif); font-size: clamp(2.35rem, 5.9vw, 4.15rem); font-weight: 750; letter-spacing: .045em; line-height: 1.16; }
h1 span { display: inline-block; margin-left: .25em; font-size: .76em; }
.hero-description { color: #ebf0e6; margin: 1rem 0 1.65rem; line-height: 1.55; }
#search-form { width: min(100%, 42rem); min-height: 3.4rem; display: flex; gap: .7rem; align-items: center; padding: 0 .9rem 0 1.05rem; background: var(--surface); color: var(--ink); border: 1px solid #f9f8ed; border-radius: .57rem; box-shadow: 0 .3rem 1.2rem #07191236; }
#search-form:focus-within { border-color: #d7c17c; outline: 2px solid #d7c17c; outline-offset: 3px; }
.search-icon { width: .91rem; height: .91rem; position: relative; border-radius: 50%; border: 1.7px solid var(--green); margin-right: .19rem; flex: 0 0 auto; }
.search-icon::after { content: ""; position: absolute; width: .42rem; height: 1.7px; border-radius: 2px; right: -.31rem; bottom: -.14rem; transform: rotate(45deg); background: var(--green); }
#search { width: 100%; min-width: 0; height: 3.3rem; padding: 0 .2rem; color: var(--ink); background: transparent; border: 0; outline: 0; }
#search::placeholder { color: var(--muted); }
#search::-webkit-search-cancel-button { display: none; }
#clear-search { width: 1.88rem; height: 1.88rem; display: grid; place-items: center; flex: none; border: 0; border-radius: .35rem; background: var(--pale); font-size: 1.25rem; line-height: 1; }
kbd { border: 1px solid #d9e1d6; border-radius: .27rem; color: var(--muted); background: #f5f7f2; font-size: .85rem; padding: .08rem .45rem; }
.examples { display: flex; align-items: center; gap: .47rem; flex-wrap: wrap; margin-top: .85rem; color: #f0f1e8; font-size: .85rem; }
.examples span { margin-right: .22rem; }
.examples button { border: 1px solid #d9e8cc67; background: #132d2472; color: #fbfff6; border-radius: 999px; padding: .32rem .74rem; line-height: 1.25; }
.examples button:hover { background: #375848; }
.library { padding-block: 2.1rem 3.25rem; min-height: 53vh; }
.library-heading { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; }
h2 { margin: 0; font-family: var(--serif); font-size: 1.78rem; letter-spacing: .04em; }
.totals, #result-status { color: var(--muted); font-size: .88rem; }
#views { display: flex; gap: 1.6rem; border-bottom: 1px solid var(--line); margin-top: .6rem; }
#views button { border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: transparent; padding: .82rem .27rem .69rem; color: var(--muted); }
#views button:hover { color: var(--green); }
#views button[aria-pressed="true"] { color: var(--green); border-bottom-color: var(--green); font-weight: 700; }
.controls { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-block: .95rem; }
.select-wrap { position: relative; }
.select-wrap .chevron { position: absolute; pointer-events: none; right: .86rem; top: calc(50% - .18rem); color: var(--green); }
select { appearance: none; min-height: 2.43rem; border: 1px solid var(--line); border-radius: .38rem; background: var(--surface); padding: .38rem 2.07rem .38rem .65rem; color: var(--ink); font-size: .88rem; cursor: pointer; }
#result-status { margin: 0; text-align: end; }
#story-note { border-left: 2px solid #8caa8b; padding: .6rem .8rem; margin: 0 0 .92rem; background: var(--pale); color: var(--muted); font-size: .88rem; line-height: 1.55; }
.table-head, .row-toggle { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(4rem, .29fr) 1.2rem; gap: 1rem; align-items: center; padding-inline: 1rem; }
.table-head { border: 1px solid var(--line); border-radius: .48rem .48rem 0 0; background: #eaf0e8; color: var(--muted); font-size: .87rem; min-height: 2.6rem; font-weight: 600; }
#results { border-inline: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); border-radius: 0 0 .48rem .48rem; overflow: clip; }
.entry + .entry { border-top: 1px solid var(--line); }
.row-toggle { list-style: none; min-height: 3.65rem; cursor: pointer; position: relative; padding-block: .72rem; }
.row-toggle::-webkit-details-marker { display: none; }
.row-toggle:hover, .entry[open] .row-toggle { background: #f3f6ef; }
.row-toggle:focus-visible { outline-offset: -3px; }
.row-toggle .chevron { color: var(--green); justify-self: center; }
.zh-term { font-weight: 700; }
.zh-term, .ja-term { overflow-wrap: anywhere; line-height: 1.47; }
.entry[open] .row-toggle { border-bottom: 1px solid #e4e9df; }
.tag { justify-self: start; border-radius: 999px; background: var(--pale); color: #315541; padding: .23rem .57rem; font-size: .83rem; white-space: nowrap; }
.tag.story { color: #644c28; background: #f4ebd9; }
.detail { padding: .95rem 1rem 1.05rem; }
.detail-copy, .reading { margin: 0 0 .75rem; color: var(--muted); font-size: .88rem; line-height: 1.6; }
.comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: .9rem; }
.comparison section { min-width: 0; border-radius: .34rem; background: #f5f6ef; padding: .75rem .8rem; }
.comparison h3 { margin: 0 0 .4rem; font-size: .85rem; color: var(--green); }
.comparison p { margin: 0; line-height: 1.7; overflow-wrap: anywhere; white-space: pre-line; }
.source-links { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .88rem; }
.source-links a { font-weight: 600; padding-block: .18rem; }
.empty { margin: 0; padding: 1.6rem 1rem; color: var(--muted); line-height: 1.6; }
.pagination { display: flex; gap: .9rem; justify-content: center; align-items: center; margin-top: 1.2rem; color: var(--muted); font-size: .89rem; }
.pagination button { background: var(--surface); border: 1px solid var(--line); border-radius: .37rem; color: var(--green); padding: .44rem .7rem; }
.pagination button:hover:not(:disabled) { background: var(--pale); }
.pagination button:disabled { opacity: .5; cursor: default; }
.footer { border-top: 1px solid var(--line); color: var(--muted); background: #f3f5ed; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .35rem 1rem; padding-block: 1.05rem; font-size: .83rem; }
.footer p { margin: 0; line-height: 1.6; }
.footer a + a { margin-left: 1rem; }
@media (max-width: 42rem) {
  .shell { width: calc(100% - 2rem); }
  .hero-inner { padding-block: 2.3rem 2.55rem; }
  .hero { background-position: 65% center; }
  .library { padding-top: 1.55rem; }
  .table-head, .row-toggle { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) .65rem; gap: .65rem; padding-inline: .75rem; }
  .table-head span:nth-child(3) { display: none; }
  .row-toggle .tag { grid-column: 1 / span 2; grid-row: 2; }
  .row-toggle .chevron { grid-column: 3; grid-row: 1 / span 2; }
  .comparison { grid-template-columns: 1fr; gap: .55rem; }
  .detail { padding-inline: .75rem; }
}
@media (max-width: 25rem) {
  .brand { font-size: .88rem; gap: .45rem; }
  .brand-divider { margin-inline: .4rem; }
  .brand-mark { height: 1.75rem; width: 1.75rem; }
  .source-menu { font-size: .82rem; }
  .totals { font-size: .78rem; }
}
@media (pointer: coarse) { kbd { display: none; } }
