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

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

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

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 {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 82px;
  gap: 32px;
}

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

.brand img {
  display: block;
}

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

.nav-menu-check,
.menu-toggle {
  display: none;
}

.menu-toggle {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(83, 97, 246, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-direction: column;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: #293ed2;
}

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

.mobile-auth-link {
  display: none;
}

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

.lang-toggle {
  flex: 0 0 auto;
  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;
  line-height: 1;
  white-space: nowrap;
}

.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;
  min-width: 0;
  overflow-x: hidden;
}

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

.api-sidebar nav {
  display: grid;
  gap: 24px;
  width: min(200px, 100%);
  min-width: 0;
  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));
  min-width: 0;
  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 {
  max-width: 100%;
  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: 1100px) {
  .site-header {
    background: rgba(247, 251, 255, 0.94);
    backdrop-filter: blur(12px);
  }

  .nav {
    gap: 16px;
  }

  .brand img {
    width: 158px;
    height: auto;
  }

  .menu-toggle {
    display: inline-flex;
    order: 3;
  }

  .nav-links {
    position: absolute;
    z-index: 20;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    row-gap: 8px;
    column-gap: 8px;
    max-height: 0;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 45px rgba(32, 42, 83, 0.12);
    opacity: 0;
    transform: translateY(-6px);
    transition: max-height 0.2s ease, padding 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
  }

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

  .nav-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border-radius: 6px;
    background: #f6f8fd;
    padding: 0 10px;
    margin: 0;
    text-align: center;
  }

  .nav-links .mobile-auth-link {
    display: flex;
  }

  .nav-links .mobile-register-link {
    background: #f6f8fd;
    color: inherit;
    font-weight: 400;
  }

  .mobile-auth-link:empty::before {
    content: "Log In";
  }

  .mobile-register-link:empty::before {
    content: "Sign Up Free";
  }

  .nav-menu-check:checked ~ .nav-links {
    max-height: calc(100vh - 104px);
    overflow-y: auto;
    padding: 12px;
    opacity: 1;
    transform: translateY(0);
  }

  .nav-actions {
    margin-left: auto;
    gap: 14px;
    order: 2;
  }

  .lang-toggle {
    min-width: 76px;
    padding-inline: 14px;
  }

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

  .api-sidebar {
    position: relative;
    width: 100%;
    overflow: hidden;
    min-height: 0;
    padding: 18px 20px;
  }

  .api-sidebar nav {
    display: flex;
    width: 100%;
    max-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% - 28px, 1190px);
  }

  .site-header {
    position: sticky;
    top: 0;
    height: auto;
  }

  .nav {
    height: 64px;
    gap: 10px;
  }

  .brand img {
    width: 132px;
  }

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

  .nav-actions {
    gap: 6px;
  }

  .lang-toggle {
    min-width: 58px;
    height: 30px;
    padding-inline: 7px;
    font-size: 11px;
  }

  .pill-link {
    display: none;
  }

  .menu-toggle {
    width: 38px;
    height: 38px;
  }

  .nav-links {
    grid-template-columns: 1fr;
    top: calc(100% + 6px);
    gap: 8px;
    row-gap: 8px;
    column-gap: 8px;
  }

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

  .nav-links a {
    justify-content: flex-start;
    padding-inline: 14px;
    margin: 0;
  }

  .nav-menu-check:checked ~ .nav-links {
    max-height: calc(100vh - 82px);
    padding: 10px;
  }

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

  .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;
  }

  .footer-bottom {
    display: grid;
    gap: 12px;
  }
}

@media (max-width: 380px) {
  .brand img {
    width: 110px;
  }

  .lang-toggle {
    min-width: 54px;
    padding-inline: 6px;
    font-size: 10px;
  }
}
