/* ---------- 模型栏目：排行 / 定价目录 / 最新变化 ---------- */
.models-page { padding-top: 20px; }

.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); }
.breadcrumb strong { font-weight: 500; color: var(--text-2); }
.breadcrumb a:hover { color: var(--accent); }

/* ---------- 页头 ---------- */
.page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px 40px;
  align-items: end;
  padding: 20px 0 24px;
}
.page-hero h1 { font-size: clamp(28px, 3.2vw, 40px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.2; }
.page-lead { max-width: 62ch; margin-top: 10px; font-size: 14px; color: var(--text-2); }
.model-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(88px, auto));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}
.model-summary > div { padding: 10px 16px; border-left: 1px solid var(--border); }
.model-summary > div:first-child { border-left: 0; }
.model-summary dt { font-size: 12px; letter-spacing: 0.06em; color: var(--text-3); }
.model-summary dd { margin-top: 2px; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }

/* 栏目内导航：贴住 sticky header 下方 */
.section-nav {
  position: sticky;
  top: 64px;
  z-index: 30;
  display: flex;
  gap: 20px;
  padding: 9px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.section-nav a { font-size: 13px; color: var(--text-2); }
.section-nav a:hover { color: var(--accent); }


/* 表头对齐：覆盖首页比价表 thead th:nth-child 的右对齐规则 */
.models-page thead th { text-align: left; }
.models-page thead th.num { text-align: right; }

/* ---------- 排行榜 ---------- */
.ranking-tabs {
  display: flex;
  flex-wrap: wrap;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--bg-surface);
}
.ranking-tab {
  padding: 10px 18px;
  border: 0;
  border-top: 2px solid transparent;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
  transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.ranking-tab:last-child { border-right: 0; }
.ranking-tab:hover { color: var(--text); }
.ranking-tab[aria-selected="true"] { color: var(--accent); background: var(--bg); border-top-color: var(--accent); }
.ranking-panel { border-radius: 0 0 var(--radius) var(--radius); }
.ranking-table { min-width: 620px; }
.ranking-table td.rank { width: 56px; color: var(--text-3); }
.ranking-table .col-provider { width: 26%; }
.ranking-table .col-value { width: 22%; }
.ranking-table .model-link:hover { color: var(--accent); }
.ranking-table td.value { font-weight: 700; }

/* ---------- 定价目录工具条 ---------- */
.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 12px 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
}
.field-label { font-size: 12px; color: var(--text-3); }
.field-label:not(:first-child) { margin-left: 6px; }
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 210px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
}
.search-box:focus-within { border-color: var(--accent); }
.search-box input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: 0; font-size: 13px; }
.catalog-toolbar select {
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
}
.catalog-toolbar .btn-text { margin-left: auto; font-size: 13px; }

/* ---------- 共享筛选组件：chip 组 / 排序分段 / 贴顶面板 / 滚动加载 ---------- */
.type-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.type-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}
.type-chip span.count { font-size: 11px; font-weight: 500; color: var(--text-3); }
.type-chip:hover { color: var(--text); }
.type-chip[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); border-color: var(--accent); }
.type-chip[aria-pressed="true"] span.count { color: var(--accent); }
.type-chip[disabled], .type-chip[disabled]:hover { border-color: var(--border); background: var(--bg); color: var(--text-4); }
.type-chip[disabled] span.count { color: var(--text-4); }

/* 排序分段控件：与搜索框、下拉同高 36px，选中项只换底色与字色 */
.sort-chips {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 36px;
  padding: 0 3px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
}
.sort-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.sort-chip .icon { width: 13px; height: 13px; }
.sort-chip:hover { color: var(--text); }
.sort-chip[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }

/* 多条件筛选面板：一行一个条件组，标签列固定 38px 让各组左对齐 */
.catalog-filter { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 10px; }
.catalog-filter .filter-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; min-width: 0; }
.catalog-filter .filter-label { flex: 0 0 38px; font-size: 12px; color: var(--text-3); }
.catalog-filter .search-box { flex: 1 1 220px; max-width: 360px; }
.catalog-filter .type-chips { flex: 1 1 240px; min-width: 0; margin-bottom: 0; }

/* 滚动时贴住 64px 高的 sticky header 下方；外层 12px 留白用页面底色铺满，列表从下方滚过时不会漏进缝隙 */
.sticky-filter {
  position: sticky;
  top: 64px;
  z-index: 30;
  padding: 12px 0;
  background: var(--bg);
}
.sticky-filter .catalog-filter { margin-bottom: 0; }

/* 滚动加载哨兵：只作为 IntersectionObserver 的触发点，不占视觉重量 */
.scroll-sentinel { height: 1px; }
/* 列表补完的终点反馈 */
.load-end { padding: 14px 0 2px; text-align: center; font-size: 12px; color: var(--text-4); }

/* ---------- 目录表 ---------- */
.catalog-panel { display: block; }
.catalog-table { min-width: 940px; }
.catalog-table tbody th { min-width: 200px; max-width: 300px; white-space: normal; }
.catalog-table .model-link { display: block; font-weight: 600; }
.catalog-table .model-link:hover { color: var(--accent); }
.catalog-table td.num, .catalog-table th.num { font-weight: 600; }
.catalog-table td.null { color: var(--text-4); font-weight: 400; }
.catalog-table .date-cell { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.table-loading { padding: 28px 20px; text-align: center; font-size: 13px; color: var(--text-3); }

/* 商品表：固定列宽、不横向滚动；标题左对齐，其余列的表头与单元格一律右对齐。
   min-width 用双类选择器，才能压过上面与 1100px 断点里的 .catalog-table。 */
.catalog-table.product-table { table-layout: fixed; min-width: 0; }
.product-table thead th,
.product-table tbody td { text-align: right; }
.product-table thead th:first-child,
.product-table tbody th { text-align: left; }
.product-table .table-loading { text-align: center; }
.product-table thead th { padding: 8px 10px; font-size: 11px; }
.product-table tbody td,
.product-table tbody th {
  height: 34px;
  padding: 6px 10px;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-table tbody th { font-weight: 500; }
.product-table .product-link { display: flex; align-items: center; gap: 6px; min-width: 0; font-weight: 600; }
.product-table .product-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.product-table .product-link .icon { flex: none; width: 11px; height: 11px; color: var(--text-4); }
.product-table .product-link:hover { color: var(--accent); }
.product-table .product-link:hover .icon { color: var(--accent); }
.product-table td.num { font-weight: 600; }
.product-table td.null { color: var(--text-4); font-weight: 400; }
.product-table .date-cell { font-size: 11px; color: var(--text-3); }

/* ---------- 分页 ---------- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 12px; }
.page-button { height: 32px; padding: 0 14px; font-size: 13px; }
.page-button[disabled] { color: var(--text-4); cursor: not-allowed; }
.page-info { color: var(--text-3); letter-spacing: 0.02em; }

/* ---------- 最新变化 ---------- */
.change-list > li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.change-list > li:first-child { border-top: 0; }
.change-list > li:hover { background: var(--bg-raised); }
.change-date { color: var(--text-3); white-space: nowrap; }
.change-name { font-weight: 600; }
.change-name:hover { color: var(--accent); }
.change-summary { color: var(--text-2); flex: 1; min-width: 220px; }
.change-values { margin-left: auto; color: var(--text-2); white-space: nowrap; }
.change-values .num { font-weight: 600; }
.change-delta { min-width: 68px; text-align: right; white-space: nowrap; }
.badge--up { color: var(--price-up); border-color: var(--price-up); }
.badge--down { color: var(--price-down); border-color: var(--price-down); }
.badge--muted { color: var(--text-3); }

/* ---------- 模型详情抽屉 ---------- */
.drawer-scrim[hidden], .model-drawer[hidden] { display: none; }
.drawer-foot a[hidden] { display: none; }
.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(9, 9, 11, 0.4);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease);
}
.drawer-scrim[data-open="true"] { opacity: 1; }
.model-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 55;
  display: flex;
  flex-direction: column;
  width: min(540px, 100vw);
  height: 100%;
  background: var(--bg);
  border-left: 1px solid var(--border-strong);
  transform: translateX(100%);
  transition: transform var(--dur-base) var(--ease);
}
.model-drawer[data-open="true"] { transform: none; }
.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.drawer-head h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }
.drawer-foot { display: flex; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--bg-surface); }
.drawer-section { margin-bottom: 20px; }
.drawer-section:last-child { margin-bottom: 0; }
.drawer-section h3 { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; color: var(--text-4); margin-bottom: 8px; }
.drawer-desc { font-size: 13px; color: var(--text-2); }
.drawer-terms {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--border);
}
.drawer-terms > div { padding: 10px 12px; background: var(--bg); }
.drawer-terms dt { font-size: 12px; color: var(--text-3); }
.drawer-terms dd { margin-top: 2px; font-size: 14px; font-weight: 700; }
.drawer-terms dd.is-null { font-weight: 400; color: var(--text-4); }
.drawer-terms dd a { color: var(--accent); font-weight: 500; }
.drawer-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.drawer-meta { font-size: 12px; color: var(--text-3); }
.drawer-note { margin-top: 8px; font-size: 12px; line-height: 1.5; color: var(--text-3); }

/* ---------- 共享表单组件：字段 / 输入 / 分组 / 校验反馈 ---------- */
.form-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-2); }
.form-unit { color: var(--text-4); font-size: 11px; font-weight: 400; }
.form-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
}
.form-group > .form-label { color: var(--text-3); letter-spacing: 0.06em; }
.form-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.form-select,
.form-input,
.form-textarea {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
}
.form-textarea { min-height: 132px; resize: vertical; line-height: 1.6; font-family: inherit; }
.form-select:focus,
.form-input:focus,
.form-textarea:focus { border-color: var(--accent); outline: 0; }
.form-input[aria-invalid="true"],
.form-select[aria-invalid="true"] { border-color: var(--danger); }
.form-error { font-size: 11px; color: var(--danger); }
.form-hint { font-size: 11px; color: var(--text-4); }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.form-actions .btn { height: 34px; padding: 0 14px; font-size: 13px; }
.form-feedback { font-size: 12px; color: var(--text-2); }
.check-row { display: flex; align-items: center; gap: 8px; }
.check-label { font-size: 12px; color: var(--text-2); }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .page-hero { grid-template-columns: 1fr; align-items: start; }
  .catalog-table { min-width: 820px; }
}
@media (max-width: 900px) {
  .section-nav { top: 64px; overflow-x: auto; gap: 16px; }
  .ranking-table { min-width: 540px; }
  .catalog-toolbar { padding: 12px; }
  .catalog-toolbar .btn-text { margin-left: 0; }
  .type-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .type-chip { flex: 0 0 auto; }
  .model-drawer { width: 100vw; }
  .change-values { margin-left: 0; }
  .change-delta { min-width: 0; }
}
@media (max-width: 560px) {
  .page-hero { padding-top: 8px; }
  .catalog-filter .filter-label { display: none; }
  .form-grid-2 { grid-template-columns: minmax(0, 1fr); }
  .product-table tbody td,
  .product-table tbody th { height: 30px; padding: 5px; font-size: 11px; }
  .model-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .model-summary > div { border-left: 1px solid var(--border); border-top: 1px solid var(--border); }
  .model-summary > div:nth-child(odd) { border-left: 0; }
  .model-summary > div:nth-child(-n + 2) { border-top: 0; }
  .model-summary dd { font-size: 18px; }
  .ranking-tabs { border-radius: 0; }
  .ranking-tab { flex: 1 1 50%; border-bottom: 1px solid var(--border); }
  .ranking-tab:nth-child(2n) { border-right: 0; }
  .search-box { flex: 1 1 100%; }
  .catalog-toolbar select { flex: 1 1 auto; }
  .pagination { gap: 8px; }
  .drawer-terms { grid-template-columns: 1fr; }
  .drawer-foot { flex-direction: column; }
}
