.model-api-page {
  --page-bg: #060c14;
  --panel-bg: #081121;
  --panel-border: rgba(123, 147, 173, 0.22);
  --line-soft: rgba(113, 143, 174, 0.22);
  --text-main: #edf2fa;
  --text-muted: #96a9bf;
  --text-soft: #6f859e;
  --accent: #25d6b4;
  --accent-weak: rgba(37, 214, 180, 0.18);
  --select-bg: linear-gradient(180deg, rgba(8, 16, 28, 0.97) 0%, rgba(5, 11, 20, 0.98) 100%);
  --select-border: rgba(130, 154, 184, 0.34);
  --select-border-hover: rgba(37, 214, 180, 0.5);
  --select-border-focus: rgba(37, 214, 180, 0.7);
  --scrollbar-track: rgba(5, 12, 22, 0.82);
  --scrollbar-thumb: linear-gradient(180deg, rgba(55, 184, 167, 0.86), rgba(35, 122, 151, 0.88));
  --scrollbar-thumb-hover: linear-gradient(180deg, rgba(85, 209, 186, 0.95), rgba(49, 146, 175, 0.96));
  --code-bg: #111827;
  position: relative;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 24px;
  color: var(--text-main);
  background:
    radial-gradient(circle at 90% -12%, rgba(20, 46, 87, 0.42), transparent 34%),
    radial-gradient(circle at 12% 8%, rgba(18, 75, 78, 0.22), transparent 30%),
    linear-gradient(180deg, #050a12 0%, #060d18 100%);
  font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  color-scheme: dark;
  scrollbar-width: thin;
  scrollbar-color: rgba(55, 184, 167, 0.9) var(--scrollbar-track);
  overflow-anchor: none;
}

.model-api-page,
.model-api-page * {
  scrollbar-width: thin;
  scrollbar-color: rgba(55, 184, 167, 0.9) var(--scrollbar-track);
}

.model-api-page *::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.model-api-page *::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: 999px;
}

.model-api-page *::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 999px;
  border: 2px solid rgba(6, 13, 22, 0.9);
}

.model-api-page *::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

.model-api-page::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 7px;
  opacity: 0.22;
}

.model-api-page__ambient {
  position: absolute;
  border-radius: 999px;
  filter: blur(90px);
  pointer-events: none;
  opacity: 0.24;
}

.model-api-page__ambient--one {
  top: -16%;
  right: 3%;
  width: 360px;
  height: 360px;
  background: rgba(20, 126, 140, 0.32);
}

.model-api-page__ambient--two {
  bottom: -16%;
  left: 35%;
  width: 460px;
  height: 460px;
  background: rgba(18, 58, 117, 0.34);
}

.model-api-page__header,
.model-api-page__layout {
  position: relative;
  z-index: 1;
}

.model-api-page__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.model-api-page__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 8px 12px;
  background: rgba(8, 16, 30, 0.88);
  color: var(--text-main);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.model-api-page__back:hover {
  border-color: rgba(37, 214, 180, 0.4);
  transform: translateY(-1px);
}

.model-api-page__header-copy h1 {
  margin: 0;
  font-size: clamp(1.62rem, 1.5vw + 1.2rem, 2.2rem);
}

.model-api-page__header-copy p {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 1.02rem;
}

.model-api-page__layout {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.model-api-page__layout.is-playground {
  grid-template-rows: minmax(0, 1fr);
}

.model-api-page__layout.is-playground .model-api-page__model-top {
  display: none;
}

.model-api-page__model-top,
.model-api-page__detail {
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(9, 17, 33, 0.92) 0%, rgba(7, 13, 24, 0.96) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 20px 48px rgba(0, 0, 0, 0.26);
}

.model-api-page__model-top {
  padding: 12px 14px;
  overflow-anchor: none;
}

.model-api-page__model-top-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 10px;
  border-bottom: 1px solid var(--line-soft);
}

.model-api-page__model-top-head strong {
  font-size: 1.62rem;
  color: #22e0bf;
  font-weight: 600;
}

.model-api-page__model-top-head span {
  color: var(--accent);
  font-size: 0.92rem;
}

.model-api-page__model-chip-list {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  overflow-anchor: none;
}

.model-api-page__model-chip {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 180px;
  max-width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.01);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.model-api-page__model-chip:hover {
  border-color: rgba(37, 214, 180, 0.38);
}

.model-api-page__model-chip.is-active {
  border-color: rgba(37, 214, 180, 0.52);
  background: rgba(59, 69, 75, 0.68);
}

.model-api-page__model-chip span {
  font-size: 0.86rem;
  color: rgba(212, 222, 236, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.model-api-page__model-chip svg {
  flex: 0 0 13px;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.model-api-page__model-chip svg.is-active {
  opacity: 1;
}

.model-api-page__detail {
  padding: 18px;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

.model-api-page__detail-head {
  border-bottom: 1px solid var(--line-soft);
}

.model-api-page__detail-head--tight {
  padding-bottom: 10px;
}

.model-api-page__top-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.model-api-page__top-tab {
  border: none;
  border-bottom: 2px solid transparent;
  padding: 6px 4px;
  background: transparent;
  color: rgba(201, 214, 232, 0.74);
  font-size: 1rem;
  cursor: pointer;
}

.model-api-page__top-tab--external {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.model-api-page__top-tab--external svg {
  flex: 0 0 auto;
  opacity: 0.84;
}

.model-api-page__top-tab.is-active {
  color: var(--text-main);
  border-bottom-color: var(--accent);
}

.model-api-page__detail-kicker {
  display: inline-block;
  color: rgba(150, 170, 194, 0.85);
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.model-api-page__detail-head h2 {
  margin: 8px 0 0;
  font-size: 0.94rem;
}

.model-api-page__playground-layout {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 480px minmax(0, 1fr);
  gap: 12px;
}

.model-api-page__playground-panel {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(4, 8, 16, 0.64);
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.model-api-page__playground-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.model-api-page__playground-panel-head h3 {
  margin: 0;
  font-size: 1.12rem;
}

.model-api-page__playground-panel-head--result h3 {
  font-size: 1.2rem;
}

.model-api-page__playground-result-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.model-api-page__playground-download-btn {
  min-height: 32px;
  padding: 0 12px;
  font-size: 0.82rem;
}

.model-api-page__playground-form {
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px 14px;
}

.model-api-page__playground-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.model-api-page__playground-field-tip {
  margin: -2px 0 0;
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.model-api-page__playground-field span {
  color: #e1eaf8;
  font-size: 0.84rem;
  font-weight: 600;
}

.model-api-page__playground-field span em {
  color: #ff6b81;
  font-style: normal;
  margin-right: 2px;
}

.model-api-page__playground-field input,
.model-api-page__playground-field textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(7, 13, 24, 0.95);
  color: #e5eef9;
  padding: 8px 10px;
  font-size: 0.84rem;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.model-api-page__playground-field select,
.model-api-page__docs-toc-head select {
  min-height: 38px;
  border-radius: 12px;
  border: 1px solid var(--select-border);
  background:
    linear-gradient(180deg, rgba(13, 28, 41, 0.95) 0%, rgba(8, 18, 30, 0.98) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M4 7.5L10 13.5L16 7.5' stroke='%23c9dff7' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: center, right 12px center;
  background-size: 100% 100%, 13px 13px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 4px 14px rgba(0, 0, 0, 0.22);
  color: #e7f1ff;
  padding: 0 38px 0 12px;
  font-size: 0.84rem;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.model-api-page__playground-field select {
  width: 100%;
}

.model-api-page__docs-toc-head select {
  min-width: 126px;
}

.model-api-page__playground-field select:hover,
.model-api-page__docs-toc-head select:hover {
  border-color: var(--select-border-hover);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 8px 18px rgba(0, 0, 0, 0.26);
}

.model-api-page__playground-field textarea {
  min-height: 124px;
  line-height: 1.52;
  resize: vertical;
}

.model-api-page__playground-field select:focus,
.model-api-page__docs-toc-head select:focus {
  outline: none;
  border-color: var(--select-border-focus);
  box-shadow:
    0 0 0 2px rgba(37, 214, 180, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.model-api-page__playground-field select:disabled,
.model-api-page__docs-toc-head select:disabled {
  cursor: not-allowed;
  opacity: 0.64;
  color: rgba(206, 221, 238, 0.7);
}

.model-api-page__playground-field select option,
.model-api-page__docs-toc-head select option {
  background: #101c2c;
  color: #ecf5ff;
}

.model-api-page__playground-field input:focus,
.model-api-page__playground-field textarea:focus {
  outline: none;
  border-color: rgba(37, 214, 180, 0.62);
  box-shadow: 0 0 0 3px rgba(37, 214, 180, 0.12);
}

.model-api-page__playground-submit {
  border: 1px solid rgba(37, 214, 180, 0.4);
  border-radius: 10px;
  min-height: 34px;
  background: linear-gradient(140deg, rgba(14, 58, 53, 0.95), rgba(10, 34, 40, 0.94));
  color: #dbf8f2;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.model-api-page__playground-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(37, 214, 180, 0.64);
}

.model-api-page__playground-submit:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.model-api-page__playground-hint {
  margin: 0;
  color: rgba(163, 182, 207, 0.9);
  font-size: 0.76rem;
}

.model-api-page__playground-result-stage {
  min-height: 0;
  overflow: auto;
  margin: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: #04070e;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.model-api-page__playground-result-stage p {
  margin: 0;
  color: rgba(154, 176, 204, 0.88);
  font-size: 0.84rem;
}

.model-api-page__playground-result-stage img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.model-api-page__playground-meta {
  padding: 10px 12px 12px;
  display: grid;
  gap: 6px;
}

.model-api-page__playground-meta p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #dce8f8;
  font-size: 0.84rem;
}

.model-api-page__playground-meta p span {
  color: rgba(152, 173, 201, 0.92);
}

.model-api-page__playground-meta p strong {
  color: #ecf4ff;
}

.model-api-page__playground-meta code {
  display: inline-flex;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #b7ffef;
}

.model-api-page__docs-layout {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 12px;
}

.model-api-page__docs-toc {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(4, 8, 16, 0.64);
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.model-api-page__docs-toc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.model-api-page__docs-toc-head h3 {
  margin: 0;
  font-size: 1.65rem;
}

.model-api-page__docs-chapters {
  overflow-y: auto;
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-content: flex-start;
}

.model-api-page__docs-chapter {
  margin-bottom: 0;
  border: none;
  background: transparent;
}

.model-api-page__docs-chapter-trigger {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
  padding: 10px 13px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(233, 241, 252, 0.92);
  font-size: 0.94rem;
  font-weight: 600;
  cursor: pointer;
}

.model-api-page__docs-chapter.is-active .model-api-page__docs-chapter-trigger {
  background: linear-gradient(90deg, rgba(32, 118, 104, 0.56) 0%, rgba(27, 83, 70, 0.78) 100%);
  border-color: rgba(37, 214, 180, 0.38);
  color: #29e2c0;
}

.model-api-page__docs-chapter svg {
  color: rgba(200, 215, 236, 0.86);
  transition: transform 0.2s ease;
}

.model-api-page__docs-chapter.is-active svg {
  color: #a9f6e8;
}

.model-api-page__docs-chapter ul {
  margin: 0;
  padding: 6px 0 6px;
}

.model-api-page__docs-chapter li {
  list-style: none;
}

.model-api-page__docs-chapter a {
  display: block;
  margin-left: 12px;
  padding: 7px 11px;
  border-radius: 10px;
  color: #a4b7cd;
  text-decoration: none;
  font-size: 0.88rem;
}

.model-api-page__docs-chapter a:hover {
  color: #d8e4f8;
  background: rgba(255, 255, 255, 0.04);
}

.model-api-page__docs-chapter a.is-current {
  background: rgba(90, 60, 170, 0.34);
  color: #bda1ff;
}

.model-api-page__docs-content {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(4, 8, 16, 0.66);
  min-height: 0;
  overflow-y: auto;
  scroll-behavior: smooth;
  padding: 16px;
}

.model-api-page__docs-content-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 14px;
}

.model-api-page__docs-content-head h3 {
  margin: 0;
  font-size: 2rem;
}

.model-api-page__docs-content-head p {
  margin: 12px 0 0;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.model-api-page__copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(37, 214, 180, 0.28);
  border-radius: 9px;
  padding: 8px 10px;
  background: rgba(8, 26, 28, 0.74);
  color: #54e7ca;
  font-size: 0.9rem;
  cursor: pointer;
}

.model-api-page__copy-btn:disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

.model-api-page__docs-section {
  padding-top: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 14px;
}

.model-api-page__docs-section:last-child {
  border-bottom: none;
}

.model-api-page__docs-section h4 {
  margin: 0 0 12px;
  font-size: 1.5rem;
  line-height: 1.3;
}

.model-api-page__docs-section h5 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  line-height: 1.35;
}

.model-api-page__docs-section p {
  margin: 0 0 12px;
  color: var(--text-muted);
  line-height: 1.65;
  font-size: 1rem;
}

.model-api-page__docs-section code {
  font-family: 'SFMono-Regular', 'Menlo', 'Consolas', monospace;
  font-size: 0.88em;
  color: #d0f2ed;
}

.model-api-page__api-key-console-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(37, 214, 180, 0.34);
  border-radius: 9px;
  padding: 7px 10px;
  color: #27e4c2;
  background: rgba(10, 28, 30, 0.56);
  font-size: 0.86rem;
  cursor: pointer;
}

.model-api-page__docs-section--muted h4,
.model-api-page__docs-section--muted h5 {
  opacity: 0.86;
}

.model-api-page__code-block {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(180deg, #1b202a 0%, #111722 100%);
}

.model-api-page__code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.model-api-page__code-lang {
  color: rgba(232, 239, 251, 0.88);
  font-size: 0.88rem;
  text-transform: lowercase;
}

.model-api-page__code-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(37, 214, 180, 0.28);
  border-radius: 7px;
  padding: 4px 8px;
  background: rgba(8, 26, 28, 0.74);
  color: #54e7ca;
  font-size: 0.75rem;
  cursor: pointer;
}

.model-api-page__code-copy-btn:hover {
  border-color: rgba(37, 214, 180, 0.52);
}

.model-api-page__code-block pre {
  margin: 0;
  padding: 14px;
  color: #37d6b3;
  font-family: 'SFMono-Regular', 'Menlo', 'Consolas', monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.model-api-page__table-wrap {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  margin: 8px 0 14px;
}

.model-api-page__table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(9, 17, 30, 0.78);
}

.model-api-page__table th,
.model-api-page__table td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.82rem;
  line-height: 1.6;
}

.model-api-page__table th {
  color: rgba(224, 235, 248, 0.92);
  background: rgba(255, 255, 255, 0.03);
}

.model-api-page__table td {
  color: rgba(180, 196, 216, 0.95);
}

.model-api-page__table tr:last-child td {
  border-bottom: none;
}

.model-api-page__toast {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 30;
  border: 1px solid rgba(29, 227, 192, 0.4);
  border-radius: 8px;
  padding: 7px 10px;
  background: rgba(7, 29, 31, 0.92);
  color: #2be8c7;
  font-size: 0.82rem;
}

.model-api-page__toast.is-error {
  border-color: rgba(255, 141, 141, 0.5);
  color: #ffc2c2;
}

.hidden {
  display: none !important;
}

@media (max-width: 1180px) {
  .model-api-page {
    height: auto;
    overflow: visible;
    padding: 16px;
  }

  .model-api-page__layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .model-api-page__docs-layout {
    grid-template-columns: 1fr;
  }

  .model-api-page__playground-layout {
    grid-template-columns: 1fr;
  }

  .model-api-page__playground-result-stage {
    min-height: 380px;
  }

  .model-api-page__docs-toc {
    max-height: 340px;
  }
}
