/* ==========================================================================
   产品目录页 /catalog
   --------------------------------------------------------------------------
   只在 slug = catalog 的单页加载。三列网格需要 1080 宽度，单列时与站点正文
   的 720 基线不同：卡片区放宽到 1080，纯文字段再用 720 收回来，避免一行过长。
   ========================================================================== */

/* 目录页整页统一到 1080：hero 与数据条也跟着放宽，否则左边缘比卡片区缩进 180px，
   整页看起来是歪的。hero 内部的标题、导语本来就有 em 限宽，放宽不会拉长行宽。 */
.wl-post__body .wx-hero,
.wl-post__body .wx-stats {
  max-width: 1080px;
}

.wl-cat-nav,
.wl-cat-group,
.wl-cat-howto {
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
  box-sizing: border-box;
}

/* 文字块不跟着网格一起拉宽 */
.wl-cat-group__desc,
.wl-cat-howto__inner > h2,
.wl-cat-howto__inner > p,
.wl-cat-howto__list {
  max-width: 720px;
}

/* ---------- 目录导航 ---------- */
.wl-cat-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 40px;
}

.wl-cat-nav a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border: 1px solid #dde6ef;
  border-radius: 999px;
  font-size: 13px;
  color: #45576a;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.wl-cat-nav a b {
  font-weight: 600;
  color: #0f2338;
  font-variant-numeric: tabular-nums;
}

.wl-cat-nav a i {
  font-style: normal;
  font-size: 11px;
  color: #9aa7b3;
  font-variant-numeric: tabular-nums;
}

.wl-cat-nav a:hover {
  border-color: #2f66ad;
  background: #f2f7fc;
  color: #2f66ad;
}

.wl-cat-nav a:hover b {
  color: #2f66ad;
}

/* ---------- 分组 ---------- */
.wl-cat-group {
  padding-top: clamp(54px, 6vw, 78px);
  scroll-margin-top: 92px;
}

.wl-cat-group__label {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #2f66ad;
}

.wl-cat-group__label span {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: #9aa7b3;
}

.wl-cat-group__h2 {
  margin: 14px 0 0;
  font-size: clamp(24px, 3.4vw, 33px);
  line-height: 1.3;
  letter-spacing: -0.022em;
  font-weight: 600;
  color: #0f2338;
}

.wl-cat-group__desc {
  margin: 12px 0 0;
  font-size: 15px;
  line-height: 1.95;
  color: #5a6b7c;
}

/* ---------- 卡片网格 ---------- */
/* ---------- 主推新品：四张实拍卡，排在 A 组之前 ---------- */
.wl-cat-featgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 26px;
}

.wl-cat-feat {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e3ebf3;
  border-radius: 4px;
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}

.wl-cat-feat:hover {
  border-color: #c9dcec;
  box-shadow: 0 14px 34px rgba(15, 35, 56, 0.09);
  transform: translateY(-2px);
}

/* 图片底与照片底色同为 #f4f4f4（见 seed/featured_photos.py 的 TARGET），
   照片裁切边缘直接融进这块底色，看不出方块 */
.wl-cat-feat__media {
  background: #f4f4f4;
}

.wl-cat-feat__media img {
  display: block;
  width: 100%;
  height: auto;
}

.wl-cat-feat__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 12px 15px 16px;
}

.wl-cat-feat__idx {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #8b98a5;
}

.wl-cat-feat__idx b {
  font-weight: 600;
  color: #2f66ad;
  font-variant-numeric: tabular-nums;
}

.wl-cat-feat__tag {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 2px;
  background: #f0b46a;
  color: #2a1704;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.wl-cat-feat h3 {
  margin: 7px 0 0;
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: -0.01em;
  font-weight: 600;
  color: #0f2338;
}

.wl-cat-feat__note {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: #7b8a99;
}

.wl-cat-grid {
  display: grid;
  /* 桌面一行三张：15 款产品排成 5 行，比两列时短三分之一，滚动更省力 */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 26px;
}

.wl-cat-grid--solo {
  grid-template-columns: minmax(0, 1fr);
}

.wl-cat-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wl-cat-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e3ebf3;
  border-radius: 4px;
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}

.wl-cat-card:hover {
  border-color: #c9dcec;
  box-shadow: 0 14px 34px rgba(15, 35, 56, 0.09);
  transform: translateY(-2px);
}

.wl-cat-card__media {
  /* 照片底色统一校到 #ececec（见 seed/shots_1105.py），这里跟着用同一个值，
     图与卡片之间就没有一条看得见的边 */
  padding: 0;
  background: #ececec;
}

.wl-cat-card__media img {
  display: block;
  width: 100%;
  height: auto;
}

.wl-cat-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 13px 16px 18px;
}

.wl-cat-card__idx {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: #8b98a5;
}

.wl-cat-card__idx b {
  font-weight: 600;
  color: #2f66ad;
  font-variant-numeric: tabular-nums;
}

/* 编码只有几款有，靠 margin-left:auto 推到行尾，没有编码的款不留空位 */
/* markdown-body 给 code 加了灰底和圆角，选择器权重同为 (0,1,1) 且它后加载，
   这里多挂一层卡片类压过去，否则编码会顶着一个灰药丸 */
.wl-cat-card .wl-cat-card__idx code {
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.02em;
  color: #9aa7b3;
}

.wl-cat-card__new {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 2px;
  background: #f0b46a;
  color: #2a1704;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.wl-cat-card h3 {
  margin: 8px 0 0;
  font-size: 16.5px;
  line-height: 1.45;
  letter-spacing: -0.01em;
  font-weight: 600;
  color: #0f2338;
}

.wl-cat-card__en {
  margin: 5px 0 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: #9aa7b3;
}

.wl-cat-card__code {
  margin: 9px 0 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: #6b7b8a;
}

.wl-cat-card__facts {
  margin: 12px 0 0;
  border-top: 1px solid #eef3f8;
}

.wl-cat-card__facts div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid #f3f7fb;
}

/* markdown-body 给 dt 加了 margin-top:16px + 斜体，这里全部归零 */
.wl-cat-card .wl-cat-card__facts dt {
  margin: 0;
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  color: #8b98a5;
}

.wl-cat-card__facts dd {
  margin: 0;
}

.wl-cat-card__facts dd {
  margin: 0;
  font-size: 12.5px;
  font-weight: 500;
  color: #0f2338;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.wl-cat-card__note {
  margin: 12px 0 0;
  font-size: 12.5px;
  line-height: 1.85;
  color: #5a6b7c;
}

/* ---------- 横排宽卡：图左文右 ---------- */
.wl-cat-card--wide,
.wl-cat-card--span2 {
  flex-direction: row;
  align-items: stretch;
}

/* 首推：单独一行，横跨整行 */
.wl-cat-card--wide {
  grid-column: 1 / -1;
}

/* 组内末张跨两列，把三列布局的最后一行补齐 */
.wl-cat-card--span2 {
  grid-column: span 2;
}

.wl-cat-card--wide .wl-cat-card__media,
.wl-cat-card--span2 .wl-cat-card__media {
  flex: none;
  width: 42%;
  display: flex;
  align-items: center;
  padding: 0;
}

.wl-cat-card--wide .wl-cat-card__body,
.wl-cat-card--span2 .wl-cat-card__body {
  width: 58%;
  padding: 18px 20px 18px;
  /* 宽卡高度由图片决定，文字少的时候靠上会显得头重，这里垂直居中 */
  justify-content: center;
}

/* ---------- D 组：无图深色卡 ---------- */
.wl-cat-card--text {
  border-color: transparent;
  background: linear-gradient(158deg, #0d3250 0%, #071d30 100%);
}

.wl-cat-card--text:hover {
  border-color: transparent;
  box-shadow: 0 18px 40px rgba(7, 29, 48, 0.28);
}

.wl-cat-card--text .wl-cat-card__idx {
  color: rgba(255, 255, 255, 0.5);
}

.wl-cat-card--text .wl-cat-card__idx b {
  color: #7fd4e8;
}

.wl-cat-card--text h3 {
  color: #fff;
}

.wl-cat-card--text .wl-cat-card__en {
  color: rgba(255, 255, 255, 0.42);
}

/* 三张卡的英文名行数不同（3~4 行），靠 min-height 猜行高总有一档对不上。
   直接让卡片内部走 subgrid：标题 / 英文名 / 编码 / 参数 / 说明各占一行，
   行高由三张里最长的那张决定，横向自然齐平。
   内边距从 body 挪到卡片上，body 用 display:contents 把六个子元素交给卡片网格。 */
.wl-cat-card--text {
  padding: 13px 16px 18px;
}

.wl-cat-card--text .wl-cat-card__body {
  padding: 0;
}

@supports (grid-template-rows: subgrid) {
  .wl-cat-grid--three {
    grid-template-rows: repeat(6, auto);
    row-gap: 0;
  }

  .wl-cat-card--text {
    display: grid;
    grid-row: span 6;
    grid-template-rows: subgrid;
  }

  .wl-cat-card--text .wl-cat-card__body {
    display: contents;
  }
}

.wl-cat-card--text .wl-cat-card__code {
  color: #8fd0e0;
}

.wl-cat-card--text .wl-cat-card__facts {
  border-top-color: rgba(255, 255, 255, 0.14);
}

.wl-cat-card--text .wl-cat-card__facts div {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.wl-cat-card--text .wl-cat-card__facts dt {
  color: rgba(255, 255, 255, 0.5);
}

.wl-cat-card--text .wl-cat-card__facts dd {
  color: #fff;
}

.wl-cat-card--text .wl-cat-card__note {
  color: rgba(255, 255, 255, 0.66);
}

/* ---------- 阅读说明 ---------- */
.wl-cat-howto {
  padding-top: clamp(56px, 6.5vw, 84px);
}

.wl-cat-howto__label {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #2f66ad;
}

.wl-cat-howto h2 {
  margin: 14px 0 0;
  font-size: clamp(24px, 3.4vw, 33px);
  line-height: 1.3;
  letter-spacing: -0.022em;
  font-weight: 600;
  color: #0f2338;
}

.wl-cat-howto p {
  margin: 14px 0 0;
  font-size: 15px;
  line-height: 1.95;
  color: #5a6b7c;
}

.wl-cat-howto strong {
  font-weight: 600;
  color: #0f2338;
}

.wl-cat-howto__list {
  margin: 22px 0 0;
  border-top: 1px solid #e3ebf3;
}

.wl-cat-howto__list div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid #eef3f8;
}

.wl-cat-howto .wl-cat-howto__list dt {
  margin: 0;
  font-size: 13px;
  font-style: normal;
  font-weight: 600;
  color: #0f2338;
}

.wl-cat-howto .wl-cat-howto__list dd {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: #5a6b7c;
}

/* ---------- 联系销售（全宽深色带） ---------- */
.wl-cat-contact {
  margin-top: clamp(62px, 7vw, 92px);
  background: linear-gradient(150deg, #0b2740 0%, #071d30 100%);
  padding: clamp(42px, 5.6vw, 68px) 0;
}

.wl-cat-contact__inner {
  /* 两张二维码横排后，右侧放不下文字，改成文字在上、码在下的竖排 */
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: clamp(24px, 3vw, 34px);
  max-width: 720px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
  box-sizing: border-box;
}

.wl-cat-contact__qrs {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.wl-cat-contact__text {
  flex: 1;
  min-width: 0;
}

.wl-cat-contact__label {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #8fd0e0;
}

.wl-cat-contact h2 {
  margin: 12px 0 0;
  font-size: clamp(24px, 3.2vw, 31px);
  line-height: 1.32;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: #fff;
}

.wl-cat-contact__text p {
  margin: 14px 0 0;
  font-size: 14.5px;
  line-height: 1.9;
  color: rgba(255, 255, 255, 0.72);
}

.wl-cat-contact__hint {
  font-size: 12.5px !important;
  color: rgba(255, 255, 255, 0.45) !important;
}

/* markdown-body 的 figure 带了 1em 40px 外边距，权重比单类高，
   这里多挂一层联系区块类把上下边距和左侧缩进都归零 */
.wl-cat-contact .wl-cat-contact__qr {
  flex: none;
  margin: 0;
  padding: 12px 12px 10px;
  background: #fff;
  border-radius: 4px;
  text-align: center;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.3);
}

.wl-cat-contact__qr img {
  display: block;
  width: 156px;
  height: 156px;
  image-rendering: pixelated;
}

.wl-cat-contact__qr figcaption {
  margin-top: 8px;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: #5a6b7c;
}

/* ---------- 暗色模式 ---------- */
.dark .wl-cat-nav a {
  border-color: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.72);
}

.dark .wl-cat-nav a b {
  color: #fff;
}

.dark .wl-cat-nav a:hover {
  border-color: #7fd4e8;
  background: rgba(127, 212, 232, 0.08);
  color: #7fd4e8;
}

.dark .wl-cat-nav a:hover b {
  color: #7fd4e8;
}

.dark .wl-cat-group__h2,
.dark .wl-cat-howto h2 {
  color: #f2f7fb;
}

.dark .wl-cat-group__desc,
.dark .wl-cat-howto p,
.dark .wl-cat-howto__list dd {
  color: rgba(255, 255, 255, 0.62);
}

.dark .wl-cat-howto strong {
  color: #fff;
}

.dark .wl-cat-card {
  background: #0e1c28;
  border-color: rgba(255, 255, 255, 0.1);
}

.dark .wl-cat-card__media {
  background: #ececec;
}

.dark .wl-cat-card h3 {
  color: #f2f7fb;
}

.dark .wl-cat-card__facts {
  border-top-color: rgba(255, 255, 255, 0.1);
}

.dark .wl-cat-card__facts div {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.dark .wl-cat-card__facts dd {
  color: #f2f7fb;
}

.dark .wl-cat-card__note {
  color: rgba(255, 255, 255, 0.6);
}

.dark .wl-cat-howto__list {
  border-top-color: rgba(255, 255, 255, 0.12);
}

.dark .wl-cat-howto__list div {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.dark .wl-cat-howto__list dt {
  color: #f2f7fb;
}

.dark .wl-cat-feat {
  background: #0e1c28;
  border-color: rgba(255, 255, 255, 0.1);
}

.dark .wl-cat-feat h3 {
  color: #fff;
}

.dark .wl-cat-feat__idx {
  color: rgba(255, 255, 255, 0.5);
}

.dark .wl-cat-feat__idx b {
  color: #8fd0e0;
}

.dark .wl-cat-feat__note {
  color: rgba(255, 255, 255, 0.55);
}

/* ---------- 响应式 ---------- */
@media (max-width: 560px) {
  .wl-cat-featgrid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
}

@media (max-width: 1080px) {
  .wl-cat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .wl-cat-grid,
  .wl-cat-grid--three {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  /* 单列时没有横向对齐的需求，整块退出 subgrid，回到普通竖排 */
  .wl-cat-grid--three {
    grid-template-rows: none;
    row-gap: 16px;
  }

  .wl-cat-card--text {
    display: flex;
    flex-direction: column;
    grid-row: auto;
    grid-template-rows: none;
  }

  .wl-cat-card--text .wl-cat-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
  }

  .wl-cat-card--wide,
  .wl-cat-card--span2 {
    flex-direction: column;
  }

  .wl-cat-card--span2 {
    grid-column: auto;
  }

  .wl-cat-card--wide .wl-cat-card__media,
  .wl-cat-card--span2 .wl-cat-card__media {
    width: 100%;
    padding: 0;
  }

  .wl-cat-card--wide .wl-cat-card__body,
  .wl-cat-card--span2 .wl-cat-card__body {
    width: 100%;
    padding: 13px 16px 18px;
  }

  .wl-cat-card__media img {
    max-width: 320px;
    margin: 0 auto;
  }

  .wl-cat-contact__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 26px;
  }

  .wl-cat-contact__qrs {
    gap: 12px;
  }

  .wl-cat-contact__qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 10px 8px;
  }

  .wl-cat-contact__qr img {
    width: 136px;
    height: 136px;
  }
}

/* ---------------------------------------------------------------------------
   品牌名不拆行
   「4.0双烘焙领鲜智造」会被中文断行规则从中间切开，首屏里很难看。
   .wl-nb 是首页的通用工具类，这个页面没加载 home.css，这里补一份。
   --------------------------------------------------------------------------- */
.wl-nb,
.wx-hero__sub a {
  white-space: nowrap;
}
