/* ===== StarFrame 简洁浅色科技风设计系统 ===== */
:root {
  --page-width: 1320px;
  --sidebar-width: 248px;
  --content-width: 1072px;
  --header-height: 62px;

  --bg: #f7fbff;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-solid: #ffffff;
  --surface-soft: #f1f7ff;
  --surface-hover: #eaf4ff;
  --line: rgba(15, 23, 42, 0.10);
  --line-strong: rgba(15, 23, 42, 0.16);
  --text: #0f172a;
  --muted: #526174;
  --faint: #8391a5;
  --accent: #0ea5e9;
  --accent-strong: #0284c7;
  --accent-soft: rgba(14, 165, 233, 0.10);
  --green: #059669;
  --green-soft: rgba(5, 150, 105, 0.10);
  --amber: #b7791f;
  --amber-soft: rgba(183, 121, 31, 0.12);
  --red: #e11d48;
  --red-soft: rgba(225, 29, 72, 0.10);
  --code-bg: #0f172a;
  --code-ink: #e2e8f0;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 16px 46px rgba(15, 23, 42, 0.08);
  --glow: 0 0 0 1px rgba(14, 165, 233, 0.18), 0 18px 52px rgba(14, 165, 233, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 0%, rgba(14, 165, 233, 0.16), transparent 32%),
    radial-gradient(circle at 84% 8%, rgba(99, 102, 241, 0.10), transparent 36%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 46%, #f3f8ff 100%);
  font-family: Inter, "SF Pro Text", "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(14, 165, 233, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 165, 233, 0.055) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.48), transparent 72%);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.16s ease;
}

a:hover {
  color: var(--accent-strong);
  text-decoration: none;
}

code,
pre {
  font-family: "SF Mono", "JetBrains Mono", Consolas, monospace;
}

:focus-visible {
  outline: 2px solid rgba(14, 165, 233, 0.56);
  outline-offset: 3px;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-height);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.topbar-inner {
  width: min(calc(100% - 48px), var(--page-width));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
  flex: 0 0 auto;
}

.brand-name {
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 28px;
}

.topbar-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 14px;
  font-weight: 500;
}

.topbar-link:hover,
.topbar-link.active {
  color: var(--text);
  background: transparent;
}

.topbar-link.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
}

.sidebar-toggle {
  display: none;
  color: var(--text);
  background: transparent;
  border: 0;
  font-size: 20px;
  cursor: pointer;
}

.sidebar {
  position: fixed;
  top: var(--header-height);
  left: max(24px, calc(50vw - (var(--page-width) / 2)));
  bottom: 0;
  width: var(--sidebar-width);
  overflow-y: auto;
  padding: 28px 18px 54px 0;
}

.sidebar::-webkit-scrollbar {
  width: 0;
}

.sidebar-group {
  margin-bottom: 18px;
}

.sidebar-label {
  margin: 0 0 7px;
  padding: 0 12px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar a {
  display: block;
  margin: 2px 0;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  transition: color 0.15s ease, background 0.15s ease;
}

.sidebar a:hover {
  color: var(--text);
  background: rgba(14, 165, 233, 0.07);
}

.sidebar a.active {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.content {
  width: min(var(--content-width), calc(100vw - var(--sidebar-width) - 72px));
  margin-left: max(calc(24px + var(--sidebar-width)), calc(50vw - (var(--page-width) / 2) + var(--sidebar-width)));
  padding: calc(var(--header-height) + 34px) 0 88px;
}

.content h1 {
  margin: 0 0 24px;
  color: var(--text);
  font-size: 34px;
  font-weight: 760;
  line-height: 1.18;
  letter-spacing: -0.025em;
}

.content h1::after {
  content: "";
  display: block;
  width: 42px;
  height: 2px;
  margin-top: 13px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.content section {
  margin-bottom: 64px;
  scroll-margin-top: 92px;
}

.content h2 {
  margin: 0 0 22px;
  color: var(--text);
  font-size: 30px;
  font-weight: 750;
  line-height: 1.22;
  letter-spacing: -0.025em;
}

.content h2::after {
  content: "";
  display: block;
  width: 42px;
  height: 2px;
  margin-top: 13px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.content h3 {
  margin: 34px 0 13px;
  color: #172033;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
}

.content h4 {
  margin: 26px 0 9px;
  color: #334155;
  font-size: 15px;
  font-weight: 700;
}

.content p {
  margin: 0 0 15px;
  color: var(--muted);
}

.content ul,
.content ol {
  padding-left: 22px;
  margin: 0 0 15px;
  color: var(--muted);
}

.content li {
  margin-bottom: 5px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 0 0 24px;
}

.step-card,
.endpoint,
table,
.note {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 251, 255, 0.90));
  box-shadow: var(--shadow);
}

.step-card {
  min-height: 148px;
  padding: 22px;
  border-radius: var(--radius);
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.step-card:hover {
  border-color: rgba(14, 165, 233, 0.30);
  transform: translateY(-2px);
  box-shadow: var(--glow);
}

.step-card span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  min-width: 42px;
  margin-bottom: 14px;
  border: 1px solid rgba(14, 165, 233, 0.24);
  border-radius: 999px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 800;
}

.step-card strong {
  display: block;
  margin-bottom: 5px;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

.step-card p {
  margin: 0;
  font-size: 13.5px;
}

.endpoint {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}

.method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

.method-post {
  color: var(--green);
  background: var(--green-soft);
}

.method-get {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.endpoint code {
  padding: 0;
  background: transparent;
  color: #075985;
  font-size: 14px;
}

.endpoint-desc {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0 0 22px;
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 14px;
}

th,
td {
  padding: 11px 15px;
  text-align: left;
  vertical-align: top;
  border: 0;
}

th {
  color: #172033;
  background: rgba(14, 165, 233, 0.08);
  font-weight: 750;
  white-space: nowrap;
}

td {
  color: var(--muted);
}

tbody tr+tr td,
tbody tr+tr th {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

td code,
th code {
  font-size: 13px;
}

.code-wrap {
  position: relative;
  margin: 0 0 22px;
}

pre {
  margin: 0;
  padding: 20px 22px;
  overflow-x: auto;
  color: var(--code-ink);
  background: var(--code-bg);
  border: 1px solid rgba(14, 165, 233, 0.16);
  border-radius: var(--radius);
  line-height: 1.68;
  font-size: 13px;
  box-shadow: var(--shadow);
}

pre code {
  color: inherit;
  background: transparent;
  padding: 0;
}

code {
  padding: 2px 6px;
  border-radius: 6px;
  color: #0369a1;
  background: rgba(14, 165, 233, 0.10);
  font-size: 13px;
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 11px;
  border: 1px solid rgba(14, 165, 233, 0.24);
  border-radius: 999px;
  color: var(--accent-strong);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.16s ease, border-color 0.16s ease;
}

.code-wrap:hover .copy-btn {
  opacity: 1;
}

.copy-btn:hover {
  border-color: rgba(14, 165, 233, 0.55);
}

.copy-btn.copied {
  color: #052e1d;
  background: var(--green);
  border-color: var(--green);
}

.links-box {
  padding: 18px 20px;
  border: 1px solid rgba(14, 165, 233, 0.22);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 251, 255, 0.90));
  box-shadow: var(--shadow);
  margin-bottom: 28px;
}

.links-box p {
  margin: 4px 0;
}

.content img {
  display: block;
  max-width: 100%;
  margin: 12px 0 18px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.note {
  padding: 15px 17px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 14px;
}

.note.warning {
  border-color: rgba(183, 121, 31, 0.22);
  background: rgba(183, 121, 31, 0.08);
}

.channel-block {
  margin-bottom: 46px;
}

.channel-block h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-queued {
  color: var(--amber);
  background: var(--amber-soft);
}

.status-progress {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.status-completed {
  color: var(--green);
  background: var(--green-soft);
}

.status-failed {
  color: var(--red);
  background: var(--red-soft);
}

.status-unknown {
  color: var(--muted);
  background: rgba(148, 163, 184, 0.12);
}

.footer {
  width: min(calc(100% - 48px), var(--page-width));
  margin: 0 auto;
  padding: 30px 0 38px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  text-align: center;
  font-size: 13px;
}

.footer p {
  margin: 4px 0;
}

@media (max-width: 960px) {
  .topbar-inner {
    width: calc(100% - 32px);
    margin: 0 auto;
  }

  .brand-name {
    font-size: 15px;
  }

  .topbar-actions {
    gap: 18px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .topbar-actions::-webkit-scrollbar {
    display: none;
  }

  .topbar-link {
    height: 32px;
    white-space: nowrap;
  }

  .sidebar-toggle {
    display: block;
  }

  .sidebar {
    left: 0;
    width: min(82vw, 280px);
    padding: 22px 16px 48px;
    background: rgba(255, 255, 255, 0.96);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 99;
    box-shadow: 16px 0 44px rgba(15, 23, 42, 0.12);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .content {
    width: calc(100% - 32px);
    margin: 0 auto;
    padding: calc(var(--header-height) + 26px) 0 64px;
  }

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

  .endpoint {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .endpoint-desc {
    width: 100%;
    margin-left: 0;
  }

  .footer {
    width: calc(100% - 36px);
  }
}