:root {
  --ivory: #f6f3e8;
  --forest: #174a3a;
  --charcoal: #202722;
  --mist: #dfe5dc;
  --signal: #c9a548;
  --sage: #8e9d8e;
  color-scheme: light;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--ivory);
  color: var(--charcoal);
  scroll-behavior: smooth;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--ivory); color: var(--charcoal); }
a { color: inherit; }
button { font: inherit; }
.skip-link { position: fixed; z-index: 40; inset: .75rem auto auto .75rem; transform: translateY(-180%); padding: .65rem 1rem; color: var(--ivory); background: var(--forest); }
.skip-link:focus { transform: none; }
.dictionary-head { min-height: 5rem; display: grid; grid-template-columns: 1fr auto 1fr; gap: 2rem; align-items: center; padding: 1rem 4vw; border-bottom: 1px solid var(--charcoal); }
.lexicon-mark { display: flex; align-items: baseline; gap: .7rem; width: max-content; text-decoration: none; }
.lexicon-mark strong { font-size: 1.4rem; }
.lexicon-mark span, .dictionary-head > p { color: var(--forest); font: .66rem/1 ui-monospace, monospace; letter-spacing: .16em; }
.dictionary-head nav { display: flex; gap: 1.3rem; }
.dictionary-head nav a { text-decoration: none; font-size: .85rem; }
.dictionary-head nav a:hover, .dictionary-head nav a:focus-visible { color: var(--forest); text-decoration: underline; text-underline-offset: .35rem; }
.dictionary-head > p { justify-self: end; margin: 0; }
.drawer-toggle { display: none; }
.index-hero { min-height: 74vh; display: grid; grid-template-columns: .42fr 1fr; border-bottom: 1px solid var(--charcoal); }
.index-hero__code { display: grid; grid-template-columns: auto 1fr; align-content: space-between; padding: 3rem; color: var(--ivory); background: var(--forest); }
.index-hero__code span, .index-hero__code small { font: .72rem/1 ui-monospace, monospace; letter-spacing: .16em; }
.index-hero__code strong { justify-self: center; font: 700 clamp(3.6rem, 7vw, 7rem)/.9 "Songti SC", serif; }
.index-hero__code small { grid-column: 2; justify-self: end; }
.index-hero__copy { align-self: center; padding: clamp(4rem, 9vw, 9rem) 7vw; }
.catalogue-label, .index-drawer header p, .term-index aside > p:first-child, .type-links header p, .shot-register header p, .style-reading > div > p, .reader-questions header p, .source-ledger > div > p { margin: 0 0 1rem; color: var(--forest); font: 700 .7rem/1.3 ui-monospace, monospace; letter-spacing: .16em; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 15ch; font: 800 clamp(3.2rem, 7vw, 7.4rem)/.95 "Songti SC", "STSong", serif; letter-spacing: -.06em; }
.index-hero__copy > p:not(.catalogue-label) { max-width: 42rem; color: #566159; font-size: 1.12rem; line-height: 1.9; }
.index-hero__copy a { display: inline-block; margin-top: 1.5rem; font-weight: 800; text-underline-offset: .4rem; }
.index-drawer, .type-links, .shot-register, .style-reading, .reader-questions, .source-ledger { padding: clamp(4rem, 7vw, 7rem) 5vw; }
.index-drawer header { display: grid; grid-template-columns: 4rem 1fr; }
.index-drawer header > span { color: var(--signal); font: 800 2rem/1 ui-monospace, monospace; }
h2 { font: 700 clamp(2.3rem, 4.5vw, 4.6rem)/1.05 "Songti SC", serif; letter-spacing: -.04em; }
.index-drawer > div { display: grid; grid-template-columns: repeat(6, 1fr); border-block: 1px solid var(--charcoal); }
.index-drawer button { min-height: 9rem; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; padding: 1rem; border: 0; border-inline-end: 1px solid var(--sage); color: var(--charcoal); background: transparent; cursor: pointer; }
.index-drawer button:last-child { border: 0; }
.index-drawer button span { color: var(--forest); font: .7rem/1 ui-monospace, monospace; }
.index-drawer button[aria-pressed="true"] { color: var(--ivory); background: var(--forest); }
.index-drawer button[aria-pressed="true"] span { color: var(--signal); }
.term-index { display: grid; grid-template-columns: minmax(14rem, .34fr) 1fr; border-block: 1px solid var(--charcoal); }
.term-index aside { padding: 4rem 3vw 4rem 5vw; border-inline-end: 1px solid var(--charcoal); }
.term-index aside { position: sticky; top: 0; align-self: start; }
.term-index aside p:last-child { color: #657067; line-height: 1.8; }
.term-index__entries { padding: 0 5vw 0 3vw; }
.term-sheet { border-bottom: 1px solid var(--sage); }
.term-sheet:last-child { border-bottom: 0; }
.term-sheet[hidden] { display: none; }
.term-sheet > header { display: grid; grid-template-columns: 7rem 5rem 1fr auto; align-items: center; gap: 1rem; min-height: 8rem; }
.entry-code { color: var(--forest); font-family: ui-monospace, SFMono-Regular, monospace; }
.term-sheet > header > span:nth-child(2) { color: var(--sage); font-size: .72rem; }
.term-sheet h3 { margin: 0; font: 700 2rem/1 "Songti SC", serif; }
.term-sheet button { border: 0; border-bottom: 1px solid var(--forest); color: var(--forest); background: transparent; cursor: pointer; }
.definition-triplet { margin: 0 0 2rem 13rem; }
.definition-triplet > div { display: grid; grid-template-columns: 6rem 1fr; gap: 1rem; padding: .8rem 0; }
.definition-triplet dt { color: var(--forest); font-weight: 800; }
.definition-triplet dd { margin: 0; color: #4c5850; line-height: 1.8; }
.type-links { color: var(--ivory); background: var(--forest); }
.type-links header p { color: var(--signal); }
.type-links ol { margin: 2.5rem 0 0; padding: 0; list-style: none; border-top: 1px solid #608373; }
.type-link { display: grid; grid-template-columns: 3rem 7rem 2rem 7rem 1fr; gap: 1rem; align-items: center; padding: 1.4rem 0; border-bottom: 1px solid #608373; }
.type-link span, .type-link i { color: var(--signal); font: .8rem/1 ui-monospace, monospace; }
.type-link p { margin: 0; color: #c9d7cf; line-height: 1.6; }
.shot-register > div { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--charcoal); }
.shot-register article { min-height: 15rem; padding: 1.4rem; border-inline-end: 1px solid var(--sage); }
.shot-register article:last-child { border: 0; }
.shot-register article > span { color: var(--forest); font: .7rem/1 ui-monospace, monospace; }
.shot-register h3 { margin-top: 4rem; font-size: 1.25rem; }
.shot-register article p { color: #5d675f; line-height: 1.7; }
.style-reading { display: grid; grid-template-columns: .8fr 1.2fr; gap: 4rem; background: var(--mist); }
.style-reading ol { margin: 0; padding: 0; list-style: none; }
.style-reading li { display: grid; grid-template-columns: 3rem 1fr; gap: 1rem; padding: 1.3rem 0; border-top: 1px solid var(--sage); }
.style-reading li span { color: var(--forest); font: 700 .72rem/1 ui-monospace, monospace; }
.style-reading li p { color: #566159; line-height: 1.75; }
.reader-questions details { border-top: 1px solid var(--charcoal); }
.reader-questions details:last-child { border-bottom: 1px solid var(--charcoal); }
.reader-questions summary { padding: 1.2rem 0; font-weight: 800; cursor: pointer; }
.reader-questions details p { max-width: 50rem; color: #5d675f; line-height: 1.8; }
.source-ledger { display: grid; grid-template-columns: 5rem 1fr; gap: 2rem; color: var(--ivory); background: var(--charcoal); }
.source-ledger > span { color: var(--signal); font: 800 2rem/1 ui-monospace, monospace; }
.source-ledger h2 { font-size: 2.5rem; }
.source-ledger > div > p:last-child { max-width: 62rem; color: #c8d0c9; line-height: 1.8; }
.dictionary-foot { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 2rem; padding: 2.4rem 5vw; border-top: 1px solid var(--sage); }
.dictionary-foot p { color: #5d675f; line-height: 1.7; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 4px; }

@media (max-width: 800px) {
  .dictionary-head { grid-template-columns: 1fr auto; }
  .dictionary-head > p { display: none; }
  .drawer-toggle { display: inline-flex; padding: .55rem .8rem; border: 1px solid var(--forest); color: var(--forest); background: transparent; }
  .has-js .dictionary-head nav { display: none; grid-column: 1 / -1; }
  .has-js .dictionary-head nav[data-open="true"] { display: flex; flex-wrap: wrap; padding-top: .8rem; }
  .index-hero { min-height: auto; grid-template-columns: 1fr; }
  .index-hero__copy { order: -1; padding: 4.5rem 5vw 3.5rem; }
  .index-hero__code { min-height: 15rem; grid-template-columns: auto 1fr; }
  .index-hero__code strong { font-size: 4rem; }
  h1 { font-size: clamp(3rem, 15vw, 5rem); }
  .index-drawer > div { grid-template-columns: repeat(3, 1fr); }
  .index-drawer button { border-bottom: 1px solid var(--sage); }
  .term-index { grid-template-columns: 1fr; }
  .term-index aside { position: static; padding: 3rem 5vw 2rem; border-inline-end: 0; border-bottom: 1px solid var(--charcoal); }
  .term-index__entries { padding: 0 5vw; }
  .term-sheet > header { grid-template-columns: 5.5rem 1fr auto; }
  .term-sheet > header > span:nth-child(2) { display: none; }
  .definition-triplet { margin-left: 0; }
  .definition-triplet > div { grid-template-columns: 1fr; gap: .25rem; }
  .type-link { grid-template-columns: 2rem 1fr auto 1fr; }
  .type-link p { grid-column: 2 / -1; }
  .shot-register > div { grid-template-columns: 1fr 1fr; }
  .shot-register article:nth-child(2) { border-inline-end: 0; }
  .style-reading { grid-template-columns: 1fr; }
  .dictionary-foot { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .index-drawer > div, .shot-register > div { grid-template-columns: 1fr 1fr; }
  .term-sheet > header { grid-template-columns: 1fr auto; padding: 1.2rem 0; }
  .entry-code { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
