:root {
  --anchor-scroll-offset: 84px;
  color-scheme: light;
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f7fb;
  color: #1f2937;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
}

code,
td,
pre,
.path {
  font-family: Consolas, Monaco, monospace;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 21px;
}

h2 {
  font-size: 18px;
  margin-bottom: 12px;
}

.topbar {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid #e4e7ec;
  display: flex;
  height: 64px;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar p {
  color: #667085;
  font-size: 13px;
  margin-top: 3px;
}

.topbar-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.topbar-actions a {
  color: #2563eb;
  font-size: 13px;
  text-decoration: none;
}

.badge {
  background: #16a34a;
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
  padding: 5px 9px;
}

.language-toggle {
  background: #eef4ff;
  border: 1px solid #b2ccff;
  color: #155eef;
  min-width: 54px;
  padding: 5px 9px;
}

.doc-shell {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  min-height: calc(100vh - 64px);
}

.side-nav {
  align-self: start;
  background: #ffffff;
  border-right: 1px solid #e4e7ec;
  height: calc(100vh - 64px);
  overflow: auto;
  padding: 18px 16px;
  position: sticky;
  top: 64px;
}

.side-title {
  color: #101828;
  font-size: 13px;
  font-weight: 700;
  margin: 6px 0 8px;
}

.side-title.muted {
  color: #667085;
  margin-top: 18px;
}

.side-nav a {
  border-radius: 5px;
  color: #344054;
  display: block;
  font-size: 14px;
  padding: 8px 10px;
  text-decoration: none;
}

.side-nav a:hover {
  background: #eef4ff;
  color: #155eef;
}

.side-nav a.active {
  background: #dbeafe;
  color: #0f3d99;
  font-weight: 700;
}

.doc-main {
  display: grid;
  gap: 16px;
  max-width: 1280px;
  padding: 20px;
  width: 100%;
}

.doc-main section[id],
.doc-main #testEnv,
.doc-main .selected-doc[id] {
  scroll-margin-top: var(--anchor-scroll-offset);
}

.environment-status {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 6px;
  display: grid;
  gap: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
}

.environment-status > div {
  border-bottom: 1px solid #bbf7d0;
  border-right: 1px solid #bbf7d0;
  min-width: 0;
  padding: 10px 12px;
}

.environment-status > div:nth-child(4n) {
  border-right: 0;
}

.environment-status > div:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.environment-status-title {
  background: #166534;
  color: #fff;
}

.environment-status span,
.environment-status strong {
  display: block;
  overflow-wrap: anywhere;
}

.environment-status span {
  font-size: 12px;
  margin-bottom: 5px;
}

.environment-status strong {
  font-size: 13px;
  line-height: 1.45;
}

.panel,
.intro {
  background: #ffffff;
  border: 1px solid #e4e7ec;
  border-radius: 6px;
  padding: 18px;
}

.compact-intro {
  align-items: center;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
}

.intro-copy {
  max-width: 760px;
}

.intro-copy h2 {
  font-size: 26px;
  margin-bottom: 10px;
}

.intro-copy p:last-child,
.doc-section p {
  color: #475467;
  font-size: 14px;
  line-height: 1.7;
}

.eyebrow {
  color: #155eef;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 8px;
}

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

.quick-steps li {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e4e7ec;
  border-radius: 6px;
  display: grid;
  gap: 10px;
  grid-template-columns: 28px minmax(0, 1fr);
  padding: 10px;
}

.quick-steps strong {
  align-items: center;
  background: #155eef;
  border-radius: 50%;
  color: #fff;
  display: flex;
  height: 26px;
  justify-content: center;
  width: 26px;
}

.quick-steps span {
  color: #344054;
  font-size: 13px;
  line-height: 1.5;
}

.interface-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
}

.interface-list-panel,
.docs-panel {
  min-width: 0;
}

.section-head,
.doc-header {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.status {
  color: #667085;
  font-size: 13px;
  margin-bottom: 10px;
}

.spec-summary {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 10px;
}

.metric {
  background: #f8fafc;
  border: 1px solid #e4e7ec;
  border-radius: 6px;
  padding: 9px;
}

.metric strong {
  display: block;
  font-size: 19px;
  line-height: 1;
}

.metric span {
  color: #667085;
  display: block;
  font-size: 11px;
  margin-top: 5px;
}

.endpoint-group {
  border-top: 1px solid #e4e7ec;
  color: #155eef;
  font-size: 13px;
  margin: 14px 0 0;
  padding: 12px 0 6px;
}

.endpoint-group:first-child {
  border-top: 0;
  margin-top: 0;
}

.endpoint {
  border-radius: 6px;
  padding: 10px;
}

.endpoint + .endpoint {
  margin-top: 6px;
}

.endpoint.active {
  background: #eef4ff;
  box-shadow: inset 3px 0 0 #155eef;
}

.method {
  border-radius: 4px;
  color: #fff;
  display: inline-block;
  font-size: 12px;
  margin-right: 8px;
  min-width: 48px;
  padding: 3px 7px;
  text-align: center;
}

.get {
  background: #079455;
}

.post {
  background: #7f56d9;
}

.path {
  color: #111827;
  font-size: 14px;
}

.desc {
  color: #475467;
  font-size: 13px;
  line-height: 1.55;
  margin: 7px 0;
}

.hint {
  color: #667085;
  font-size: 12px;
  margin: 0 0 9px;
}

.actions,
.endpoint-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

button {
  background: #155eef;
  border: 0;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  padding: 7px 11px;
}

button.secondary {
  background: #475467;
}

button:disabled {
  background: #98a2b3;
  cursor: not-allowed;
}

.doc-header p {
  margin-top: 8px;
}

.doc-tag {
  background: #eef4ff;
  border-radius: 4px;
  color: #155eef;
  font-size: 12px;
  padding: 5px 8px;
  white-space: nowrap;
}

.endpoint-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 6px;
}

.endpoint-tag {
  border-radius: 4px;
  font-size: 12px;
  padding: 4px 8px;
}

.endpoint-tag.sandbox {
  background: #e8f5e9;
  color: #1b5e20;
}

.endpoint-tag.dryrun {
  background: #fff4e5;
  color: #8a4b00;
}

.endpoint-tag.money {
  background: #fee4e2;
  color: #b42318;
}

.endpoint-tag.vendor,
.endpoint-tag.stub {
  background: #eef4ff;
  color: #1d4ed8;
}

.endpoint-tag.sign,
.endpoint-tag.readonly {
  background: #f2f4f7;
  color: #344054;
}

.detail-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.detail-block {
  border: 1px solid #e4e7ec;
  border-radius: 6px;
  min-width: 0;
  overflow-x: auto;
  padding: 12px;
}

.detail-block h4 {
  font-size: 13px;
  margin: 0 0 8px;
}

.detail-list {
  color: #475467;
  font-size: 13px;
  line-height: 1.7;
  margin: 0;
  padding-left: 18px;
}

.detail-link {
  font-size: 13px;
  margin-top: 10px;
}

.detail-link a {
  color: #155eef;
  text-decoration: none;
}

.field-table,
table {
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 12px;
  width: 100%;
}

.field-table {
  font-size: 12px;
  margin: 0;
}

th,
td {
  border: 1px solid #e4e7ec;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f8fafc;
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.field-table td:first-child {
  white-space: nowrap;
}

.mini-pre,
pre {
  background: #101828;
  border-radius: 6px;
  color: #d0d5dd;
  margin: 0;
  min-height: 120px;
  overflow: auto;
  padding: 12px;
}

.mini-pre {
  font-size: 12px;
  min-height: 96px;
  white-space: pre-wrap;
}

.tryout-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
}

label {
  display: block;
  font-size: 13px;
  margin-bottom: 12px;
}

input,
textarea {
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  display: block;
  font: inherit;
  margin-top: 6px;
  padding: 8px 10px;
  width: 100%;
}

.doc-section {
  overflow-x: auto;
}

.compact-list,
.flow-list {
  color: #475467;
  line-height: 1.8;
  margin: 12px 0 0;
  padding-left: 20px;
}

.doc-columns {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1fr);
}

.code-block {
  min-height: 0;
  white-space: pre-wrap;
}

.check-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.check-grid div {
  border: 1px solid #e4e7ec;
  border-radius: 6px;
  padding: 12px;
}

.check-grid strong {
  display: block;
  margin-bottom: 6px;
}

.check-grid span {
  color: #667085;
  display: block;
  font-size: 13px;
  line-height: 1.6;
}

.empty-text {
  color: #667085;
  font-size: 13px;
  margin: 0;
}

.site-footer {
  background: #fff;
  border-top: 1px solid #e4e7ec;
  color: #667085;
  font-weight: 600;
  margin-top: 32px;
  padding: 22px;
  text-align: center;
}

@media (max-width: 980px) {
  .environment-status {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .environment-status > div,
  .environment-status > div:nth-child(4n) {
    border-bottom: 1px solid #bbf7d0;
    border-right: 1px solid #bbf7d0;
  }

  .environment-status > div:nth-child(2n) {
    border-right: 0;
  }

  .environment-status > div:last-child {
    border-bottom: 0;
  }

  .doc-shell {
    grid-template-columns: 1fr;
  }

  .side-nav {
    border-bottom: 1px solid #e4e7ec;
    border-right: 0;
    display: flex;
    gap: 8px;
    height: auto;
    overflow-x: auto;
    position: static;
    white-space: nowrap;
  }

  .side-title {
    flex: 0 0 auto;
    margin: 8px 4px;
  }

  .side-nav a {
    flex: 0 0 auto;
  }

  .interface-layout,
  .tryout-layout,
  .compact-intro,
  .doc-columns,
  .check-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  :root {
    --anchor-scroll-offset: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    height: auto;
    padding: 14px 18px;
    position: static;
  }

  .doc-main {
    padding: 12px;
  }

  .environment-status {
    grid-template-columns: 1fr;
  }

  .environment-status > div,
  .environment-status > div:nth-child(2n),
  .environment-status > div:nth-child(4n) {
    border-bottom: 1px solid #bbf7d0;
    border-right: 0;
  }

  .environment-status > div:last-child {
    border-bottom: 0;
  }

  .panel,
  .intro {
    padding: 14px;
  }

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

  .intro-copy h2 {
    font-size: 23px;
  }

  .endpoint-actions,
  .actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  button {
    min-height: 38px;
    width: 100%;
  }

  .section-head,
  .doc-header {
    display: grid;
  }

  table,
  .field-table {
    min-width: 680px;
  }

  pre,
  .mini-pre {
    max-width: calc(100vw - 56px);
  }
}

.brand {
  min-width: 0;
}

.menu-toggle {
  display: none;
}

.nav-search {
  margin-bottom: 12px;
}

.nav-search input {
  margin-top: 0;
}

.hero {
  background: #ffffff;
  border: 1px solid #e4e7ec;
  border-radius: 6px;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  padding: 20px;
}

.hero-copy h2 {
  font-size: 28px;
  line-height: 1.28;
  margin-bottom: 12px;
}

.hero-copy p:last-child {
  color: #475467;
  font-size: 15px;
  line-height: 1.8;
}

.facts {
  border: 1px solid #e4e7ec;
  border-radius: 6px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
}

.facts div {
  border-bottom: 1px solid #e4e7ec;
  padding: 10px 12px;
}

.facts div:nth-child(odd) {
  border-right: 1px solid #e4e7ec;
}

.facts div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.facts span {
  color: #667085;
  display: block;
  font-size: 12px;
  margin-bottom: 5px;
}

.facts strong {
  color: #101828;
  display: block;
  font-size: 13px;
  line-height: 1.45;
}

.section-tag {
  background: #eef4ff;
  border: 1px solid #b2ccff;
  border-radius: 4px;
  color: #155eef;
  font-size: 12px;
  padding: 5px 8px;
  white-space: nowrap;
}

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

.linked-steps li {
  align-items: center;
  border: 1px solid #e4e7ec;
  border-radius: 6px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  padding: 10px 12px;
}

.linked-steps a,
.flow-row a {
  color: #155eef;
  font-weight: 700;
  text-decoration: none;
}

.linked-steps span {
  color: #475467;
  font-size: 13px;
  line-height: 1.6;
}

.flow-row {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.flow-row a {
  border: 1px solid #e4e7ec;
  border-radius: 6px;
  min-height: 58px;
  padding: 11px;
}

.definition-grid,
.quick-facts dl {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.definition-grid div,
.quick-facts dl div {
  background: #f8fafc;
  border: 1px solid #e4e7ec;
  border-radius: 6px;
  padding: 11px;
}

.definition-grid strong,
.quick-facts dt {
  color: #101828;
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 5px;
}

.definition-grid span,
.quick-facts dd {
  color: #475467;
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
}

.quick-facts {
  margin-top: 14px;
}

.quick-facts h3 {
  font-size: 15px;
  margin: 0 0 10px;
}

.with-copy {
  position: relative;
}

.copy-button {
  background: #344054;
  min-height: auto;
  padding: 4px 8px;
  position: absolute;
  right: 8px;
  top: 8px;
  width: auto;
}

.with-copy code {
  display: block;
  padding-top: 24px;
}

.filter-tools {
  display: flex;
  gap: 8px;
}

.filter-tools input,
.filter-tools select {
  margin: 0;
  min-width: 180px;
}

select {
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  font: inherit;
  padding: 8px 10px;
}

.table-scroll {
  overflow-x: auto;
}

.notice-box {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  color: #9a3412;
  font-size: 13px;
  line-height: 1.7;
  margin-top: 14px;
  padding: 12px;
}

.compact-desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

@media (max-width: 1180px) {
  .flow-row,
  .definition-grid,
  .quick-facts dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .menu-toggle {
    display: inline-flex;
    flex: 0 0 auto;
    justify-content: center;
    min-height: 36px;
    padding: 6px 10px;
    width: 42px;
  }

  .topbar {
    align-items: center;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .topbar-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .topbar-actions .language-toggle,
  .topbar-actions a {
    width: auto;
  }

  .side-nav {
    display: none;
  }

  .nav-open .side-nav {
    display: block;
    padding: 12px;
  }

  .side-nav a {
    white-space: normal;
  }

  .hero {
    padding: 14px;
  }

  .hero-copy h2 {
    font-size: 23px;
  }

  .facts,
  .linked-steps li,
  .flow-row,
  .definition-grid,
  .quick-facts dl {
    grid-template-columns: 1fr;
  }

  .facts div,
  .facts div:nth-child(odd) {
    border-bottom: 1px solid #e4e7ec;
    border-right: 0;
  }

  .facts div:last-child {
    border-bottom: 0;
  }

  .filter-tools {
    display: grid;
  }

  .filter-tools input,
  .filter-tools select {
    min-width: 0;
    width: 100%;
  }
}
