/* No remote font imports here: this stylesheet is render-blocking on every
   public page, and cross-border Google Fonts fetches can leave Chrome on a
   white page while CSS resolves. Keep public entrypoints on local/system fonts. */

/* INFWAVE_STATIC_FILE_ROLE: PUBLIC_SHELL_AUTHORITY
   Current shared public-site shell for /, /models, /docs, and /transparency. */
/* Shared public frontend shell primitives: page frame, nav, brand, footer, mobile nav. */
body.ifw-public-page {
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: clip !important;
  --ifw-frame-max: 1200px;
  --ifw-page-pad: 32px;
  --ink-950: #0a0e27;
  --ink-900: #0f1730;
  --ink-800: #1a2342;
  --ink-700: #2a3456;
  --ink-500: #4a5374;
  --ink-300: #8d95af;
  --ink-200: #b8becf;
  --ink-100: #d8dce6;
  --ink-50: #eef0f5;
  --ink-25: #f6f7fa;
  --canvas: #f8fafc;
  --canvas-alt: #f1f5f9;
  --amber-700: #8b6d3f;
  --amber-500: #c89d5e;
  --amber-300: #e4c898;
  --ifw-action-700: #de6023;
  --ifw-action-600: #c94e18;
  --ifw-action-100: rgba(222, 96, 35, 0.12);
  --ifw-action-075: rgba(222, 96, 35, 0.085);
  --ifw-action-ring: rgba(222, 96, 35, 0.22);
  --hairline: #e2e8f0;
  --hairline-strong: #cbd5e1;
  --ifw-nav-offset: 80px;
  --ifw-nav-pad-top: 20px;
  --ifw-nav-pad-bottom: 18px;
  --ifw-section-y: 24px;
  --ifw-section-gap: 14px;
  --ifw-card-pad: 14px;
  --ifw-card-gap: 10px;
  --ifw-footer-top: 32px;
  --ifw-footer-bottom: 38px;
  --ifw-h1: 32px;
  --ifw-h2: 22px;
  --ifw-h3: 16px;
  --ifw-body: 14px;
  --ifw-small: 12.5px;
  --ifw-caption: 11px;

  font-family: 'IBM Plex Sans', ui-sans-serif, -apple-system, 'PingFang SC', 'Hiragino Sans GB', sans-serif;
  color: var(--ink-900);
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 42%, #f1f5f9 100%);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
}

body.ifw-public-page .ifw-root {
  width: 100%;
  padding-top: var(--ifw-nav-offset, 80px);
  overflow-x: clip;
}

/* Phase 3: V9-scoped universal reset. Hoisted from 3 V9 subpage inline
   <style> blocks + the :where() block at top of infwave-newapi-home.css.
   V8 (no .ifw-v9-page) keeps browser-default margin/padding for backward
   compatibility with home-public.html.
   Wrap in :where() to keep specificity 0 — otherwise body.ifw-v9-page *
   (0,1,1) would override .ifw-nav (0,1,0) etc and strip intentional padding. */
:where(body.ifw-v9-page),
:where(body.ifw-v9-page *),
:where(body.ifw-v9-page *::before),
:where(body.ifw-v9-page *::after) {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Phase 2: V9 single-source design tokens. Scope: all 5 V9 pages
   (body.ifw-v9-page). V8 (home-public.html) does NOT carry .ifw-v9-page
   and is unaffected. Only override values that differ from body.ifw-public-page;
   shared values inherit. */
body.ifw-v9-page {
  --ifw-frame-max: 1320px;   /* override 1200 */
  --ifw-h1: 30px;            /* override 32 */
  --ifw-h2: 20px;            /* override 22 */
  --ifw-h3: 15px;            /* override 16 */
  --ifw-body: 13px;          /* override 14 */
  --ifw-small: 12px;         /* override 12.5 */
  --ink-950: #0a0e27;        /* extend palette (body.ifw-public-page has no --ink-950) */
  --ink: var(--ink-900);
  --muted: var(--ink-500);
  --soft: var(--ink-25);
  --line: var(--hairline);
  --line-strong: var(--hairline-strong);
  --brand: var(--ifw-action-700);
  --brand-dark: var(--ifw-action-600);
  --panel: #ffffff;
  --dark: #0b1020;
  --dark-2: #10172a;
}

body.ifw-public-page code {
  background: var(--ink-50);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  color: var(--ifw-action-700);
}

body.ifw-public-page a {
  color: var(--ifw-action-700);
  text-decoration: none;
}

body.ifw-public-page a:hover {
  text-decoration: underline;
}

body.ifw-public-page .mono,
body.ifw-public-page .ifw-mono {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-feature-settings: "calt" 0;
}

.ifw-shell {
  width: min(100%, var(--ifw-frame-max));
  margin: 0 auto;
  padding-left: var(--ifw-page-pad);
  padding-right: var(--ifw-page-pad);
}

.ifw-nav {
  width: min(100%, var(--ifw-frame-max));
  margin: 0 auto;
  padding-left: var(--ifw-page-pad);
  padding-right: var(--ifw-page-pad);
}

.ifw-nav-wrap {
  border-bottom: 1px solid rgba(226, 232, 240, 0);
  background: rgba(248, 250, 252, 0.72);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 30;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.ifw-nav-wrap.is-scrolled {
  background: rgba(244, 247, 250, 0.68);
  border-bottom-color: rgba(226, 232, 240, 0);
  box-shadow: none;
}

.ifw-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: var(--ifw-nav-pad-top);
  padding-bottom: var(--ifw-nav-pad-bottom);
}

.ifw-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.ifw-brand-glyph {
  width: 40px;
  height: 40px;
  display: inline-flex;
  /* Force embedded SVG to light rendering even when iOS Safari is in dark mode.
     The brand SVG contains `@media (prefers-color-scheme: dark)` rules that
     would otherwise wash out the logo on iPhone in dark mode. */
  color-scheme: light;
}

.ifw-brand-glyph img,
.ifw-brand-glyph svg {
  width: 100%;
  height: 100%;
  display: block;
}

.ifw-brand-name {
  font-family: 'Plus Jakarta Sans', 'IBM Plex Sans', ui-sans-serif, -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
  font-size: 22px;
  line-height: 1;
  letter-spacing: 0;
  color: var(--ink-900, #0f1730);
}

.ifw-nav-links {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 28px;
}

.ifw-nav-links > a:not(.ifw-nav-cta) {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 17px;
  line-height: 1.28;
  font-weight: 400;
  letter-spacing: 0.005em;
  color: var(--ink-700);
  text-decoration: none;
  position: relative;
  padding: 4px 0;
  transition: color .15s;
}

.ifw-nav-links > a:not(.ifw-nav-cta):hover {
  color: var(--ink-900);
}

.ifw-nav-links > a:not(.ifw-nav-cta)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 2.5px;
  border-radius: 999px;
  background: var(--ifw-action-700);
  opacity: 0;
  transition: opacity .12s ease;
}

.ifw-nav-links > a:not(.ifw-nav-cta):hover::after,
.ifw-nav-links > a.active:not(.ifw-nav-cta)::after {
  opacity: 1;
}

.ifw-nav-links > a.active {
  color: var(--ink-900);
}

.ifw-nav-cta {
  padding: 9px 18px !important;
  background: var(--ink-900);
  color: var(--canvas) !important;
  font-size: 15px !important;
  line-height: 1.25;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 6px;
  transition: background .15s, transform .15s;
}

.ifw-nav-cta:hover {
  background: var(--ifw-action-700);
  transform: translateY(-1px);
  text-decoration: none;
}

.ifw-nav-cta:active {
  background: var(--ifw-action-600);
  transform: translateY(0);
}

.ifw-lang-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: auto;
  color: var(--ink-700) !important;
  font-family: 'IBM Plex Sans', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'PingFang SC', sans-serif;
  font-size: 15px !important;
  line-height: 1.25;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.ifw-lang-switch::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  background: currentColor;
  opacity: 0.78;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10Z'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10Z'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}

.ifw-nav-links > .ifw-lang-switch:not(.ifw-nav-cta)::after {
  display: none;
}

.ifw-lang-switch:hover {
  color: var(--ink-900) !important;
}

.ifw-lang-switch:hover::before {
  opacity: 1;
}

.ifw-nav-utilities {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ifw-nav-utility {
  position: relative;
  flex: 0 0 auto;
}

.ifw-icon-button {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(15, 23, 48, 0.055);
  color: var(--ink-700);
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.ifw-icon-button:hover,
.ifw-nav-utility.is-open .ifw-icon-button {
  border-color: rgba(15, 23, 48, 0.08);
  background: rgba(222, 96, 35, 0.1);
  color: var(--ink-900);
}

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

.ifw-nav-badge {
  position: absolute;
  top: 4px;
  right: 3px;
  min-width: 15px;
  height: 15px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--ifw-action-700);
  color: #fff;
  font-size: 9px;
  line-height: 1;
  font-weight: 700;
}

.ifw-nav-badge[data-count]:not([data-count="0"]) {
  display: inline-flex;
}

.ifw-control-menu,
.ifw-announcement-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 160;
  display: none;
  min-width: 180px;
  padding: 6px;
  border: 1px solid rgba(15,23,48,0.12);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 58px rgba(15,23,48,0.18);
}

.ifw-nav-utility.is-open .ifw-control-menu,
.ifw-nav-utility.is-open .ifw-announcement-panel {
  display: grid;
  gap: 2px;
}

.ifw-control-menu button,
.ifw-control-menu a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 7px 10px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-800);
  font: inherit;
  font-size: 14px;
  line-height: 1.2;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.ifw-control-menu button:hover,
.ifw-control-menu a:hover {
  background: var(--ifw-action-100);
  color: var(--ink-900);
  text-decoration: none;
}

.ifw-control-menu [aria-current="true"]::after {
  content: "✓";
  color: var(--ifw-action-700);
  font-weight: 700;
}

.ifw-announcement-panel {
  width: min(340px, calc(100vw - 32px));
  padding: 12px;
  gap: 10px;
}

.ifw-announcement-panel h3 {
  margin: 0;
  color: var(--ink-900);
  font-size: 14px;
  line-height: 1.3;
  font-weight: 600;
}

.ifw-announcement-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
}

.ifw-announcement-item {
  padding: 9px 10px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--ink-25);
}

.ifw-announcement-item b {
  display: block;
  margin-bottom: 3px;
  color: var(--ink-900);
  font-size: 12px;
}

.ifw-announcement-item p {
  margin: 0;
  color: var(--ink-500);
  font-size: 12px;
  line-height: 1.45;
}

/* ===== Phase 4: V9 Dark Mode — single source ===== */
/* All V9 pages (body.ifw-v9-page) share one dark mode token flip + body bg
   + nav bg + component dark backgrounds + dark logo content swap. V8
   (home-public.html, no .ifw-v9-page) does not receive dark mode here; if
   V8 dark mode is needed later, build a separate body.ifw-public-page.ifw-theme-dark
   block. */

body.ifw-v9-page[data-ifw-theme="dark"],
body.ifw-v9-page.ifw-theme-dark {
  /* dark ink palette */
  --ink-950: #f8fafc;
  --ink-900: #eef2ff;
  --ink-800: #e2e8f0;
  --ink-700: #cbd5e1;
  --ink-500: #94a3b8;
  --ink-300: #64748b;
  --ink-200: #475569;
  --ink-100: #334155;
  --ink-50: #1e293b;
  --ink-25: #111827;
  --canvas: #0b1020;
  --canvas-alt: #111827;
  --hairline: rgba(148, 163, 184, 0.22);
  --hairline-strong: rgba(148, 163, 184, 0.34);
  /* derived re-resolve so .ifw-newapi-root legacy --ink / --muted etc
     pick up the dark values; --panel needs explicit dark value because
     light --panel: #fff is too high contrast. */
  --ink: var(--ink-900);
  --muted: var(--ink-500);
  --soft: var(--ink-25);
  --line: var(--hairline);
  --line-strong: var(--hairline-strong);
  --panel: #101827;
  color: var(--ink-900);
  background:
    radial-gradient(circle at 16% 16%, rgba(222,96,35,0.16), transparent 32%),
    radial-gradient(circle at 82% 9%, rgba(71,107,255,0.14), transparent 30%),
    linear-gradient(180deg, #080c18 0%, #0d1324 46%, #080c18 100%);
}

/* Nav wrap dark frosted bg (V9 only) */
body.ifw-v9-page[data-ifw-theme="dark"] .ifw-nav-wrap,
body.ifw-v9-page.ifw-theme-dark .ifw-nav-wrap {
  background: rgba(8, 12, 24, 0.76);
}

/* Dark mode panel-style component backgrounds (V9 only).
   Folded from the legacy ad-hoc body.ifw-public-page.ifw-theme-dark scope. */
body.ifw-v9-page[data-ifw-theme="dark"] .ifw-icon-button,
body.ifw-v9-page.ifw-theme-dark .ifw-icon-button,
body.ifw-v9-page[data-ifw-theme="dark"] .ifw-control-menu,
body.ifw-v9-page.ifw-theme-dark .ifw-control-menu,
body.ifw-v9-page[data-ifw-theme="dark"] .ifw-announcement-panel,
body.ifw-v9-page.ifw-theme-dark .ifw-announcement-panel,
body.ifw-v9-page[data-ifw-theme="dark"] .ifw-model-card,
body.ifw-v9-page.ifw-theme-dark .ifw-model-card,
body.ifw-v9-page[data-ifw-theme="dark"] .ifw-newapi-model-card,
body.ifw-v9-page.ifw-theme-dark .ifw-newapi-model-card,
body.ifw-v9-page[data-ifw-theme="dark"] .ifw-newapi-market-sidebar button,
body.ifw-v9-page.ifw-theme-dark .ifw-newapi-market-sidebar button,
body.ifw-v9-page[data-ifw-theme="dark"] .ifw-market-toolbar,
body.ifw-v9-page.ifw-theme-dark .ifw-market-toolbar {
  background: rgba(15, 23, 42, 0.94);
}

/* Hero proof tiles + workflow/trust cards dark bg (home unique).
   Without this, cards keep their light-mode #fff bg and become unreadable. */
body.ifw-v9-page[data-ifw-theme="dark"] .ifw-hero-proof span,
body.ifw-v9-page.ifw-theme-dark .ifw-hero-proof span,
body.ifw-v9-page[data-ifw-theme="dark"] .ifw-workflow-grid article,
body.ifw-v9-page.ifw-theme-dark .ifw-workflow-grid article,
body.ifw-v9-page[data-ifw-theme="dark"] .ifw-trust-board article,
body.ifw-v9-page.ifw-theme-dark .ifw-trust-board article {
  background: rgba(15, 23, 42, 0.78);
  border-color: var(--hairline);
}

/* Dark logo swap (V9 only; V8 does not enter dark mode). */
body.ifw-v9-page[data-ifw-theme="dark"] .ifw-brand-glyph img[src$="/infwave-logo-gateway.svg"],
body.ifw-v9-page.ifw-theme-dark .ifw-brand-glyph img[src$="/infwave-logo-gateway.svg"] {
  content: url(/infwave-logo-gateway-dark.svg);
}

/* Phase 5: subpage panel/card backgrounds. Inline <style> blocks on
   models/docs/transparency hard-code white panel backgrounds for light mode.
   This block flips them dark in V9 dark mode so text stays readable.
   Border-color also flipped to dark --hairline (rgba 148,163,184,0.22). */
body.ifw-v9-page[data-ifw-theme="dark"] .docs-summary-card,
body.ifw-v9-page.ifw-theme-dark .docs-summary-card,
body.ifw-v9-page[data-ifw-theme="dark"] .surface-card,
body.ifw-v9-page.ifw-theme-dark .surface-card,
body.ifw-v9-page[data-ifw-theme="dark"] .step,
body.ifw-v9-page.ifw-theme-dark .step,
body.ifw-v9-page[data-ifw-theme="dark"] .panel,
body.ifw-v9-page.ifw-theme-dark .panel,
body.ifw-v9-page[data-ifw-theme="dark"] .schema-panel,
body.ifw-v9-page.ifw-theme-dark .schema-panel,
body.ifw-v9-page[data-ifw-theme="dark"] .contact-card,
body.ifw-v9-page.ifw-theme-dark .contact-card,
body.ifw-v9-page[data-ifw-theme="dark"] .meta-pill,
body.ifw-v9-page.ifw-theme-dark .meta-pill,
body.ifw-v9-page[data-ifw-theme="dark"] .schema-stat,
body.ifw-v9-page.ifw-theme-dark .schema-stat,
body.ifw-v9-page[data-ifw-theme="dark"] .models-link,
body.ifw-v9-page.ifw-theme-dark .models-link,
body.ifw-v9-page[data-ifw-theme="dark"] .models-status-card,
body.ifw-v9-page.ifw-theme-dark .models-status-card,
body.ifw-v9-page[data-ifw-theme="dark"] .docs-search input,
body.ifw-v9-page.ifw-theme-dark .docs-search input {
  background: rgba(15, 23, 42, 0.78);
  border-color: var(--hairline);
}

/* Code blocks: .code-block uses background: var(--ink-900) which in dark mode
   resolves to #eef2ff (white) — reverse intent. Lock to fixed dark bg. */
body.ifw-v9-page[data-ifw-theme="dark"] .code-block,
body.ifw-v9-page.ifw-theme-dark .code-block {
  background: #0b1020;
  border-color: var(--hairline);
}

/* Model catalog & market board panels: shared CSS hardcodes white bg too. */
body.ifw-v9-page[data-ifw-theme="dark"] .docs-model-board,
body.ifw-v9-page.ifw-theme-dark .docs-model-board,
body.ifw-v9-page[data-ifw-theme="dark"] .docs-model-board-head,
body.ifw-v9-page.ifw-theme-dark .docs-model-board-head,
body.ifw-v9-page[data-ifw-theme="dark"] .ifw-market-table-head,
body.ifw-v9-page.ifw-theme-dark .ifw-market-table-head {
  background: rgba(15, 23, 42, 0.78);
  border-color: var(--hairline);
}

/* Phase 5 follow-up (Codex review P0): docs/transparency table-row level
   widgets — <details>/<summary> accordion, .sdk-card, .schema-nav anchors,
   table rows. Inline <style> in docs.html / transparency.html uses #fff
   for these in light mode; V9 dark needs explicit flip. */
body.ifw-v9-page[data-ifw-theme="dark"] details,
body.ifw-v9-page.ifw-theme-dark details,
body.ifw-v9-page[data-ifw-theme="dark"] .sdk-card,
body.ifw-v9-page.ifw-theme-dark .sdk-card,
body.ifw-v9-page[data-ifw-theme="dark"] .schema-nav a,
body.ifw-v9-page.ifw-theme-dark .schema-nav a,
body.ifw-v9-page[data-ifw-theme="dark"] .ifw-table-scroll table,
body.ifw-v9-page.ifw-theme-dark .ifw-table-scroll table,
body.ifw-v9-page[data-ifw-theme="dark"] .ifw-table-scroll tr,
body.ifw-v9-page.ifw-theme-dark .ifw-table-scroll tr,
body.ifw-v9-page[data-ifw-theme="dark"] .ifw-table-scroll td,
body.ifw-v9-page.ifw-theme-dark .ifw-table-scroll td,
body.ifw-v9-page[data-ifw-theme="dark"] .ifw-table-scroll th,
body.ifw-v9-page.ifw-theme-dark .ifw-table-scroll th {
  background: rgba(15, 23, 42, 0.78);
  border-color: var(--hairline);
  color: var(--ink-900);
}

/* docs.html .docs-main details has higher specificity (body.ifw-public-page .docs-main details);
   match it for the dark override. */
body.ifw-v9-page[data-ifw-theme="dark"].ifw-public-page .docs-main details,
body.ifw-v9-page.ifw-theme-dark.ifw-public-page .docs-main details {
  background: rgba(15, 23, 42, 0.78);
  border-color: var(--hairline);
}

body.ifw-v9-page[data-ifw-theme="dark"] .ifw-market-search input,
body.ifw-v9-page.ifw-theme-dark .ifw-market-search input,
body.ifw-v9-page[data-ifw-theme="dark"] .ifw-market-action,
body.ifw-v9-page.ifw-theme-dark .ifw-market-action,
body.ifw-v9-page[data-ifw-theme="dark"] .ifw-market-segment,
body.ifw-v9-page.ifw-theme-dark .ifw-market-segment {
  background: rgba(8, 13, 27, 0.96);
  border-color: var(--hairline);
  color: var(--ink-900);
}

.ifw-foot {
  width: 100%;
  margin-top: var(--ifw-section-y);
  padding: var(--ifw-footer-top) 0 var(--ifw-footer-bottom);
  border-top: 1px solid var(--hairline);
  display: flex;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  align-items: center;
}

.ifw-foot-brand {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--ink-300);
  letter-spacing: 0.1em;
}

.ifw-foot-inner {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  align-items: center;
}

.ifw-foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 14px;
  align-items: center;
}

.ifw-foot-links a {
  color: var(--ink-500);
  text-decoration: none;
  transition: color .15s;
}

.ifw-foot-links a:hover {
  color: var(--ink-900);
}

.ifw-foot .ifw-lang-switch {
  gap: 5px;
  color: var(--ink-500) !important;
  font-family: 'JetBrains Mono', monospace;
  font-size: inherit !important;
  line-height: inherit;
  font-weight: 500;
}

.ifw-foot .ifw-lang-switch::before {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
}

.ifw-foot-mail {
  color: var(--ifw-action-700) !important;
  font-family: 'JetBrains Mono', monospace;
}

@media (max-width: 1040px) {
  body.ifw-public-page {
    --ifw-page-pad: 20px;
    --ifw-section-y: 20px;
    --ifw-section-gap: 12px;
    --ifw-h1: 26px;
    --ifw-h2: 20px;
  }

  body.ifw-public-page .ifw-root {
    --ifw-nav-offset: 116px;
    padding-top: var(--ifw-nav-offset, 116px);
  }

  .ifw-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .ifw-nav-links {
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: visible;
    padding-bottom: 0;
  }

  .ifw-nav-links > a:not(.ifw-nav-cta) {
    font-size: 12px;
    padding: 6px 8px;
    border: 1px solid var(--hairline-strong);
    border-radius: 999px;
    background: #fff;
  }

  .ifw-nav-links > .ifw-lang-switch:not(.ifw-nav-cta) {
    min-width: auto;
    padding-left: 10px;
    padding-right: 10px;
  }

  .ifw-nav-links > a:not(.ifw-nav-cta)::after {
    display: none;
  }

  .ifw-nav-links > a.active {
    background: rgba(15, 23, 48, 0.06);
    border-color: rgba(15, 23, 48, 0.14);
  }

  .ifw-nav-links > .ifw-nav-cta {
    margin-left: auto;
  }

  .ifw-nav-utilities {
    gap: 6px;
    margin-left: auto;
  }

  .ifw-icon-button {
    width: 34px;
    height: 34px;
    background: #fff;
    border-color: var(--hairline-strong);
  }

  .ifw-nav-cta {
    border-color: var(--ink-900) !important;
    background: var(--ink-900) !important;
    color: var(--canvas) !important;
    border-radius: 6px !important;
  }
}

/* ===== Public child-page primitives (shared by /docs and /transparency) ===== */
/* Page header */
body.ifw-public-page .page-header { width: 100%; padding: 16px 0 12px; }
body.ifw-public-page .page-header h1 { font-size: var(--ifw-h1); font-weight: 600; letter-spacing: -0.014em; line-height: 1.18; margin-bottom: 8px; }
body.ifw-public-page .page-header p { font-size: 14px; color: var(--ink-500); max-width: 720px; line-height: 1.56; }

/* Eyebrow / page-tag (uppercase mono lead-in) */
body.ifw-public-page .page-tag,
body.ifw-public-page .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--amber-700);
}
body.ifw-public-page .page-tag {
  padding: 4px 10px 4px 9px;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  background: #fff;
  margin-bottom: 10px;
}
body.ifw-public-page .page-tag::before,
body.ifw-public-page .eyebrow::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--amber-500);
  box-shadow: 0 0 8px var(--amber-500);
}

/* Section primitives */
body.ifw-public-page .section { padding: var(--ifw-section-y) 0; }
body.ifw-public-page .section + .section { border-top: 1px solid var(--hairline); }
body.ifw-public-page .section-head {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--amber-700);
  margin-bottom: 8px;
}
body.ifw-public-page .section-title {
  font-size: var(--ifw-h2); font-weight: 600;
  letter-spacing: -0.014em; line-height: 1.25;
  margin-bottom: 14px;
}
body.ifw-public-page .page-copy,
body.ifw-public-page .section-copy {
  font-size: 14px; color: var(--ink-500); max-width: 760px;
}

/* Badges */
body.ifw-public-page .badge,
body.ifw-public-page .badge-ok,
body.ifw-public-page .badge-warn {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px; font-weight: 500;
}
body.ifw-public-page .badge-ok { background: #e6f7ee; color: #1a7a4c; }
body.ifw-public-page .badge-warn { background: #fff4e6; color: #a85c00; }

/* ===== Shared model catalog =====
   Single styling authority for the homepage #models block, /models, and docs model tables. */
.ifw-market-table-wrap,
.docs-model-board {
  width: 100%;
  min-width: 0;
  scroll-margin-top: calc(var(--ifw-nav-offset, 80px) + 28px);
  border: 1px solid rgba(222,96,35,0.14);
  border-radius: 12px;
  background: rgba(255,255,255,0.96);
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(15,23,48,0.065);
}

.ifw-market-table-wrap {
  max-width: 1120px;
  margin: 20px auto 0;
}

.docs-model-board {
  margin: 0 auto;
}

.ifw-market-table-head,
.docs-model-board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--hairline);
  border-radius: 12px 12px 0 0;
  background: #fff;
}

.ifw-market-table-head b,
.docs-model-board-head b {
  color: var(--ink-900);
  font-size: 20px;
  line-height: 1.25;
  font-weight: 600;
}

.ifw-market-table-head span,
.docs-model-board-head span {
  color: var(--ink-300);
  font-size: 13px;
  line-height: 1.2;
}

.ifw-market-filter-panel {
  position: relative;
  z-index: 50;
  padding: 14px 16px 16px;
  border-bottom: 1px solid var(--hairline);
  background: #f8fafc;
  box-shadow: none;
  box-sizing: border-box;
}

.ifw-market-filter-bar {
  display: grid;
  grid-template-columns: minmax(168px, 1.15fr) minmax(168px, 1.05fr) minmax(168px, 1.05fr) minmax(132px, 0.7fr) minmax(150px, 0.8fr);
  gap: 12px;
  align-items: end;
  width: 100%;
}

.ifw-market-filter-field,
.ifw-market-head-cell,
.docs-model-head-cell {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.ifw-market-filter-field-label,
.ifw-market-head-label,
.docs-model-head-label {
  color: var(--ink-500);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  font-weight: 600;
}

.ifw-market-table-scroll,
.docs-model-scroll {
  max-height: 540px;
  overflow: auto;
  scrollbar-gutter: stable both-edges;
  -webkit-overflow-scrolling: touch;
}

.ifw-market-table,
.docs-model-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--ink-900);
  font-size: 14px;
}

.docs-model-table {
  min-width: 860px;
}

.ifw-market-col-model { width: 24%; }
.ifw-market-col-scenario { width: 17%; }
.ifw-market-col-endpoint { width: 35%; }
.ifw-market-col-billing { width: 12%; }
.ifw-market-col-status { width: 12%; }

.ifw-market-table th,
.docs-model-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 13px 14px;
  border-bottom: 1px solid var(--hairline);
  background: #f8fafc;
  box-shadow: inset 0 -1px 0 var(--hairline);
  color: var(--ink-500);
  vertical-align: top;
  text-align: left;
}

.ifw-market-table:not(.docs-model-table) th:not(:first-child),
.ifw-market-table:not(.docs-model-table) td:not(:first-child) {
  text-align: right;
}

.ifw-market-table th:nth-child(1) { width: 24%; }
.ifw-market-table th:nth-child(2) { width: 17%; }
.ifw-market-table th:nth-child(3) { width: 35%; }
.ifw-market-table th:nth-child(4) { width: 12%; }
.ifw-market-table th:nth-child(5) { width: 12%; }
.docs-model-table th:nth-child(1) { width: 22%; }
.docs-model-table th:nth-child(2) { width: 34%; }
.docs-model-table th:nth-child(3) { width: 30%; }
.docs-model-table th:nth-child(4) { width: 14%; }

.ifw-market-table:not(.docs-model-table) th:not(:first-child) .ifw-market-head-cell {
  justify-items: end;
}

.ifw-market-table td,
.docs-model-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
  white-space: normal;
  overflow-wrap: anywhere;
  color: var(--ink-700);
}

.ifw-market-table tbody tr:hover td,
.docs-model-table tbody tr:hover td {
  background: rgba(222,96,35,0.035);
}

.ifw-market-table tr:last-child td,
.docs-model-table tr:last-child td {
  border-bottom: none;
}

.ifw-model-name-cell,
.docs-model-name {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  color: var(--ink-900);
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
  white-space: nowrap;
}

.ifw-model-mark,
.docs-model-mark {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-800);
  border: 1px solid var(--hairline);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15,23,48,0.035);
}

.ifw-model-mark img,
.ifw-model-mark svg,
.docs-model-mark img,
.docs-model-mark svg {
  width: 18px;
  height: 18px;
  display: block;
}

.ifw-model-mark-anthropic img,
.docs-model-mark-anthropic img {
  width: 21px;
  height: 21px;
  border-radius: 5px;
}

.ifw-model-mark-openai svg,
.ifw-model-mark-bytedance svg,
.docs-model-mark-openai svg,
.docs-model-mark-bytedance svg {
  width: 18px;
  height: 18px;
}

.ifw-model-mark-surface {
  color: var(--ifw-action-700);
}

.ifw-model-mark-surface svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ifw-market-table strong,
.docs-model-table strong {
  display: block;
  color: var(--ink-900);
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.ifw-model-name-cell strong {
  display: inline;
}

.ifw-market-table small {
  display: block;
  margin-top: 4px;
  color: var(--ink-300);
  font-size: 12px;
  line-height: 1.25;
}

.ifw-market-table code,
.docs-model-table code,
.docs-model-source code {
  font-family: 'JetBrains Mono', monospace;
  color: var(--ifw-action-700);
  font-size: 13px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.docs-model-source {
  font-size: 14px;
  color: var(--ink-300);
  margin-top: 14px;
  line-height: 1.6;
}

.ifw-status-pill {
  display: inline-flex;
  justify-content: center;
  min-width: 58px;
  padding: 6px 9px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--ink-25);
  color: var(--ink-500);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

.ifw-status-pill.is-callable {
  border-color: rgba(34,197,94,0.25);
  background: rgba(34,197,94,0.08);
  color: #15803d;
}

.ifw-status-pill.is-dynamic,
.ifw-status-pill.is-planned {
  border-color: rgba(222,96,35,0.22);
  background: rgba(222,96,35,0.075);
  color: var(--ifw-action-700);
}

.ifw-status-pill.is-enable {
  border-color: rgba(200,157,94,0.3);
  background: rgba(200,157,94,0.1);
  color: var(--amber-700);
}

.ifw-market-empty,
.docs-model-empty {
  display: none;
  padding: 14px 18px;
  border-top: 1px solid var(--hairline);
  color: var(--ink-500);
  font-size: 13.5px;
  line-height: 1.4;
  text-align: center;
}

.ifw-market-table-wrap[data-empty="true"] .ifw-market-empty,
.docs-model-board[data-empty="true"] .docs-model-empty {
  display: block;
}

.ifw-market-filter-control {
  position: relative;
  width: 100%;
  min-width: 0;
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'PingFang SC', sans-serif;
}

.docs-model-table .ifw-market-filter-control {
  min-width: 118px;
}

.ifw-market-filter-control.is-open {
  z-index: 120;
}

.ifw-market-filter-button {
  width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: #fff;
  color: var(--ink-800);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  text-align: left;
  cursor: pointer;
}

.ifw-market-filter-button::after {
  content: '';
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  opacity: 0.78;
}

.ifw-market-filter-button:focus-visible {
  outline: 2px solid var(--ifw-action-ring);
  outline-offset: 1px;
  border-color: rgba(222, 96, 35, 0.44);
}

.ifw-market-filter-control.is-open .ifw-market-filter-button {
  border-color: rgba(222, 96, 35, 0.44);
  box-shadow: 0 0 0 3px var(--ifw-action-075);
}

.ifw-market-filter-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 130;
  display: none;
  min-width: 100%;
  padding: 6px;
  border: 1px solid rgba(15,23,48,0.12);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 58px rgba(15,23,48,0.18);
}

.ifw-market-filter-field:nth-child(n+3) .ifw-market-filter-menu,
.docs-model-table th:not(:first-child) .ifw-market-filter-menu {
  right: 0;
  left: auto;
}

.ifw-market-filter-control.is-open .ifw-market-filter-menu {
  display: grid;
  gap: 2px;
}

.ifw-market-filter-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 32px;
  padding: 7px 9px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-800);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.1;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.ifw-market-filter-option::before {
  content: '';
  color: #fff;
  font-weight: 700;
  line-height: 1;
}

.ifw-market-filter-option[aria-selected="true"] {
  background: var(--ifw-action-700);
  color: #fff;
}

.ifw-market-filter-option[aria-selected="true"]::before {
  content: '✓';
}

.ifw-market-filter-option:hover,
.ifw-market-filter-option:focus-visible {
  outline: none;
  background: var(--ifw-action-100);
  color: var(--ink-900);
}

.ifw-market-filter-option[aria-selected="true"]:hover,
.ifw-market-filter-option[aria-selected="true"]:focus-visible {
  background: var(--ifw-action-600);
  color: #fff;
}

.ifw-simple-section {
  padding: 22px 0 0;
  border-top: none;
}

@media (max-width: 1040px) {
  .ifw-market-table-wrap { margin-top: 20px; }
}

@media (max-width: 720px) {
  .ifw-market-table-head,
  .docs-model-board-head {
    display: block;
  }

  .ifw-market-table-head span,
  .docs-model-board-head span {
    display: block;
    margin-top: 6px;
  }

  .ifw-market-filter-control { min-width: 0; }
  .ifw-market-filter-panel { padding: 12px 10px; }
  .ifw-market-table-scroll,
  .docs-model-scroll { max-height: 450px; }
  .ifw-market-table thead { display: block; }
  .docs-model-table { min-width: 700px; }

  .ifw-market-filter-bar {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr) minmax(0, 0.94fr);
    gap: 8px;
  }

  .ifw-market-filter-field:nth-child(2),
  .ifw-market-filter-field:nth-child(4) {
    display: none;
  }

  .ifw-market-filter-field-label,
  .ifw-market-head-label,
  .docs-model-head-label {
    font-size: 10px;
  }

  .ifw-market-label-row {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.88fr) minmax(0, 1.04fr);
    gap: 8px;
    padding: 12px 10px;
    border-bottom: 1px solid var(--hairline);
    background: #f8fafc;
  }

  .ifw-market-label-row th:nth-child(2),
  .ifw-market-table:not(.docs-model-table) td:nth-child(2),
  .ifw-market-label-row th:nth-child(4),
  .ifw-market-table:not(.docs-model-table) td:nth-child(4) {
    display: none;
  }

  .ifw-market-label-row th:nth-child(1),
  .ifw-market-label-row th:nth-child(3),
  .ifw-market-label-row th:nth-child(5) { width: auto; }

  .ifw-market-table:not(.docs-model-table),
  .ifw-market-table:not(.docs-model-table) tbody,
  .ifw-market-table:not(.docs-model-table) td {
    display: block;
    width: 100%;
  }

  .ifw-market-table th,
  .ifw-market-table td,
  .docs-model-table th,
  .docs-model-table td {
    padding: 12px 10px;
  }

  .ifw-market-table:not(.docs-model-table) th {
    position: static;
    padding: 0;
    border-bottom: none;
    background: transparent;
    box-shadow: none;
  }

  .ifw-market-filter-button {
    height: 34px;
    padding: 0 6px;
    gap: 4px;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .ifw-market-filter-button::after { flex: 0 0 8px; }
  .ifw-market-table code,
  .docs-model-table code { font-size: 12px; overflow-wrap: normal; word-break: normal; }
  .ifw-status-pill { min-width: 0; padding: 6px 7px; font-size: 10px; }

  .ifw-market-table:not(.docs-model-table) tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    column-gap: 12px;
    align-items: center;
    padding: 13px 10px;
    border-bottom: 1px solid var(--hairline);
  }

  .ifw-market-table:not(.docs-model-table) tbody tr:last-child { border-bottom: none; }

  .ifw-market-table:not(.docs-model-table) td {
    padding: 0;
    border-bottom: none;
  }

  .ifw-market-table:not(.docs-model-table) td:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
  }

  .ifw-market-table:not(.docs-model-table) td:nth-child(3) {
    grid-column: 1;
    grid-row: 2;
    margin-top: 5px;
    padding-left: 31px;
    text-align: left !important;
  }

  .ifw-market-table:not(.docs-model-table) td:nth-child(5) {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    text-align: right !important;
  }

  .ifw-simple-section { padding-top: 24px; }
}

/* Model marketplace layout.
   /models and docs reuse the exact public-home marketplace structure. */
.ifw-model-market-board {
  margin: 0 auto;
  overflow: visible;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.ifw-market-toolbar {
  display: grid;
  /* First column hugs the 340px search box so the model count sits right next to
     it (was up to 440px, leaving a big gap between search and "12 个模型"). */
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 6px 8px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: rgba(255,255,255,0.96);
  box-shadow: 0 8px 18px rgba(15,23,48,0.025);
}

.ifw-market-search {
  position: relative;
  flex: none;
  /* Fill the 340px toolbar column (= left filter sidebar width) so the search box
     lines up with the filter module below it, with no gap before the model count. */
  width: 100%;
  min-width: 0;
  max-width: 340px;
}

.ifw-market-search::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 50%;
  width: 17px;
  height: 17px;
  transform: translateY(-50%);
  opacity: .58;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.8-3.8'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.8-3.8'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}

.ifw-market-search input {
  width: 100%;
  height: 32px;
  box-sizing: border-box;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: #fff;
  padding: 0 14px 0 36px;
  color: var(--ink-900);
  font: inherit;
  font-size: 14px;
  outline: none;
}

.ifw-market-toolbar-main {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ifw-market-search input:focus {
  border-color: rgba(222, 96, 35, 0.44);
  box-shadow: 0 0 0 3px var(--ifw-action-075);
}

.ifw-market-toolbar-actions {
  /* 2026-05-25: take the remaining toolbar width so right-side controls have
     room (was inline-flex, did not grow, leaving them cramped on the right). */
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.ifw-market-action,
.ifw-market-segment {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-700);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
}

.ifw-market-action {
  gap: 6px;
  padding: 0 10px;
  cursor: pointer;
}

.ifw-market-action svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ifw-market-segment {
  gap: 2px;
  padding: 3px;
}

.ifw-market-segment button {
  /* 2026-05-25: padding-based width so text labels (卡片/表格) get breathing room. */
  min-width: 36px;
  min-height: 24px;
  padding: 0 9px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-500);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.ifw-market-segment button[aria-pressed="true"] {
  background: var(--ink-900);
  color: var(--canvas);
}

.ifw-market-toggle {
  gap: 7px;
  padding: 0 9px;
}

.ifw-market-toggle span {
  white-space: nowrap;
}

.ifw-market-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ifw-market-toggle i {
  width: 28px;
  height: 16px;
  position: relative;
  border-radius: 999px;
  background: var(--ink-50);
  box-shadow: inset 0 0 0 1px var(--hairline);
}

.ifw-market-toggle i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(15,23,48,0.18);
  transition: transform .15s ease, background .15s ease;
}

.ifw-market-toggle input:checked + i {
  background: rgba(222,96,35,0.22);
}

.ifw-market-toggle input:checked + i::after {
  transform: translateX(12px);
  background: var(--ifw-action-700);
}

.ifw-model-market-board[data-view-mode="table"] .ifw-model-grid {
  grid-template-columns: 1fr;
}

.ifw-model-market-board[data-view-mode="table"] .ifw-newapi-model-card {
  display: grid;
  grid-template-columns: minmax(250px, 0.62fr) minmax(700px, 1fr);
  align-items: center;
  gap: 20px;
  min-height: 58px;
}

.ifw-model-market-board[data-view-mode="table"] .ifw-newapi-model-card dl {
  grid-template-columns: repeat(3, minmax(64px, max-content));
}

.ifw-market-shell {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.ifw-market-sidebar {
  position: sticky;
  top: calc(var(--ifw-nav-offset, 80px) + 18px);
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: rgba(255,255,255,0.9);
}

.ifw-market-sidebar button,
.ifw-market-sidebar a {
  width: 100%;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #475467;
  text-align: left;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.ifw-market-sidebar button.is-active {
  background: rgba(222,96,35,0.09);
  border-color: rgba(222,96,35,0.26);
  color: var(--ifw-action-700);
}

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

.ifw-model-card {
  min-width: 0;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  padding: 14px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 18px 44px rgba(17,24,39,0.045);
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.ifw-model-card:hover {
  border-color: var(--ifw-action-700);
  transform: translateY(-2px);
  box-shadow: 0 22px 52px rgba(15,23,48,0.07);
}

.ifw-model-card.is-hidden,
.ifw-model-card[hidden] {
  display: none;
}

.ifw-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.ifw-card-top b,
.ifw-model-card b {
  color: var(--ink-900);
  font-size: 15px;
  line-height: 1.25;
  font-weight: 600;
}

.ifw-model-card .ifw-model-mark,
.ifw-model-card .docs-model-mark {
  width: 32px;
  height: 32px;
  min-width: 32px;
  aspect-ratio: 1 / 1;
  flex: 0 0 32px;
  border-radius: 8px;
  overflow: hidden;
}

.ifw-model-card .ifw-model-mark img,
.ifw-model-card .docs-model-mark img {
  width: 26px;
  height: 26px;
  border-radius: 6px;
}

.ifw-model-card .ifw-model-mark svg,
.ifw-model-card .docs-model-mark svg {
  width: 22px;
  height: 22px;
}

.ifw-model-card p {
  margin: 0;
  color: var(--ink-500);
  font-size: 12px;
  line-height: 1.56;
}

.ifw-model-card dl {
  display: grid;
  gap: 8px;
  margin: auto 0 0;
  padding-top: 14px;
  font-size: 11px;
}

.ifw-model-card dl div {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
}

.ifw-model-card dt {
  color: #98a2b3;
}

.ifw-model-card dd {
  margin: 0;
  color: #344054;
  overflow-wrap: anywhere;
}

/* Phase 5 final: V9 frame-max is single-sourced to 1320px at body.ifw-v9-page
   scope (see Phase 2 token block). Historic 1360px values for marketplace
   and v9 pages here are removed so all 5 V9 pages render at the same width
   as home-V9.html (Codex review item: user requirement "4 子页统一首页"). */

body.ifw-v9-page.ifw-page-models {
  letter-spacing: 0;
}

body.ifw-v9-page.ifw-page-models .page-header {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-bottom: 16px;
  padding: 28px 0 30px;
  position: relative;
  isolation: isolate;
  border-top: 0;
  border-bottom: 0;
  background: transparent;
  color: #fff;
}

body.ifw-v9-page.ifw-page-models .page-header::before {
  content: "";
  position: absolute;
  inset: 0 calc(50% - 50vw);
  z-index: -1;
  border-top: 1px solid rgba(226,232,240,0.72);
  border-bottom: 1px solid rgba(226,232,240,0.72);
  background:
    linear-gradient(135deg, rgba(15,23,48,0.96) 0%, rgba(41,82,178,0.88) 56%, rgba(222,96,35,0.76) 100%);
}

body.ifw-v9-page.ifw-page-models .models-topline {
  width: 100%;
  margin: 0;
  padding: 0 clamp(36px, 2.4vw, 56px);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  text-align: left;
}

body.ifw-v9-page.ifw-page-models .page-header h1 {
  font-size: clamp(28px, 2.25vw, 36px);
  line-height: 1.14;
  letter-spacing: 0;
  font-weight: 650;
  margin-bottom: 7px;
}

body.ifw-v9-page.ifw-page-models .page-tag,
body.ifw-v9-page.ifw-page-models .page-header h1,
body.ifw-v9-page.ifw-page-models .page-header p,
body.ifw-v9-page.ifw-page-models .page-header code {
  color: #fff;
}

/* Phase 5 follow-up #2: .page-tag base rule (L800+) sets background: #fff
   for off-banner placement; on the marketplace gradient banner this collapses
   to white text on white pill (Codex flagged). Override to translucent so
   the navy/blue/orange banner shows through and the white text + amber dot
   stay legible. Apply to all 5 V9 pages for consistency. */
body.ifw-v9-page.ifw-page-transparency .page-tag,
body.ifw-v9-page.ifw-page-legal .page-tag,
body.ifw-v9-page.ifw-page-docs .page-tag {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.32);
}

body.ifw-v9-page.ifw-page-models .page-tag {
  opacity: 0.82;
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.24);
  color: #fff;
  min-height: 30px;
  padding: 0 13px;
  font-size: 13.5px;
}

body.ifw-v9-page.ifw-page-models .page-header p {
  max-width: 1120px;
  opacity: 0.9;
  color: #fff;
  font-size: clamp(14.5px, 1.02vw, 16px);
  line-height: 1.55;
}

body.ifw-v9-page.ifw-page-models .page-header code {
  background: rgba(255,255,255,0.14);
  color: #fff;
}

body.ifw-v9-page.ifw-page-models .models-actions {
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 12px;
  margin: 0 0 4px;
}

body.ifw-v9-page.ifw-page-models .models-link {
  border-color: rgba(255,255,255,0.24);
  background: rgba(255,255,255,0.12);
  color: #fff;
  min-height: 42px;
  padding: 0 20px;
  font-size: 15px;
  font-weight: 600;
}

body.ifw-v9-page.ifw-page-models .models-link:hover {
  border-color: rgba(255,255,255,0.48);
  color: #fff;
}

@media (max-width: 760px) {
  body.ifw-v9-page.ifw-page-models .page-header {
    padding: 28px 0 30px;
  }
  body.ifw-v9-page.ifw-page-models .models-topline {
    display: block;
    padding: 0 24px;
  }
  body.ifw-v9-page.ifw-page-models .models-actions {
    justify-content: flex-start;
    margin-top: 14px;
  }
}

body.ifw-v9-page.ifw-page-models .models-main > .section {
  padding-top: 12px;
}

body.ifw-v9-page.ifw-page-models .models-main {
  width: min(100%, 1500px);
}

.ifw-model-market-board .ifw-market-shell {
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 22px;
}

.ifw-newapi-market-sidebar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.ifw-v9-page.ifw-page-models .ifw-newapi-market-sidebar > .ifw-sidebar-header,
body.ifw-v9-page.ifw-page-models .ifw-newapi-market-sidebar > .ifw-filter-section {
  grid-column: 1 / -1;
}

.ifw-newapi-market-sidebar h2 {
  color: var(--ink-900);
  font-size: 14px;
  line-height: 1.2;
  font-weight: 650;
  white-space: nowrap;
}

.ifw-newapi-market-sidebar button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  min-height: 42px;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-700);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  overflow: visible;
  transition: background .12s ease, color .12s ease;
}

.ifw-newapi-market-sidebar button .ifw-filter-label {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  overflow: visible;
  white-space: normal;
  overflow-wrap: normal;
  line-height: 1.18;
}

.ifw-sidebar-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-500);
}

.ifw-sidebar-icon svg {
  width: 15px !important;
  height: 15px !important;
  display: block;
}

.ifw-lobe-model-icon {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ifw-sidebar-icon .ifw-lobe-model-icon {
  width: 16px;
  height: 16px;
}

.ifw-sidebar-icon-all,
.ifw-sidebar-icon-model,
.ifw-sidebar-icon-code,
.ifw-sidebar-icon-video,
.ifw-sidebar-icon-reason {
  color: var(--ink-500);
}

.ifw-sidebar-icon-all::before,
.ifw-sidebar-icon-model::before,
.ifw-sidebar-icon-code::before,
.ifw-sidebar-icon-video::before,
.ifw-sidebar-icon-reason::before {
  content: "";
  width: 15px;
  height: 15px;
  background: currentColor;
  display: block;
}

.ifw-sidebar-icon-all::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='black'%3E%3Crect x='4' y='4' width='7' height='7' rx='1.5'/%3E%3Crect x='13' y='4' width='7' height='7' rx='1.5'/%3E%3Crect x='4' y='13' width='7' height='7' rx='1.5'/%3E%3Crect x='13' y='13' width='7' height='7' rx='1.5'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='black'%3E%3Crect x='4' y='4' width='7' height='7' rx='1.5'/%3E%3Crect x='13' y='4' width='7' height='7' rx='1.5'/%3E%3Crect x='4' y='13' width='7' height='7' rx='1.5'/%3E%3Crect x='13' y='13' width='7' height='7' rx='1.5'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}

.ifw-sidebar-icon-model::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M6 4h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Zm1.5 4h9v2h-9V8Zm0 4h9v2h-9v-2Zm0 4h5v2h-5v-2Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M6 4h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Zm1.5 4h9v2h-9V8Zm0 4h9v2h-9v-2Zm0 4h5v2h-5v-2Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ifw-sidebar-icon-code::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M8.7 7.3 4 12l4.7 4.7 1.4-1.4L6.8 12l3.3-3.3-1.4-1.4Zm6.6 0-1.4 1.4 3.3 3.3-3.3 3.3 1.4 1.4L20 12l-4.7-4.7Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M8.7 7.3 4 12l4.7 4.7 1.4-1.4L6.8 12l3.3-3.3-1.4-1.4Zm6.6 0-1.4 1.4 3.3 3.3-3.3 3.3 1.4 1.4L20 12l-4.7-4.7Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ifw-sidebar-icon-video::before {
  color: #3C8CFF;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M5 5h10a2 2 0 0 1 2 2v2.2l3.5-2.2v10L17 14.8V17a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M5 5h10a2 2 0 0 1 2 2v2.2l3.5-2.2v10L17 14.8V17a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ifw-sidebar-icon-reason::before {
  color: #D97757;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M12 2.5 13.7 8l5.5 1.7-5.5 1.7L12 17l-1.7-5.6-5.5-1.7L10.3 8 12 2.5Zm6.5 10 1 3 3 1-3 1-1 3-1-3-3-1 3-1 1-3Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M12 2.5 13.7 8l5.5 1.7-5.5 1.7L12 17l-1.7-5.6-5.5-1.7L10.3 8 12 2.5Zm6.5 10 1 3 3 1-3 1-1 3-1-3-3-1 3-1 1-3Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ifw-newapi-market-sidebar button .ifw-filter-label-text {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: normal;
  word-break: keep-all;
  line-height: 1.22;
}

.ifw-newapi-market-sidebar button:hover {
  background: var(--ink-25);
  color: var(--ink-900);
}

.ifw-newapi-market-sidebar button em {
  flex: 0 0 auto;
  min-width: 23px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(15,23,48,0.055);
  color: var(--ink-500);
  font-family: inherit;
  font-style: normal;
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.2;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ifw-newapi-market-sidebar button.is-active {
  border-color: transparent;
  background: rgba(222,96,35,0.12);
  color: var(--ifw-action-700);
  font-weight: 600;
}

.ifw-newapi-market-sidebar button.is-active em {
  background: rgba(222,96,35,0.13);
  color: var(--ifw-action-700);
}

.ifw-newapi-market-sidebar button.is-active .ifw-sidebar-icon {
  color: var(--ifw-action-700);
}

.ifw-newapi-market-sidebar .ifw-filter-section-toggle {
  min-height: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 0 0 8px;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink-900);
  border-top: 0;
}

body.ifw-v9-page.ifw-page-models .ifw-newapi-market-sidebar .ifw-filter-section-toggle {
  margin: 0 0 8px;
  padding: 0;
}

body.ifw-v9-page.ifw-page-models .ifw-newapi-market-sidebar .ifw-filter-section {
  border-top: 0;
  padding-top: 4px;
}

body.ifw-v9-page.ifw-page-models .ifw-newapi-market-sidebar .ifw-filter-section + .ifw-filter-section {
  margin-top: 16px;
}

.ifw-newapi-market-sidebar .ifw-filter-section-toggle::before,
.ifw-newapi-market-sidebar .ifw-filter-section-toggle::after {
  content: none;
}

.ifw-newapi-market-sidebar .ifw-filter-section-toggle > span {
  white-space: nowrap;
}

.ifw-newapi-market-sidebar .ifw-filter-section-toggle svg {
  width: 13px;
  height: 13px;
  color: var(--ink-300);
}

body.ifw-v9-page.ifw-page-models .ifw-newapi-market-sidebar .ifw-filter-section-body {
  padding-bottom: 5px;
}

body.ifw-v9-page.ifw-page-models .ifw-newapi-market-sidebar .ifw-filter-section:not(.is-collapsed) .ifw-filter-section-body.ifw-filter-group {
  display: grid;
  grid-template-columns: 1fr 1fr !important;
  gap: 6px;
  padding: 0 0 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

/* The "全部X" (all) button spans the full width above the 2-column chips. */
body.ifw-v9-page.ifw-page-models .ifw-newapi-market-sidebar .ifw-filter-section-body.ifw-filter-group > button[data-filter-val=""] {
  grid-column: 1 / -1;
}

body.ifw-v9-page.ifw-page-models .ifw-newapi-market-sidebar .ifw-filter-section-body.ifw-filter-group > button {
  min-height: 34px;
  padding: 6px 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  border: 1px solid rgba(203,213,225,0.88);
  border-radius: 8px;
  background: rgba(255,255,255,0.96);
  color: rgba(15,23,48,0.86);
  box-shadow: 0 1px 2px rgba(15,23,48,0.025);
  font-size: 13px;
  font-weight: 550;
}

body.ifw-v9-page.ifw-page-models .ifw-newapi-market-sidebar .ifw-filter-section-body.ifw-filter-group > button.ifw-loading-filter {
  color: rgba(15,23,48,0.54);
  background: rgba(255,255,255,0.68);
  border-color: rgba(226,232,240,0.9);
  cursor: progress;
}

body.ifw-v9-page.ifw-page-models .ifw-newapi-market-sidebar .ifw-filter-section-body.ifw-filter-group > button:hover {
  background: #fff;
  border-color: rgba(148,163,184,0.68);
  box-shadow: 0 4px 12px rgba(15,23,48,0.045);
}

body.ifw-v9-page.ifw-page-models .ifw-newapi-market-sidebar .ifw-filter-section-body.ifw-filter-group > button.is-active {
  background: rgba(222,96,35,0.09);
  border-color: rgba(222,96,35,0.34);
  box-shadow: none;
}

body.ifw-v9-page.ifw-page-models .ifw-sidebar-header {
  align-items: center;
  /* 筛选 on the left, 重置 compact on the right. */
  justify-content: space-between;
  /* Tighter gap below the 筛选/重置 row → first filter section (was 8px header
     + 10px section padding = too airy). */
  margin-bottom: 4px;
}

body.ifw-v9-page.ifw-page-models .ifw-sidebar-header h2 {
  /* Bigger 筛选 heading (Futu-style emphasis). */
  font-size: 17px;
  font-weight: 700;
  line-height: 1.1;
}

/* 重置 as a real bordered button with a subtle shadow (Futu reference), not a
   bare text link. */
body.ifw-v9-page.ifw-page-models .ifw-sidebar-reset {
  /* Compact pill — override the sidebar's full-width 38px button defaults so 重置
     is a small button hugging its label, not a big empty box. */
  width: auto;
  min-width: 0;
  min-height: 0;
  flex: 0 0 auto;
  line-height: 1.1;
  padding: 5px 12px;
  border: 1px solid rgba(203,213,225,0.95);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15,23,48,0.06);
  font-size: 13px;
  font-weight: 550;
  color: var(--ink-700);
}
body.ifw-v9-page.ifw-page-models .ifw-sidebar-reset:hover:not(:disabled) {
  border-color: rgba(148,163,184,0.78);
  box-shadow: 0 2px 6px rgba(15,23,48,0.09);
  background: #fff;
  color: var(--ifw-action-700);
  text-decoration: none;
}

.ifw-model-market-board .ifw-model-grid {
  grid-template-columns: repeat(3, minmax(286px, 1fr));
  gap: 12px;
}

.ifw-newapi-model-card {
  min-height: 0;
  padding: 11px 12px;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(15,23,48,0.025);
  transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}

.ifw-newapi-model-card:hover {
  transform: none;
  box-shadow: 0 6px 16px rgba(15,23,48,0.045);
}

.ifw-newapi-card-top {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.ifw-newapi-model-card .ifw-card-header-left .ifw-model-mark,
.ifw-newapi-model-card .ifw-card-header-left .docs-model-mark {
  width: 28px;
  height: 28px;
  min-width: 28px;
  flex: 0 0 28px;
  border-radius: 7px;
}

.ifw-newapi-model-card .ifw-card-header-left .ifw-model-mark img,
.ifw-newapi-model-card .ifw-card-header-left .docs-model-mark img {
  width: 22px;
  height: 22px;
  border-radius: 5px;
}

.ifw-newapi-model-card .ifw-card-header-left .ifw-model-mark svg,
.ifw-newapi-model-card .ifw-card-header-left .docs-model-mark svg {
  width: 19px;
  height: 19px;
}

.ifw-newapi-model-card .ifw-card-header-left .ifw-lobe-model-icon {
  width: 20px;
  height: 20px;
}

.ifw-newapi-model-card b.ifw-card-model-name {
  font-family: inherit;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--ink-900);
  /* Names are normalized to short forms (provider prefix + date stamp stripped),
     so a single line fits. If an unexpectedly long id appears it truncates with
     an ellipsis; the full id stays in the title attr + copy + detail drawer. */
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ifw-card-version-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: max-content;
  padding: 1px 6px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--ink-25);
  color: var(--ink-700);
  font-size: 12px;
  line-height: 1.25;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.ifw-model-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.ifw-model-copy {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-500);
  cursor: pointer;
}

.ifw-model-copy svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ifw-model-copy:hover {
  border-color: rgba(222,96,35,0.28);
  color: var(--ifw-action-700);
}

.ifw-model-price-lines {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
  margin: 8px 0 0;
  padding: 6px 0 0;
  /* No divider/bottom hairline — cards stay clean (removed stray line). */
  border-top: 0;
  border-bottom: 0;
}

.ifw-price-row {
  display: grid;
  grid-template-columns: 32px 56px 66px 38px minmax(86px, 1fr);
  align-items: center;
  column-gap: 5px;
  row-gap: 0;
  min-height: 27px;
  min-width: 0;
  color: var(--ink-700);
  font-size: 12.8px;
  line-height: 1;
}

.ifw-price-kind {
  min-width: 0;
  color: var(--ink-500);
  font-weight: 450;
  white-space: nowrap;
}

.ifw-price-current {
  display: inline-grid;
  grid-template-columns: max-content max-content;
  min-width: 0;
  align-items: center;
  column-gap: 1px;
  color: var(--ink-900);
  font-family: inherit;
  /* Actual price: same size as the row, normal weight (no bold / no +1 size). */
  font-size: 13px;
  line-height: 1;
  font-weight: 500;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.ifw-price-current small {
  color: var(--ink-700);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}

/* Card bottom meta row: version count + billing type (按量/按次), keeps the
   header uncrowded and vertically tidy. */
.ifw-card-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  /* Anchor to the card bottom so 按量计费/版本 badges line up across a grid row
     regardless of how many price rows (1 video / 2 gpt / 3 claude) a card has. */
  margin-top: auto;
  padding-top: 10px;
}
.ifw-card-meta-row:empty { display: none; }
.ifw-card-billing-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--ink-25);
  color: var(--ink-500);
  font-size: 11.5px;
  line-height: 1.5;
  font-weight: 500;
  white-space: nowrap;
}

.ifw-price-original {
  display: inline-flex;
  align-items: center;
  color: var(--ink-500);
  font-size: 12.3px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration-line: line-through;
  text-decoration-thickness: 1.4px;
  text-decoration-color: rgba(83,96,131,0.55);
  font-variant-numeric: tabular-nums;
}

.ifw-price-original.is-empty,
.ifw-price-discount.is-empty,
.ifw-cache-price.is-empty {
  visibility: hidden;
}

.ifw-cache-price {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  color: var(--ink-600);
  white-space: nowrap;
  justify-self: start;
  justify-content: flex-start;
  margin-left: 8px;
}

.ifw-cache-label {
  color: var(--ink-700);
  font-size: 12.2px;
  font-weight: 600;
  line-height: 1.08;
}

.ifw-cache-price .ifw-cache-amount {
  color: var(--ink-900);
  font-size: 13.2px;
  font-weight: 650;
}

.ifw-price-discount {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  justify-self: start;
  padding: 1px 5px;
  border: 1px solid rgba(222,96,35,0.18);
  border-radius: 999px;
  background: rgba(222,96,35,0.08);
  color: var(--ifw-action-700);
  font-size: 10.5px;
  line-height: 1.25;
  font-style: normal;
  font-weight: 600;
  white-space: nowrap;
}

.ifw-rule-value {
  min-width: 0;
  color: var(--ink-700);
  font-size: 13.5px;
  line-height: 1.25;
  font-weight: 600;
  white-space: nowrap;
}

/* Card view price rows: flex, left-packed, with the ACTUAL price first (right
   after a fixed-width label) so the current price aligns at the same x across
   EVERY card — discounted, single-tier, and cache rows alike. The struck
   original + discount badge trail it (via order) and collapse when absent, so
   no-discount cards have no empty-column gap. (Table view keeps its own grid.) */
.ifw-model-market-board:not([data-view-mode="table"]) .ifw-price-row:not(.ifw-price-video) {
  display: flex;
  align-items: baseline;
  column-gap: 8px;
}
.ifw-model-market-board:not([data-view-mode="table"]) .ifw-price-row:not(.ifw-price-video) > .ifw-price-kind {
  flex: 0 0 42px;
  width: 42px;
}
.ifw-model-market-board:not([data-view-mode="table"]) .ifw-price-row:not(.ifw-price-video) > .ifw-price-current { order: 1; }
.ifw-model-market-board:not([data-view-mode="table"]) .ifw-price-row:not(.ifw-price-video) > .ifw-price-original { order: 2; }
.ifw-model-market-board:not([data-view-mode="table"]) .ifw-price-row:not(.ifw-price-video) > .ifw-price-discount { order: 3; }
/* Collapse empty cells (no-discount rows) + cache cell (cache has its own row). */
.ifw-model-market-board:not([data-view-mode="table"]) .ifw-price-row:not(.ifw-price-video) > .ifw-price-original.is-empty,
.ifw-model-market-board:not([data-view-mode="table"]) .ifw-price-row:not(.ifw-price-video) > .ifw-price-discount.is-empty,
.ifw-model-market-board:not([data-view-mode="table"]) .ifw-price-row:not(.ifw-price-video) > .ifw-cache-price {
  display: none;
}
.ifw-model-market-board:not([data-view-mode="table"]) .ifw-price-video {
  grid-template-columns: minmax(44px, auto) max-content minmax(70px, 1fr);
  column-gap: 10px;
}
.ifw-model-market-board:not([data-view-mode="table"]) .ifw-price-video > .ifw-price-original,
.ifw-model-market-board:not([data-view-mode="table"]) .ifw-price-video > .ifw-price-discount {
  display: none;
}

.ifw-model-market-board[data-view-mode="table"] .ifw-model-price-lines {
  grid-template-columns: 348px 214px;
  align-items: center;
  column-gap: 44px;
  row-gap: 0;
  min-height: 0;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--hairline);
  border-radius: 7px;
  background: rgba(248,250,252,0.66);
}

.ifw-model-market-board[data-view-mode="table"] .ifw-price-row {
  display: grid;
  grid-template-columns: 36px 56px 56px 40px 120px;
  align-items: baseline;
  column-gap: 8px;
  row-gap: 0;
  min-height: 0;
  line-height: 1.18;
}

.ifw-model-market-board[data-view-mode="table"] .ifw-price-row:not(.has-cache) {
  grid-template-columns: 36px 56px 56px 40px;
}

.ifw-model-market-board[data-view-mode="table"] .ifw-price-row:not(.has-cache) .ifw-cache-price.is-empty {
  display: none;
}

.ifw-model-market-board[data-view-mode="table"] .ifw-cache-price {
  align-items: baseline;
  justify-self: start;
  justify-content: flex-start;
  gap: 8px;
  margin-left: 6px;
}

.ifw-model-market-board[data-view-mode="table"] .ifw-price-video {
  grid-column: 1 / -1;
  grid-template-columns: 42px 88px minmax(160px, 1fr);
  gap: 12px;
}

.ifw-model-market-board[data-view-mode="table"] .ifw-price-video .ifw-price-original.is-empty,
.ifw-model-market-board[data-view-mode="table"] .ifw-price-video .ifw-price-discount.is-empty {
  display: none;
}

.ifw-model-market-board[data-view-mode="table"] .ifw-price-kind {
  font-size: 12px;
  line-height: 1.1;
}

.ifw-model-market-board[data-view-mode="table"] .ifw-price-current {
  font-size: 13.5px;
}

.ifw-model-market-board[data-view-mode="table"] .ifw-price-discount {
  padding: 0 5px;
  font-size: 10.5px;
}

.ifw-model-market-board[data-view-mode="table"] .ifw-price-original {
  font-size: 12px;
}

.ifw-newapi-model-card dl {
  margin-top: 14px;
  padding-top: 0;
}

.ifw-model-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 14px;
}

.ifw-model-tags span {
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--ink-25);
  color: var(--ink-700);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 500;
}

.ifw-model-tags span:first-child {
  background: rgba(222,96,35,0.1);
  color: var(--ifw-action-700);
}

@media (max-width: 1480px) {
  .ifw-model-market-board .ifw-model-grid {
    grid-template-columns: repeat(3, minmax(286px, 1fr));
  }

  .ifw-model-market-board[data-view-mode="table"] .ifw-newapi-model-card {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 10px;
  }

  .ifw-model-market-board[data-view-mode="table"] .ifw-model-price-lines {
    width: 100%;
  }
}

@media (max-width: 1120px) {
  .ifw-model-market-board .ifw-model-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .ifw-market-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .ifw-market-search {
    min-width: 0;
  }

  .ifw-market-toolbar-main {
    align-items: flex-start;
    flex-direction: column;
  }

  .ifw-market-toolbar-actions {
    justify-content: flex-start;
  }

  .ifw-market-shell {
    grid-template-columns: 1fr;
  }

  .ifw-market-sidebar {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ifw-model-market-board .ifw-market-shell,
  .ifw-model-market-board .ifw-model-grid {
    grid-template-columns: 1fr;
  }

  .ifw-newapi-market-sidebar {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .ifw-model-grid {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 560px) {
  .ifw-market-sidebar {
    grid-template-columns: 1fr;
  }

  body.ifw-v9-page.ifw-page-models .ifw-newapi-market-sidebar .ifw-filter-section:not(.is-collapsed) .ifw-filter-section-body.ifw-filter-group {
    grid-template-columns: 1fr !important;
  }
}
