:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #25342d;
  background: #fff;
  line-height: 1.7;
  --green: #176347;
  --line: #e1e7e2;
  --muted: #64716b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-size: 16px;
}

a {
  color: var(--green);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid #a8ca71;
  outline-offset: 4px;
}

.skip {
  position: fixed;
  top: -100px;
  left: 20px;
  background: white;
  padding: 10px;
  z-index: 3;
}

.skip:focus {
  top: 8px;
}

header {
  height: 70px;
  border-bottom: 1px solid var(--line);
  background: #fffffff9;
  position: sticky;
  top: 0;
  z-index: 2;
}

.header-inner {
  max-width: 1240px;
  height: 100%;
  margin: auto;
  padding: 0 36px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.5px;
  color: #25342d;
  text-decoration: none;
}

.version {
  font-size: 12px;
  padding: 2px 8px;
  background: #eff5ed;
  border: 1px solid #dfe8d8;
  border-radius: 4px;
  color: var(--green);
}

.github {
  margin-left: auto;
  font-size: 13px;
  text-decoration: none;
  color: var(--muted);
}

.layout {
  max-width: 1240px;
  margin: auto;
  padding: 0 36px;
  display: grid;
  grid-template-columns:230px minmax(0, 1fr);
  gap: 65px;
}

aside {
  position: sticky;
  top: 70px;
  height: calc(100dvh - 70px);
  overflow: auto;
  padding: 38px 0 24px;
}

.label {
  font-size: 10px;
  letter-spacing: 1.5px;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 12px 10px;
}

nav a {
  display: block;
  padding: 6px 10px;
  margin: 3px 0;
  border-left: 2px solid transparent;
  color: #526159;
  text-decoration: none;
  font-size: 13px;
}

nav a:hover {
  background: #f5f7f4;
}

nav a[aria-current] {
  background: #eff5ed;
  color: var(--green);
  border-left-color: var(--green);
  font-weight: 600;
}

.toc {
  border-top: 1px solid var(--line);
  padding-top: 22px;
  margin-top: 28px;
}

.toc a {
  font-size: 12px;
  padding: 4px 10px;
}

main {
  min-width: 0;
  max-width: 800px;
  padding-top: 38px;
}

.subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

h1, h2, h3 {
  color: #203128;
  line-height: 1.3;
  scroll-margin-top: 95px;
}

h1 {
  font-size: 38px;
  letter-spacing: -1.2px;
  margin: 0 0 28px;
  font-weight: 650;
}

h2 {
  font-size: 25px;
  letter-spacing: -.5px;
  margin: 40px 0 18px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

h3 {
  font-size: 19px;
  letter-spacing: -.2px;
  margin: 28px 0 12px;
}

p {
  margin: 0 0 18px;
}

code {
  font: .85em "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  background: #f0f3ef;
  padding: 2px 4px;
  border-radius: 3px;
  overflow-wrap: anywhere;
}

.code-block {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
  background: #f7f9f6;
  margin: 22px 0;
}

.code-label {
  font-size: 11px;
  color: var(--muted);
  background: #f0f4ef;
  padding: 8px 17px;
  border-bottom: 1px solid var(--line);
}

pre {
  margin: 0;
  padding: 18px;
  overflow: auto;
  line-height: 1.8;
}

pre code {
  background: none;
  padding: 0;
  font-size: 12px;
  color: #254b3b;
  overflow-wrap: normal;
}

.copy-button {
  position: absolute;
  right: 8px;
  top: 5px;
  font: inherit;
  font-size: 11px;
  color: var(--green);
  background: none;
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 2px 8px;
  cursor: pointer;
}

.copy-button:hover {
  background: white;
  border-color: var(--line);
}

.table-scroll {
  overflow: auto;
  margin: 24px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

th, td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-weight: 600;
  background: #f5f7f4;
}

td:first-child {
  min-width: 140px;
}

.pagination {
  margin-top: 45px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-size: 13px;
}

footer {
  padding: 15px 0 35px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 950px) {
  .layout {
    gap: 30px;
    grid-template-columns:195px minmax(0, 1fr);
    padding: 0 24px;
  }
}

@media (max-width: 720px) {
  header {
    height: 60px;
  }

  .header-inner {
    padding: 0 20px;
  }

  .layout {
    display: block;
    padding: 0 20px;
  }

  aside {
    position: static;
    height: auto;
    padding: 20px 0;
    border-bottom: 1px solid var(--line);
  }

  nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 6px;
  }

  .label {
    flex-basis: 100%;
    margin-left: 0;
  }

  nav a {
    padding: 3px 8px;
    font-size: 12px;
    margin: 0;
  }

  .toc {
    display: none;
  }

  main {
    padding-top: 28px;
  }

  h1 {
    font-size: 32px;
  }

  h2 {
    font-size: 23px;
    scroll-margin-top: 80px;
  }

  .pagination {
    font-size: 12px;
  }

  table {
    min-width: 520px;
  }
}

@media print {
  header, aside, .copy-button, .pagination {
    display: none;
  }

  .layout {
    display: block;
    padding: 0;
  }

  main {
    max-width: none;
    padding: 0;
  }

  pre {
    white-space: pre-wrap;
  }

  .code-block, tr {
    break-inside: avoid;
  }
}
