:root {
  --paper: #e8e8e3;
  --light: #dcdcd6;
  --ink: #181715;
  --muted: #55544d;
  --brass: #bfb21a;
  --small: 1rem;
  --body: 1.125rem;
  --lead: clamp(1.35rem, 1rem + 0.7vw, 1.8rem);
  --title: clamp(2.7rem, 1.5rem + 5vw, 6rem);
  color: var(--ink);
  background: var(--ink);
  font: var(--small)/1.55 Georgia, 'Songti SC', SimSun, serif;
}

* { box-sizing: border-box; }

body { margin: 0; }

a { color: inherit; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: .16em; }

:focus-visible { outline: .18rem solid currentColor; outline-offset: .24rem; }

.skip { position: absolute; inset: 0 auto auto 0; padding: .75rem; background: var(--paper); }
.skip:not(:focus) { transform: translateY(-110%); }

.frame { width: min(100% - 2rem, 54rem); margin: clamp(1rem, 6vw, 6rem) auto; }
.sheet { padding: clamp(1.2rem, 6vw, 4.3rem); background: var(--paper); }
.sheet + .sheet { margin-top: clamp(.75rem, 2vw, 2rem); }

.topline, .endline { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: baseline; gap: .5rem 1.25rem; }
.topline { margin: 0 0 clamp(1.6rem, 5vw, 3.8rem); }
.brand { font-weight: 700; }

h1, h2, h3, p { margin: 0; }
h1, h2 { font-weight: 400; letter-spacing: -.035em; line-height: 1.03; }
h1 { font-size: var(--title); }
h2 { font-size: clamp(2.2rem, 1.55rem + 2vw, 3.4rem); }
h3 { font-size: var(--lead); font-weight: 400; }

.intro { max-width: 44ch; margin-top: 1.2rem; font-size: var(--lead); line-height: 1.35; }
.tool { padding: clamp(.85rem, 4vw, 2rem); margin: clamp(1.5rem, 4vw, 3.3rem) 0 0; background: var(--light); }
.tool fieldset { border: 0; margin: 0; padding: 0; min-inline-size: 0; }
.tool legend { padding: 0; margin-bottom: .3rem; font-weight: 700; }
.choices { display: flex; gap: 0 .35rem; flex-wrap: wrap; }
.choices label { display: flex; align-items: center; gap: .4rem; padding: .5rem .65rem; min-height: 44px; cursor: pointer; }
.choices label:has(input:checked) { background: var(--brass); }
.choices input { accent-color: var(--ink); margin: 0; }

.sample {
  --measure: 58ch;
  max-inline-size: var(--measure);
  margin-top: 1.1rem;
  line-height: 1.6;
  font-size: var(--body);
  overflow-wrap: anywhere;
}

.tool:has(#narrow:checked) .sample { --measure: min(23ch, 70%); }
.tool:has(#wide:checked) .sample { --measure: 77ch; }
:lang(zh-CN) .sample { font-size: clamp(1.06rem, 1rem + .3vw, 1.2rem); --measure: 28ic; }
:lang(zh-CN) .tool:has(#narrow:checked) .sample { --measure: min(14ic, 70%); }
:lang(zh-CN) .tool:has(#wide:checked) .sample { --measure: 38ic; }

.jump { display: inline-block; margin-top: 1.2rem; }

.notes { background: var(--light); }
.notes article { display: grid; grid-template-columns: minmax(10rem, 1fr) 2fr; gap: .55rem 2rem; margin-top: clamp(1.8rem, 4vw, 3rem); }
.notes article p { font-size: var(--body); }
.source { display: inline-block; margin-top: .6rem; }

.footer { background: var(--paper); padding: 1.35rem clamp(1.2rem, 6vw, 4.3rem); }
.footer span { color: var(--muted); }

@media (max-width: 37rem) {
  .notes article { grid-template-columns: 1fr; }
}
