/* ============================================================
   云舟 yunzhou · 产品列表页样式（assets_custom，改造页自有）
   依赖 yunzhou.css 的变量与基础组件；对抗区已在 yunzhou.css 顶部
   ============================================================ */
/* 主区宽度：模板里原本是 col-sm-9/col-sm-10（75%/83%），
   但侧栏 .yz-sb 不带栅格类、独占整行，于是右侧长期空出 25%（1920 下 441px）。
   这里强制吃满整行，配合 product.tpl 的 col-12。 */
.yz-cart-main { width: 100%; max-width: 100%; flex: 0 0 100%; padding-top: 8px; }

/* 页头 */
.yz-p-head { margin-bottom: 18px; }
.yz-page-title { font-size: 24px; font-weight: 800; }
.yz-page-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* 产品网格
   2026-11-08 两次调整：
   ① 由 `repeat(auto-fill, minmax(260px, 1fr))` 改为显式断点——260px 下限让 1440 只排 3 列
      （7 个产品 → 3+3+1），1366 掉到 2 列；单一 min 值无解。
   ② 主区改为占满整行后，可用宽度变大（1920 下 1193 → 1598）。
   实测过 5 列（≥1700）：7 个产品变 5+2、末行空 3 位，比 4+3 更不平衡，故上限锁 4 列。
   现行断点：≥1200 四列 / 900–1199 三列 / 768–899 两列 / <768 单列 */
.yz-p-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 1199px) {
  .yz-p-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 899px) {
  .yz-p-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.yz-p-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s var(--ease-out);
}
.yz-p-card:hover { border-color: var(--accent-dim); transform: translateY(-2px); }
.yz-p-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 10px;
}
.yz-p-name { font-size: 16px; font-weight: 700; }
.yz-p-out {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: 99px;
  padding: 2px 8px;
}
.yz-p-card-body { padding: 0 16px 12px; flex: 1; }
.yz-p-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  /* 用 max-height 而不是 -webkit-line-clamp：
     商品描述里可能含 <div>/<li> 结构，line-clamp 对嵌套块级元素不可靠。
     6 行 ≈ 1.7em × 6，超出部分靠「展开」按钮展开。 */
  max-height: calc(1.7em * 6);
  overflow: hidden;
}
.yz-p-desc.is-open {
  max-height: none;
}
/* 描述被裁时脚本才显示这个按钮；未裁时保持 hidden */
.yz-p-more {
  display: inline-block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}
.yz-p-more[hidden] { display: none; }
.yz-p-more:hover { text-decoration: underline; }
.yz-p-stock { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 6px; }
.yz-p-price-row { margin-top: 10px; }
.yz-p-price { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.yz-cur { font-size: 13px; color: var(--accent); font-weight: 600; }
.yz-num { font-family: var(--mono); font-size: 26px; font-weight: 800; color: var(--accent); line-height: 1; }
.yz-per { font-size: 12px; color: var(--muted); }
.yz-p-origin { font-size: 12px; color: var(--muted); text-decoration: line-through; margin-top: 3px; }
.yz-p-trial { font-size: 12px; color: var(--ok); margin-top: 4px; }
.yz-p-card-foot { padding: 0 16px 16px; }



/* 分页 */
.yz-pagination { display: flex; justify-content: center; margin-top: 22px; }
.yz-pagination .pagination { display: flex; gap: 4px; list-style: none; padding: 0; margin: 0; }
.yz-pagination .pagination li { display: inline-flex; }
.yz-pagination .pagination a,
.yz-pagination .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  text-decoration: none;
}
.yz-pagination .pagination .active span,
.yz-pagination .pagination .active a {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}

/* 空态 */
.yz-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 80px 20px;
  color: var(--muted);
}
.yz-empty-icon { font-size: 42px; color: var(--line-strong); }
.yz-empty p { font-size: 14px; }

/* 移动端：网格降列 */
@media (max-width: 767px) {
  .yz-p-grid { grid-template-columns: 1fr; }
  .yz-page-title { font-size: 20px; }
}
