:root {
  color-scheme: light;
  --paper: #f5f1e8;
  --card: #fffcf5;
  --ink: #26251f;
  --subtle: #59534b;
  --accent: #9b3c2b;
  --edge: #d8cdbd;
  --soft: #eee5d7;
  font-family: "Source Sans 3", system-ui, "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0 auto; max-width: 80rem; padding: 0 clamp(1rem, 5vw, 4rem); }
a { color: var(--accent); text-underline-offset: .2em; }
a:focus-visible, input:focus-visible, button:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.masthead, footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1.25rem 0; }
.masthead a { font-weight: 650; }
.wordmark { color: var(--ink); font-size: 1.1rem; text-decoration: none; letter-spacing: .06em; }
.wordmark span { color: var(--accent); margin-inline-start: .25em; }
.intro { padding: clamp(2rem, 8vw, 6rem) 0 clamp(1.5rem, 5vw, 3rem); }
h1, h2, p { margin: 0; }
h1 {
  font-family: "Noto Serif SC", "Songti SC", SimSun, serif;
  font-size: clamp(2.4rem, 7.7vw, 6rem);
  font-weight: 700;
  letter-spacing: -.06em;
  line-height: 1.15;
  min-height: 1.2em;
}
h1 span { color: var(--accent); }
.intro p { color: var(--subtle); margin-top: 1.1rem; line-height: 1.7; max-width: 36rem; }
.controls {
  padding: 1rem;
  background: var(--soft);
  border-radius: .75rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(8rem, .34fr) minmax(8rem, .34fr);
  gap: 1rem;
}
label { font-size: .88rem; font-weight: 650; }
input, button, select { font: inherit; color: inherit; }
input[type="text"], select {
  width: 100%;
  height: 2.7rem;
  border-radius: .45rem;
  border: 1px solid var(--edge);
  background: var(--card);
  padding: 0 .65rem;
  margin-top: .35rem;
}
input[type="range"] { width: 100%; height: 2.7rem; margin: .35rem 0 0; accent-color: var(--accent); display: block; }
output { float: right; min-width: 4ch; font-variant-numeric: tabular-nums; text-align: end; color: var(--accent); }
.specimens { display: grid; gap: .8rem; margin-top: .9rem; }
.specimen {
  padding: clamp(1rem, 3vw, 1.55rem);
  border: 1px solid var(--edge);
  border-radius: .75rem;
  background: var(--card);
  min-width: 0;
}
.specimen header { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem 1rem; flex-wrap: wrap; }
.specimen h2 { font-size: 1rem; }
.specimen small { color: var(--subtle); display: block; margin-top: .15rem; }
.specimen button { font-size: .83rem; }
.sample { margin: .65em 0 .55em; overflow-wrap: anywhere; line-height: 1.35; min-height: 1.35em; font-synthesis: none; }
.specimen footer { padding: 0; justify-content: start; gap: .45rem 1.2rem; font-size: .8rem; color: var(--subtle); }
.integration {
  display: grid;
  grid-template-columns: minmax(12rem, .45fr) minmax(0, 1fr);
  gap: 1.4rem;
  margin: 2.6rem 0 1rem;
  padding: clamp(1rem, 4vw, 2rem);
  border-radius: .75rem;
  background: var(--soft);
  scroll-margin-top: 1rem;
}
.integration h2 { font-size: 1.55rem; }
.integration p { color: var(--subtle); margin: .65rem 0 1rem; line-height: 1.6; }
.methods { display: flex; flex-wrap: wrap; gap: .45rem; padding: 0; margin: 0; border: 0; }
.sr-only, .methods input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.methods span, button {
  display: inline-block;
  background: var(--card);
  border: 1px solid var(--edge);
  border-radius: .45rem;
  padding: .4rem .75rem;
  cursor: pointer;
}
button:hover, .methods label:hover span { background: var(--paper); }
.methods input:checked + span, #copy { color: white; background: var(--accent); border-color: var(--accent); }
.methods input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }
#copy:hover { background: #783023; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 .8rem; padding: 1rem; background: #302a25; color: #fff5e4; border-radius: .5rem; line-height: 1.55; }
code { font-family: "IBM Plex Mono", Consolas, monospace; font-size: .85rem; }
.copy-row { display: flex; align-items: center; gap: .75rem; }
#copy-status { color: var(--subtle); font-size: .85rem; }
body > footer { justify-content: start; font-size: .85rem; color: var(--subtle); padding-bottom: 2rem; }
@media (max-width: 46rem) {
  .controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .controls label:first-child { grid-column: 1 / -1; }
  .integration { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 23rem) {
  .specimen header { align-items: start; }
}
