/* =====================================================================
   模型广场独立页 · 样式（依赖 landing.css 的设计令牌与通用组件）
   ===================================================================== */

/* ---------- 页头 ---------- */
.models-hero {
  position: relative;
  padding: 56px 0 32px;
  background: linear-gradient(180deg, #fafbfd 0%, #ffffff 100%);
  border-bottom: 1px solid var(--border-light);
  overflow: hidden;
}
.models-hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(228, 228, 231, 1) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: .55;
  -webkit-mask-image: radial-gradient(720px 360px at 50% 0%, #000 0%, transparent 78%);
  mask-image: radial-gradient(720px 360px at 50% 0%, #000 0%, transparent 80%);
  pointer-events: none;
}
.models-hero .container { position: relative; z-index: 1; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-4); margin-bottom: 18px; }
.crumbs a:hover { color: var(--primary); }
.crumbs b { color: var(--text-2); font-weight: 600; }
.models-hero h1 { font-size: clamp(30px, 4vw, 42px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.models-sub { margin-top: 14px; max-width: 720px; font-size: 16px; color: var(--text-3); line-height: 1.7; }
.models-sub #models-count-line { display: block; margin-top: 6px; font-size: 13.5px; color: var(--text-4); font-variant-numeric: tabular-nums; }

/* ---------- 工具栏 ---------- */
.models-toolbar {
  display: flex; align-items: center; gap: 14px;
  margin-top: 28px; flex-wrap: wrap;
}
.search-box {
  flex: 1; min-width: 240px; max-width: 460px;
  display: flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 16px;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.search-box svg { width: 18px; height: 18px; color: var(--text-4); flex: none; }
.search-box input {
  flex: 1; min-width: 0; height: 100%;
  border: none; outline: none; background: none;
  font-size: 14.5px; font-family: inherit; color: var(--text-1);
}
.search-box input::placeholder { color: var(--text-4); }
.sort-box {
  display: inline-flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 6px 0 16px;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-sm);
  font-size: 14px; color: var(--text-3);
}
.sort-box select {
  height: 100%; padding: 0 8px;
  border: none; outline: none; background: none;
  font-size: 14px; font-family: inherit; font-weight: 600; color: var(--text-1);
  cursor: pointer;
}
.vendor-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.vendor-chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 999px;
  background: #fff;
  font-size: 13px; font-weight: 600; color: var(--text-2);
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.vendor-chip i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.vendor-chip:hover { border-color: #cbd5e1; }
.vendor-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.vendor-chip .chip-n { font-weight: 500; opacity: .65; font-variant-numeric: tabular-nums; }

/* ---------- 模型网格 ---------- */
.models-section { padding: 40px 0 72px; }
.model-card .model-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.badge-unlimited {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 700;
  color: var(--success); background: var(--success-soft);
  border: 1px solid #a7f3d0;
}
.badge-cache {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 700;
  color: var(--warn); background: #fffbeb;
  border: 1px solid #fde68a;
}
.model-prices.col4 { grid-template-columns: repeat(4, 1fr); }
.price-item .pv small { white-space: nowrap; }
.models-foot { margin-top: 36px; text-align: center; }
.models-foot .pricing-note { margin: 0 0 18px; }
.models-empty b { font-size: 15.5px; }
.models-empty p { margin: 6px 0 18px; font-size: 14.5px; }

@media (max-width: 768px) {
  /* 页头 */
  .models-hero { padding: 96px 0 22px; }
  .crumbs { margin-bottom: 12px; font-size: 12.5px; }
  .models-hero h1 { font-size: 30px; }
  .models-sub { margin-top: 10px; font-size: 14px; line-height: 1.65; }
  /* 工具栏：双行布局（搜索全宽，单位+排序并排） */
  .models-toolbar {
    margin: 18px -12px 0;
    padding: 10px;
    border-radius: 14px;
    gap: 8px;
    top: 74px;   /* 胶囊导航下方 */
  }
  .search-box { max-width: none; flex: 1 1 100%; height: 42px; }
  .unit-toggle { flex: 1; height: 40px; }
  .unit-toggle button { flex: 1; padding: 0; font-size: 12.5px; }
  .sort-box { flex: 1; height: 40px; justify-content: space-between; }
  /* 厂商 chips：单行横滚 */
  .vendor-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 12px -4px 0;
    padding: 2px 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .vendor-chips::-webkit-scrollbar { display: none; }
  .vendor-chip { flex-shrink: 0; height: 32px; padding: 0 12px; font-size: 12.5px; }
  .vc-logo { width: 15px; height: 15px; }
  /* 卡片：紧凑分层 */
  .models-section { padding: 20px 0 56px; }
  .models-grid { gap: 10px; }
  .model-card { padding: 12px 12px 10px; border-radius: 13px; }
  .mc-head { gap: 9px; }
  .mc-logo { width: 32px; height: 32px; border-radius: 9px; }
  .mc-logo img { width: 18px; height: 18px; }
  .mc-logo i { font-size: 14px; }
  .model-name {
    font-size: 14px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: calc(100vw - 140px);
    font-size: 13.5px;
  }
  .model-id span {
    display: inline-block;
    max-width: 132px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    vertical-align: middle;
  }
  .model-vendor { font-size: 11px; padding: 2px 8px 2px 6px; display: none; }  /* 移动端隐藏右上厂商（card 顶部太挤），信息由 logo+chips 承载 */
  .badge-unlimited, .badge-cache { height: 19px; font-size: 10px; padding: 0 6px; }
  .model-tags { gap: 5px; }
  .model-meta .tag { font-size: 10.5px; height: 21px; padding: 0 7px; }
  .model-prices { gap: 5px; padding-top: 8px; }
  .price-item { display: flex; align-items: center; justify-content: space-between; padding: 6px 9px; background: var(--bg-alt); border-radius: 8px; }
  .price-item .pl { font-size: 10px; }
  .price-item .pv { font-size: 12px; }
  .price-item .pv small { font-size: 9px; }
  .mc-detail { width: 100%; margin-top: 8px; padding: 7px 0; justify-content: center; font-size: 12px; }
  /* 页脚 CTA */
  .models-foot { margin-top: 24px; }
  .models-foot .pricing-note { font-size: 12.5px; padding: 0 6px; }
}

/* ---------- 卡片：厂商大图标 + 复制 ID ---------- */
.mc-head { display: flex; align-items: center; gap: 13px; min-width: 0; }
.mc-logo {
  flex: none;
  width: 46px; height: 46px;
  border-radius: 13px;
  background: #fff;
  border: 1px solid var(--border-light);
  box-shadow: 0 1px 4px rgba(15, 23, 42, .05);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.mc-logo img { width: 26px; height: 26px; object-fit: contain; }
.mc-logo i {
  font-style: normal; color: #fff;
  font-size: 18px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  border-radius: inherit;
}
.model-card .model-name {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
}
.model-card .model-vendor { flex: none; max-width: 40%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.model-vendor img { border-radius: 3px; }
.model-id {
  all: unset;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 12px; color: var(--text-4);
  margin-top: 3px;
  max-width: 100%;
  min-width: 0;
  transition: color .15s ease;
}
.model-id svg { width: 12px; height: 12px; opacity: 0; transition: opacity .15s ease; }
.model-card:hover .model-id svg { opacity: .8; }
.model-id:hover { color: var(--primary); }
.model-id.copied { color: var(--success); }
.model-id.copied::after {
  content: "已复制";
  font-family: inherit; font-size: 11px; font-weight: 700;
  color: var(--success);
}

/* ---------- 工具栏吸顶 ---------- */
.models-toolbar {
  position: sticky;
  top: 96px;
  z-index: 30;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 12px;
  margin: 28px -12px 0;
  border-radius: 16px;
}
.vendor-chips { margin-top: 14px; }

/* 标题渐变字 */
.grad-text {
  background: linear-gradient(90deg, #4f46e5, #2563eb, #0891b2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- 单位切换 ---------- */
.unit-toggle {
  display: inline-flex; align-items: center;
  height: 46px; padding: 4px;
  background: #fff; border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.unit-toggle button {
  height: 100%; padding: 0 16px;
  border: 0; border-radius: 999px;
  background: transparent;
  font-size: 13px; font-weight: 600; color: var(--text-3);
  cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.unit-toggle button.active {
  background: var(--primary); color: #fff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, .3);
}

/* ---------- 详情抽屉 ---------- */
.model-drawer { position: fixed; inset: 0; z-index: 950; display: flex; justify-content: flex-end; }
.model-drawer .drawer-mask {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, .42);
  opacity: 0; transition: opacity .25s ease;
}
.model-drawer.show .drawer-mask { opacity: 1; }
.model-drawer .drawer-panel {
  position: relative;
  width: min(460px, 94vw);
  height: 100%;
  background: #fff;
  box-shadow: -18px 0 48px rgba(15, 23, 42, .18);
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.32, .72, 0, 1);
  display: flex; flex-direction: column;
}
.model-drawer.show .drawer-panel { transform: translateX(0); }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-light);
  position: sticky; top: 0; background: #fff;
}
.drawer-name { display: block; font-size: 17px; font-weight: 800; color: var(--text-1); }
.drawer-close {
  flex: none;
  width: 34px; height: 34px;
  border: 0; border-radius: 50%;
  background: #f5f6f8; color: #64748b;
  font-size: 14px; cursor: pointer;
}
.drawer-close:hover { background: #e8ecf2; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px 32px; }
.drawer-desc { margin: 0 0 16px; font-size: 13.5px; line-height: 1.75; color: var(--text-3); }
.drawer-sec { margin-top: 18px; }
.drawer-sec h5 {
  margin: 0 0 10px;
  font-size: 12px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-4);
  display: flex; align-items: center; gap: 8px;
}
.drawer-sec h5::before { content: ""; width: 3px; height: 11px; border-radius: 2px; background: var(--primary); }
.drawer-prices { list-style: none; margin: 0; padding: 0; }
.drawer-prices li {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px;
  background: var(--bg-alt); border-radius: 10px;
  font-size: 13.5px; color: var(--text-2);
}
.drawer-prices li + li { margin-top: 6px; }
.drawer-prices b { font-weight: 800; color: var(--text-1); font-variant-numeric: tabular-nums; }
.drawer-code {
  margin: 0 0 12px;
  padding: 12px 14px;
  background: var(--bg-code, #0f172a); color: #e2e8f0;
  border-radius: 10px;
  font-size: 12px; line-height: 1.7;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow-x: auto;
}
.drawer-cta {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--primary); color: #fff;
  font-size: 13.5px; font-weight: 700;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.drawer-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(37, 99, 235, .3); }
.drawer-id { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }

@media (max-width: 768px) {
  .unit-toggle { height: 40px; }
  .model-drawer .drawer-panel { width: 100vw; }
}

/* ---------- 查看详情按钮 ---------- */
.mc-detail {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  margin-top: 12px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text-2);
  font-size: 12.5px; font-weight: 600;
  cursor: pointer;
  transition: all .18s ease;
}
.mc-detail svg { width: 13px; height: 13px; transition: transform .18s ease; }
.mc-detail:hover {
  border-color: var(--primary-border);
  color: var(--primary);
  background: var(--primary-soft);
}
.mc-detail:hover svg { transform: translateX(2px); }

/* chips 里的厂商图标配留空样式 */
.vendor-chip .vc-logo {
  width: 16px; height: 16px;
  object-fit: contain;
  flex: none;
  border-radius: 3px;
}
