/* ============================================================
   ecom 电商栏目布局补丁（2026-11-29）
   背景：demo/vendor/tailwind.css 是预编译产物，媒体查询只生成到 1024px，
   且部分任意值类（max-w-[880px]、max-h-[520px]、min-h-[260px]、xl:*）
   当时未被扫描到，导致桌面大屏下卡片列数不足、详情弹层图片撑满整屏。
   本文件只补这些缺口，不改设计语言；加载顺序在 tailwind.css 之后。
   回滚：删掉 index.html 里本文件的 <link> 即可。
   ============================================================ */

/* ── 左栏：取消"栏内滚动"，改为整页滚动（避免滚中滚） ── */
@media (min-width: 1024px) {
  .ecom-left { position: static; max-height: none; overflow: visible; }
}
.ecom-copy-list { max-height: none; overflow: visible; }

/* ── 详情卡网格：lg 4 列 / 超宽屏 5 列（原 xl:grid-cols-5 未编译）
      实测 1440 屏上 5 列单卡只有 152px，图里文案看不清；4 列 192px 更合适，
      所以 5 列留到 1600px 以上再启用。 ── */
@media (min-width: 1024px) {
  .ecom-grid-detail { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1600px) {
  .ecom-grid-detail { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
/* 模板库：xl 4 列（原 xl:grid-cols-4 未编译） */
@media (min-width: 1280px) {
  .ecom-tpl-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* 场景主图网格：1:1 方图无叠字，按右栏宽度自适应排小卡（不再用视口断点，
   避免右栏比视口窄 340px 后回落成 4 列大卡）；每卡最小 112px，点击浮窗看大图 */
.ecom-main-grid {
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
}

/* ── 白底预览限高（原 max-h-[220px] 未编译，会按原图尺寸撑开左栏） ── */
.ecom-white-img { max-height: 220px; }

/* ── tab 行：窄屏允许换行，规格说明单独占一行 ── */
.ecom-tabbar { flex-wrap: wrap; }
.ecom-tabbar .ecom-spec { flex: 1 1 100%; margin-left: 0; margin-top: 2px; }
@media (min-width: 1024px) {
  .ecom-tabbar .ecom-spec { flex: 0 0 auto; margin-left: 4px; margin-top: 0; }
}
.ecom-tabbar > button { white-space: nowrap; }

/* ── 卡片详情弹层：限宽 880 / 限高 92vh / 大图限高 520 ── */
.ecom-modal {
  width: 100%;
  max-width: 880px;
  max-height: 92vh;
  overflow-y: auto;
}
.ecom-modal-media { min-height: 260px; }
.ecom-modal-img {
  max-height: 520px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}
@media (max-width: 640px) {
  .ecom-modal-img { max-height: 42vh; }
}

/* ── 遮罩与层级（原 bg-slate-900/60 与 z-[60] 未编译，弹层会跟页面糊在一起） ── */
.ecom-modal-mask { background: rgba(17, 20, 24, .62); z-index: 60; }
.ecom-confirm-mask { background: rgba(17, 20, 24, .62); z-index: 70; }

/* ── 自绘确认框（替代原生 confirm/prompt） ── */
.ecom-confirm { max-width: 420px; }

/* ============================================================
   ★2026-12-03 套图详情页缩略图「移动端适配」
   背景：三组缩略图（白底 / 场景主图 / 详情页）写的是 tailwind 的
        grid-cols-5（无响应式前缀）→ 手机上每格只有 ~60px，看不清也点不准。
   规则：手机 2 列 / 平板 3 列 / ≥1024 保持 5 列（桌面不变）。
   为什么不用 sm:/lg:grid-cols-*：预编译的 tailwind.css 里没有这两档网格类，
   加类不会生效，重编 CSS 风险更大 —— 这里用普通媒体查询覆盖即可。
   ============================================================ */
@media (max-width: 639px) {
  .ecom-thumbs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
}
@media (min-width: 640px) and (max-width: 1023px) {
  .ecom-thumbs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
}
/* 手机端重跑按钮稍高一点，手指可点（原来 19px 偏窄） */
@media (max-width: 639px) {
  .ecom-thumbs button {
    height: 26px;
    font-size: 12px;
  }
  .ecom-thumbs .absolute.top-0\.5,
  .ecom-thumbs .absolute.top-1\.5 {
    font-size: 11px;
  }
}
