/* 全站内容宽度统一 —— 参考 02 号（PeptideFactoryLabs）的容器体系
 *
 * 02 号的定义：
 *   .shell      = min(1320px, 100% - 96px)   常规内容
 *   .wide-shell = min(1344px, 100% - 96px)   宽版内容
 *   ≤1198px: min(930px, 100% - 64px)
 *   ≤767px : 100% - 40px
 *   ≤390px : 100% - 30px
 *
 * 01 号的 .container 是 Bootstrap 容器，带 15px 左右内边距，
 * 因此 max-width 取「目标内容宽 + 30px」时，两侧留白与 02 号完全一致。
 *
 * 首页的全宽模块（首屏轮播、肽产品与质量模块、询盘区与收尾 CTA）使用
 * 100vw 突破父容器，不受本文件影响，仍然保持整屏宽度。
 *
 * 调整统一宽度时，只改下面三个变量即可。
 */

:root {
  --site-shell: 1320px;        /* 常规内容宽度（与 02 号 .shell 一致） */
  --site-shell-wide: 1344px;   /* 宽版内容宽度（与 02 号 .wide-shell 一致） */
  --site-gutter: 48px;         /* 视口两侧留白（达到宽度上限前的最小值） */
  --site-pad: 15px;            /* 01 号 .container 的单侧内边距 */
}

/* ---------------------------------------------------------- 正文容器 */
.container {
  max-width: min(
    calc(var(--site-shell) + var(--site-pad) * 2),
    calc(100% - var(--site-gutter) * 2 + var(--site-pad) * 2)
  ) !important;
}

@media (max-width: 1198px) {
  .container {
    max-width: min(
      calc(930px + var(--site-pad) * 2),
      calc(100% - 64px + var(--site-pad) * 2)
    ) !important;
  }
}

@media (max-width: 767px) {
  .container {
    max-width: calc(100% - 40px + var(--site-pad) * 2) !important;
  }
}

@media (max-width: 390px) {
  .container {
    max-width: calc(100% - 30px + var(--site-pad) * 2) !important;
  }
}

/* ---------------------------------------------------------- 页脚容器 */
/* 01 号页脚原本用 min(1740px, 100% - 120px)，与正文宽度不一致，统一到同一体系。
   页脚容器没有内边距，因此直接使用 02 号的公式。 */
#peptide-footer .footer-shell {
  width: min(var(--site-shell), calc(100% - var(--site-gutter) * 2)) !important;
  margin-inline: auto !important;
}

@media (max-width: 1198px) {
  #peptide-footer .footer-shell {
    width: min(930px, calc(100% - 64px)) !important;
  }
}

@media (max-width: 767px) {
  #peptide-footer .footer-shell { width: calc(100% - 40px) !important; }
}

@media (max-width: 390px) {
  #peptide-footer .footer-shell { width: calc(100% - 30px) !important; }
}
