/* Inner pages: models, guide, and the console-written documents (About, terms, privacy).
   Builds on site.css (tokens, header, buttons, pills, spotlight). */

/* ---------- page hero ---------- */
/* The glow is clipped at the sides only: downwards it fades out behind the content below.
   (Clipping at the sides matters on phones, where anything wider widens the whole page.) */
.page-hero { position: relative; overflow-x: clip; padding: clamp(140px, 18vh, 190px) 0 clamp(36px, 5vw, 64px); }
.page-hero__glow {
  position: absolute; left: 50%; top: 4%; width: min(1300px, 140vw); height: 820px; transform: translateX(-50%); pointer-events: none;
  background: radial-gradient(closest-side, rgba(104, 70, 255, 0.5), rgba(76, 44, 210, 0.2) 50%, transparent 78%);
  filter: blur(30px); animation: hero-breathe 9s ease-in-out infinite alternate;
}
.page-hero ~ * { position: relative; }
.page-hero--doc .page-hero__glow { left: 38%; top: 20%; width: min(1100px, 130vw); height: 900px; }
@keyframes hero-breathe { from { opacity: 0.75; } to { opacity: 1; } }
.page-hero__inner { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; }
.container--doc { position: relative; width: min(100% - 48px, 980px); margin-inline: auto; }

.page-title {
  margin-top: 26px; font-weight: 500; font-size: clamp(2.5rem, 6vw, 4.6rem); line-height: 1.04; letter-spacing: -0.035em;
  background: linear-gradient(180deg, #ffffff 30%, #c9c3e6 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.page-title--doc { font-size: clamp(2.8rem, 7.5vw, 5.6rem); padding-bottom: 0.06em; }
.page-lead { max-width: 640px; margin-top: 20px; color: var(--muted); font-size: 1.08rem; }
:lang(ja) .page-title, :lang(zh-CN) .page-title, :lang(zh-TW) .page-title { letter-spacing: -0.01em; }

.pill--badge { padding: 5px 16px 5px 5px; }
.pill__badge {
  padding: 4px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #fff;
  background: linear-gradient(180deg, #6c4cf5, #8059e3); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.15);
}

.facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; margin-top: 26px; color: var(--muted); font-size: 0.92rem; }
.fact { display: inline-flex; align-items: center; gap: 8px; }
.fact::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--violet-400); box-shadow: 0 0 8px var(--glow); }

.section--flush { padding-top: 0; }
.spotlight--compact { padding-block: clamp(52px, 7vw, 84px); }

/* ---------- search and filters ---------- */
.search { position: relative; display: flex; align-items: center; }
.search > .icon { position: absolute; left: 14px; width: 16px; height: 16px; color: var(--dim); pointer-events: none; }
.search__input {
  width: 100%; height: 44px; padding: 0 14px 0 40px; border: 0; border-radius: 12px; color: var(--text); font: inherit; font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.035); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow 0.2s, background-color 0.2s;
}
.search__input::placeholder { color: var(--dim); }
.search__input:focus { outline: none; background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 1px var(--violet-400), 0 0 0 4px rgba(139, 108, 255, 0.15); }
.search__input::-webkit-search-cancel-button { filter: invert(0.7); }

.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border: 0; border-radius: 999px; cursor: pointer;
  font-size: 0.88rem; color: #d6d6dc; background: rgba(255, 255, 255, 0.03); box-shadow: inset 0 0 0 1px var(--line);
  transition: color 0.2s, background-color 0.2s, box-shadow 0.2s;
}
.filter-chip:hover { color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.filter-chip[aria-pressed="true"] { color: #fff; background: rgba(139, 108, 255, 0.16); box-shadow: inset 0 0 0 1px rgba(139, 108, 255, 0.55); }
.filter-chip__count { min-width: 22px; padding: 1px 6px; border-radius: 999px; font-size: 0.74rem; text-align: center; color: var(--muted); background: rgba(255, 255, 255, 0.06); }
.filter-chip__ratio { font-size: 0.74rem; color: var(--violet-300); font-variant-numeric: tabular-nums; }
.catalog__groups { grid-column: 1 / -1; padding-top: 14px; border-top: 1px solid var(--line); }
.group-cell { white-space: nowrap; }
.group-cell__name { color: var(--text); }
.group-cell__ratio { margin-left: 8px; font-size: 0.8rem; color: var(--violet-300); font-variant-numeric: tabular-nums; }

/* ---------- models: price table ---------- */
.catalog__toolbar { display: grid; grid-template-columns: minmax(220px, 320px) 1fr; align-items: start; gap: 16px 24px; }
.catalog__panel {
  margin-top: 20px; overflow-x: auto; border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
  box-shadow: inset 0 0 0 1px var(--line);
}
.price-table { width: 100%; min-width: 760px; border-collapse: separate; border-spacing: 0; font-size: 0.95rem; }
.price-table th {
  padding: 14px 18px; text-align: left; font-weight: 500; font-size: 0.82rem; color: var(--muted); white-space: nowrap;
  border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.02);
}
.price-table td { padding: 16px 18px; vertical-align: top; border-bottom: 1px solid var(--line); }
.price-table tbody tr:last-child td { border-bottom: 0; }
.price-table tbody tr { transition: background-color 0.2s; }
.price-table tbody tr:hover { background: rgba(139, 108, 255, 0.05); }
.price-table .is-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.price-table th.is-num .sort { margin-left: auto; text-align: right; }
.muted { color: var(--dim); }

.sort {
  display: inline-grid; grid-template-columns: auto auto; align-items: center; column-gap: 6px; padding: 0; border: 0;
  background: none; color: inherit; font: inherit; cursor: pointer; text-align: left;
}
.sort:hover { color: var(--text); }
.sort__unit { grid-column: 1; font-size: 0.7rem; color: var(--dim); }
.sort__icon { grid-row: 1; grid-column: 2; width: 14px; height: 14px; opacity: 0.35; transition: transform 0.2s, opacity 0.2s; }
.sort__icon.is-active { opacity: 1; color: var(--violet-300); transform: rotate(180deg); }
.sort__icon.is-active.is-desc { transform: none; }

.model-cell { min-width: 260px; }
.model-cell__name { display: flex; align-items: center; gap: 10px; }
.model-cell__name code { font-family: var(--mono); font-size: 0.94rem; color: var(--text); }
.model-cell__dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--dot, #8b6cff); box-shadow: 0 0 10px var(--dot, #8b6cff); }
.model-cell__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; padding-left: 18px; font-size: 0.82rem; color: var(--muted); }
.model-cell__desc { max-width: 52ch; margin-top: 6px; padding-left: 18px; font-size: 0.86rem; color: var(--dim); }
.tag { padding: 1px 8px; border-radius: 999px; font-size: 0.74rem; color: var(--violet-300); background: rgba(139, 108, 255, 0.1); }
.endpoints { display: flex; flex-wrap: wrap; gap: 6px; }
.endpoint { padding: 3px 9px; border-radius: 8px; font-family: var(--mono); font-size: 0.74rem; color: #d6d6dc; background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 1px var(--line); }
[data-family="Qwen"] { --dot: #8b6cff; }
[data-family="GLM"] { --dot: #60a5fa; }
[data-family="DeepSeek"] { --dot: #38bdf8; }
[data-family="Kimi"] { --dot: #e879f9; }
[data-family="MiniMax"] { --dot: #f472b6; }
[data-family="Doubao"] { --dot: #2dd4bf; }
[data-family="Hunyuan"] { --dot: #facc15; }
[data-family="MiMo"] { --dot: #fb923c; }

.copy {
  display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none; border: 0; border-radius: 8px; cursor: pointer;
  color: var(--dim); background: transparent; transition: color 0.2s, background-color 0.2s;
}
.copy .icon { width: 15px; height: 15px; }
.copy:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.copy.is-done { color: #4ade80; }

.catalog__state { padding: 48px 24px; text-align: center; color: var(--muted); }
.catalog__note { max-width: 760px; margin-top: 14px; font-size: 0.86rem; color: var(--dim); }

/* ---------- guide: documentation layout ---------- */
.docs {
  position: relative; display: grid; grid-template-columns: 250px minmax(0, 1fr) 210px; gap: 56px;
  width: min(100% - 48px, 1320px); margin-inline: auto; padding-top: 116px; min-height: 100vh;
}
.docs__glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(55% 45% at 78% 0%, rgba(84, 52, 210, 0.28), transparent 70%), radial-gradient(40% 40% at 0% 100%, rgba(60, 30, 160, 0.16), transparent 70%);
}
.docs__sidebar {
  position: sticky; top: 104px; align-self: start; max-height: calc(100vh - 124px); overflow-y: auto; padding: 2px 6px 24px 2px;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}
.search--docs { margin-bottom: 8px; }
.docs__group-title { margin: 26px 0 10px; font-size: 0.92rem; font-weight: 600; color: var(--text); }
.docs__nav ul { border-left: 1px solid var(--line); }
.docs__nav-link {
  display: block; margin-left: -1px; padding: 6px 0 6px 16px; border-left: 1px solid transparent;
  font-size: 0.93rem; color: var(--muted); transition: color 0.2s, border-color 0.2s;
}
.docs__nav-link:hover { color: var(--text); }
.docs__nav-link[aria-current="page"] { color: var(--violet-300); border-left-color: var(--violet-400); }
.docs__empty { margin-top: 20px; font-size: 0.9rem; color: var(--dim); }
.docs__links { display: grid; gap: 4px; margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); }
.docs__link { display: flex; align-items: center; justify-content: space-between; padding: 6px 2px; font-size: 0.9rem; color: var(--muted); }
.docs__link:hover { color: var(--text); }
.docs__menu { display: none; }

.docs__article { min-width: 0; max-width: 740px; padding-bottom: 96px; }
.docs__eyebrow { font-size: 0.92rem; font-weight: 600; color: var(--violet-400); }
.docs__title { margin-top: 8px; font-size: clamp(2.1rem, 4vw, 2.75rem); font-weight: 600; line-height: 1.15; letter-spacing: -0.025em; }
.docs__desc { margin-top: 12px; font-size: 1.12rem; color: var(--muted); }
.docs__body { margin-top: 36px; }

/* Shared reading styles for the guide and the console's documents. */
.docs__body, .prose { color: #cdcdd6; font-size: 1rem; line-height: 1.78; overflow-wrap: break-word; }
.docs__body > * + *, .prose > * + * { margin-top: 1.05em; }
.docs__body h2, .prose h2 { margin-top: 2.4em; font-size: 1.55rem; font-weight: 600; line-height: 1.3; letter-spacing: -0.015em; color: var(--text); scroll-margin-top: 100px; }
.docs__body h3, .prose h3 { margin-top: 1.9em; font-size: 1.18rem; font-weight: 600; color: var(--text); scroll-margin-top: 100px; }
.docs__body h4, .prose h4 { margin-top: 1.6em; font-size: 1rem; font-weight: 600; color: var(--text); }
.docs__body strong, .prose strong { color: var(--text); font-weight: 600; }
.docs__body a, .prose a { color: var(--violet-300); text-decoration: underline; text-decoration-color: rgba(167, 139, 250, 0.4); text-underline-offset: 3px; }
.docs__body a:hover, .prose a:hover { text-decoration-color: currentColor; }
.docs__body ul, .prose ul, .docs__body ol, .prose ol { padding-left: 1.4em; }
.docs__body ul, .prose ul { list-style: disc; }
.docs__body ol, .prose ol { list-style: decimal; }
.docs__body li + li, .prose li + li { margin-top: 0.4em; }
.docs__body li::marker, .prose li::marker { color: var(--violet-400); }
.docs__body :not(pre) > code, .prose :not(pre) > code {
  padding: 0.12em 0.42em; border-radius: 6px; font-family: var(--mono); font-size: 0.86em; color: #e6e1ff;
  background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px var(--line);
  overflow-wrap: anywhere; /* long URLs wrap instead of widening the page */
}
.docs__body hr, .prose hr { border: 0; border-top: 1px solid var(--line); margin-block: 2em; }
.docs__body blockquote, .prose blockquote { padding: 2px 0 2px 20px; border-left: 3px solid var(--line-strong); color: var(--text); font-weight: 500; }
.docs__body pre, .prose pre { overflow-x: auto; }

.table-wrap { overflow-x: auto; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 0.92rem; line-height: 1.6; }
.table-wrap th { padding: 10px 14px 10px 0; text-align: left; font-weight: 600; color: var(--text); border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.table-wrap td { padding: 11px 14px 11px 0; vertical-align: top; border-bottom: 1px solid var(--line); }
/* Codes in a table stay whole; a narrow screen scrolls the table instead. */
.table-wrap :not(pre) > code { white-space: nowrap; overflow-wrap: normal; }

.callout {
  display: flex; gap: 12px; padding: 14px 16px; border-radius: 14px; color: #d9d6ee;
  background: rgba(139, 108, 255, 0.08); box-shadow: inset 0 0 0 1px rgba(139, 108, 255, 0.28);
}
.callout__icon { width: 18px; height: 18px; margin-top: 4px; color: var(--violet-300); }
.callout__body > * + * { margin-top: 0.6em; }
.callout--warning, .callout--caution { background: rgba(251, 191, 36, 0.07); box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.28); }
.callout--warning .callout__icon, .callout--caution .callout__icon { color: #fbbf24; }

.code { margin-block: 1.4em; overflow: hidden; border-radius: 14px; background: #0b0a12; box-shadow: inset 0 0 0 1px var(--line); }
.code__bar { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 8px 0 14px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); }
.code__label { font-family: var(--mono); font-size: 0.78rem; color: var(--dim); }
.code__tabs { display: flex; gap: 2px; margin-right: auto; }
.code__tab {
  position: relative; height: 42px; padding: 0 10px; border: 0; background: none; cursor: pointer;
  font-size: 0.84rem; color: var(--dim); transition: color 0.2s;
}
.code__tab:hover { color: var(--text); }
.code__tab[aria-selected="true"] { color: var(--text); }
.code__tab[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--violet-400); }
.code__copy { margin-left: auto; }
.code__pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-family: var(--mono); font-size: 0.84rem; line-height: 1.7; color: #e6e6f0; tab-size: 2; }
.code__pre:focus-visible { outline-offset: -2px; border-radius: 0; }

.docs__pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 64px; }
.docs__pager-link {
  display: grid; gap: 4px; padding: 16px 18px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow 0.2s, background-color 0.2s;
}
.docs__pager-link:hover { background: rgba(139, 108, 255, 0.06); box-shadow: inset 0 0 0 1px rgba(139, 108, 255, 0.45); }
.docs__pager-link--next { text-align: right; }
.docs__pager-dir { font-size: 0.8rem; color: var(--dim); }
.docs__pager-title { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); }
.docs__pager-link--next .docs__pager-title { justify-content: flex-end; }

.docs__toc { position: sticky; top: 104px; align-self: start; font-size: 0.88rem; }
.docs__toc-title { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-weight: 500; color: var(--text); }
.docs__toc-list { border-left: 1px solid var(--line); }
.docs__toc-link { display: block; margin-left: -1px; padding: 5px 0 5px 14px; border-left: 1px solid transparent; color: var(--muted); transition: color 0.2s, border-color 0.2s; }
.docs__toc-link:hover { color: var(--text); }
.docs__toc-link.is-active { color: var(--violet-300); border-left-color: var(--violet-400); }

/* ---------- documents written in the console ---------- */
.doc-body { position: relative; padding-bottom: clamp(72px, 9vw, 120px); }
.prose { font-size: 1.04rem; }
.prose h1 { font-size: 2rem; font-weight: 500; color: var(--text); }
.prose h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 500; }
.prose__empty { color: var(--dim); }

/* ---------- FAQ ---------- */
.faq__inner { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.faq__head { position: sticky; top: 110px; display: grid; justify-items: start; gap: 20px; }
.faq__head .display { margin-top: 0; text-align: left; }
.faq__lead { color: var(--muted); }
.faq__list { display: grid; gap: 12px; }
.faq__item { border-radius: 18px; background: #0a0a0e; box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow 0.25s; }
.faq__item[open] { box-shadow: inset 0 0 0 1px rgba(139, 108, 255, 0.35); }
.faq__question {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px; cursor: pointer;
  list-style: none; font-weight: 500; color: var(--text);
}
.faq__question::-webkit-details-marker { display: none; }
.faq__chevron { width: 18px; height: 18px; flex: none; color: var(--muted); transition: transform 0.3s var(--ease); }
.faq__item[open] .faq__chevron { transform: rotate(180deg); color: var(--violet-300); }
.faq__answer { padding: 0 24px 22px; font-size: 0.96rem; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .docs { grid-template-columns: 230px minmax(0, 1fr); gap: 44px; }
  .docs__toc { display: none; }
}
@media (max-width: 900px) {
  .catalog__toolbar { grid-template-columns: 1fr; }
  .docs { display: block; padding-top: 92px; }
  .docs__menu {
    position: sticky; top: 84px; z-index: 30; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px;
    border: 0; border-radius: 999px; cursor: pointer; font-size: 0.9rem; color: var(--text);
    background: rgba(12, 11, 20, 0.92); box-shadow: inset 0 0 0 1px var(--line-strong); backdrop-filter: blur(10px);
  }
  .docs__sidebar {
    position: fixed; top: 77px; left: 0; bottom: 0; z-index: 45; width: min(320px, 86vw); max-height: none; padding: 20px;
    background: #07060d; box-shadow: 1px 0 0 var(--line), 24px 0 60px rgba(0, 0, 0, 0.6);
    transform: translateX(-105%); visibility: hidden; transition: transform 0.3s var(--ease), visibility 0.3s;
  }
  .docs__sidebar.is-open { transform: none; visibility: visible; }
  .docs__article { padding-top: 24px; }
  .faq__inner { grid-template-columns: 1fr; }
  .faq__head { position: static; }
}
@media (max-width: 760px) {
  .page-hero__inner { align-items: flex-start; text-align: left; }
  .facts { justify-content: flex-start; }
  .catalog__panel { overflow: visible; background: none; box-shadow: none; }
  .price-table { min-width: 0; }
  .price-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .price-table, .price-table tbody, .price-table tr, .price-table td { display: block; }
  .price-table tbody { display: grid; gap: 12px; }
  .price-table tbody tr { padding: 16px; border-radius: 18px; background: rgba(255, 255, 255, 0.03); box-shadow: inset 0 0 0 1px var(--line); }
  .price-table td { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 7px 0; border: 0; }
  .price-table td::before { content: attr(data-label); font-size: 0.8rem; color: var(--dim); text-align: left; white-space: normal; }
  .price-table td.model-cell { display: block; min-width: 0; padding-bottom: 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
  .price-table td.model-cell::before { content: none; }
  .docs__pager { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .page-hero__glow { animation: none; }
}
