/* =========================================================
   AIGateway 门户站样式（模型广场 · 首页）
   ========================================================= */

/* ---------- 门户首页 hero ---------- */
.portal-hero {
  padding: 44px 0 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.portal-hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(600px 240px at 20% 0%, rgba(59, 130, 246, 0.08), transparent),
    radial-gradient(600px 240px at 80% 0%, rgba(99, 102, 241, 0.07), transparent);
  pointer-events: none;
}
.portal-hero > * { position: relative; }

.portal-hero h1 {
  font-size: 42px;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, #1e293b 30%, #3b82f6 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 16px;
}
.portal-hero .lead {
  font-size: 16px; color: var(--text-secondary);
  max-width: 820px; margin: 0 auto 32px; line-height: 1.7;
}

/* 统计区 */
.portal-stats { padding: 0 0 40px; }

/* 模型区块标题 */
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 8px 0 18px; gap: 12px;
}
.section-title { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.section-title::before {
  content: ''; width: 4px; height: 18px; border-radius: 2px;
  background: var(--primary-gradient); display: inline-block;
}

/* 模型网格 */
.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

/* 渠道分组标签 */
.provider-groups { margin-bottom: 28px; }

/* 首页快捷入口 */
.quick-actions {
  display: flex; flex-wrap: wrap; gap: 12px;
  justify-content: center; margin-top: 28px;
}

/* ---------- 模型广场页 ---------- */
.models-page { padding-top: 32px; }
.models-page .page-head { margin-bottom: 28px; }
.models-page .page-head h1 { font-size: 26px; margin-bottom: 6px; }
.models-page .page-head p { color: var(--text-secondary); }

/* 筛选工具栏 */
.filter-bar {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px;
  box-shadow: var(--shadow-sm); margin-bottom: 24px;
  flex-wrap: wrap;
}
.filter-bar .search-box { flex: 1; min-width: 220px; }

/* 分类筛选（单行下拉） */
.filter-group { display: flex; gap: 8px; }
.filter-dd { position: relative; }
.filter-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface); color: var(--text-secondary);
  font-size: 13px; cursor: pointer; white-space: nowrap;
  transition: var(--transition-fast);
}
/* 固定宽度，内容居中，勾选后计数不抖动 */
#protocolBtn { width: 96px; }
#pricingBtn { width: 96px; }
#providerBtn { width: 96px; }
.filter-btn:hover { border-color: var(--primary); color: var(--primary-dark); }
.filter-btn.active { border-color: var(--primary); background: var(--primary-bg); color: var(--primary-dark); }
.filter-panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 50;
  min-width: 180px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 8px;
  display: none;
  flex-direction: column; gap: 2px;
}
.filter-dd:hover .filter-panel,
.filter-dd:focus-within .filter-panel { display: flex; }
.filter-dd:hover .filter-btn,
.filter-dd:focus-within .filter-btn {
  border-color: var(--primary); background: var(--primary-bg); color: var(--primary-dark);
}
.filter-panel label {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text-secondary); cursor: pointer;
  transition: var(--transition-fast);
}
.filter-panel label:hover { background: var(--primary-bg); }
.filter-panel input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--primary); }

/* 视图切换 */
.view-switch {
  display: flex; background: var(--surface-2);
  border-radius: var(--radius-full); padding: 3px; gap: 2px;
}
.view-switch .view-btn {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: var(--transition-fast);
}
.view-switch .view-btn.active {
  background: var(--surface); color: var(--primary);
  box-shadow: var(--shadow-xs);
}

/* 列表视图 */
.model-list {
  display: flex; flex-direction: column; gap: 10px;
}
.model-list .model-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
}
.model-list .model-head { min-width: 0; }
.model-list .model-foot {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: center;
}
.model-list .model-foot .pricing-tag { width: 56px; justify-content: center; }
.model-list .model-price { justify-content: flex-start; }
.model-list .price-cols { gap: 8px; }
.model-list .price-cols-3 .price-col { flex: 0 0 62px; }
.model-list .price-cols-2 .price-col { flex: 0 0 82px; }

@media (max-width: 768px) {
  .portal-hero { padding: 40px 0 24px; }
  .portal-hero h1 { font-size: 26px; }
  .portal-hero .lead { font-size: 15px; margin-bottom: 24px; }
  .portal-hero .search-box { max-width: 100%; }
  .quick-actions { flex-direction: column; }
  .quick-actions .btn { width: 100%; }

  .model-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
  .model-protocols { flex-wrap: wrap; }
  .model-card { padding: 14px; }
  .model-name { font-size: 14px; }
  .model-avatar { width: 36px; height: 36px; font-size: 15px; border-radius: 10px; }
  .model-price .price { font-size: 12px; line-height: 1.5; }
  .model-price .price em { font-size: 11px; }

  .filter-bar { padding: 12px 14px; gap: 12px; }
  .filter-bar .search-box, .filter-bar .chips { min-width: 100%; flex: none; }

  .docs-layout { flex-direction: column; gap: 0; }
  .docs-side {
    width: 100%; position: static;
    display: flex; overflow-x: auto; gap: 4px;
    padding-bottom: 12px; margin-bottom: 12px;
  }
  .docs-side a { white-space: nowrap; padding: 7px 12px; }
  .docs-main h2 { font-size: 19px; }
}
