:root {
  --bg: #f6f8fa;
  --paper: #ffffff;
  --ink: #1f2328;
  --mute: #656d76;
  --line: #d0d7de;
  --line-strong: #8c959f;
  --link: #0969da;
  --link-hover: #0550ae;
  --good: #1a7f37;
  --good-btn: #1f883d;
  --good-hover: #1a7f37;
  --good-soft: #dafbe1;
  --info-soft: #ddf4ff;
  --star-soft: #fff8c5;
  --warn: #9a6700;
  --warn-soft: #fff8c5;
  --halt: #cf222e;
  --halt-soft: #ffebe9;
  --code: #1f2328;
  --code-bg: #f6f8fa;
  --header: #24292f;
  --header-ink: #f0f6fc;
  --header-mute: #b1bac4;
  --chip-bg: #eaeef2;
  --shadow: 0 1px 0 rgba(31, 35, 40, 0.04);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "Noto Sans", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 6px;
  --max: 1180px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font: 16px/1.6 var(--sans);
}

body.nav-lock {
  overflow: hidden;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

code,
kbd,
pre {
  font-family: var(--mono);
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 80;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.skip:focus {
  top: 12px;
}

.wrap {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--header);
  color: var(--header-ink);
  border-bottom: 1px solid #3d444d;
}

.bar.is-stuck {
  box-shadow: 0 8px 24px rgba(1, 4, 9, 0.18);
}

.bar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: inherit;
  min-width: 0;
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  object-fit: cover;
}

.brand strong {
  display: block;
  font-size: 0.98rem;
}

.brand small {
  display: block;
  color: var(--header-mute);
  font-size: 0.75rem;
}

.menu {
  display: flex;
  align-items: center;
}

.menu ul {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 0.7rem;
  border-radius: var(--radius);
  color: var(--header-ink);
  font-size: 0.92rem;
}

.menu a:hover,
.menu a[aria-current="page"] {
  background: rgba(240, 246, 252, 0.08);
  text-decoration: none;
}

.menu .cta {
  margin-left: 0.35rem;
  background: var(--good-btn);
  color: #fff;
  font-weight: 600;
}

.menu .cta:hover,
.menu .cta[aria-current="page"] {
  background: var(--good-hover);
}

.toggle {
  display: none;
  min-height: 36px;
  padding: 0 0.7rem;
  border: 1px solid #3d444d;
  border-radius: var(--radius);
  background: transparent;
  color: var(--header-ink);
  font: inherit;
  cursor: pointer;
}

.hero {
  padding: 1.6rem 0 0.4rem;
}

.repo-head {
  padding: 1rem 0 0;
}

.repo-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.8rem;
  margin-bottom: 0.85rem;
}

.repo-name {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 1.15rem;
}

.repo-name em {
  font-style: normal;
  color: var(--mute);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--mute);
  font-size: 0.75rem;
}

.tabs {
  display: flex;
  gap: 0.15rem;
  border-bottom: 1px solid var(--line);
}

.tabs a,
.tabs span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 0.85rem;
  border-bottom: 2px solid transparent;
  color: var(--ink);
  font-size: 0.9rem;
}

.tabs .on {
  border-bottom-color: #fd8c73;
  font-weight: 600;
}

.tabs a:hover {
  text-decoration: none;
  color: var(--link);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 1.4rem;
  padding: 1.2rem 0 2.4rem;
}

.readme,
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.readme {
  overflow: hidden;
}

.file-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: var(--code-bg);
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--mute);
}

.md {
  padding: 1.15rem 1.3rem 1.5rem;
}

.md h1,
.md h2,
.md h3 {
  scroll-margin-top: 84px;
}

.md h1 {
  margin: 0 0 0.7rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--line);
  font-size: 1.85rem;
  line-height: 1.25;
}

.md h2 {
  margin: 1.6rem 0 0.7rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
  font-size: 1.35rem;
}

.md h3 {
  margin: 1.15rem 0 0.45rem;
  font-size: 1.05rem;
}

.md p,
.md li {
  color: var(--ink);
}

.md .lead {
  color: var(--ink);
  font-size: 1.02rem;
}

.md .note {
  margin: 0.9rem 0;
  padding: 0.75rem 0.9rem;
  border-left: 4px solid var(--line-strong);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--code-bg);
}

.md .note.warn {
  border-left-color: #d4a72c;
  background: var(--warn-soft);
}

.md .note.halt {
  border-left-color: var(--halt);
  background: var(--halt-soft);
}

.md .note h3 {
  margin: 0 0 0.3rem;
}

.md .note p {
  margin: 0;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.2rem 0 1rem;
}

.badge {
  display: inline-flex;
  overflow: hidden;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1;
}

.badge b,
.badge span {
  padding: 0.32rem 0.45rem;
  font-weight: 600;
}

.badge b {
  background: #24292f;
  color: #fff;
}

.badge span {
  background: var(--chip-bg);
  color: var(--ink);
}

.badge.star span {
  background: var(--star-soft);
}

.badge.ver span {
  background: var(--info-soft);
}

.badge.oss span {
  background: var(--good-soft);
}

.acts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1rem 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 0.95rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.92rem;
}

.btn:hover {
  text-decoration: none;
}

.btn-good {
  background: var(--good-btn);
  color: #fff;
}

.btn-good:hover {
  background: var(--good-hover);
  color: #fff;
}

.btn-ghost {
  border-color: var(--line);
  background: var(--paper);
  color: var(--ink);
}

.btn-ghost:hover {
  background: var(--code-bg);
  color: var(--ink);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 1rem 0 0.4rem;
}

.stat {
  padding: 0.75rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--code-bg);
}

.stat b {
  display: block;
  font-family: var(--mono);
  font-size: 1.15rem;
}

.stat span,
.stat em {
  display: block;
  font-size: 0.82rem;
  color: var(--mute);
}

.stat em {
  margin-top: 0.25rem;
  font-style: normal;
}

.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 42%);
  gap: 1.1rem;
  align-items: start;
}

.shot {
  margin: 0;
}

.shot img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--code-bg);
}

.shot figcaption {
  margin-top: 0.4rem;
  color: var(--mute);
  font-size: 0.82rem;
}

.grid-4,
.grid-2 {
  display: grid;
  gap: 0.75rem;
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card,
.entry {
  display: block;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: inherit;
}

a.entry:hover,
a.card:hover {
  border-color: #80b8f0;
  text-decoration: none;
  box-shadow: 0 0 0 1px #80b8f0 inset;
}

.tag {
  display: inline-block;
  margin-bottom: 0.3rem;
  padding: 0.08rem 0.4rem;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--mute);
  font-family: var(--mono);
  font-size: 0.7rem;
}

.card h3,
.entry h3,
.rel h3,
.os h3 {
  margin: 0.15rem 0 0.35rem;
  font-size: 1rem;
}

.card p,
.entry p,
.rel p,
.os p {
  margin: 0;
  color: var(--mute);
  font-size: 0.9rem;
}

.blob {
  margin: 0.9rem 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.blob-head {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--line);
  background: var(--code-bg);
  color: var(--mute);
  font-family: var(--mono);
  font-size: 0.75rem;
}

.blob pre {
  margin: 0;
  padding: 0.85rem 0.9rem;
  overflow: auto;
  background: #fff;
  color: var(--code);
  font-size: 0.82rem;
  line-height: 1.55;
}

.rel-list {
  display: grid;
  gap: 0.75rem;
}

.rel {
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.rel-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}

.rel-top strong {
  font-family: var(--mono);
}

.rel ul {
  margin: 0.45rem 0 0;
  padding-left: 1.1rem;
  color: var(--mute);
  font-size: 0.9rem;
}

.os {
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--code-bg);
}

.os p + p {
  margin-top: 0.45rem;
}

.table-wrap {
  overflow: auto;
  margin: 0.8rem 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--code-bg);
  font-weight: 600;
}

tr:last-child td {
  border-bottom: 0;
}

.steps {
  margin: 0.7rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  margin: 0 0 0.7rem;
  padding: 0.75rem 0.85rem 0.75rem 3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--code-bg);
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0.7rem;
  top: 0.8rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--header);
  color: #fff;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.5rem;
  text-align: center;
}

.faq details {
  margin: 0.45rem 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.faq summary {
  cursor: pointer;
  padding: 0.7rem 0.9rem;
  font-weight: 600;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  float: right;
  color: var(--mute);
  font-family: var(--mono);
}

.faq details[open] summary::after {
  content: "−";
}

.faq details p {
  margin: 0;
  padding: 0 0.9rem 0.8rem;
  color: var(--mute);
}

.toc {
  position: sticky;
  top: 84px;
  padding: 0.85rem 0.9rem;
}

.toc h2 {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--mute);
}

.toc ol {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.86rem;
}

.toc a {
  color: var(--ink);
}

.toc a[aria-current="location"] {
  color: var(--link);
  font-weight: 600;
}

.crumbs {
  margin: 0 0 0.6rem;
  color: var(--mute);
  font-size: 0.86rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.7rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--mute);
  font-size: 0.78rem;
}

.chip.on {
  background: var(--good-soft);
  border-color: #aceebb;
  color: var(--good);
}

.page-hero {
  padding: 1.2rem 0 0;
}

.page-hero .readme {
  padding: 0;
}

.page-hero .md {
  padding: 1.15rem 1.3rem 1.35rem;
}

.section {
  padding: 0 0 1.15rem;
}

.section .md > h2:first-child {
  margin-top: 0;
}

.foot {
  border-top: 1px solid var(--line);
  background: var(--paper);
  padding: 1.6rem 0 1.2rem;
}

.foot-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
  gap: 1.2rem;
}

.foot .brand {
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.foot .brand small {
  color: var(--mute);
}

.foot h3 {
  margin: 0 0 0.45rem;
  font-size: 0.86rem;
}

.foot p,
.foot li {
  color: var(--mute);
  font-size: 0.88rem;
}

.foot ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot li {
  margin: 0.25rem 0;
}

.legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.4rem;
  margin-top: 1.1rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
  color: var(--mute);
  font-size: 0.8rem;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
  }

  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-split,
  .foot-grid,
  .stats {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .toggle {
    display: inline-flex;
    align-items: center;
  }

  .menu {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 64px;
    background: var(--header);
    border-bottom: 1px solid #3d444d;
    padding: 0.6rem 1rem 1rem;
  }

  .menu.is-open {
    display: block;
  }

  .menu ul {
    flex-direction: column;
    align-items: stretch;
  }

  .menu .cta {
    margin-left: 0;
    justify-content: center;
  }

  .hero-split,
  .grid-4,
  .grid-2,
  .foot-grid,
  .stats {
    grid-template-columns: 1fr;
  }

  .bar-row {
    position: relative;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
