.api-page {
  font-family: 'SFProDisplay', Arial, sans-serif;
  color: #111;
  background: #fff;
}

.api-hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: 132px 24px 36px;
  text-align: center;
}

.api-hero__kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #007aff;
  margin-bottom: 16px;
}

.api-hero h1 {
  font-size: 48px;
  line-height: 1.12;
  font-weight: 600;
  margin: 0 0 16px;
  letter-spacing: -0.03em;
}

.api-hero__lead {
  font-size: 22px;
  line-height: 1.45;
  color: #3a3a3a;
  max-width: 700px;
  margin: 0 auto;
}

.api-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 48px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 24px 96px;
  align-items: start;
}

.api-nav {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 120px);
  overflow: auto;
  padding-right: 8px;
}

.api-nav a {
  display: block;
  color: #555;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.35;
  padding: 6px 10px;
  border-radius: 6px;
}

.api-nav a:hover,
.api-nav a.is-active {
  color: #007aff;
  background: rgba(0, 122, 255, 0.08);
}

.api-nav__group {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #999;
  padding: 16px 10px 6px;
}

.api-nav__group:first-child {
  padding-top: 0;
}

.api-nav__method {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  white-space: nowrap;
}

.api-content {
  min-width: 0;
}

.api-section {
  margin-bottom: 56px;
  scroll-margin-top: 104px;
}

.api-section h2 {
  font-size: 28px;
  line-height: 1.2;
  font-weight: 600;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}

.api-section h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 28px 0 10px;
}

.api-section p,
.api-section li {
  font-size: 16px;
  line-height: 1.7;
  color: #2e2e2e;
}

.api-section p {
  margin: 0 0 14px;
}

.api-section ul {
  margin: 0 0 16px;
  padding-left: 20px;
}

.api-layers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 24px 0;
}

.api-layer {
  border: 1px solid #ececec;
  border-radius: 12px;
  padding: 16px;
  background: #fafafa;
}

.api-layer strong {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
}

.api-layer span {
  font-size: 13px;
  line-height: 1.45;
  color: #666;
}

.api-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  margin: 24px 0 32px;
}

.api-flow__box {
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  padding: 14px 16px;
  text-align: center;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
}

.api-flow__box small {
  display: block;
  font-weight: 400;
  color: #777;
  margin-top: 4px;
}

.api-flow__arrow {
  color: #007aff;
  font-size: 20px;
}

.api-method {
  border-top: 1px solid #eee;
  padding-top: 32px;
  margin-top: 32px;
  scroll-margin-top: 104px;
}

.api-method:first-of-type {
  border-top: 0;
  padding-top: 0;
  margin-top: 8px;
}

.api-method__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 14px;
  margin-bottom: 8px;
}

.api-method__head h3 {
  margin: 0;
  font-size: 22px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.api-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e8f2ff;
  color: #007aff;
}

.api-url {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  background: #f4f6f8;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 12px 0 16px;
  word-break: break-all;
}

.api-url .api-badge {
  flex-shrink: 0;
}

.api-label {
  font-size: 13px;
  font-weight: 600;
  color: #777;
  margin: 18px 0 8px;
}

.api-code {
  margin: 0 0 16px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #ececec;
}

.api-code pre {
  margin: 0;
  overflow-x: auto;
}

.api-code code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
}

.api-code .hljs {
  background: #f7f8fa;
  color: #222;
  padding: 16px 18px;
}

.api-warn {
  background: #fff6e8;
  border: 1px solid #ffe0a8;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.55;
  margin: 12px 0 16px;
}

.api-mobile-nav {
  display: none;
}

html {
  scroll-behavior: smooth;
}

@media screen and (max-width: 980px) {
  .api-hero {
    padding: 96px 20px 20px;
  }

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

  .api-hero__lead {
    font-size: 18px;
  }

  .api-layout {
    grid-template-columns: 1fr;
    padding: 0 20px 72px;
    gap: 0;
  }

  .api-nav {
    display: none;
  }

  .api-mobile-nav {
    display: block;
    position: sticky;
    top: 0;
    z-index: 20;
    background: #fff;
    padding: 8px 0 12px;
  }

  .api-mobile-nav select {
    width: 100%;
    height: 44px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0 12px;
    font-size: 15px;
    background: #fff;
  }

  .api-layers,
  .api-flow {
    grid-template-columns: 1fr;
  }

  .api-flow__arrow {
    transform: rotate(90deg);
    text-align: center;
  }
}

.api-nav { background: #fff; }
.api-section a { color: #007aff; }
.api-section a:hover { text-decoration: underline; }
.api-page code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: #f4f6f8;
  padding: 1px 5px;
  border-radius: 4px;
}
.api-code code { background: none; padding: 0; font-size: 13px; }
.api-page, .api-page * { box-sizing: border-box; }
