:root {
  color-scheme: dark;
  --bg: #0b0f15;
  --panel: #131922;
  --panel-2: #18202b;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f4f7fb;
  --muted: #95a0af;
  --accent: #52d9e8;
  --gold: #e8bd70;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: radial-gradient(circle at 72% 0%, rgba(82, 217, 232, 0.13), transparent 34%), var(--bg);
  color: var(--text);
}

a {
  color: inherit;
}

.docs-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 250px minmax(0, 1fr);
}

.docs-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: rgba(11, 15, 21, 0.82);
  padding: 24px 18px;
  backdrop-filter: blur(22px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 34px;
  text-decoration: none;
}

.brand span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(145deg, #151b24, #050608);
  box-shadow: inset 0 0 0 1px var(--line);
  color: #fff;
  font-size: 22px;
  font-weight: 900;
}

.brand strong {
  font-size: 17px;
}

.docs-nav nav {
  display: grid;
  gap: 6px;
}

.docs-nav nav a {
  border-radius: 8px;
  color: var(--muted);
  padding: 10px 12px;
  text-decoration: none;
}

.docs-nav nav a:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.docs-content {
  width: 100%;
  max-width: none;
  padding: 48px 56px 72px;
}

.hero {
  margin-bottom: 22px;
  padding: 28px 0 18px;
}

.hero p,
.hero h1,
.card h2,
.card h3,
.card p {
  margin: 0;
}

.hero p {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin-top: 10px;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}

.hero-actions code,
.hero-actions a {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  padding: 11px 13px;
  text-decoration: none;
}

.hero-actions a {
  background: var(--accent);
  color: #061015;
  font-weight: 800;
}

.card {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(19, 25, 34, 0.86);
  padding: 22px;
}

.card h2 {
  margin-bottom: 12px;
  font-size: 23px;
}

.card h3 {
  margin-bottom: 6px;
  font-size: 15px;
}

.card p {
  color: var(--muted);
  line-height: 1.72;
}

pre {
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: #080b10;
  padding: 14px;
}

code {
  color: #d8ecff;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

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

th {
  color: var(--muted);
  font-size: 12px;
}

td {
  color: #dce3ee;
  font-size: 14px;
  line-height: 1.55;
}

td b {
  color: var(--gold);
}

.model-table-legacy {
  display: none;
}

.model-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 10px;
}

.model-catalog-toolbar {
  position: sticky;
  top: 14px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 10px;
  padding: 9px;
  border: 1px solid rgba(87, 215, 224, 0.2);
  border-radius: 10px;
  background: rgba(10, 15, 22, 0.94);
  backdrop-filter: blur(10px);
}

.model-catalog-search {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #f4f8ff;
  padding: 9px 11px;
}

.model-catalog-search:focus,
.model-detail-button:focus,
.model-detail-close:focus {
  outline: 2px solid #9ef6fb;
  outline-offset: 2px;
}

.model-catalog-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.model-card-loading,
.model-doc-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 15, 22, 0.78);
}

.model-card-loading {
  grid-column: 1 / -1;
  padding: 18px;
  color: var(--muted);
}

.model-doc-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
  min-height: 190px;
  padding: 13px;
}

.model-doc-head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.model-avatar {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(87, 215, 224, 0.24), rgba(246, 192, 86, 0.18));
  color: #eff8ff;
  font-size: 20px;
  font-weight: 900;
}

.model-title-block {
  min-width: 0;
}

.model-title-block h3 {
  margin: 0 0 4px;
  overflow-wrap: anywhere;
  color: #f4f8ff;
  font-size: 16px;
}

.model-title-block code {
  color: #9fd2ff;
}

.model-doc-desc {
  min-height: 42px;
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: #d8e0eb;
}

.model-detail-row {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
}

.model-detail-button,
.model-detail-close {
  border: 1px solid rgba(87, 215, 224, 0.35);
  border-radius: 7px;
  background: rgba(87, 215, 224, 0.08);
  color: #9ef6fb;
  cursor: pointer;
  padding: 6px 10px;
}

.model-detail-dialog {
  width: min(680px, calc(100% - 28px));
  max-height: 86vh;
  border: 1px solid rgba(87, 215, 224, 0.3);
  border-radius: 12px;
  background: #0d1624;
  color: #e7edf6;
  padding: 0;
}

.model-detail-dialog::backdrop {
  background: rgba(2, 6, 23, 0.72);
}

.model-detail-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.model-detail-head > div {
  min-width: 0;
  flex: 1;
}

.model-detail-head h3 {
  margin: 0 0 4px;
  overflow-wrap: anywhere;
}

.model-detail-body {
  overflow: auto;
  max-height: calc(86vh - 78px);
  padding: 18px;
}

.model-detail-body p {
  color: #d8e0eb;
}

.model-detail-body .model-meta-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.model-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.model-chip {
  border-radius: 999px;
  background: rgba(87, 215, 224, 0.14);
  color: #9ef6fb;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
}

.model-price-box {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-radius: 8px;
  background: rgba(246, 192, 86, 0.1);
  padding: 10px 12px;
}

.model-price-box > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.model-price-box strong {
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: var(--gold);
  text-align: right;
}

.model-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.model-meta-grid div {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 9px;
}

.model-meta-grid dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.model-meta-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: #e7edf6;
  font-size: 13px;
  line-height: 1.45;
}

.model-meta-wide {
  grid-column: 1 / -1;
}

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

.grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 14px;
}

@media (max-width: 840px) {
  .docs-shell {
    display: block;
  }

  .docs-nav {
    position: static;
    height: auto;
  }

  .docs-content {
    width: 100%;
    padding: 28px 18px 48px;
  }

  .model-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .model-card-grid {
    grid-template-columns: 1fr;
  }

  .model-catalog-toolbar {
    top: 8px;
    align-items: stretch;
    flex-direction: column;
  }

  .model-catalog-count {
    white-space: normal;
  }

  .model-meta-grid {
    grid-template-columns: 1fr;
  }

  .model-detail-body .model-meta-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 561px) and (max-width: 840px) {
  .model-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
