:root {
  color-scheme: light;
  --page: #ffffff;
  --surface: #f7f8fa;
  --surface-strong: #eef1f4;
  --line: #dfe3e8;
  --line-strong: #c7cdd4;
  --text: #16191d;
  --muted: #5e6875;
  --green: #16865a;
  --green-soft: #eaf7f1;
  --blue: #1769aa;
  --blue-soft: #eaf3fa;
  --amber: #9a5b00;
  --amber-soft: #fff6dd;
  --code: #11161c;
  --header-height: 68px;
  --sidebar-width: 248px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--page);
  font-family:
    Inter,
    "Noto Sans SC",
    "Microsoft YaHei",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 15px;
  line-height: 1.72;
  letter-spacing: 0;
}

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

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

code,
pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  letter-spacing: 0;
}

code {
  overflow-wrap: anywhere;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 1000;
  padding: 10px 14px;
  color: #fff;
  background: var(--code);
  border-radius: 4px;
}

.skip-link:focus {
  top: 10px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.docs-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--header-height);
  display: grid;
  grid-template-columns: minmax(218px, 248px) minmax(260px, 560px) 1fr;
  align-items: center;
  gap: 24px;
  padding: 10px 28px;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
  min-width: 0;
}

.brand img {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
}

.brand-copy {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.brand-copy strong {
  font-size: 16px;
  line-height: 1.2;
  white-space: nowrap;
}

.brand-copy span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.docs-search input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
}

.docs-search input:focus {
  background: #fff;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(22, 134, 90, 0.12);
}

.header-links {
  display: flex;
  justify-content: flex-end;
  gap: 22px;
  min-width: 0;
}

.header-links a {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.header-links a:hover {
  color: var(--green);
}

.mobile-section-picker {
  display: none;
}

.search-results {
  position: fixed;
  top: 60px;
  left: max(276px, calc((100vw - 1080px) / 2 + 248px));
  z-index: 60;
  width: min(560px, calc(100vw - 320px));
  max-height: min(520px, calc(100vh - 90px));
  overflow-y: auto;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  box-shadow: 0 18px 50px rgba(18, 26, 33, 0.16);
}

.search-results a,
.search-empty {
  display: block;
  padding: 11px 12px;
  border-radius: 4px;
  color: var(--text);
  text-decoration: none;
}

.search-results a:hover,
.search-results a:focus {
  background: var(--surface);
}

.search-results strong {
  display: block;
  font-size: 14px;
}

.search-results span,
.search-empty {
  color: var(--muted);
  font-size: 12px;
}

.docs-shell {
  width: min(1480px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 900px) 180px;
  justify-content: center;
  gap: 48px;
  padding: 0 28px;
}

.docs-sidebar,
.page-toc {
  position: sticky;
  top: calc(var(--header-height) + 24px);
  align-self: start;
  max-height: calc(100vh - var(--header-height) - 48px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.docs-sidebar {
  padding: 26px 20px 34px 0;
  border-right: 1px solid var(--line);
}

.section-nav section + section {
  margin-top: 26px;
}

.section-nav h2 {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.section-nav a {
  display: block;
  margin: 2px 0;
  padding: 7px 10px;
  color: #303741;
  border-left: 2px solid transparent;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.45;
}

.section-nav a:hover {
  color: var(--green);
  background: var(--surface);
}

.section-nav a[aria-current="location"] {
  color: var(--green);
  background: var(--green-soft);
  border-left-color: var(--green);
  font-weight: 700;
}

.docs-main {
  min-width: 0;
  padding: 26px 0 80px;
}

.doc-article {
  padding: 28px 0 64px;
  border-bottom: 1px solid var(--line);
}

.doc-article:first-child {
  padding-top: 18px;
}

.doc-article:last-child {
  border-bottom: 0;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
h3 {
  margin-top: 0;
  color: var(--text);
  line-height: 1.28;
  letter-spacing: 0;
}

h1 {
  margin-bottom: 16px;
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 760;
}

h2 {
  margin: 38px 0 14px;
  font-size: 22px;
}

h3 {
  margin: 28px 0 12px;
  font-size: 18px;
}

.lead {
  max-width: 780px;
  margin: 0 0 28px;
  color: #3f4853;
  font-size: 17px;
  line-height: 1.78;
}

.key-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 28px 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.key-facts div {
  min-width: 0;
  padding: 15px 16px;
  background: var(--surface);
}

.key-facts div + div {
  border-left: 1px solid var(--line);
}

.key-facts span,
.key-facts code {
  display: block;
}

.key-facts span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.key-facts code {
  color: var(--text);
  font-size: 13px;
}

.notice {
  margin: 28px 0;
  padding: 16px 18px;
  border-left: 4px solid;
  border-radius: 4px;
}

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

.notice p {
  margin: 0;
  color: #3e4852;
}

.notice-info {
  background: var(--blue-soft);
  border-color: var(--blue);
}

.notice-warning {
  background: var(--amber-soft);
  border-color: var(--amber);
}

.action-list {
  list-style: none;
  padding: 0;
  margin: 20px 0;
  counter-reset: actions;
}

.action-list li {
  position: relative;
  min-height: 54px;
  padding: 4px 0 20px 52px;
  counter-increment: actions;
}

.action-list li::before {
  content: counter(actions);
  position: absolute;
  left: 0;
  top: 0;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--green);
  border-radius: 50%;
  font-weight: 700;
}

.action-list li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 16px;
  top: 38px;
  bottom: 2px;
  width: 1px;
  background: var(--line);
}

.action-list strong,
.action-list span {
  display: block;
}

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

.action-list.compact li {
  padding-bottom: 15px;
}

.code-block {
  margin: 18px 0 28px;
  overflow: hidden;
  background: var(--code);
  border: 1px solid #27303a;
  border-radius: 6px;
}

.code-toolbar {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 16px;
  color: #abb6c1;
  background: #1a2129;
  border-bottom: 1px solid #2a333d;
  font-size: 12px;
}

.copy-button {
  min-width: 68px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 9px;
  color: #dce5ed;
  background: transparent;
  border: 1px solid #48535f;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.copy-button:hover {
  background: #27313b;
}

.copy-button svg {
  width: 14px;
  height: 14px;
}

pre {
  margin: 0;
  padding: 20px;
  overflow-x: auto;
  color: #e9f0f5;
  font-size: 13px;
  line-height: 1.65;
  tab-size: 2;
}

.definition-list {
  margin: 18px 0;
  border-top: 1px solid var(--line);
}

.definition-list > div {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 20px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.definition-list dt {
  font-weight: 700;
}

.definition-list dd {
  margin: 0;
  color: var(--muted);
}

.responsive-table {
  max-width: 100%;
  margin: 18px 0 28px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  text-align: left;
}

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

th {
  color: #39434d;
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
}

td {
  color: #48525d;
  font-size: 14px;
}

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

.check-list,
.plain-list {
  margin: 16px 0;
  padding-left: 22px;
}

.check-list li,
.plain-list li {
  margin: 8px 0;
  padding-left: 4px;
  color: #3f4853;
}

.guide-figure {
  margin: 22px 0 32px;
}

.guide-figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.guide-figure figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.tutorial-step {
  padding: 28px 0 4px;
  border-top: 1px solid var(--line);
}

.tutorial-step:first-of-type {
  margin-top: 32px;
}

.step-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.step-heading > span {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--green);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
}

.step-heading h2 {
  margin: 0;
}

.tutorial-step > p {
  margin: 9px 0 0 42px;
  color: var(--muted);
}

.article-note {
  margin: 24px 0;
  color: var(--muted);
  font-size: 14px;
}

.endpoint {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.endpoint > span,
.endpoint-row > span {
  flex: 0 0 auto;
  min-width: 46px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.endpoint-list {
  margin: 20px 0;
  border-top: 1px solid var(--line);
}

.endpoint-row {
  display: grid;
  grid-template-columns: 52px minmax(220px, 0.9fr) minmax(0, 1.2fr);
  align-items: start;
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.endpoint-row p {
  margin: 0;
  color: var(--muted);
}

.faq-list {
  margin: 20px 0;
  border-top: 1px solid var(--line);
}

.faq-list details {
  border-bottom: 1px solid var(--line);
}

.faq-list summary {
  padding: 17px 4px;
  cursor: pointer;
  font-weight: 700;
}

.faq-list p {
  margin: -2px 0 18px;
  padding-right: 20px;
  color: var(--muted);
}

.page-toc {
  padding-top: 32px;
}

.page-toc > p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.page-toc a {
  display: block;
  padding: 5px 0 5px 10px;
  color: var(--muted);
  border-left: 1px solid var(--line);
  text-decoration: none;
  font-size: 12px;
  line-height: 1.45;
}

.page-toc a:hover,
.page-toc a.active {
  color: var(--green);
  border-left-color: var(--green);
}

.docs-footer {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 18px 24px;
  color: var(--muted);
  background: var(--surface);
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.docs-footer a {
  color: var(--text);
  text-decoration: none;
}

@media (max-width: 1180px) {
  .docs-shell {
    grid-template-columns: var(--sidebar-width) minmax(0, 860px);
    gap: 38px;
  }

  .page-toc {
    display: none;
  }
}

@media (max-width: 860px) {
  :root {
    --header-height: auto;
  }

  html {
    scroll-padding-top: 168px;
  }

  .docs-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 14px;
    padding: 10px 16px 12px;
  }

  .brand-copy {
    flex-wrap: wrap;
    gap: 1px 7px;
  }

  .header-links {
    gap: 14px;
  }

  .docs-search {
    grid-column: 1 / -1;
  }

  .mobile-section-picker {
    display: block;
    grid-column: 1 / -1;
  }

  .mobile-section-picker select {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
  }

  .search-results {
    top: 103px;
    left: 16px;
    width: calc(100vw - 32px);
  }

  .docs-shell {
    display: block;
    padding: 0 18px;
  }

  .docs-sidebar {
    display: none;
  }

  .docs-main {
    padding-top: 8px;
  }

  .doc-article {
    padding: 32px 0 52px;
  }

  .key-facts {
    grid-template-columns: 1fr;
  }

  .key-facts div + div {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .definition-list > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .endpoint-row {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .endpoint-row p {
    grid-column: 2;
  }

  .tutorial-step > p {
    margin-left: 0;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 14px;
  }

  .docs-header {
    grid-template-columns: minmax(0, 1fr);
  }

  .header-links {
    display: none;
  }

  .brand img {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  h1 {
    font-size: 30px;
  }

  h2 {
    font-size: 20px;
  }

  .lead {
    font-size: 16px;
  }

  .docs-shell {
    padding: 0 14px;
  }

  .action-list li {
    padding-left: 46px;
  }

  pre {
    padding: 16px;
    font-size: 12px;
  }

  .docs-footer {
    flex-wrap: wrap;
    gap: 8px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
