:root {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #fbfbfc;
  --panel-strong: #f4f6f8;
  --text: #17191c;
  --muted: #69707a;
  --border: #e4e7eb;
  --accent: #0f766e;
  --accent-soft: #e6f5f3;
  --code-bg: #101418;
  --code-text: #edf2f7;
  --shadow: 0 12px 35px rgba(18, 25, 38, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

:root.dark {
  color-scheme: dark;
  --bg: #101113;
  --panel: #15171a;
  --panel-strong: #1d2025;
  --text: #edf0f3;
  --muted: #a4abb5;
  --border: #2b3037;
  --accent: #2dd4bf;
  --accent-soft: #123330;
  --code-bg: #080b0f;
  --code-text: #e8eef6;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
}

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

.doc-article a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.doc-article a:hover {
  color: color-mix(in srgb, var(--accent) 72%, var(--text));
}

button,
input {
  font: inherit;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  width: 288px;
  height: 100vh;
  flex-shrink: 0;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
}

.brand-row {
  display: flex;
  height: 64px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
}

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

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
}

.icon-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.icon-button {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.text-button {
  gap: 8px;
  min-height: 34px;
  border-radius: 8px;
  padding: 0 12px;
}

.icon-button:hover,
.text-button:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: var(--panel-strong);
  color: var(--text);
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.search-wrap {
  padding: 16px;
}

.search-box {
  display: flex;
  height: 36px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  padding: 0 10px;
  color: var(--muted);
}

.search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

kbd {
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--panel-strong);
  padding: 1px 6px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
}

.nav-groups {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 4px 12px 28px;
}

.nav-group {
  margin-top: 20px;
}

.nav-group-title {
  margin: 0 0 8px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav-link {
  display: flex;
  min-height: 36px;
  align-items: center;
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.nav-link:hover,
.nav-link.active {
  background: var(--panel-strong);
  color: var(--text);
}

.mobile-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: none;
  height: 60px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  padding: 0 14px;
  backdrop-filter: blur(10px);
}

.content-shell {
  min-width: 0;
  flex: 1;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 860px) 240px;
  gap: 44px;
  width: min(1180px, calc(100vw - 340px));
  margin: 0 auto;
  padding: 32px 0 80px;
}

.doc-article {
  min-width: 0;
}

.doc-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: 999px;
  background: var(--accent-soft);
  padding: 0 12px;
  color: color-mix(in srgb, var(--accent) 68%, var(--text));
  font-size: 13px;
  font-weight: 700;
}

.doc-section {
  scroll-margin-top: 24px;
  border-bottom: 1px solid var(--border);
  padding: 18px 0 42px;
}

.doc-section:last-child {
  border-bottom: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: 0;
}

h1 {
  max-width: 720px;
  font-size: 42px;
}

h2 {
  margin-top: 30px;
  font-size: 26px;
}

section > h2:first-of-type {
  margin-top: 0;
}

h3 {
  margin-top: 26px;
  font-size: 18px;
}

p {
  margin: 12px 0 0;
  color: var(--muted);
}

.lead {
  max-width: 760px;
  color: var(--muted);
  font-size: 18px;
}

code {
  border-radius: 6px;
  background: var(--panel-strong);
  padding: 2px 6px;
  color: color-mix(in srgb, var(--accent) 66%, var(--text));
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

pre {
  position: relative;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--code-bg);
  box-shadow: var(--shadow);
  margin: 16px 0 0;
  padding: 18px;
}

pre code {
  display: block;
  min-width: fit-content;
  background: transparent;
  padding: 0;
  color: var(--code-text);
  line-height: 1.65;
  white-space: pre;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.info-item {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.info-item span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.info-item code {
  display: block;
  overflow-wrap: anywhere;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--panel);
  color: var(--text);
  font-weight: 800;
}

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

tr:last-child td {
  border-bottom: 0;
}

.endpoint {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  margin-top: 16px;
  padding: 8px 10px;
}

.endpoint span {
  border-radius: 5px;
  background: var(--accent-soft);
  padding: 2px 7px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.callout {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 16px;
  padding: 16px;
  color: var(--text);
}

.callout p,
.callout strong {
  color: inherit;
}

.callout-highlight {
  border-color: #f2b84b;
  background: #fff6db;
  color: #5b3a05;
  box-shadow: 0 10px 26px rgba(194, 123, 13, 0.12);
}

:root.dark .callout-highlight {
  border-color: #7c5a18;
  background: #2d230f;
  color: #f4d58a;
}

.callout-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: #ef4444;
  margin: 0 8px 0 0;
  padding: 0 9px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  vertical-align: middle;
}

.path-card {
  border: 3px solid #ef4444;
  border-radius: 8px;
  background: #fffdfa;
  margin-top: 16px;
  padding: 18px;
  box-shadow: 0 14px 34px rgba(239, 68, 68, 0.13);
}

:root.dark .path-card {
  background: #211817;
}

.path-card span {
  display: block;
  margin-bottom: 8px;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 900;
}

.path-card > code {
  display: block;
  overflow-wrap: anywhere;
  border: 1px solid #fecaca;
  background: #fff1f2;
  padding: 10px 12px;
  color: #991b1b;
  font-size: 18px;
  font-weight: 900;
}

.path-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.path-alt {
  color: var(--muted);
  font-size: 14px;
}

.guide-visual {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.visual-panel {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.visual-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-strong);
  padding: 10px 12px;
}

.visual-bar span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--muted) 45%, transparent);
}

.visual-bar code {
  min-width: 0;
  overflow: hidden;
  margin-left: 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visual-console {
  display: grid;
  grid-template-columns: 122px minmax(0, 1fr);
  min-height: 220px;
}

.visual-side {
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel-strong) 70%, var(--bg));
  padding: 12px 9px;
}

.visual-side div {
  border-radius: 6px;
  margin-bottom: 6px;
  padding: 8px 9px;
  color: var(--muted);
  font-size: 13px;
}

.visual-side .visual-active {
  outline: 2px solid #ef4444;
  outline-offset: 2px;
  background: var(--panel);
  color: var(--text);
  font-weight: 800;
}

.visual-main,
.visual-form {
  padding: 18px;
}

.visual-main strong {
  display: block;
  margin-bottom: 14px;
}

.visual-main button {
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--border));
  border-radius: 8px;
  background: var(--accent-soft);
  color: color-mix(in srgb, var(--accent) 70%, var(--text));
  padding: 8px 12px;
  font-weight: 800;
}

.visual-field {
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 7px;
  margin-top: 18px;
  background: var(--bg);
}

.visual-form label {
  display: block;
  margin-bottom: 13px;
}

.visual-form label span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.visual-select {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  padding: 9px 11px;
  color: var(--text);
  font-weight: 700;
}

.visual-menu {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.visual-choice {
  position: relative;
  border-top: 1px solid var(--border);
  padding: 12px;
}

.visual-choice:first-child {
  border-top: 0;
}

.visual-choice strong,
.visual-choice small {
  display: block;
}

.visual-choice small {
  color: var(--muted);
}

.visual-recommended {
  outline: 2px solid #ef4444;
  outline-offset: -2px;
  background: #fff7d6;
}

:root.dark .visual-recommended {
  background: #30250f;
}

.visual-recommended em {
  position: absolute;
  top: 12px;
  right: 12px;
  border-radius: 999px;
  background: #ef4444;
  padding: 2px 8px;
  color: #fff;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.success-check {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  gap: 18px;
  align-items: stretch;
  margin-top: 18px;
}

.success-copy {
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: 8px;
  background: var(--accent-soft);
  padding: 16px;
}

.success-copy strong {
  display: block;
  color: color-mix(in srgb, var(--accent) 70%, var(--text));
  font-size: 16px;
}

.success-copy p {
  color: var(--text);
}

.codex-shot {
  overflow: hidden;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  background: #171717;
  padding: 34px 20px 22px;
  color: #f4f4f5;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
}

.codex-shot h4 {
  margin: 0 0 24px;
  text-align: center;
  color: #f7f7f7;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0;
}

.codex-input {
  border-radius: 24px;
  background: #2d2d2f;
  min-height: 104px;
  padding: 16px 14px 10px;
}

.codex-placeholder {
  color: #8f8f96;
  font-size: 15px;
}

.codex-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
}

.codex-plus,
.codex-send {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #b8b8bd;
  font-size: 24px;
  line-height: 1;
}

.codex-send {
  background: #a8a8ad;
  color: #27272a;
  font-size: 19px;
  font-weight: 900;
}

.codex-permission {
  min-width: 0;
  color: #ff8a3d;
  font-size: 14px;
  font-weight: 800;
}

.codex-provider {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 2px solid #ef4444;
  border-radius: 2px;
  background: #303033;
  margin-left: auto;
  padding: 7px 11px;
  color: #eeeeef;
}

.codex-provider strong,
.codex-provider em,
.codex-provider small {
  color: inherit;
  font-size: 14px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
}

.resource-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  margin-top: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.resource-card strong {
  color: var(--text);
  font-size: 17px;
}

.resource-card p {
  margin-top: 5px;
}

.resource-card > a {
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--border));
  border-radius: 8px;
  background: var(--accent-soft);
  padding: 8px 12px;
  text-decoration: none;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--border);
  margin-top: 28px;
  padding: 26px 0 8px;
  color: var(--muted);
}

.site-footer strong {
  display: block;
  color: var(--text);
  font-size: 15px;
}

.site-footer p {
  margin: 4px 0 0;
  font-size: 13px;
}

.footer-copy {
  text-align: right;
}

.toc {
  min-width: 0;
}

.toc-inner {
  position: sticky;
  top: 32px;
  max-height: calc(100vh - 64px);
  overflow: auto;
  border-left: 1px solid var(--border);
  padding-left: 18px;
}

.toc-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.toc a {
  display: block;
  border-radius: 6px;
  padding: 5px 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.toc a:hover,
.toc a.active {
  background: var(--panel-strong);
  color: var(--text);
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: none;
  background: rgba(0, 0, 0, 0.42);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  transform: translateY(20px);
  opacity: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 10px 14px;
  color: var(--text);
  pointer-events: none;
  transition: transform 180ms ease, opacity 180ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1180px) {
  .content-grid {
    grid-template-columns: minmax(0, 1fr);
    width: min(860px, calc(100vw - 340px));
  }

  .toc {
    display: none;
  }
}

@media (max-width: 860px) {
  body.nav-open {
    overflow: hidden;
  }

  .app-shell {
    display: block;
  }

  .mobile-header {
    display: flex;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

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

  body.nav-open .overlay {
    display: block;
  }

  .content-grid {
    width: min(100% - 32px, 860px);
    padding-top: 18px;
  }

  .doc-actions {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .guide-visual {
    grid-template-columns: 1fr;
  }

  .success-check {
    grid-template-columns: 1fr;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .resource-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-copy {
    text-align: left;
  }

  h1 {
    font-size: 32px;
  }

  h2 {
    font-size: 23px;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 14px;
  }

  .content-grid {
    width: min(100% - 24px, 860px);
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  pre {
    padding: 14px;
  }
}
