* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

*:focus,
*:active {
  -webkit-tap-highlight-color: transparent;
}

button,
a,
input,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg-page: #ffffff;
  --bg-surface: #ffffff;
  --bg-subtle: #fafafa;
  --bg-hover: #f2f2f2;
  --bg-code: #fafafa;
  --bg-code-header: #f2f2f2;
  --border-subtle: #e4e4e4;
  --border-medium: #c9c9c9;
  --border-strong: #8f8f8f;
  --text-primary: #111111;
  --text-secondary: #3d3d3d;
  --text-muted: #6b6b6b;
  --accent: #111111;
  --success: #111111;
  --warning: #111111;
  --header-height: 60px;
  --sidebar-width: 260px;
  --toc-width: 220px;
  --font-main: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Fira Code", Menlo, Monaco, Consolas, monospace;
}

::selection {
  background: #111111;
  color: #ffffff;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 14.5px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.docs-header {
  position: sticky;
  top: 0;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 1000;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mobile-menu-btn:hover {
  background: var(--bg-hover);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-logo {
  width: 26px;
  height: 26px;
  border-radius: 6px;
}

.brand-title {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.header-center {
  flex: 1;
  max-width: 440px;
  margin: 0 24px;
}

.search-box {
  display: flex;
  align-items: center;
  background: #fafafa;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 6px 12px;
  gap: 8px;
  transition: all 0.15s ease;
}

.search-box:focus-within {
  border-color: #8f8f8f;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.05);
}

.search-icon {
  color: var(--text-muted);
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.search-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 13.5px;
  font-family: inherit;
  width: 100%;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-kbd {
  font-size: 11px;
  color: var(--text-muted);
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-secondary);
  background: #fafafa;
  border: 1px solid var(--border-subtle);
  padding: 5px 12px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.header-action-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
  background: #f2f2f2;
}

.docs-layout {
  display: flex;
  max-width: 1440px;
  margin: 0 auto;
  min-height: calc(100vh - var(--header-height));
}

.docs-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  border-right: 1px solid var(--border-subtle);
  padding: 24px 16px;
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  overflow-y: auto;
  background: #ffffff;
}

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

.sidebar-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  margin-bottom: 8px;
  padding-left: 8px;
}

.sidebar-nav {
  list-style: none;
}

.sidebar-nav li {
  margin-bottom: 2px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 13.5px;
  padding: 6px 10px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.sidebar-link:hover {
  color: var(--text-primary);
  background: var(--bg-subtle);
}

.sidebar-link.active {
  color: var(--text-primary);
  background: #f2f2f2;
  font-weight: 600;
}

.method-tag {
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
}

.method-tag.post {
  background: #111111;
  color: #ffffff;
  border: 1px solid #111111;
}

.method-tag.get {
  background: #ffffff;
  color: #6b6b6b;
  border: 1px solid #c9c9c9;
}

.method-tag.delete {
  background: #ffffff;
  color: #111111;
  border: 1px solid #111111;
}

.method-tag.preview {
  background: #ffffff;
  color: #6b6b6b;
  border: 1px solid #c9c9c9;
}

.method-tag.latest {
  background: #111111;
  color: #ffffff;
  border: 1px solid #111111;
}

.docs-main {
  flex: 1;
  min-width: 0;
  padding: 40px 48px 80px 48px;
  background: #ffffff;
}

.article-header {
  margin-bottom: 36px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 24px;
}

.article-title {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.6px;
  color: var(--text-primary);
  margin-bottom: 10px;
  line-height: 1.25;
}

.article-desc {
  font-size: 15.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.doc-section {
  margin-bottom: 48px;
  scroll-margin-top: 80px;
}

.section-title {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text-primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title a {
  text-decoration: none;
  color: var(--text-muted);
  opacity: 0;
  font-size: 18px;
  transition: opacity 0.15s ease;
}

.section-title:hover a {
  opacity: 1;
}

.subsection-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--text-primary);
  margin: 22px 0 12px 0;
}

p {
  margin-bottom: 16px;
  color: var(--text-secondary);
  font-size: 14.5px;
  line-height: 1.65;
}

strong {
  color: var(--text-primary);
  font-weight: 600;
}

code:not(pre code) {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: #f4f4f5;
  color: #18181b;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid #ececee;
}

.callout {
  background: #fafafa;
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--text-primary);
  border-radius: 12px;
  padding: 14px 18px;
  margin: 20px 0;
}

.callout.tip {
  border-left-color: #a1a1aa;
}

.callout.warning {
  border-left-color: #111111;
}

.callout-title {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.callout p {
  margin-bottom: 0;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.model-cat-view {
  animation: fadeInView 0.25s ease-out forwards;
}

@keyframes fadeInView {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.model-id-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.model-desc-text {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

.model-alias-badge {
  font-size: 10px;
  font-weight: 700;
  background: #f2f2f2;
  color: #3d3d3d;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid #c9c9c9;
}

.model-latest-badge {
  font-size: 10px;
  font-weight: 700;
  background: #111111;
  color: #ffffff;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid #111111;
}

.model-preview-badge {
  font-size: 10px;
  font-weight: 700;
  background: #ffffff;
  color: #6b6b6b;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid #c9c9c9;
}

.model-snapshot-badge {
  font-size: 10px;
  font-weight: 700;
  background: #fafafa;
  color: #6b6b6b;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid #e4e4e4;
}

.pricing-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-secondary);
}

.pricing-cache {
  color: var(--text-muted);
  font-size: 11.5px;
}

.code-container {
  background: #fafafa;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  margin: 20px 0;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f2f2f2;
  border-bottom: 1px solid var(--border-subtle);
  padding: 4px 10px;
}

.code-tabs {
  display: flex;
  gap: 4px;
}

.code-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-family: inherit;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.code-tab:hover {
  color: var(--text-primary);
}

.code-tab.active {
  background: #ffffff;
  color: var(--text-primary);
  border-color: var(--border-subtle);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.copy-btn {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.copy-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
  background: #fafafa;
}

.copy-btn.copied {
  color: #111111;
  border-color: #111111;
  background: #f2f2f2;
}

pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  background: #fafafa;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  color: #111111;
}

pre code {
  font-family: var(--font-mono);
  background: transparent !important;
  padding: 0 !important;
  border: none !important;
  color: inherit;
}

.hljs,
.hljs * {
  color: #262626 !important;
  background: transparent !important;
}

.hljs-keyword,
.hljs-built_in,
.hljs-type {
  color: #000000 !important;
  font-weight: 700;
}

.hljs-string,
.hljs-title.class_ {
  color: #4a4a4a !important;
}

.hljs-function,
.hljs-title.function_,
.hljs-title {
  color: #000000 !important;
  font-weight: 600;
  font-style: italic;
}

.hljs-number,
.hljs-literal,
.hljs-boolean {
  color: #6b6b6b !important;
  font-weight: 600;
}

.hljs-attr,
.hljs-property,
.hljs-variable {
  color: #262626 !important;
}

.hljs-comment {
  color: #9a9a9a !important;
  font-style: italic;
}

.hljs-punctuation,
.hljs-operator {
  color: #8f8f8f !important;
}

.table-container {
  overflow-x: auto;
  margin: 20px 0;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: #ffffff;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

th {
  background: #fafafa;
  color: var(--text-primary);
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: top;
}

td:not(:last-child) code,
td.nowrap {
  white-space: nowrap;
}

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

tr:hover td {
  background: #fafafa;
}

.docs-toc {
  width: var(--toc-width);
  flex-shrink: 0;
  padding: 40px 16px;
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  overflow-y: auto;
  background: #ffffff;
}

.toc-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  margin-bottom: 12px;
  padding-left: 8px;
}

.toc-nav {
  list-style: none;
}

.toc-nav li {
  margin-bottom: 6px;
}

.toc-link {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.4;
  display: block;
  padding: 4px 8px;
  border-radius: 4px;
  border-left: 2px solid transparent;
  transition: all 0.15s ease;
}

.toc-link:hover {
  color: var(--text-primary);
}

.toc-link.active {
  color: var(--text-primary);
  font-weight: 600;
  border-left-color: var(--text-primary);
}

.docs-footer {
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--text-primary);
}

@media (max-width: 1100px) {
  .docs-toc {
    display: none;
  }
}

@media (max-width: 820px) {
  .mobile-menu-btn {
    display: block;
  }

  .header-center {
    display: none;
  }

  .docs-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    background: #ffffff;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.08);
  }

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

  .docs-main {
    padding: 24px 20px 60px 20px;
  }
}
