:root {
  color-scheme: light;
  /* --bg: #f7f7fb; */
  --surface: #ffffff;
  --surface-2: #f0f1f8;
  --ink: #171827;
  --muted: #606477;
  --line: #d9dbea;
  --accent: #76b900;
  --accent-2: #4f8f00;
  --accent-soft: #efffce;
  --accent-ink: #173300;
  --code-bg: #151626;
  --code-ink: #f4f5ff;
  --code-key: #8bd3ff;
  --code-string: #ffd38a;
  --code-value: #a7f3c6;
  --code-comment: #858ba8;
  --code-keyword: #c7a4ff;
  --code-type: #7dd3fc;
  --code-func: #f0abfc;
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-2);
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(247, 247, 251, 0.96);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 13px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 760;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 13px;
  letter-spacing: 0;
}

.top-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  font-size: 14px;
}

.top-links a {
  color: var(--muted);
  font-weight: 650;
  text-decoration: none;
}

.top-links a:hover {
  color: var(--accent);
}

.guide-layout {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 34px;
  padding: 30px 22px 68px;
}

.sidebar {
  position: sticky;
  top: 74px;
  align-self: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
}

.sidebar-title {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chapter-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 2px;
}

.chapter-list a {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: baseline;
  gap: 8px;
  padding: 8px;
  border-radius: 7px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

.chapter-list a:hover,
.chapter-list a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--ink);
}

.chapter-list .num {
  color: var(--accent);
  font-weight: 780;
  font-size: 12px;
}

.content {
  max-width: 880px;
}

.chapter-label {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 780;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.page-title {
  margin: 0 0 12px;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.08;
  letter-spacing: 0;
}

.intro {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 19px;
  max-width: 760px;
}

.section {
  margin: 34px 0;
}

.section h2 {
  margin: 0 0 12px;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: 0;
}

.section h3 {
  margin: 0 0 8px;
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: 0;
}

p {
  margin: 0 0 14px;
}

.short {
  color: var(--muted);
  max-width: 720px;
}

.example {
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.example-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 9px 13px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.example-title a {
  font-weight: 650;
}

pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  background: var(--code-bg);
  color: var(--code-ink);
  font-size: 13px;
  line-height: 1.45;
}

pre .tok-key,
pre .tok-func {
  color: var(--code-key);
}

pre .tok-string {
  color: var(--code-string);
}

pre .tok-value {
  color: var(--code-value);
}

pre .tok-comment {
  color: var(--code-comment);
  font-style: italic;
}

pre .tok-keyword {
  color: var(--code-keyword);
}

pre .tok-type {
  color: var(--code-type);
}

pre .tok-command {
  color: var(--code-func);
}

code {
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", Menlo, ui-monospace, monospace;
}

:not(pre) > code {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.92em;
}

.note {
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface);
  padding: 14px 16px;
}

.note p:last-child {
  margin-bottom: 0;
}

.step-list {
  list-style: none;
  margin: 16px 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.step-list li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 13px;
}

.step-list .step-num {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 780;
  font-size: 13px;
}

.step-list strong {
  display: block;
  margin-bottom: 3px;
}

.step-list span {
  color: var(--muted);
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.mini-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
}

.mini-card strong {
  display: block;
  margin-bottom: 6px;
}

.mini-card span {
  color: var(--muted);
}

.mini-card p:last-child {
  margin-bottom: 0;
}

.horizontal-list {
  list-style: none;
  margin: 16px 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

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

th {
  background: var(--surface-2);
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.link-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.link-list a {
  display: block;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  text-decoration: none;
  font-weight: 680;
}

.page-nav {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 42px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.page-nav a {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  padding: 9px 12px;
  text-decoration: none;
  font-weight: 730;
}

.footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 22px;
}

.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

@media (max-width: 920px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-links {
    justify-content: flex-start;
  }

  .guide-layout {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .sidebar {
    position: static;
  }

  .chapter-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .horizontal-list {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 560px) {
  .header-inner,
  .guide-layout,
  .footer {
    padding-left: 14px;
    padding-right: 14px;
  }

  .chapter-list {
    grid-template-columns: 1fr;
  }

  .page-title {
    font-size: 34px;
  }

  .intro {
    font-size: 17px;
  }

  .page-nav {
    flex-direction: column;
  }
}
