/* ===== BAKESLA 站点补丁样式 site-fixes.css =====
   建立于 2026-11-06。
   ⚠️ 以后所有移动端 / 样式补丁【只写这个文件】，不要再往 responsive.css 或 all.min.css 里加。
   ⚠️ 背景：com 首页加载的是合并包 all.min.css，其它页面加载 style.css + responsive.css，
      两套并存导致补丁容易只落一处（2026-11-06 com 首页轮播裁切即因此漏修）。
   本文件在四站所有页面的 <head> 里【最后】加载，同特异性下覆盖前面所有样式表。

   现有内容（均为 2026-11-06 移动端修复）：
     ① 新闻博客列表 /channel/2：图片固定 300px + 文字框 calc(100% - 330px) 在手机上只剩 20px → 竖排
     ② 栏目页 banner：responsive.css 断点把高度写死 11rem/16.8rem，标题 54~60px 换行后撑破容器被裁
     ③ 首页轮播：.banner-bg 固定 700px + overflow:hidden + 垂直居中，手机上内容最高 945px 被上下各裁一半
   全部规则都限定在 ≤767px，桌面端与平板零影响。
   ================================================= */

@media only screen and (max-width: 767px) {
  /* ① 新闻博客列表：横排改竖排 */
  .news-list { flex-direction: column; }
  .news-list .img-box { width: 100%; height: auto; margin-bottom: 12px; }
  .news-list .img-box img { width: 100%; height: auto; }
  .news-list .right-box { width: 100%; margin-right: 0; min-width: 0; }

  /* ② 栏目页 banner：高度自适应 + 标题缩小，避免被裁 */
  section.banner-inner-section { height: auto; min-height: 150px; padding: 18px 0; }
  .banner-inner-title h1 { font-size: 26px; line-height: 36px; }

  /* ③ 首页轮播：高度自适应，避免内容被裁 */
  .banner-slider .banner-bg { height: auto; min-height: 0; padding: 24px 0 10px; }
}

/* ===== 产品下拉（6 大类，2026-11-07）：名称较长，面板按最长条目自适应宽度，避免两行折断 ===== */
.header-menu .submenu{width:max-content;min-width:260px;max-width:min(420px,92vw)}
.header-menu .submenu ul>li>a{white-space:normal;line-height:1.45;padding:9px 22px}
@media (max-width:1199px){.header-menu .submenu{max-width:min(360px,92vw)}}

/* 加宽上限（英文长名称单行显示，仅桌面档，2026-11-07） */
@media (min-width:1200px){.header-menu .submenu{max-width:min(520px,92vw)}}

/* ===== 产品卡统一显示（2026-11-08）：标题固定两行高，六张卡等高、按钮对齐 ===== */
.collection-box-title{min-height:64px;display:flex;align-items:center;justify-content:center;padding:0 8px}
.collection-box-thumb{height:auto;aspect-ratio:1/1}
.collection-box-thumb img{width:100%;height:100%;object-fit:contain;background:#fff}
@media (max-width:1199px){.collection-box-title{min-height:58px}}

@media only screen and (max-width: 767px) {
  /* ④ 首页轮播：手机上把图片排到文字【上方】，保证整台机器在首屏完整可见
     （2026-11-06 用户反馈"不要半张图"）
     实测：banner 总高 831~871px，图片底部落在 885~925px，而手机首屏可见区约 664px，
     图片排在文字下方时只露出机器顶部；调换顺序后图片底部落在 444px，完整进首屏。
     文字一个字不删、字号不变，只调顺序。桌面端（>=768px）完全不生效。 */
  .banner-slider .banner-bg .row { display: flex; flex-direction: column-reverse; }
  .banner-slider .banner-bg .banner-thumb { max-width: 320px; margin: 0 auto; }
  .banner-slider .banner-bg { padding: 12px 0 8px; }
}


@media only screen and (max-width: 4000px) {
  /* ⑤ 焦点图第 2 张纵向拉伸修复（2026-11-08）
     该图 <img> 带 width="500" height="500" 属性，而 CSS 只写了 width:100% 没写 height，
     于是 height 属性以 500px 生效 → 手机上 320×500、桌面上 636×500，图被竖着拽长。
     旧图是透明底抠图不明显；换成带背景照片后一眼可见。 */
  .banner-slider .banner-thumb img { height: auto; }
}

/* ⑥ 页脚 Product Categories 单行（仅桌面 ≥992px，2026-11-08）
   最长项 "Semi-Automatic Dough Divider & Rounder (Vertical)" 单行需 367px，
   原列内可用宽度仅 288px（列 336 - 左右 padding 48）→ 折两行。
   做法：产品列固定 420px（内宽 372px），其余三列平分剩余；链接不折行。 */
@media only screen and (min-width: 992px) {
  .footer-section .row > .col-lg-3 { flex: 1 1 0%; max-width: none; width: auto; }
  .footer-section .row > .col-lg-3:nth-child(3) { flex: 0 0 420px; max-width: 420px; }
  .footer-section .row > .col-lg-3:nth-child(3) .footer-link li a { white-space: nowrap; }
}

/* ⑦ 页脚 Website Links 列右移 1cm（≈38px），2026-11-08
   注意：不要改列的 padding（那会被 flex 重算列宽，实际只移了 25px）。
   改为把列内 .footer-link 块整体右移 38px —— 列宽保持均分不变，内容精确右移 38px。 */
@media only screen and (min-width: 992px) {
  .footer-section .row > .col-lg-3:nth-child(2) > .footer-link { padding-left: 38px; }
}

/* ⑧ 正文分割线（后台 TinyMCE「分割线」按钮插入，2026-11-16）
   背景：这两条规则原本只写在 style.css，但 content 详情页加载的是
   all.min.css（2026-09-01 合并构建时被 purgecss 判为“未使用”删掉，因为
   divider-gradient 只出现在数据库正文里、模板中不存在）→ 前台裸 <hr>
   回落到浏览器默认 1px inset 灰实线。
   此处补进 site-fixes.css：content 详情页已加载本文件、不经 purgecss。
   标记形如：<hr class="divider-gradient" style="--divider-color:#6b7280"> */
.content-detail-box .content hr.divider-gradient {
  height: 1px;
  border: none;
  margin: 32px 0;
  background: linear-gradient(90deg, transparent, var(--divider-color, rgba(0, 0, 0, 0.12)), transparent);
}
.content-detail-box .content hr.divider-dotted {
  height: 1px;
  border: none;
  margin: 32px 0;
  border-top: 1px dashed var(--divider-color, rgba(0, 0, 0, 0.15));
}
.content-detail-box .content hr.divider-gradient,
.content-detail-box .content hr.divider-dotted {
  box-sizing: border-box;
  max-width: 100%;
}

/* ⑨ 正文手机端格式：对齐 / 显隐 / 有序列表（2026-11-16 补）
   说明：data-mobile-font-size 那批规则在 all.min.css 里幸存（已生效，实测 84pt→112px），
   但 data-mobile-align / hide / only 与 .content ol 被 purgecss 清掉，此处补齐。 */
@media screen and (max-width: 768px) {
  .content-detail-box [data-mobile-align="left"] {
    text-align: left !important;
  }
  .content-detail-box [data-mobile-align="center"] {
    text-align: center !important;
  }
  .content-detail-box [data-mobile-align="right"] {
    text-align: right !important;
  }
  .content-detail-box [data-mobile-hide="true"] {
    display: none !important;
  }
}

@media screen and (min-width: 769px) {
  .content-detail-box [data-mobile-only="true"] {
    display: none !important;
  }
}

.content-detail-box .content ol {
  list-style: decimal;
  padding-left: 40px;
  margin: 10px 0;
}

/* ==========================================================================
   正文图注（figcaption）· 2026-11-17
   背景：后台编辑器（TinyMCE 7，skins/content/default/content.min.css）里
         figure{display:table;margin:1rem auto} + figcaption{居中灰字}，
         图注本来就在图片正下方；但前台站点 CSS 没有任何 figure/figcaption
         规则，且富文本里的图片带 inline 的 float:right/left，
         图片脱离文档流 → 图注跑到图片左上、横跨整行（实测 y 比图顶还高）。
   做法：把编辑器的表现搬到前台，并把“浮动”从 <img> 挪到 <figure>，
         这样图注永远贴在该图的正下方、居中。
   ========================================================================== */
.content figure {
  display: table;              /* 盒子自动贴合图片宽度，图注因此正对图下方 */
  max-width: 100%;
  margin: 18px auto;           /* 覆盖浏览器默认的 1em 40px，与正文左右对齐 */
  text-align: center;
}
.content figure > img {
  float: none !important;      /* 关键：浮动改由 figure 承担，否则图注会跑到图旁边 */
  display: block;
  margin: 0;
  max-width: 100%;
  height: auto;
}
.content figure.align-left,
.content figure.align-right {
  max-width: 100%;
}
.content figure.align-left {
  float: left;
  margin: 6px 24px 14px 0;
}
.content figure.align-right {
  float: right;
  margin: 6px 0 14px 24px;
}
.content figure figcaption {
  display: block;
  clear: both;
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.6;
  color: #777;
  text-align: center;
}
/* 手机端：取消左右浮动，图注照样在图正下方 */
@media (max-width: 767.98px) {
  .content figure,
  .content figure.align-left,
  .content figure.align-right {
    float: none !important;
    max-width: 100%;
    margin: 16px auto;
  }
}
