/* ============================================================
   AI Model Explorer — Design System (Phase 0 Foundation)
   语义化 Token + 基础组件；绿色品牌保留，绿/橙/紫收回装饰用途。
   依据：docs/archive/design/{DESIGN,DESIGN_REVIEW,IMPLEMENTATION_PLAN}.md
   ============================================================ */

:root {
  /* ---- 语义色（DESIGN.md §7 / DESIGN_REVIEW §9） ---- */
  --background: #f7f9f4;
  --surface: #ffffff;
  --foreground: #17221e;
  --foreground-2: #33443c;
  --muted: #647069;          /* P2-6/C: 压暗一档，弱化文字对比度 surface/bg 均 ≥4.5:1（AA 正文） */

  --border: #e2e9df;
  --border-subtle: #eef2ea;
  --border-hover: #cfe0c8;

  --brand: #173e35;          /* 深绿品牌锚点 */
  --brand-accent: #63933a;   /* 交互 / 选中态 */
  --brand-hi: #baf17a;       /* CTA 高亮（慎用，不作大底色） */
  --brand-soft: #edf4e9;     /* 浅绿底 */

  /* 状态色 */
  --success: #2f9e6e;
  --success-soft: #eaf6d8;
  --success-fg: #1c7a52;
  --warning: #e8a33d;
  --warning-soft: #fff2e3;
  --warning-fg: #94530d;        /* P2-6 收尾：压暗达标（3.83→5.44:1 on --warning-soft，AA 正文） */
  --error: #e06b6b;
  --error-soft: #ffeee1;
  --error-fg: #92450c;          /* P2-6 收尾：压暗达标（3.95→6.03:1 on --error-soft，AA 正文） */
  --on-brand: #ffffff;        /* 品牌 / 状态色之上的前景文字 */

  /* 强调（保留既有识别色） */
  --accent: #3b6cff;
  --accent-gateway: #2563EB;

  /* 模态 / 语言分类（category） */
  --category-text-bg: #e6f2ea;   --category-text-fg: #1d6b4f;
  --category-image-bg: #efeaff;  --category-image-fg: #5f42d6;
  --category-video-bg: #fff2e3;  --category-video-fg: #94530d;   /* 与 --warning-fg 同底色同达标 */
  --category-audio-bg: #e6f0f2;  --category-audio-fg: #2f6f8f;
  --category-agent-bg: #f3e6f2;  --category-agent-fg: #7d3aa0;

  /* 代码块 */
  --code-bg: #10231d;
  --code-fg: #e7f3e4;

  /* ---- 字体（DESIGN.md § Typography） ---- */
  --font-sans: 'Geist Sans', 'Noto Sans SC', system-ui, sans-serif;
  --font-mono: 'Geist Mono', 'SF Mono', ui-monospace, Menlo, Consolas, monospace;

  /* ---- 圆角（DESIGN_REVIEW §9：6/10/14；pill 仅 tag/status/filter） ---- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  /* ---- 间距（4px 系统，DESIGN_REVIEW §10） ---- */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;
  --page-gutter: 26px;   /* 页面左右留白 / 标准区块间距（P2-6 收口：统一间距裸值） */

  /* ---- 字阶（P2-6 收口：统一裸 font-size 进 Token；半像素档折叠进相邻整数档） ---- */
  --text-2xs: 10px;
  --text-xs: 11px;
  --text-sm: 12px;
  --text-base: 13px;   /* 正文基准 */
  --text-md: 14px;
  --text-lg: 15px;
  --text-xl: 16px;
  --text-2xl: 17px;
  --text-3xl: 18px;
  --text-4xl: 19px;
  --text-5xl: 21px;
  --text-6xl: 22px;
  --text-7xl: 25px;
  --text-8xl: 26px;
  --text-9xl: 30px;
  --text-10xl: 32px;
  --text-11xl: 34px;
  --text-display: 40px;
  --text-hero: 46px;

  /* ---- 阴影（中性，去绿调营销感） ---- */
  --shadow-1: 0 1px 2px rgba(17, 34, 30, .05);
  --shadow-2: 0 6px 22px rgba(17, 34, 30, .08);
  --shadow-3: 0 14px 40px rgba(17, 34, 30, .10);

  /* ---- 兼容别名（保留现有组件样式，渐进迁移，勿新增重复组件） ---- */
  --paper: var(--background);
  --card: var(--surface);
  --ink: var(--foreground);
  --ink-2: var(--foreground-2);
  --line: var(--border);
  --line-2: var(--border-subtle);
  --deep: var(--brand);
  --green: var(--brand-hi);
  --green-600: var(--brand-accent);
  --green-700: #38642a;        /* 白底文字/链接专用深绿，对比 ≥7:1（AA 正文达标） */
  --soft: var(--brand-soft);
  --orange: #ff9f62;          /* 适配 .no-box「不适合」强调色 */
  --r-sm: var(--radius-sm);
  --r-md: var(--radius-md);
  --r-lg: var(--radius-lg);
  --r-xl: 18px;               /* entity-head / brandmark 大圆角，保留 */
  --sh-1: var(--shadow-1);
  --sh-2: var(--shadow-2);
  --sh-3: var(--shadow-3);
  --mod-text-bg: var(--category-text-bg);   --mod-text-fg: var(--category-text-fg);
  --mod-image-bg: var(--category-image-bg); --mod-image-fg: var(--category-image-fg);
  --mod-video-bg: var(--category-video-bg); --mod-video-fg: var(--category-video-fg);
}

* { box-sizing: border-box; }

html { scroll-behavior: auto; }

html, body {
  overflow-x: hidden;
}
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

h1, h2, h3, h4 { margin: 0; line-height: 1.24; letter-spacing: -.01em; }

code, pre, .mono {
  font-family: var(--font-mono);
}

/* ---------------- 布局 ---------------- */
.wrap { max-width: 1180px; margin: auto; padding: 0 var(--page-gutter); }
.page { padding: 40px var(--page-gutter) 90px; }
.app-view { min-height: 70vh; }

.page-head { margin-bottom: 28px; }
.page-head h1 { font-size: var(--text-display); font-weight: 800; margin-bottom: 10px; }
.page-head h1 em { font-style: normal; color: var(--green-600); }
.page-desc { color: var(--muted); max-width: 620px; margin: 0; }

.eyebrow {
  display: block;
  font-size: var(--text-xs);
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 10px;
}

.sec-title { font-size: var(--text-5xl); font-weight: 700; margin: 40px 0 6px; }
.sec-sub { color: var(--muted); margin: 0 0 18px; font-size: var(--text-md); }
.sec-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; margin-bottom: 14px; }
.sec-bar .sec-title { margin-bottom: 0; }

.heading { display: flex; gap: 40px; justify-content: space-between; align-items: flex-end; margin-bottom: 24px; flex-wrap: wrap; }
.heading h2 { font-size: var(--text-9xl); font-weight: 800; }
.heading h2 em { font-style: normal; color: var(--green-600); }
.heading > p { color: var(--muted); max-width: 380px; margin: 0; }
.section { padding: 52px 0; }

.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------------- 顶栏 / 底栏 ---------------- */
.topbar {
  height: 72px;
  border-bottom: 1px solid var(--line);
  padding: 0 max(var(--page-gutter), calc((100vw - 1180px) / 2));
  display: flex;
  align-items: center;
  gap: 44px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 40;
}
.brand { text-decoration: none; display: flex; align-items: center; gap: 10px; font-size: var(--text-lg); white-space: nowrap; }
.brand b { font-weight: 800; }
.brand-logo {
  width: 30px; height: 30px; border-radius: 8px;
  display: block; object-fit: contain;
  background: transparent;
}
#main-nav { display: flex; gap: var(--page-gutter); margin-right: auto; }
#main-nav a {
  text-decoration: none; font-size: var(--text-md); color: var(--muted);
  padding: 6px 0; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s;
  white-space: nowrap; flex: none;
}
#main-nav a:hover { color: var(--ink); }
#main-nav a.on { color: var(--deep); border-color: var(--green); font-weight: 600; }
.version-pill {
  font-size: var(--text-xs); padding: 6px var(--space-3); border-radius: var(--radius-pill);
  background: var(--soft); color: var(--deep); font-weight: 600; white-space: nowrap;
}
.footer {
  border-top: 1px solid var(--line);
  padding: var(--page-gutter); display: flex; justify-content: space-between;
  color: var(--muted); font-size: var(--text-base); flex-wrap: wrap; gap: var(--space-2);
}

/* ---------------- 按钮 / 控件 ---------------- */
.button {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 11px 20px; border-radius: var(--radius-pill);
  border: 1px solid var(--line); background: var(--card);
  font-size: var(--text-md); font-weight: 600; cursor: pointer;
  text-decoration: none; color: var(--ink);
  transition: transform .12s, box-shadow .15s, background .15s;
  font-family: inherit;
}
.button:hover { box-shadow: var(--sh-2); }
.button.primary { background: var(--deep); color: var(--on-brand); border-color: var(--deep); }
.button.primary span { color: var(--green); }
.button.ghost { background: transparent; }
.button.small { padding: var(--space-2) 14px; font-size: var(--text-base); }
/* secondary 变体：与基础 .button 等价，显式命名便于后续页面统一调用 */
.button.secondary { background: var(--surface); color: var(--foreground); border-color: var(--border); }

.text-link {
  color: var(--deep); font-weight: 600; font-size: var(--text-base);
  text-decoration: none; border-bottom: 1px solid var(--green-700); padding-bottom: 1px;
}
.text-link:hover { border-color: var(--deep); }
.crumb { text-decoration: none; border-bottom: 1px solid transparent; }
.crumb:hover { border-color: var(--muted); }

.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 0; padding: 0 0 18px; margin: 0;
  color: var(--muted); font-size: var(--text-base); font-weight: 600; cursor: pointer; font-family: inherit;
}
.back-link:hover { color: var(--deep); }

.segmented { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.segmented button {
  padding: var(--space-2) 15px; border-radius: var(--radius-pill); cursor: pointer;
  border: 1px solid var(--line); background: var(--card);
  font-size: var(--text-base); color: var(--ink-2); font-family: inherit;
  transition: background .15s, color .15s, border-color .15s;
}
.segmented button:hover { border-color: var(--border-hover); }
.segmented button.selected { background: var(--deep); color: var(--on-brand); border-color: var(--deep); }

input[type=search], select {
  font-family: inherit; font-size: var(--text-md); color: var(--ink);
  border: 1px solid var(--line); background: var(--card);
  border-radius: var(--radius-md); padding: 11px 18px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input[type=search]:focus { border-color: var(--brand-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-accent) 30%, transparent); }
select { padding: var(--space-2) var(--space-3); border-radius: var(--r-sm); }
.sort-label { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-base); color: var(--muted); }

.toolbar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar #provider-search { min-width: 260px; flex: 1 1 260px; }
.toolbar-segs { display: flex; gap: var(--space-3); flex-wrap: wrap; }

.notice {
  font-size: var(--text-sm); color: var(--muted); background: var(--soft);
  border-radius: var(--r-md); padding: 10px 14px; margin: 0 0 22px;
}

.tabs { display: flex; gap: var(--space-2); border-bottom: 1px solid var(--line); margin-bottom: var(--page-gutter); }
.tabs button {
  background: none; border: 0; border-bottom: 2px solid transparent;
  padding: 10px var(--space-1); margin-right: 20px; cursor: pointer;
  font-family: inherit; font-size: var(--text-lg); font-weight: 600; color: var(--muted);
}
.tabs button.on { color: var(--deep); border-color: var(--deep); }

/* ---------------- 徽章 / 标签 ---------------- */
.tag {
  display: inline-flex; align-items: center;
  font-size: var(--text-xs); padding: var(--space-1) 10px; border-radius: var(--radius-pill);
  background: var(--soft); color: var(--deep); font-weight: 600; white-space: nowrap;
}
.tag-open { background: var(--success-soft); color: var(--success-fg); }
.tag.mono { font-family: var(--font-mono); background: var(--border-subtle); color: var(--ink-2); }

.mod-badge, .mod-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: var(--text-xs); font-weight: 700; padding: var(--space-1) 10px;
  border-radius: var(--radius-pill); white-space: nowrap; line-height: 1.3;
}
.mod-badge i, .mod-chip i { font-style: normal; font-size: var(--text-2xs); }
.mod-text { background: var(--mod-text-bg); color: var(--mod-text-fg); }
.mod-image { background: var(--mod-image-bg); color: var(--mod-image-fg); }
.mod-video { background: var(--mod-video-bg); color: var(--mod-video-fg); }
.mod-legend { display: flex; gap: var(--space-2); margin-top: 18px; flex-wrap: wrap; }
.model-card .mod-badge { padding: 3px var(--space-2); font-size: var(--text-xs); gap: var(--space-1); }
.model-card .free-badge { padding: 2px 7px; font-size: var(--text-2xs); }

.cap-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.cap-tag {
  font-size: var(--text-xs); padding: var(--space-1) 10px; border-radius: 6px;
  background: var(--border-subtle); color: var(--ink-2); border: 1px solid var(--line-2); font-weight: 600;
}

.tier-pill {
  display: inline-block; font-size: var(--text-xs); font-weight: 700;
  padding: 3px 9px; border-radius: var(--radius-pill); white-space: nowrap;
}
.tier-weak { background: var(--border-subtle); color: var(--muted); }
.tier-mid { background: var(--warning-soft); color: var(--warning-fg); }
.tier-high { background: var(--success-soft); color: var(--success-fg); }
.tier-top { background: var(--deep); color: var(--green); }

/* ---------------- 品牌 logo ---------------- */
.brandmark {
  display: inline-grid; place-items: center; flex: none;
  border-radius: 12px; overflow: hidden;
  background: color-mix(in srgb, var(--brand) 9%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--surface));
  color: var(--brand); font-weight: 800;
}
.brandmark img { display: block; object-fit: contain; }
.bm-sm { width: 30px; height: 30px; border-radius: 9px; font-size: var(--text-base); }
.bm-sm img { width: 17px; height: 17px; }
.bm-xs { width: 22px; height: 22px; border-radius: 7px; font-size: var(--text-xs); }
.bm-xs img { width: 13px; height: 13px; }
.bm-md { width: 42px; height: 42px; font-size: var(--text-2xl); }
.bm-md img { width: 24px; height: 24px; }
.bm-lg { width: 64px; height: 64px; border-radius: 18px; font-size: var(--text-8xl); }
.bm-lg img { width: 36px; height: 36px; }

/* ---------------- 首页 ---------------- */
.hero { padding: 58px var(--page-gutter) 44px; }
.hero-single { max-width: 760px; margin: 0 auto; text-align: center; }
.hero-copy.hero-center { display: flex; flex-direction: column; align-items: center; }
.hero h1 { font-size: var(--text-hero); font-weight: 800; letter-spacing: -.03em; margin-bottom: 14px; line-height: 1.08; }
.hero h1 em { font-style: normal; color: var(--green-600); }
.hero-lead { color: var(--muted); font-size: var(--text-xl); max-width: 520px; margin: 0 0 var(--space-5); }
.task-form { width: 100%; max-width: 620px; margin: 0 auto; }
.task-input-row { display: flex; gap: 10px; align-items: stretch; }
.task-input-row input {
  flex: 1; height: 52px; padding: 0 18px; font-size: var(--text-lg);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface); color: var(--foreground);
  transition: border-color .15s, box-shadow .15s;
}
.task-input-row input::placeholder { color: var(--muted); }
.task-input-row input:focus { outline: none; border-color: var(--brand-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-accent) 22%, transparent); }
.task-input-row .button { height: 52px; padding: 0 22px; white-space: nowrap; }
.home-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: center; margin-top: 14px; }
.chip-n {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  background: var(--brand-soft); color: var(--brand); border: 1px solid color-mix(in srgb, var(--brand-accent) 35%, transparent);
  border-radius: var(--radius-pill); padding: 6px var(--space-3); font-size: var(--text-base); font-weight: 600;
  transition: background .14s, border-color .14s;
}
.chip-n:hover { background: color-mix(in srgb, var(--brand-accent) 16%, transparent); }
.chip-n .x { font-size: var(--text-md); line-height: 1; opacity: .6; }
.chip-n:hover .x { opacity: 1; }
.popular-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); justify-content: center; margin-top: 16px; }
.popular-label { font-size: var(--text-base); color: var(--muted); }
.pop-chip {
  cursor: pointer; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-pill);
  padding: 7px 14px; font-size: var(--text-base); font-weight: 600; color: var(--foreground-2);
  transition: transform .14s, border-color .14s, background .14s, color .14s;
}
.pop-chip:hover { border-color: var(--brand-accent); color: var(--brand); background: var(--brand-soft); transform: translateY(-2px); }
/* Phase 2 最近搜索 */
.recent-search { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); justify-content: center; margin-top: 14px; }
.rs-label { font-size: var(--text-sm); color: var(--muted); }
.rs-chip {
  font-size: var(--text-sm); padding: var(--space-1) var(--space-3); border-radius: var(--radius-pill); cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--foreground-2);
  transition: border-color .15s, background .15s, color .15s;
}
.rs-chip:hover { border-color: var(--brand-accent); color: var(--brand); background: var(--brand-soft); }
.hero-browse { display: inline-block; margin-top: 18px; font-size: var(--text-md); }
.section-foot { display: flex; justify-content: center; margin-top: var(--page-gutter); }

/* 首页零成本入口：免费模型 */
.free-band {
  display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 22px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--space-5);
}
.fb-side { display: flex; flex-direction: column; gap: var(--space-4); }
.fb-stats { display: flex; gap: 10px; }
.fb-stat {
  flex: 1; background: var(--success-soft); border-radius: var(--radius-md);
  padding: var(--space-3) 10px; text-align: center;
}
.fb-stat b { display: block; font-size: var(--text-8xl); line-height: 1.1; color: var(--success-fg); font-family: var(--font-mono); }
.fb-stat small { display: block; margin-top: 4px; font-size: var(--text-xs); color: var(--muted); }
.fb-note { margin: 0; font-size: var(--text-sm); line-height: 1.6; color: var(--muted); }
.fb-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; }
.fb-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start; }
.fb-pick {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-3) 14px;
  background: var(--background); transition: border-color .15s, background .15s, transform .15s;
}
.fb-pick:hover { border-color: var(--brand-accent); background: var(--brand-soft); transform: translateY(-1px); }
.fb-pick-main { min-width: 0; flex: 1; }
.fb-pick-main b { display: block; font-size: var(--text-base); color: var(--foreground); }
.fb-pick-main small {
  margin-top: 2px; font-size: var(--text-xs); line-height: 1.45; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.fb-pick-go { color: var(--muted); font-size: var(--text-md); }
.fb-pick:hover .fb-pick-go { color: var(--brand); }
@media (max-width: 860px) {
  .free-band { grid-template-columns: 1fr; }
  .fb-picks { grid-template-columns: 1fr; }
}

/* 信任层（Layer 3） */
.trust-section { margin-top: 8px; }
.trust-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-4); }
.trust-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px 22px;
}
.trust-card h4 { margin: 0 0 var(--space-2); font-size: var(--text-md); color: var(--brand); }
.trust-card p { margin: 0; color: var(--muted); font-size: var(--text-base); line-height: 1.6; }
.trust-card b { color: var(--foreground); }

/* 型号详情：推荐理由 */
.why-box { background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand-accent) 22%, transparent); border-radius: var(--radius-lg); padding: 18px 22px; }
.why-box h3 { margin-bottom: 12px; }
.why-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2) 22px; }
.why-list li { display: flex; align-items: flex-start; gap: var(--space-2); font-size: var(--text-md); color: var(--foreground-2); }
.why-list .ck { color: var(--success); font-weight: 700; flex: none; }
/* Phase 2 综合评分分解条 */
.score-break { background: var(--surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 14px var(--space-4); margin-bottom: 16px; }
.sb-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.sb-head span { font-size: var(--text-base); font-weight: 700; color: var(--foreground-2); }
.sb-head small { display: block; font-size: var(--text-xs); font-weight: 400; color: var(--muted); }
.sb-head b { font-size: var(--text-8xl); font-weight: 800; color: var(--brand); line-height: 1; }
.sb-head b small { font-size: var(--text-base); font-weight: 600; color: var(--muted); margin-left: 2px; }
.sb-row { display: grid; grid-template-columns: 96px 1fr 34px; align-items: center; gap: 10px; margin: 7px 0; }
.sb-label { font-size: var(--text-sm); color: var(--foreground-2); display: flex; flex-direction: column; line-height: 1.2; }
.sb-label i { font-style: normal; font-size: var(--text-2xs); color: var(--muted); }
.sb-track { height: 7px; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--brand-accent) 14%, transparent); overflow: hidden; }
.sb-track i { display: block; height: 100%; border-radius: var(--radius-pill); background: linear-gradient(90deg, var(--brand-accent), var(--brand)); }
.sb-val { font-size: var(--text-sm); font-weight: 700; text-align: right; color: var(--foreground-2); font-variant-numeric: tabular-nums; }
.try-box { display: flex; flex-direction: column; gap: var(--space-2); align-items: flex-start; }
.muted-note { color: var(--muted); font-size: var(--text-sm); margin: 0; }

/* 浏览页工具栏 + 表格视图 */
.browse-toolbar { display: flex; gap: var(--space-3); align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.bt-search { position: relative; flex: 1; min-width: 220px; }
.bt-search .bt-ico { position: absolute; left: 15px; top: 40%; transform: translateY(-50%); color: var(--muted); font-size: var(--text-9xl); line-height: 1; }
.bt-search input { width: 100%; height: 44px; padding: 0 14px 0 42px; font-size: var(--text-md);
  border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--foreground); }
.bt-search input:focus { outline: none; border-color: var(--brand-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-accent) 22%, transparent); }
.view-switch { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--surface); }
.view-switch button { border: 0; background: transparent; padding: 0 var(--space-4); height: 40px; cursor: pointer; font-size: var(--text-base); font-weight: 600; color: var(--muted); }
.view-switch button.selected { background: var(--brand); color: var(--on-brand); }
.cap-mini { display: inline-block; background: var(--category-text-bg); color: var(--category-text-fg); border-radius: var(--radius-pill); padding: 2px var(--space-2); font-size: var(--text-xs); margin: 1px 3px 1px 0; font-weight: 600; white-space: nowrap; }
.dt-name { white-space: nowrap; max-width: 220px; }
.dt-name a { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--foreground); }
.dt-name-txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; flex: 1; }
.dt-name-txt b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.dt-name-txt small { color: var(--muted); font-size: var(--text-xs); }
.dt-caps { min-width: 130px; max-width: 220px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
@media (max-width: 720px) {
  .why-list { grid-template-columns: 1fr; }
  .hero h1 { font-size: var(--text-11xl); }
}

/* ---------------- 厂商卡片 ---------------- */
.provider-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 18px; }
.provider-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 22px; text-decoration: none; display: flex; flex-direction: column; gap: 10px;
  position: relative; overflow: hidden;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.provider-card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--brand, var(--deep)); opacity: .85;
}
.provider-card:hover { transform: translateY(-3px); box-shadow: var(--sh-3); border-color: var(--border-hover); }
.pc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pc-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.provider-card h3 { font-size: var(--text-3xl); }
.provider-card p { margin: 0; color: var(--muted); font-size: var(--text-base); min-height: 40px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pc-mix { display: flex; gap: 6px; flex-wrap: wrap; }
.pc-series { display: flex; gap: 6px; flex-wrap: wrap; }
.series-chip {
  font-size: var(--text-xs); padding: 3px 9px; border-radius: 6px;
  background: var(--border-subtle); color: var(--ink-2); border: 1px solid var(--line-2);
}
.series-chip.more, .mini-chip.more { color: var(--muted); }
.pc-body { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.pc-foot {
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--line-2); padding-top: 12px; margin-top: auto;
  font-size: var(--text-sm); color: var(--muted);
}
.pc-foot i { font-style: normal; color: var(--green-700); font-weight: 600; }

/* ---------------- 实体头部（厂商 / 系列 / 型号）---------------- */
.entity-head {
  display: flex; gap: 22px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: 28px; margin-bottom: var(--page-gutter); position: relative; overflow: hidden;
}
.entity-head::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: var(--brand, var(--deep));
}
.eh-main { flex: 1; min-width: 0; }
.eh-main h1 { font-size: var(--text-10xl); font-weight: 800; margin-bottom: 8px; }
.eh-main > p { color: var(--muted); margin: 0 0 var(--space-3); max-width: 680px; }
.eh-tags { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
.eh-links { display: flex; gap: var(--space-4); margin-top: 14px; flex-wrap: wrap; }

/* ---------------- 参数卡片条 ---------------- */
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-3); }
.stat-strip.four { grid-template-columns: repeat(4, 1fr); }
.stat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 14px var(--space-4); display: flex; flex-direction: column; gap: 3px; min-width: 0;
}
.stat-label { font-size: var(--text-xs); color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.stat-value {
  font-size: var(--text-4xl); font-weight: 700; color: var(--deep);
  word-break: break-word; line-height: 1.3;
}
.stat-value code { font-size: var(--text-sm); font-weight: 600; background: none; padding: 0; }
.stat-card small { font-size: var(--text-xs); color: var(--muted); }

/* ---------------- 系列卡片 / 系列页 ---------------- */
.family-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: var(--space-4); }
.family-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 20px; text-decoration: none; display: flex; flex-direction: column; gap: 10px;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.family-card:hover { transform: translateY(-3px); box-shadow: var(--sh-3); border-color: color-mix(in srgb, var(--brand) 35%, var(--surface)); }
.fc-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.fc-top b { font-size: var(--text-xl); }
.fc-top .count { font-size: var(--text-xs); color: var(--muted); background: var(--soft); padding: 3px 9px; border-radius: var(--radius-pill); }
.family-card p { margin: 0; color: var(--muted); font-size: var(--text-base); flex: 1; }
.fc-mix, .fc-models { display: flex; gap: 6px; flex-wrap: wrap; }
.mini-chip {
  font-size: var(--text-xs); padding: 3px var(--space-2); border-radius: 6px;
  background: var(--border-subtle); color: var(--ink-2); border: 1px solid var(--line-2);
}
.fc-go { font-style: normal; font-size: var(--text-base); color: var(--green-700); font-weight: 600; margin-top: 2px; }

.pick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--space-3); margin-bottom: 8px; }
.pick-card {
  background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--green);
  border-radius: var(--r-md); padding: 14px var(--space-4); text-decoration: none;
  display: flex; flex-direction: column; gap: 3px; transition: box-shadow .15s, transform .12s;
}
.pick-card:hover { box-shadow: var(--sh-2); transform: translateY(-2px); }
.pick-label { font-size: var(--text-xs); color: var(--green-700); font-weight: 700; letter-spacing: .04em; }
.pick-card b { font-size: var(--text-lg); }
.pick-card small { color: var(--muted); font-size: var(--text-sm); }

/* ---------------- 对比表 ---------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); max-width: 100%; }
.cmp-table { width: 100%; border-collapse: collapse; font-size: var(--text-base); min-width: 780px; }
.cmp-table th {
  text-align: left; font-size: var(--text-xs); letter-spacing: .04em; color: var(--muted);
  font-weight: 700; padding: 13px var(--space-4); border-bottom: 1px solid var(--line); background: var(--border-subtle);
  white-space: nowrap;
}
.cmp-table td { padding: 13px var(--space-4); border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.cmp-table tbody tr { cursor: pointer; transition: background .12s; }
.cmp-table tbody tr:hover { background: var(--brand-soft); }
.cmp-table tbody tr:last-child td { border-bottom: 0; }
.cmp-table td b { display: block; font-size: var(--text-md); }
.cmp-table td small { color: var(--muted); font-size: var(--text-xs); font-family: var(--font-mono); }
/* 对比表首列 sticky：窄屏横滚时模型名列固定，便于对照 */
.cmp-table th:first-child, .cmp-table td:first-child { position: sticky; left: 0; z-index: 2; background: var(--card); }
.cmp-table thead th:first-child { background: var(--border-subtle); z-index: 3; }
.cell-desc { color: var(--muted); font-size: var(--text-sm); display: block; max-width: 260px; }
.td-go { color: var(--green-700); font-weight: 700; text-align: right; }
/* 表格行首列模型名：真链接，键盘 / Tab 可达（替代仅靠整行 data-goto 点击） */
.row-link { color: var(--ink); text-decoration: none; font-weight: 600; }
.row-link:hover { color: var(--deep); }

/* ============================================================
   基础组件：数据表 Token 系统（Phase 0.2）
   data-table / data-table--browse / data-table--compare 共享
   排版 / 间距 / 边框 Token；不耦合任何业务逻辑。
   现有 .cmp-table（app.js 标记不变）通过选择器复用 compare 表 Token。
   ============================================================ */
/* 共享层：排版 / 颜色 / 折叠（含 .cmp-table，不新增重复组件） */
.data-table,
.data-table--browse,
.data-table--compare,
.cmp-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  color: var(--foreground);
}
/* 独立数据表（非 .table-wrap 包裹时）自带边框 / 圆角 / 底色；
   .cmp-table 已由 .table-wrap 提供，故不重复加边框，避免双线 */
.data-table,
.data-table--browse,
.data-table--compare {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
}
.data-table th, .data-table td,
.data-table--browse th, .data-table--browse td,
.data-table--compare th, .data-table--compare td,
.cmp-table th, .cmp-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  vertical-align: middle;
}
.data-table thead th,
.data-table--browse thead th,
.data-table--compare thead th {
  font-weight: 600; font-size: var(--text-sm); letter-spacing: .02em;
  color: var(--muted); background: var(--border-subtle);
}
.data-table tbody tr:last-child td,
.data-table--compare tbody tr:last-child td,
.cmp-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover,
.data-table--compare tbody tr:hover,
.cmp-table tbody tr:hover { background: var(--brand-soft); }

/* 变体：浏览表（紧凑） */
.data-table--browse { font-size: var(--text-base); min-width: 720px; table-layout: fixed; }
.data-table--browse col:nth-child(1) { width: 22%; }
.data-table--browse col:nth-child(2) { width: 12%; }
.data-table--browse col:nth-child(3) { width: 10%; }
.data-table--browse col:nth-child(4) { width: 9%; }
.data-table--browse col:nth-child(5) { width: 9%; }
.data-table--browse col:nth-child(6) { width: 14%; }
.data-table--browse col:nth-child(7) { width: 7%; }
.data-table--browse col:nth-child(8) { width: 7%; }
.data-table--browse col:nth-child(9) { width: 10%; }
/* 变体：对比表（常规字号，强调行 hover） */
.data-table--compare { font-size: var(--text-md); }

/* 移动端：浏览表 / 对比表转卡片堆叠，消除窄屏横向滚动（断点提到 768px，覆盖 641–768 夹层） */
@media (max-width: 768px) {
  /* —— 浏览表 —— */
  .data-table--browse { min-width: 0 !important; table-layout: auto; font-size: var(--text-base); }
  .data-table--browse colgroup { display: none; }
  .data-table--browse thead { display: none; }
  .data-table--browse tr {
    display: block; margin-bottom: 12px; padding: var(--space-1) 2px;
    background: var(--card); border: 1px solid var(--border-subtle); border-radius: var(--r-md);
  }
  .data-table--browse td {
    display: flex; justify-content: space-between; align-items: center; gap: var(--space-3);
    padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border-subtle); text-align: right;
  }
  .data-table--browse tr td:last-child { border-bottom: 0; }
  .data-table--browse td::before {
    content: attr(data-label); flex: none; text-align: left;
    font-size: var(--text-xs); font-weight: 700; color: var(--muted); letter-spacing: .02em;
  }
  .data-table--browse td.dt-name { display: block; padding: var(--space-3) var(--space-3) var(--space-2); }
  .data-table--browse td.dt-name::before { content: none; }
  .data-table--browse td.dt-name a { display: flex; width: 100%; min-width: 0; }
  .data-table--browse .dt-name { max-width: none; }
  .data-table--browse td.dt-caps { max-width: none; flex-wrap: wrap; justify-content: flex-end; }
  .data-table--browse td.dt-caps .cap-mini { margin: 1px 0 1px var(--space-1); }
  /* —— 对比表 —— */
  .cmp-table { min-width: 0 !important; table-layout: auto; font-size: var(--text-base); }
  .cmp-table colgroup { display: none; }
  .cmp-table thead { display: none; }
  .cmp-table tbody tr {
    display: block; margin-bottom: 12px; padding: var(--space-1) 2px;
    background: var(--card); border: 1px solid var(--border-subtle); border-radius: var(--r-md); cursor: default;
  }
  .cmp-table tbody td {
    display: flex; justify-content: space-between; align-items: center; gap: var(--space-3);
    padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border-subtle); text-align: right;
  }
  .cmp-table tbody tr td:last-child { border-bottom: 0; }
  .cmp-table tbody td::before {
    content: attr(data-label); flex: none; text-align: left;
    font-size: var(--text-xs); font-weight: 700; color: var(--muted); letter-spacing: .02em;
  }
  .cmp-table tbody td:first-child { position: static; background: transparent; }
  .cmp-table .td-go { justify-content: flex-end; }
}

/* ---------------- 模型卡网格 ---------------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card-grid.compact { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.model-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--space-4) 18px; text-decoration: none; display: flex; flex-direction: column; gap: 6px;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.model-card:hover { transform: translateY(-3px); box-shadow: var(--sh-3); border-color: var(--border-hover); }
.mc-top { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; overflow: hidden; min-width: 0; }
.mc-tags { display: flex; align-items: center; gap: 5px; flex-wrap: nowrap; margin-left: auto; overflow: hidden; min-width: 0; }
.mc-name { min-width: 0; overflow-wrap: anywhere; }
.mc-name { font-size: var(--text-xl); font-weight: 700; margin-top: 4px; }
.mc-from { font-size: var(--text-sm); color: var(--muted); }
.mc-desc { margin: 2px 0 0; font-size: var(--text-base); color: var(--ink-2); flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mc-meta {
  display: flex; gap: 10px; flex-wrap: wrap; font-size: var(--text-xs); color: var(--muted);
  border-top: 1px solid var(--line-2); padding-top: 10px; margin-top: 8px;
}
.mc-hits { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.hit-pill { font-size: var(--text-2xs); font-weight: 700; padding: 2px var(--space-2); border-radius: var(--radius-pill); }
.hot-flag, .match-flag {
  display: inline-flex; align-items: center;
  margin-left: auto; font-size: var(--text-xs); font-weight: 700; white-space: nowrap; line-height: 1;
  background: var(--deep); color: var(--green); padding: 3px 9px; border-radius: var(--radius-pill);
}
/* Phase 2 浏览卡片/表格综合评分标 */
.score-flag {
  display: inline-flex; align-items: center;
  margin-left: auto; font-size: var(--text-xs); font-weight: 700; white-space: nowrap; line-height: 1;
  background: var(--brand-soft); color: var(--brand); padding: 3px 9px; border-radius: var(--radius-pill);
  border: 1px solid color-mix(in srgb, var(--brand-accent) 24%, transparent);
}
.score-td { color: var(--brand); font-weight: 700; font-variant-numeric: tabular-nums; }
.free-badge {
  display: inline-flex; align-items: center;
  font-size: var(--text-xs); font-weight: 700; letter-spacing: .02em; line-height: 1; white-space: nowrap;
  color: var(--green); background: var(--deep);
  padding: 2px var(--space-2); border-radius: var(--radius-pill); cursor: default;
}
.free-badge.sm { font-size: var(--text-2xs); padding: 1px 6px; }
/* 对比表价格列：免费/带说明型号后的「信息点」+ 悬停/点击浮层 */
.price-cell { position: relative; display: inline-flex; align-items: center; gap: 5px; }
.free-info {
  position: relative;
  width: 15px; height: 15px; flex: none;
  border-radius: 50%;
  background: var(--deep); color: var(--green);
  font-style: normal; font-size: var(--text-2xs); font-weight: 700; line-height: 15px; text-align: center;
  cursor: pointer; user-select: none; outline: none;
}
.free-info:hover, .free-info:focus, .free-info.active { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-accent) 30%, transparent); }
.free-tip {
  display: none;
  position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%);
  width: 230px; max-width: 70vw;
  background: var(--deep); color: var(--on-brand);
  font-size: var(--text-sm); font-weight: 400; line-height: 1.55; text-align: left;
  padding: var(--space-2) 10px; border-radius: 8px; z-index: 60;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--foreground) 22%, transparent);
}
.free-tip::after {
  content: ''; position: absolute; right: 100%; top: 50%; transform: translateY(-50%);
  border: 6px solid transparent; border-right-color: var(--deep);
}
/* 最右列免费信息点：浮层向左展开，避免溢出视口右侧 */
.cmp-table td:last-child .free-tip,
.data-table--compare td:last-child .free-tip { left: auto; right: calc(100% + 8px); }
.cmp-table td:last-child .free-tip::after,
.data-table--compare td:last-child .free-tip::after { right: auto; left: 100%; border-right-color: transparent; border-left-color: var(--deep); }
.free-info:hover .free-tip,
.free-info:focus .free-tip,
.free-info.active .free-tip { display: block; }
/* 厂商类型徽章：免费 API / 托管网关 */
.cat-badge {
  display: inline-flex; align-items: center;
  font-size: var(--text-xs); font-weight: 700; letter-spacing: .02em; line-height: 1.4;
  color: var(--on-brand); padding: 2px var(--space-2); border-radius: var(--radius-pill); cursor: default; white-space: nowrap;
}
.cat-free { background: var(--deep); color: var(--green); }
.cat-gateway { background: var(--accent-gateway); }
.gateway-note {
  background: var(--soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  border-radius: 14px;
  padding: var(--space-4) 18px;
  margin-bottom: 18px;
}
.gateway-note .gn-title {
  display: inline-block; font-size: var(--text-sm); font-weight: 800; letter-spacing: .04em;
  color: var(--green); background: var(--deep); padding: 2px 10px; border-radius: var(--radius-pill); margin-bottom: 8px;
}
.gateway-note p { margin: var(--space-1) 0 10px; font-size: var(--text-md); color: var(--ink); }
.gateway-note strong { color: var(--deep); }
.gn-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: 8px; }
.gn-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--text-base); font-weight: 600; color: var(--deep);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-pill);
  padding: var(--space-1) 10px var(--space-1) 6px; text-decoration: none; transition: .15s;
}
.gn-chip .brandmark { flex: none; box-shadow: 0 0 0 1px var(--line); }
.gn-chip .gn-host {
  font-style: normal; font-size: var(--text-2xs); font-weight: 700; letter-spacing: .03em;
  color: var(--on-brand); background: var(--accent-gateway); padding: 1px 6px; border-radius: var(--radius-pill);
}
.gn-chip:hover { border-color: var(--brand-accent); color: var(--green-700); }
.gn-link { color: var(--green-700); font-weight: 700; text-decoration: none; }
.gn-link:hover { text-decoration: underline; }
.gw-intro { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); margin: var(--space-2) 0 22px; }
.gw-pros, .gw-cons { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: var(--space-4) 18px; }
.gw-pros h4, .gw-cons h4 { margin: 0 0 var(--space-2); font-size: var(--text-md); }
.gw-pros h4 { color: var(--success-fg); }
.gw-cons h4 { color: var(--error-fg); }
.gw-intro ul { margin: 0; padding-left: 18px; }
.gw-intro li { font-size: var(--text-base); line-height: 1.7; color: var(--muted); }
.gw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: var(--space-4); }
.gw-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.gw-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.gw-head h3 { margin: 0; font-size: var(--text-xl); }
.gw-desc { font-size: var(--text-base); color: var(--muted); margin: 0 0 var(--space-3); line-height: 1.6; }
.gw-models { display: flex; flex-direction: column; gap: var(--space-2); }
.gw-model { display: flex; align-items: center; gap: var(--space-2); text-decoration: none; color: var(--ink); background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: var(--space-2) 10px; transition: .15s; }
.gw-model:hover { border-color: var(--green); }
.gw-model b { font-size: var(--text-base); font-weight: 600; }
.gw-model small { margin-left: auto; color: var(--muted); font-size: var(--text-xs); font-family: var(--font-mono); }
@media (max-width: 640px) { .gw-intro { grid-template-columns: 1fr; } }
.gateway-note small { color: var(--muted); font-size: var(--text-sm); }
.result-count { font-size: var(--text-base); color: var(--muted); margin: 0 0 14px; }
.result-count b { color: var(--deep); }

/* ---------------- 浏览页 ---------------- */
.browse-layout { display: grid; grid-template-columns: 268px 1fr; gap: var(--page-gutter); align-items: start; }
.browse-results { min-width: 0; }
.filter-panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px; position: sticky; top: 92px; display: flex; flex-direction: column; gap: var(--space-4);
}
/* 面板头：标题与「清空」同行，常驻面板顶部，滚动时始终可达 */
.fp-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); }
.fp-head h3 { font-size: var(--text-md); font-weight: 700; color: var(--ink); margin: 0; }
.fp-reset {
  border: 0; background: none; padding: 0; cursor: pointer; font-family: inherit;
  font-size: var(--text-sm); color: var(--muted); text-decoration: underline; text-underline-offset: 2px;
}
.fp-reset:hover { color: var(--green-700); }
/* 标题与副标题同行，避免每块多占一行 */
.fp-block h4 { font-size: var(--text-sm); color: var(--ink); margin-bottom: 8px; display: flex; align-items: baseline; gap: 6px; }
.fp-block h4 small { font-weight: 400; color: var(--muted); font-size: var(--text-xs); }
.chip-wrap { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; white-space: nowrap;
  padding: 5px 10px; border-radius: var(--r-sm); cursor: pointer;
  border: 1px solid var(--line); background: var(--card); font-family: inherit;
  font-size: var(--text-sm); font-weight: 600; color: var(--ink-2); line-height: 1.5;
  transition: background .15s, border-color .15s, color .15s;
}
.chip:hover { border-color: var(--border-hover); }
.chip.on { background: var(--deep); border-color: var(--deep); color: var(--on-brand); }
/* 能力维度（主观评级）用虚线框，与客观硬性条件在同一组内保持可辨识 */
.chip--cap { border-style: dashed; }
.chip--cap.on { border-style: solid; }
/* 侧栏内分段按钮收窄，让模态 / 价格 / 排序各自回到单行 */
.filter-panel .segmented { gap: 5px; }
.filter-panel .segmented button { padding: 5px 11px; font-size: var(--text-sm); }

.task-result { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; }

/* ---------------- 推荐结果行 ---------------- */
.tr-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 16px; gap: var(--space-4); }
.tr-head h3 { font-size: var(--text-4xl); margin: 0; line-height: 1.25; }
.match-badge {
  font-size: var(--text-xs); font-weight: 700; padding: 5px var(--space-3); border-radius: var(--radius-pill);
  background: var(--soft); color: var(--deep); white-space: nowrap;
}
.result-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0; border-top: 1px solid var(--line-2);
  text-decoration: none; transition: padding-left .15s;
}
.result-row:hover { padding-left: 6px; }
.result-row:hover .result-main b { color: var(--green-700); }
.rank { font-size: var(--text-sm); color: var(--muted); font-weight: 700; width: 22px; flex: none; }
.result-main { display: flex; flex-direction: column; min-width: 160px; }
.result-main b { font-size: var(--text-lg); }
.result-main small { font-size: var(--text-xs); color: var(--muted); }
.result-reason { flex: 1; font-size: var(--text-sm); color: var(--muted); min-width: 140px; }
.score-pill {
  font-size: var(--text-xs); font-weight: 700; padding: 3px 9px; border-radius: var(--radius-pill);
  background: var(--success-soft); color: var(--success-fg); white-space: nowrap;
}
.arrow { color: var(--green-700); font-weight: 700; }
.disclaimer { font-size: var(--text-sm); color: var(--muted); margin: var(--space-4) 0 0; }

/* ---------------- 匹配器 ---------------- */
.matcher-page { background: var(--background); }
.matcher-layout { display: grid; grid-template-columns: 380px 1fr; gap: var(--page-gutter); align-items: start; }
.matcher-form {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--space-5);
}
.matcher-form label { display: block; font-size: var(--text-sm); color: var(--muted); font-weight: 700; margin: var(--space-3) 0 10px; }
.matcher-form label:first-child { margin-top: 0; }
.task-options { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.task-option {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 11px; cursor: pointer; font-family: inherit; text-align: left;
  display: flex; flex-direction: row; align-items: flex-start; gap: 9px; transition: background .15s, border-color .15s;
}
.task-option .to-ico { flex: none; font-size: var(--text-2xl); line-height: 1.3; color: var(--green-600); }
.task-option .to-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.task-option b { font-size: var(--text-base); }
.task-option small { font-size: var(--text-2xs); color: var(--muted); line-height: 1.4; }
.task-option:hover { border-color: var(--border-hover); }
.task-option.selected { background: var(--deep); border-color: var(--deep); color: var(--on-brand); }
.task-option.selected small { color: color-mix(in srgb, var(--on-brand) 60%, transparent); }
.task-option.selected span { color: var(--green); }
.recommendation {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--space-5); min-height: 320px;
}

/* ---------------- 型号详情 ---------------- */
.detail-page .entity-head { align-items: flex-start; }
.detail-sec { margin-top: 34px; }
.detail-sec > h3 {
  font-size: var(--text-3xl); font-weight: 700; margin-bottom: 14px;
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.detail-sec > h3 small { font-size: var(--text-sm); color: var(--muted); font-weight: 400; }

.cap-bars {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px;
}
.cap-row { display: flex; flex-direction: column; gap: 7px; }
.cap-row-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.cap-row-head b { font-size: var(--text-base); display: flex; align-items: baseline; gap: 6px; }
.cap-row-head b span { font-size: var(--text-2xs); color: var(--muted); font-weight: 400; letter-spacing: .04em; }
.cap-track { height: 6px; border-radius: var(--radius-pill); background: var(--border-subtle); overflow: hidden; }
.cap-track i { display: block; height: 100%; border-radius: var(--radius-pill); }
.cap-track i.tier-weak { background: var(--border-subtle); }
.cap-track i.tier-mid { background: var(--warning); }
.cap-track i.tier-high { background: var(--success); }
.cap-track i.tier-top { background: var(--deep); }
.cap-row small { font-size: var(--text-xs); color: var(--muted); line-height: 1.5; }

.detail-sec.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fit-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; }
.fit-box h4 { font-size: var(--text-md); margin-bottom: 10px; }
.ok-box { border-left: 3px solid var(--green); }
.no-box { border-left: 3px solid var(--orange); }
.fit-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 7px; }
.fit-list li {
  font-size: var(--text-sm); padding: 5px 11px; border-radius: var(--radius-pill); font-weight: 600;
}
.fit-list li.ok { background: var(--success-soft); color: var(--success-fg); }
.fit-list li.no { background: var(--warning-soft); color: var(--warning-fg); }
.fit-list li.muted { background: var(--border-subtle); color: var(--muted); font-weight: 400; }

.api-block { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.api-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-bottom: 14px; }
.api-fact {
  display: flex; flex-direction: column; gap: 3px;
  background: var(--paper); border-radius: var(--r-sm); padding: 10px var(--space-3);
}
.api-fact b { font-size: var(--text-xs); color: var(--muted); font-weight: 700; }
.api-fact code { font-size: var(--text-sm); color: var(--deep); word-break: break-all; }
.api-feat span { display: flex; flex-wrap: wrap; gap: 5px; }
.api-price {
  display: flex; flex-direction: column; gap: var(--space-1); margin: 14px 0;
  background: var(--paper); border-left: 3px solid var(--green-600);
  border-radius: var(--r-sm); padding: 10px 13px;
}
.api-price b { font-size: var(--text-xs); color: var(--green-700); font-weight: 700; letter-spacing: .02em; }
.api-price span { font-size: var(--text-sm); color: var(--deep); line-height: 1.5; }
.api-note {
  margin: var(--space-3) 0 2px; padding: 10px 13px; border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--warning) 14%, transparent); border-left: 3px solid var(--warning);
  font-size: var(--text-sm); line-height: 1.55; color: var(--deep);
}
.grade-badge {
  display: inline-flex; align-items: center; gap: var(--space-1);
  font-size: var(--text-xs); font-weight: 700; line-height: 1.2; white-space: nowrap;
  padding: 3px var(--space-2); border-radius: var(--radius-pill);
  background: var(--soft); color: var(--deep);
}
.grade-badge::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: var(--grade-dot, currentColor);
}
.grade-badge.g-A { background: var(--success-soft); --grade-dot: var(--success-fg); }
.grade-badge.g-B { background: color-mix(in srgb, var(--accent) 14%, var(--background)); --grade-dot: var(--accent); }
.grade-badge.g-C { background: var(--warning-soft); --grade-dot: var(--warning-fg); }
.grade-badge.g-D { background: var(--error-soft); --grade-dot: var(--error-fg); }
.eco-box { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.eco-row { display: grid; grid-template-columns: 110px 1fr; gap: var(--space-3); padding: 11px 15px; align-items: start; border-bottom: 1px solid var(--line); }
.eco-row:last-child { border-bottom: none; }
.eco-row > b { font-size: var(--text-sm); color: var(--muted); font-weight: 700; padding-top: 2px; }
.eco-row > span { font-size: var(--text-base); color: var(--deep); line-height: 1.6; }
.eco-links { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.eco-link { color: var(--green-700); font-weight: 600; text-decoration: none; border-bottom: 1px dashed color-mix(in srgb, var(--green-700) 50%, transparent); }
.eco-link:hover { color: var(--deep); }
.bench-list { list-style: none; display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; }
.bench-list li { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.bench-list b { font-size: var(--text-base); color: var(--deep); }
.bench-list span { font-size: var(--text-sm); color: var(--muted); }
/* 版本信息区块（model_versions.json） */
.ver-box { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.ver-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 15px; border-bottom: 1px solid var(--line); }
.ver-row:last-child { border-bottom: none; }
.ver-row > b { font-size: var(--text-base); color: var(--deep); }
.ver-row > .muted { font-size: var(--text-sm); }
.feat {
  font-style: normal; font-size: var(--text-xs); font-weight: 600; padding: 2px var(--space-2); border-radius: var(--radius-pill);
  background: var(--paper); color: var(--muted); border: 1px solid var(--line);
}
.feat.on { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--deep); border-color: var(--green-600); }
.feat.dim { opacity: .7; }
.code-tabs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.code-tab {
  border: 1px solid var(--line); background: var(--card); border-radius: var(--radius-pill);
  padding: 6px 14px; font-size: var(--text-sm); cursor: pointer; font-family: inherit; color: var(--ink-2);
}
.code-tab.selected { background: var(--deep); color: var(--on-brand); border-color: var(--deep); }
.copy-btn {
  margin-left: auto; border: 1px solid var(--line); background: var(--card);
  border-radius: var(--radius-pill); padding: 6px 14px; font-size: var(--text-sm); cursor: pointer;
  font-family: inherit; color: var(--ink-2);
}
.copy-btn:hover { border-color: var(--green-600); color: var(--deep); }
.code-block {
  margin: 0; background: var(--code-bg); color: var(--code-fg); border-radius: var(--r-md);
  padding: var(--space-4) 18px; overflow-x: auto; font-size: var(--text-sm); line-height: 1.65;
}
.code-block code { font-family: inherit; white-space: pre; }

.naming-grid, .glossary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--space-3); }
.naming-card, .glossary-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: var(--space-4); display: flex; flex-direction: column; gap: 5px;
}
.naming-term {
  align-self: flex-start; font-size: var(--text-xs); font-weight: 700;
  background: var(--deep); color: var(--green); padding: 3px 9px; border-radius: 6px;
}
.naming-card b, .glossary-card b { font-size: var(--text-md); }
.naming-card p, .glossary-card p { margin: 0; font-size: var(--text-sm); color: var(--muted); flex: 1; }
.naming-card small, .glossary-card small { font-size: var(--text-xs); color: var(--green-700); }

/* 参数速读（解读区块） */
.insight-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.insight-card {
  background: var(--card); border: 1px solid var(--line);
  border-left: 3px solid var(--green-600); border-radius: var(--r-md);
  padding: 10px 13px; display: flex; flex-direction: column; gap: var(--space-1);
}
.insight-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.insight-k { font-size: var(--text-xs); font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.insight-band { font-size: var(--text-2xs); font-weight: 700; color: var(--deep); background: var(--green); padding: 1px 7px; border-radius: var(--radius-pill); white-space: nowrap; }
.insight-val { font-size: var(--text-md); font-weight: 800; color: var(--deep); line-height: 1.25; word-break: break-word; }
.insight-card p { margin: 0; font-size: var(--text-xs); color: var(--muted); line-height: 1.45; }
.insight-tip { font-size: var(--text-2xs); color: var(--green-700); }

.rel-group { margin-bottom: 18px; }
.rel-group h4 { font-size: var(--text-base); color: var(--muted); margin-bottom: 10px; font-weight: 700; }
.source-line { margin-top: 34px; font-size: var(--text-sm); color: var(--muted); }

/* ---------------- 空态 ---------------- */
.empty-box {
  grid-column: 1 / -1; text-align: center; padding: 44px 20px;
  background: var(--card); border: 1px dashed var(--line); border-radius: var(--r-lg); color: var(--muted);
}
.empty-box span { font-size: var(--text-6xl); color: var(--green-600); display: block; margin-bottom: 8px; }
.empty-box p { margin: 0; font-size: var(--text-base); }
.empty-box.big { padding: 70px 20px; }
.empty-box.big h2 { font-size: var(--text-6xl); color: var(--ink); margin-bottom: 8px; }

/* ---------------- 响应式 ---------------- */
:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }

@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; }
  .browse-layout, .matcher-layout { grid-template-columns: 1fr; }
  .filter-panel { position: static; min-width: 0; }
  .stat-strip.four { grid-template-columns: repeat(2, 1fr); }
}

/* 顶栏在 721–960px 区间易溢出：提前折行 + 导航横滑（iPad 竖屏 768px 也能完整显示） */
@media (max-width: 960px) {
  .topbar { gap: 18px; height: auto; padding: var(--space-3) 18px; flex-wrap: wrap; }
  #main-nav {
    gap: var(--space-4); order: 3; width: 100%; overflow-x: auto;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
    scrollbar-width: none;
  }
  #main-nav::-webkit-scrollbar { display: none; }
  .version-pill { display: none; }
}

@media (max-width: 720px) {
  /* 顶栏折行已在 ≤960px 断点统一处理 */
  .page { padding-block: var(--page-gutter) 60px; padding-inline: 18px; }
  .wrap { padding-inline: 18px; }
  .page-head h1, .hero h1 { font-size: var(--text-10xl); }
  .eh-main h1 { font-size: var(--text-7xl); }
  .entity-head { flex-direction: column; gap: 14px; padding: 20px; }
  .detail-sec.split { grid-template-columns: 1fr; }
  .stat-strip.four { grid-template-columns: 1fr 1fr; }
  .task-options { grid-template-columns: 1fr; }
  .result-row { flex-wrap: wrap; }
  .result-reason { width: 100%; }
  .filter-panel .segmented { flex-wrap: wrap; }
  .filter-panel .segmented button { flex: 1 1 auto; }
  /* 移动端触控目标不小于 36–40px，避免误触 */
  .chip, .cmp-toggle, .rs-chip { min-height: 36px; }
  .cmp-remove { min-width: 32px; min-height: 32px; }
}

/* ---------- 对比集 / 最近浏览 ---------- */
.detail-actions { margin: var(--space-1) 0 18px; }
.cmp-toggle {
  border: 1px solid var(--success); color: var(--success-fg); background: var(--surface);
  border-radius: var(--radius-pill); padding: 0 6px; font-size: var(--text-md); font-weight: 600;
  cursor: pointer; transition: background .15s, color .15s;
}
.cmp-toggle:hover { background: var(--success-soft); }
.cmp-toggle.on { background: var(--deep); color: var(--green); }
/* Phase 2：browse 表内紧凑型，禁止文案换行撑破列宽 */
.cmp-toggle.sm { white-space: nowrap; padding: 0 10px; min-height: 28px; }
/* Phase 2 收藏星 */
.fav-toggle { margin-left: 8px; }
.fav-toggle.on { background: var(--deep); color: var(--green); border-color: var(--deep); }
.cmp-remove {
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 8px; width: 28px; height: 28px; cursor: pointer; line-height: 1; font-size: var(--text-md);
}
.cmp-remove:hover { border-color: var(--error); color: var(--error); }
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px;
  border-radius: var(--radius-pill); background: var(--deep); color: var(--green); font-size: var(--text-xs); font-weight: 700;
}
.nav-badge[hidden] { display: none; }

/* 首屏骨架屏（loadData 首次渲染前占位，消除白屏） */
#boot-skeleton { display: flex; flex-direction: column; gap: 22px; }
.sk-hero { height: 120px; border-radius: 16px; }
.sk-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }
.sk-card { height: 160px; border-radius: 14px; }
.sk-hint { color: var(--muted); font-size: var(--text-md); margin: var(--space-1) 0 0; }
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 50;
  background: var(--accent); color: var(--on-brand); padding: var(--space-2) 14px; border-radius: 8px;
  font-size: var(--text-md); font-weight: 600; transition: top .15s ease; text-decoration: none;
}
.skip-link:focus { top: 10px; }
.sk-hero, .sk-card {
  background: linear-gradient(100deg, var(--border-subtle) 30%, var(--surface) 50%, var(--border-subtle) 70%);
  background-size: 200% 100%;
  animation: sk-shimmer 1.3s ease-in-out infinite;
}
@keyframes sk-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (max-width: 720px) { .sk-grid { grid-template-columns: 1fr 1fr; } }

/* 轻提示（对比集上限等） */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(12px);
  max-width: min(90vw, 420px); padding: 10px var(--space-4); border-radius: var(--r-pill, 999px);
  background: var(--deep, #11231a); color: var(--on-brand, #eafff0);
  font-size: var(--text-base); font-weight: 500; box-shadow: var(--sh-2, 0 8px 24px rgba(0,0,0,.18));
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 60;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
