:root {
  --blue: #5361f6;
  --navy: #14213a;
  --muted: #617088;
  --footer: #f5f8fc;
  --line: #d9dfef;
  --soft: #f2f4f8;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: #fff;
  color: var(--navy);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(1190px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: absolute;
  z-index: 4;
  inset: 0 0 auto;
  height: 82px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 82px;
  gap: 32px;
}

.brand {
  display: inline-flex;
  line-height: 1;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 38px;
  color: #101b31;
  font-size: 14px;
}

.nav-links .active,
.nav-links a:first-child {
  color: #293ed2;
  font-weight: 800;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 30px;
  color: #101b31;
  font-size: 14px;
}

.lang-toggle {
  min-width: 46px;
  height: 32px;
  border: 1px solid rgba(83, 97, 246, 0.25);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
  color: #293ed2;
  font-weight: 800;
}

.pill-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 20px;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
  padding: 0 26px;
  box-shadow: 0 14px 28px rgba(83, 97, 246, 0.18);
}

.api-hero {
  position: relative;
  overflow: hidden;
  min-height: 350px;
  padding-top: 82px;
  background:
    radial-gradient(circle at 13% 45%, rgba(197, 235, 255, 0.95), transparent 25%),
    radial-gradient(circle at 74% 42%, rgba(204, 241, 252, 0.82), transparent 22%),
    radial-gradient(circle at 45% 20%, rgba(255, 209, 216, 0.44), transparent 21%),
    linear-gradient(115deg, #eaf8ff 0%, #fff4f5 42%, #f8fbff 100%);
}

.hero-ring {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.hero-ring-left {
  left: -88px;
  bottom: 20px;
  width: 180px;
  height: 180px;
  border: 32px solid rgba(83, 97, 246, 0.20);
  box-shadow: 0 0 70px rgba(83, 97, 246, 0.16);
}

.hero-ring-right {
  right: -108px;
  bottom: -12px;
  width: 235px;
  height: 235px;
  border: 62px solid rgba(255, 255, 255, 0.58);
  box-shadow: 0 0 70px rgba(83, 97, 246, 0.12);
}

.api-hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: 268px;
  text-align: center;
}

.api-hero h1 {
  margin: 26px 0 14px;
  color: #20242c;
  font-size: 48px;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: 8px;
}

.version-search {
  display: grid;
  grid-template-columns: 1fr 36px;
  align-items: center;
  width: min(225px, 80vw);
  height: 36px;
  border: 1px solid rgba(83, 97, 246, 0.55);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.74);
  color: #20242c;
}

.version-search input {
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #20242c;
  padding: 0 14px;
  font-weight: 700;
}

.version-search span {
  display: grid;
  place-items: center;
  color: #20242c;
  font-size: 22px;
  line-height: 1;
}

.api-docs {
  display: grid;
  grid-template-columns: minmax(220px, 286px) minmax(0, 1fr);
  align-items: start;
}

.api-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
  background: #f2f2f3;
  padding: 36px 34px 70px;
}

.api-sidebar nav {
  display: grid;
  gap: 24px;
  width: min(200px, 100%);
  margin-left: auto;
}

.api-sidebar a {
  display: block;
  color: #626a7a;
  line-height: 1.2;
}

.api-sidebar a strong,
.api-sidebar a span {
  display: block;
}

.api-sidebar a strong {
  font-size: 16px;
  font-weight: 900;
}

.api-sidebar a span {
  margin-top: 3px;
  font-size: 15px;
  font-weight: 800;
}

.api-sidebar a.active,
.api-sidebar a:hover {
  color: var(--blue);
}

.api-content {
  width: min(792px, calc(100% - 56px));
  margin: 0 auto;
  padding: 34px 0 76px;
}

.doc-section {
  scroll-margin-top: 20px;
  margin-bottom: 56px;
}

.doc-section h2 {
  margin: 0 0 26px;
  color: #2b2f38;
  font-size: 36px;
  line-height: 1.05;
  font-weight: 900;
}

.doc-section h2 span {
  font-size: 31px;
}

.doc-section h2 small {
  color: #3a3d45;
  font-size: 15px;
  font-weight: 800;
}

.summary-list,
.flow-list {
  margin: 0 0 8px;
  padding: 0;
  color: #6a7180;
  font-size: 14px;
  line-height: 1.75;
  list-style-position: inside;
}

.summary-list a,
.flow-list a,
.note a {
  color: var(--blue);
  font-weight: 900;
}

.table-wrap {
  overflow-x: auto;
  margin: 8px 0 14px;
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  color: #656d7c;
  font-size: 14px;
  line-height: 1.45;
}

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

th {
  background: #eef1f7;
  color: #30343d;
  font-weight: 900;
}

td pre {
  margin: 0;
  white-space: pre-wrap;
  color: #646b78;
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.65;
}

.minor-title,
.note,
.compact-doc p {
  margin: 14px 0 8px;
  color: #6a7180;
  font-size: 14px;
  line-height: 1.8;
}

.status-note {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 4px;
  background: #fff1f1;
  color: #c54242;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 800;
}

.code-block {
  margin: 8px 0 0;
  overflow-x: auto;
  border-radius: 3px;
  background: #373940;
  color: #f7f8fb;
  padding: 18px 20px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 14px;
  line-height: 1.65;
}

.compact-doc {
  margin-bottom: 42px;
}

.compact-doc h2 {
  margin-bottom: 12px;
}

.footer {
  background: var(--footer);
  padding: 88px 0 34px;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 170px 170px 170px;
  gap: 86px;
}

.footer-about p {
  max-width: 500px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 2;
}

.footer h3 {
  margin: 22px 0 26px;
  color: #202938;
  font-size: 14px;
  font-weight: 800;
}

.footer-grid > div:not(.footer-about) a {
  display: block;
  margin-bottom: 20px;
  color: #68758b;
  font-size: 14px;
}

.footer-bottom {
  margin-top: 86px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
  color: #708098;
  font-size: 13px;
}

html[lang="en"] .nav-links {
  gap: 28px;
}

html[lang="en"] .api-sidebar a strong {
  font-size: 15px;
}

html[lang="en"] .api-sidebar a span {
  font-size: 13px;
}

html[lang="en"] .doc-section h2 {
  font-size: 34px;
}

html[lang="en"] .doc-section h2 span {
  font-size: 24px;
}

@media (max-width: 980px) {
  .nav-links {
    display: none;
  }

  .api-docs {
    grid-template-columns: 1fr;
  }

  .api-sidebar {
    position: relative;
    min-height: 0;
    padding: 18px 20px;
  }

  .api-sidebar nav {
    display: flex;
    width: 100%;
    margin: 0;
    overflow-x: auto;
    gap: 18px;
    padding-bottom: 6px;
  }

  .api-sidebar a {
    flex: 0 0 190px;
  }

  .api-content {
    width: min(100% - 32px, 792px);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 24px, 1190px);
  }

  .site-header,
  .nav {
    height: 72px;
  }

  .nav-actions > a:not(.pill-link) {
    display: none;
  }

  .nav-actions {
    gap: 14px;
  }

  .pill-link {
    padding: 0 18px;
  }

  .api-hero {
    min-height: 300px;
    padding-top: 72px;
  }

  .api-hero-inner {
    min-height: 220px;
  }

  .api-hero h1 {
    font-size: 42px;
  }

  .doc-section h2 {
    font-size: 32px;
  }

  .doc-section h2 span {
    font-size: 27px;
  }

  table {
    font-size: 13px;
  }

  .footer {
    padding-top: 62px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}
