:root {
  --bg: #f7f8fb;
  --panel: #ffffff;
  --text: #101828;
  --muted: #5f6b7c;
  --line: #e7eaf0;
  --blue: #1769e0;
  --green: #16a37a;
  --orange: #e38b22;
  --code-bg: #101828;
  --code-text: #edf2f7;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family:
    "Segoe UI", "PingFang SC", "Microsoft YaHei", ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, sans-serif;
}

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

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  min-height: 52px;
  padding: 0 18px;
  border-bottom: 1px solid #e5e7eb;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.02);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
  color: #111827;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.brand-mark {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  overflow: hidden;
  color: transparent;
  background: url("logo.png") center / contain no-repeat;
  font-size: 0;
}

.topnav {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  overflow-x: auto;
  color: #111827;
  font-size: 15px;
  font-weight: 760;
  scrollbar-width: none;
  white-space: nowrap;
}

.topnav::-webkit-scrollbar {
  display: none;
}

.topnav a {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
}

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

.shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 28px;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.sidebar {
  position: sticky;
  top: 88px;
  align-self: start;
  max-height: calc(100vh - 110px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.sidebar h2 {
  margin: 18px 0 8px;
  color: var(--text);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.sidebar h2:first-child {
  margin-top: 0;
}

.sidebar a {
  display: block;
  padding: 7px 0;
  color: var(--muted);
  font-size: 14px;
}

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

.content {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.article {
  max-width: 860px;
  padding: 42px;
}

.article h1 {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 42px;
  line-height: 1.15;
  letter-spacing: 0;
}

.article h2 {
  margin: 38px 0 14px;
  color: var(--text);
  font-size: 25px;
  letter-spacing: 0;
}

.article h3 {
  margin: 28px 0 10px;
  color: var(--text);
  font-size: 18px;
}

.article p,
.article li {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.85;
}

.article a {
  color: var(--blue);
  font-weight: 700;
}

.article ul,
.article ol {
  padding-left: 24px;
}

.notice {
  margin: 22px 0;
  border-left: 4px solid var(--green);
  border-radius: 6px;
  padding: 14px 16px;
  background: #eefaf6;
  color: #126c52;
}

.endpoint {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f9fbfd;
}

.method {
  border-radius: 6px;
  padding: 6px 8px;
  color: #ffffff;
  background: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.endpoint code {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.copy {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
  color: var(--blue);
  background: #ffffff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.copy:hover {
  border-color: var(--blue);
}

.code-block {
  margin: 18px 0;
  overflow: hidden;
  border-radius: 8px;
  background: var(--code-bg);
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  padding: 10px 14px;
  color: #a8b3c7;
  font-size: 13px;
  font-weight: 800;
}

.code-block pre {
  margin: 0;
  padding: 16px;
  overflow: auto;
  color: var(--code-text);
  font-size: 14px;
  line-height: 1.7;
}

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

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fbfdff;
}

.card h3 {
  margin-top: 0;
}

.figure {
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fbfdff;
}

.figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.figure figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.footer {
  border-top: 1px solid var(--line);
  padding: 18px 42px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px 10px;
  }

  .topnav {
    justify-content: flex-start;
    gap: 18px;
    width: 100%;
  }

  .topnav a {
    min-height: 34px;
  }

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

  .sidebar {
    position: static;
    max-height: none;
  }

  .article {
    padding: 28px 20px;
  }

  .article h1 {
    font-size: 32px;
  }

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

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

  .footer {
    padding: 18px 20px;
  }
}
