:root {
  color-scheme: light dark;
  --background: #faf8f4;
  --surface: #fffdf9;
  --accent-surface: #fff2dd;
  --text: #252018;
  --muted: #625749;
  --line: #e4d9cb;
  --link: #88420e;
  font-family: "Instrument Sans", "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  line-height: 1.75;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #1c1814;
    --surface: #24201a;
    --accent-surface: #322619;
    --text: #f7f0e6;
    --muted: #d0c0ad;
    --line: #4a3e31;
    --link: #ffc382;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--text); }
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: .08em; }
a:hover { text-decoration-thickness: .14em; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 4px; }
.frame { width: min(100% - 2rem, 72rem); margin-inline: auto; }
.skip-link {
  position: absolute;
  z-index: 1;
  inset: .75rem auto auto 1rem;
  min-height: 2.5rem;
  padding: .4rem .8rem;
  background: var(--surface);
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }
.masthead {
  padding-block: clamp(1rem, .75rem + 1.2vw, 1.5rem);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.page-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: .8rem;
}
h1, h2 { margin: 0; line-height: 1.25; }
h1 { font-size: clamp(1.4rem, 1.19rem + 1vw, 2rem); overflow-wrap: anywhere; }
.heading-context { color: var(--muted); font-weight: 550; }
h2 { font-size: 1.35rem; }
.masthead p { margin: .55rem 0 0; color: var(--muted); line-height: 1.5; }
.guide-layout {
  display: grid;
  grid-template-columns: minmax(11rem, 15rem) minmax(0, 1fr);
  align-items: start;
  gap: clamp(1.5rem, 1rem + 3vw, 4rem);
  padding-block: 1.8rem 3.5rem;
}
.contents {
  position: sticky;
  top: 1rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: .85rem;
  background: var(--surface);
}
.contents h2 { font-size: 1.02rem; }
.contents ul { display: grid; gap: .5rem; margin: .55rem 0 0; padding: 0; list-style: none; }
.contents a, .back a {
  display: flex;
  align-items: center;
  min-width: 2.5rem;
  min-height: 2.5rem;
  line-height: 1.4;
}
.contents a { text-decoration: none; }
.contents a:hover { text-decoration: underline; }
main { max-inline-size: 48rem; overflow-wrap: anywhere; }
main section { padding-block: 1.55rem; border-bottom: 1px solid var(--line); scroll-margin-top: 1rem; }
main section.quick-start {
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: .85rem;
  background: var(--surface);
}
main ul, main ol { margin-block: .75rem 0; padding-inline-start: 1.4em; }
main li + li { margin-block-start: .45rem; }
code, kbd {
  padding: .1em .25em;
  border-radius: .2em;
  background: var(--accent-surface);
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: .9em;
}
.back { margin-block: 1rem 0; }
.back a { display: inline-flex; }

@media (max-width: 52rem), (max-height: 45rem) {
  .contents { position: static; }
}

@media (max-width: 52rem) {
  .guide-layout { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .contents ul { grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); }
}
