:root {
  color-scheme: light;
  --ink: #16201f;
  --muted: #66726f;
  --line: #dbe3e0;
  --surface: #ffffff;
  --surface-soft: #f5f8f7;
  --accent: #087f72;
  --accent-soft: #e2f4ef;
  --coral: #c9523f;
  --coral-soft: #fff0ec;
  --code: #171c1b;
  --code-ink: #dce7e3;
  --shadow: 0 10px 28px rgba(27, 45, 41, 0.08);
  --topbar-height: 64px;
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-height) + 24px);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-size: 15px;
  line-height: 1.7;
  letter-spacing: 0;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(8, 127, 114, 0.3);
  outline-offset: 3px;
}

code,
pre {
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0;
}

code {
  font-size: 0.9em;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 8px 12px;
  border-radius: 4px;
  color: #fff;
  background: var(--accent);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--topbar-height);
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand img {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.brand span {
  display: grid;
  line-height: 1.15;
}

.brand strong {
  font-size: 15px;
  font-weight: 750;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.service-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.service-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2ca36f;
  box-shadow: 0 0 0 4px rgba(44, 163, 111, 0.12);
}

.console-link {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.console-link:hover {
  text-decoration: underline;
}

.menu-button {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
  font-size: 21px;
  line-height: 1;
}

.docs-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: calc(100vh - var(--topbar-height));
}

.sidebar {
  position: sticky;
  top: var(--topbar-height);
  align-self: start;
  height: calc(100vh - var(--topbar-height));
  padding: 28px 20px 48px 28px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--surface-soft);
}

.sidebar nav {
  display: grid;
  gap: 2px;
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 5px 10px;
  border-left: 2px solid transparent;
  color: #50605c;
  font-size: 13px;
  text-decoration: none;
}

.sidebar a:hover,
.sidebar a.active {
  border-left-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.sidebar a code {
  min-width: 30px;
  color: inherit;
  font-size: 9px;
  font-weight: 800;
}

.nav-label {
  margin: 22px 10px 6px;
  color: #8a9592;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.nav-label:first-child {
  margin-top: 0;
}

main {
  width: min(100%, 1120px);
  min-width: 0;
  padding: 0 56px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.68fr);
  gap: 64px;
  align-items: end;
  min-height: 490px;
  padding: 88px 0 64px;
  border-bottom: 1px solid var(--line);
}

.eyebrow,
.section-heading p {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.08;
  letter-spacing: 0;
}

.lead {
  max-width: 690px;
  margin: 22px 0 30px;
  color: #56645f;
  font-size: 18px;
  line-height: 1.8;
}

.base-url {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  max-width: 650px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.base-url span {
  padding: 11px 13px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.base-url code {
  min-width: 0;
  padding: 11px 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.base-url button,
.code-header button,
.tab-copy {
  min-height: 34px;
  padding: 6px 10px;
  border: 0;
  border-left: 1px solid var(--line);
  color: var(--accent);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.base-url button:hover,
.code-header button:hover,
.tab-copy:hover {
  background: var(--accent-soft);
}

.flow-panel {
  display: grid;
  border-top: 1px solid var(--line);
}

.flow-panel div {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  grid-template-areas:
    "number title"
    "number meta";
  gap: 0 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.flow-panel span {
  grid-area: number;
  color: var(--coral);
  font-family: "Cascadia Code", monospace;
  font-size: 12px;
}

.flow-panel strong {
  grid-area: title;
  font-size: 14px;
}

.flow-panel small {
  grid-area: meta;
  color: var(--muted);
  font-size: 12px;
}

.content-section,
.endpoint {
  padding: 68px 0;
  border-bottom: 1px solid var(--line);
}

.section-heading {
  margin-bottom: 24px;
}

h2 {
  margin: 0;
  font-size: 29px;
  line-height: 1.25;
}

h3 {
  margin: 34px 0 12px;
  font-size: 18px;
}

.content-section > p,
.endpoint > p {
  max-width: 840px;
  color: #52605c;
}

.endpoint-heading {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 20px;
}

.endpoint-heading h2 {
  min-width: 0;
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 25px;
  overflow-wrap: anywhere;
}

.method {
  flex: 0 0 auto;
  min-width: 50px;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: "Cascadia Code", monospace;
  font-size: 11px;
  font-weight: 850;
  text-align: center;
}

.method.get {
  color: #086b60;
  background: var(--accent-soft);
}

.method.post {
  color: #a33c2d;
  background: var(--coral-soft);
}

.code-block,
.language-example {
  margin: 24px 0;
  overflow: hidden;
  border-radius: 6px;
  background: var(--code);
  box-shadow: var(--shadow);
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding-left: 15px;
  border-bottom: 1px solid #313b39;
  color: #9fb0aa;
  font-size: 11px;
  text-transform: uppercase;
}

.code-header button,
.tab-copy {
  border-left-color: #313b39;
  color: #a8e4d8;
}

pre {
  margin: 0;
  padding: 22px;
  overflow-x: auto;
  color: var(--code-ink);
  font-size: 13px;
  line-height: 1.75;
  tab-size: 2;
}

pre code {
  font-size: inherit;
  white-space: pre;
}

.compact pre {
  max-height: 420px;
}

.notice {
  margin: 26px 0;
  padding: 18px 20px;
  border-left: 3px solid;
  border-radius: 0 6px 6px 0;
}

.notice strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.notice p {
  margin: 0;
  color: #596660;
}

.notice.warning {
  border-color: var(--coral);
  background: var(--coral-soft);
}

.notice.info {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.steps {
  display: grid;
  gap: 0;
  max-width: 800px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.steps li {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.steps li > span {
  color: var(--coral);
  font-family: "Cascadia Code", monospace;
  font-size: 12px;
}

.steps strong {
  font-size: 14px;
}

.steps li > div,
.error-layout > div {
  min-width: 0;
}

.steps code {
  white-space: normal;
  overflow-wrap: anywhere;
}

.steps p {
  margin: 2px 0 0;
  color: var(--muted);
}

.table-wrap {
  margin: 24px 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
  text-align: left;
}

th,
td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

td {
  font-size: 13px;
}

tr:last-child td {
  border-bottom: 0;
}

td code,
p code,
li code,
.index-example code {
  color: #086b60;
  background: #edf6f3;
}

.response-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  padding: 12px 14px;
  border-left: 3px solid #2ca36f;
  background: #eff9f4;
}

.response-line span {
  color: #18714f;
  font-size: 11px;
  font-weight: 850;
}

details {
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 6px;
}

summary {
  padding: 13px 15px;
  cursor: pointer;
  font-weight: 700;
}

details .code-block {
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

.language-tabs {
  display: flex;
  align-items: stretch;
  min-height: 46px;
  overflow-x: auto;
  border-bottom: 1px solid #313b39;
}

.language-tabs [role="tab"] {
  flex: 0 0 auto;
  padding: 0 16px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: #96a59f;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}

.language-tabs [role="tab"][aria-selected="true"] {
  border-bottom-color: #58c5b1;
  color: #d8f5ef;
}

.tab-copy {
  margin-left: auto;
}

.code-panels pre {
  min-height: 330px;
  max-height: 560px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0;
}

.pricing-grid article {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.pricing-grid article:first-child {
  border-top-color: var(--coral);
}

.pricing-grid span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.pricing-grid strong {
  color: var(--ink);
  font-size: 22px;
}

.pricing-grid code {
  min-width: 0;
  color: var(--accent);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.formula {
  display: grid;
  gap: 6px;
  padding: 20px;
  border-left: 3px solid var(--accent);
  background: var(--surface-soft);
}

.formula span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.formula code {
  font-size: 14px;
}

.formula small {
  color: var(--muted);
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 28px 0 36px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.rules-grid > div {
  min-width: 0;
  padding: 20px 18px;
  border-right: 1px solid var(--line);
}

.rules-grid > div:last-child {
  border-right: 0;
}

.rules-grid strong,
.rules-grid span {
  display: block;
}

.rules-grid span {
  margin: 5px 0 9px;
  color: var(--coral);
  font-weight: 800;
}

.rules-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.index-example {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.index-example div {
  display: grid;
  gap: 2px;
  padding: 12px;
  border-left: 3px solid #a9b6b2;
  background: var(--surface);
}

.index-example div.marked {
  border-left-color: var(--coral);
}

.index-example span {
  font-weight: 700;
}

.index-example small {
  color: var(--muted);
}

.index-example > code {
  grid-column: 1 / -1;
  justify-self: start;
}

.error-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.error-layout h3 {
  margin-top: 24px;
}

.reliability-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.reliability-list div {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.reliability-list span {
  color: var(--coral);
  font-family: "Cascadia Code", monospace;
  font-size: 12px;
}

.reliability-list p {
  margin: 0;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 120px;
  padding: 30px 0;
}

footer div {
  display: grid;
}

footer span {
  color: var(--muted);
  font-size: 11px;
}

footer a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 980px) {
  .docs-shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .sidebar {
    padding-left: 18px;
  }

  main {
    padding: 0 32px;
  }

  .intro {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .flow-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow-panel div:nth-child(odd) {
    padding-right: 18px;
  }

  .flow-panel div:nth-child(even) {
    padding-left: 18px;
  }
}

@media (max-width: 760px) {
  :root {
    --topbar-height: 58px;
  }

  .topbar {
    height: var(--topbar-height);
    padding: 0 16px;
  }

  .service-status,
  .console-link {
    display: none;
  }

  .menu-button {
    display: inline-grid;
    place-items: center;
  }

  .docs-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 40;
    top: var(--topbar-height);
    right: 0;
    bottom: 0;
    left: 0;
    display: none;
    width: auto;
    height: auto;
    padding: 22px 18px 40px;
    border-right: 0;
    background: rgba(245, 248, 247, 0.98);
  }

  .sidebar.open {
    display: block;
  }

  main {
    width: 100%;
    padding: 0 18px;
  }

  .intro {
    min-height: calc(100vh - var(--topbar-height));
    padding: 54px 0 40px;
  }

  h1 {
    font-size: 41px;
  }

  .lead {
    font-size: 16px;
  }

  .base-url {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .base-url button {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .flow-panel {
    grid-template-columns: 1fr;
  }

  .flow-panel div:nth-child(odd),
  .flow-panel div:nth-child(even) {
    padding-right: 0;
    padding-left: 0;
  }

  .content-section,
  .endpoint {
    padding: 50px 0;
  }

  .endpoint-heading {
    align-items: flex-start;
  }

  .endpoint-heading h2 {
    font-size: 20px;
  }

  pre {
    padding: 18px;
    font-size: 12px;
  }

  .language-tabs {
    position: relative;
    padding-right: 0;
  }

  .tab-copy {
    position: sticky;
    right: 0;
    background: var(--code);
  }

  .code-panels pre {
    min-height: 360px;
  }

  .pricing-grid,
  .rules-grid,
  .error-layout {
    grid-template-columns: 1fr;
  }

  .rules-grid > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .rules-grid > div:last-child {
    border-bottom: 0;
  }

  .index-example {
    grid-template-columns: 1fr;
  }

  .index-example > code {
    grid-column: auto;
  }

  footer {
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
