/* ============================================================
   渠道真实商品 · 列表 / 详情
   依赖 products.css 的令牌层（--ink/--muted/--line/--surface/--price）
   ============================================================ */

/* ---------- 列表页工具条 ---------- */
.ch-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 12px; margin-bottom: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.ch-search {
  display: flex; align-items: center; gap: 7px; flex: 1 1 240px; min-width: 200px;
  height: 34px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
}
.ch-search input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent;
  font-size: 13px; color: var(--ink);
}
.ch-search .icon { width: 15px; height: 15px; color: var(--muted); flex: none; }
.ch-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.ch-chip {
  height: 30px; padding: 0 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 12.5px; color: var(--muted); cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.ch-chip:hover { border-color: var(--brand-300); color: var(--ink); }
.ch-chip.is-on { background: var(--brand-50); border-color: var(--brand-300); color: var(--brand-700); font-weight: 600; }
.ch-count-note { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---------- 品类分区 ---------- */
.ch-cat { margin-bottom: 30px; scroll-margin-top: 74px; }
.ch-cat__head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding-bottom: 10px; margin-bottom: 14px; border-bottom: 1px solid var(--line);
}
.ch-cat__head h2 { font-size: 18px; letter-spacing: -.01em; }
.ch-cat__count { font-size: 12.5px; color: var(--muted); }
.ch-cat__min { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.ch-cat__min b { color: var(--price); font-family: var(--mono); }
.ch-cat__note { margin: -6px 0 12px; font-size: 12px; color: var(--muted); }
.ch-cat__note b { color: var(--warn); font-weight: 600; }

/* ---------- 商品卡 ---------- */
.ch-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
/* “全线产品”总览页（仅 products/index.html 使用 .ch-cat）一行 5 个；品类页仍有侧栏，保持 3 列 */
.ch-cat .ch-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1200px) { .ch-cat .ch-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 980px) { .ch-grid, .ch-cat .ch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .ch-grid, .ch-cat .ch-grid { grid-template-columns: 1fr; } }

.ch-card {
  display: flex; flex-direction: column; gap: 9px;
  padding: 14px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: inherit; text-decoration: none;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease);
}
.ch-card:hover { border-color: var(--brand-300); box-shadow: 0 8px 22px -14px rgba(11,87,208,.35); transform: translateY(-1px); }
.ch-card--pending { background: color-mix(in srgb, var(--surface) 92%, var(--gray-200, #e4e9f0) 8%); }
.ch-card__media {
  display: block; height: 120px; overflow: hidden;
  border: 1px solid var(--line); border-radius: 7px; background: var(--bg-soft, #f5f7fa);
}
.ch-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ch-card__top { display: flex; align-items: flex-start; gap: 8px; }
.ch-card__name { font-size: 14.5px; font-weight: 650; line-height: 1.4; flex: 1; min-width: 0; }
.ch-card__ch {
  flex: none; font-size: 10.5px; padding: 2px 6px; border-radius: 4px;
  color: var(--muted); background: var(--bg-soft, #f5f7fa); border: 1px solid var(--line);
  white-space: nowrap;
}
.ch-card__meta { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.ch-card__range {
  color: var(--warn, #a86a12);
  border: 1px solid rgba(168, 106, 18, .28);
  background: var(--warn-soft, #fdf5e6);
  border-radius: 4px;
  padding: 0 5px;
  font-size: 11px;
  line-height: 16px;
}
.ch-card__sold {
  color: #b3261e;
  border: 1px solid rgba(179, 38, 30, .24);
  background: rgba(179, 38, 30, .06);
  border-radius: 4px;
  padding: 0 5px;
  font-size: 11px;
  line-height: 16px;
  font-weight: 600;
}
/* 与首页爆款同骨架：固定 4 行，标签左 / 值右对齐，缺失值置灰 */
.ch-card__specs { display: grid; gap: 3px; }
.ch-card__specs span {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  font-size: 11.5px; color: var(--muted); line-height: 1.5;
}
.ch-card__specs em { font-style: normal; color: var(--muted-2, #7d8a9b); flex: none; }
.ch-card__specs b { font-weight: 600; color: var(--ink-2, #1d2a3d); text-align: right; }
.ch-card__specs span.ch-card__na b { color: var(--muted-2, #7d8a9b); font-weight: 500; }
.ch-card__foot {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 10px;
  margin-top: auto; padding-top: 4px;
}
.ch-price { font-size: 12px; color: var(--muted); line-height: 1.2; }
.ch-price b { font-family: var(--mono); font-size: 19px; color: var(--price); font-weight: 700; letter-spacing: -.02em; }
.ch-price i { font-style: normal; font-size: 12px; color: var(--price); }
.ch-price small { font-size: 11.5px; color: var(--muted); }
.ch-price--pending b { font-family: inherit; font-size: 15px; color: var(--warn, #a86a12); }
.ch-price__tag { display: block; margin-top: 2px; font-style: normal; font-size: 11px; color: var(--warn, #a86a12); }
.ch-cta {
  flex: none; height: 28px; padding: 0 10px; border-radius: 6px;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; border: 1px solid var(--line); color: var(--muted); background: var(--surface);
}
.ch-card:hover .ch-cta { border-color: var(--brand-300); color: var(--brand-600); }
.ch-cta--pending { pointer-events: none; opacity: .85; }

.ch-empty {
  padding: 46px 16px; text-align: center; border: 1px dashed var(--line);
  border-radius: var(--radius); color: var(--muted); background: var(--surface);
}
.ch-empty b { display: block; color: var(--ink); margin-bottom: 4px; }
.ch-empty .ch-chip { margin-top: 14px; }

.ch-more {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 10px; font-size: 12px; color: var(--muted);
}
.ch-more .ch-chip { height: 26px; padding: 0 10px; }

/* ---------- 详情页 ---------- */
.ch-detail { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
@media (max-width: 900px) { .ch-detail { grid-template-columns: 1fr; } }

/* 固定深色底板：不跟随明暗主题，浅色主题下是一块刻意设计的内容卡 */
.ch-detail__media {
  position: relative;
  display: block; width: 100%; max-width: 460px; aspect-ratio: 1200 / 150;
  overflow: hidden; margin-bottom: 16px; padding: 10px; box-sizing: border-box;
  border: 1px solid rgba(148, 163, 184, .26); border-radius: 16px; background: #08121f;
  box-shadow: 0 18px 40px -30px rgba(2, 8, 20, .5);
}
.ch-detail__media picture { display: block; width: 100%; height: 100%; }
.ch-detail__media img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.ch-detail__media figcaption {
  position: absolute; right: 18px; bottom: 18px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; line-height: 1.6; color: #cbd8e8;
  background: rgba(8, 18, 31, .72); border: 1px solid rgba(255, 255, 255, .18);
}
@media (max-width: 620px) { .ch-detail__media { max-width: none; } }
.ch-detail__head h1 { font-size: clamp(22px, 2.4vw, 30px); letter-spacing: -.02em; line-height: 1.25; }
.ch-detail__sub { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ch-detail__sub span {
  font-size: 12px; color: var(--muted); padding: 3px 8px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
}
.ch-block { margin-top: 22px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.ch-block h2 { font-size: 14px; margin-bottom: 10px; }
.ch-specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
@media (max-width: 620px) { .ch-specs { grid-template-columns: 1fr; } }
.ch-specs div { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.ch-specs span { color: var(--muted); }
.ch-specs b { font-weight: 600; text-align: right; }
.ch-desc { font-size: 12.5px; color: var(--muted); line-height: 1.75; white-space: pre-line; }
.ch-desc p { margin: 0 0 6px; }

.ch-buy { position: sticky; top: 78px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
@media (max-width: 900px) { .ch-buy { position: static; } }
.ch-buy__label { font-size: 12px; color: var(--muted); }
.ch-buy__price { display: flex; align-items: baseline; gap: 4px; margin: 4px 0 6px; }
.ch-buy__price b { font-family: var(--mono); font-size: 30px; color: var(--price); letter-spacing: -.03em; }
.ch-buy__price i { font-style: normal; color: var(--price); font-size: 15px; }
.ch-buy__price small { font-size: 12px; color: var(--muted); }
.ch-qty-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin: 10px 0 2px; }
.ch-qty-row__label { font-size: 12.5px; color: var(--muted); }
.ch-qty { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.ch-qty__btn { width: 34px; min-height: 34px; padding: 0; border: 0; background: transparent; color: var(--ink); font-size: 16px; line-height: 1; cursor: pointer; }
.ch-qty__btn:hover:not(:disabled) { background: var(--surface-2, rgba(0,0,0,.04)); }
.ch-qty__btn:disabled { color: var(--muted); opacity: .4; cursor: not-allowed; }
.ch-qty__input { width: 54px; min-width: 0; height: 34px; padding: 0; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); background: transparent; color: var(--ink); text-align: center; font-family: var(--mono); font-size: 13.5px; }
.ch-qty__input:focus { outline: 2px solid var(--brand, #2f6fed); outline-offset: -2px; }
.ch-qty-row__max { font-size: 11.5px; color: var(--muted); }
.ch-buy__total { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
.ch-buy__total b { font-family: var(--mono); font-size: 19px; color: var(--price); letter-spacing: -.02em; }
.ch-buy__total small { font-size: 11.5px; color: var(--muted); }
.ch-buy__pending { font-size: 20px; font-weight: 700; color: var(--warn, #a86a12); margin: 6px 0 2px; }
.ch-buy__note { font-size: 12px; color: var(--muted); line-height: 1.6; margin: 8px 0 14px; }
.ch-buy__ref-tag { display: inline-block; margin: 2px 0 0; padding: 1px 6px; border-radius: 4px; font-size: 11.5px; color: var(--warn, #a86a12); background: var(--warn-soft, #fdf5e6); }
.ch-buy__actions { display: grid; gap: 8px; }
.ch-buy__actions .btn { width: 100%; justify-content: center; }
.ch-buy__facts { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 6px; font-size: 12px; color: var(--muted); }
.ch-buy__facts div { display: flex; justify-content: space-between; gap: 10px; }
.ch-buy__facts b { color: var(--ink); font-weight: 600; }

/* 裸金属系统镜像：自动开通必选，人工开通只做说明 */
.ch-os { display: grid; gap: 5px; margin: 10px 0 2px; }
.ch-os__label { font-size: 12px; color: var(--ink); font-weight: 600; }
.ch-os__select { width: 100%; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font-size: 13px; }
.ch-os__select:disabled { color: var(--muted); background: var(--surface-2, #f6f7f9); }
.ch-os__hint { margin: 0; font-size: 11.5px; line-height: 1.6; color: var(--muted); }
.ch-os__hint b { color: var(--ink); }

/* 可配置商品选配面板：所有控件与明细按行对齐，金额用等宽字体 */
.ch-cfg { display: grid; gap: 8px; margin: 6px 0 4px; }
.ch-cfg__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--muted); }
.ch-cfg__row select,
.ch-cfg__row input { min-width: 0; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font-size: 13px; }
.ch-cfg__row select { flex: 1; max-width: 230px; }
.ch-cfg__num { display: inline-flex; align-items: center; gap: 6px; flex: 1; max-width: 230px; justify-content: flex-end; }
.ch-cfg__num input { width: 100%; text-align: right; font-family: var(--mono); }
.ch-cfg__defhint { display: grid; gap: 2px; margin: -2px 0 2px; font-size: 11.5px; line-height: 1.55; color: var(--muted); }
.ch-cfg__defhint b { font-family: var(--mono); font-weight: 600; color: var(--ink); }
.ch-cfg__sum { display: grid; gap: 4px; margin-top: 4px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--muted); }
.ch-cfg__sum div { display: flex; justify-content: space-between; gap: 10px; }
.ch-cfg__sum b { color: var(--ink); font-weight: 600; font-family: var(--mono); }

.ch-pending-banner {
  margin-top: 16px; padding: 12px 14px; border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--warn, #a86a12) 28%, transparent);
  background: var(--warn-soft, #fdf5e6); color: var(--warn, #a86a12);
  font-size: 12.5px; line-height: 1.65;
}
.ch-pending-banner b { display: block; margin-bottom: 2px; color: var(--warn-deep, #82500a); }

/* ---------- 首页爆款区（真实商品） ---------- */
.machine--real .machine__price { display: flex; align-items: baseline; gap: 4px; }
.machine--real .machine__price small { font-size: 11.5px; color: var(--muted); font-weight: 400; margin-left: 2px; }
.machine--real .machine__id { display: flex; gap: 8px; flex-wrap: wrap; }
.machine__ch { color: var(--brand-600); }
