/* ==========================================================================
   site.css — 站点样式（原 index 单体内联样式的抽取版）
   设计令牌（颜色/字体）在 tailwind.config 内，本文件只放 Tailwind 无法表达的部分。
   ========================================================================== */

/* ---------- 1. 基础 ---------- */
html { scroll-padding-top: 5.5rem; } /* 修复：锚点跳转被 sticky header 遮挡 */

body {
  background-color: #FFFFFF;
  color: #4E4E4E;
  font-family: 'DM Sans', 'Noto Sans SC', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .font-slab {
  font-family: 'Roboto Slab', 'Noto Sans SC', serif;
  color: #191F30;
}

/* 无障碍：键盘焦点可见（原稿缺失） */
:focus-visible {
  outline: 2px solid #68A83C;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- 2. 卡片 ---------- */
.soft-card {
  background: #FFFFFF;
  border: 1px solid #E6ECE6;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(25, 31, 48, 0.05);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.soft-card:hover {
  transform: translateY(-3px);
  border-color: #68A83C;
  box-shadow: 0 12px 28px rgba(104, 168, 60, 0.12);
}

.dashed-principle-card {
  background: #FFFFFF;
  border: 1.5px dashed #BCE0B4;
  border-radius: 12px;
  transition: all .25s ease;
}
.dashed-principle-card:hover {
  border-style: solid;
  border-color: #68A83C;
  box-shadow: 0 10px 25px rgba(104, 168, 60, 0.1);
}

/* ---------- 4. 性能 ---------- */
.deferred-section {
  content-visibility: auto;
  contain-intrinsic-size: auto 640px; /* 修复：原值 "auto none auto 640px" 是无效语法 */
}

/* ---------- 5. 对话框 ---------- */
dialog::backdrop {
  background-color: rgba(25, 31, 48, 0.78);
  backdrop-filter: blur(4px);
}
/* 修复：原稿 dialog 无 max-height，小屏会溢出不可滚动 */
dialog { max-height: 90vh; }
dialog[open] { display: block; }

/* ---------- 6. 动画 ---------- */
@keyframes pulseRing {
  0%   { transform: scale(1);    opacity: .75; }
  100% { transform: scale(1.45); opacity: 0; }
}
.play-pulse { position: relative; }
.play-pulse::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background-color: #68A83C;
  animation: pulseRing 1.8s infinite;
  z-index: -1;
}
@media (prefers-reduced-motion: reduce) {
  .play-pulse::before { animation: none; }
  .soft-card, .dashed-principle-card { transition: none; }
}

/* ---------- 7. 多行截断（替代 Tailwind line-clamp 插件） ---------- */
.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* ---------- 8. 图片加载失败时隐藏 alt 文本溢出 ---------- */
img[data-photo] { color: transparent; font-size: 0; }
img[data-photo]:not([src]),
img[data-photo][src=""] { visibility: hidden; }

/* ---------- 9. 图标（GPT-Image 生成，白底已转透明） ---------- */
.ico    { display:block; object-fit:contain; width:1.25rem; height:1.25rem; }  /* 20px */
.ico-lg { width:1.75rem; height:1.75rem; }                                    /* 28px，板块图标 */
.ico-sm { width:1rem; height:1rem; }                                          /* 16px，行内 */
/* 深色/彩色底上用白色线稿 */
.ico-on-dark { filter:brightness(0) invert(1); }

/* ---------- 7. 首屏主视觉（2026-11-30 改版） ----------
   原 2×2 四宫格产品卡 → 单张主视觉 + 下沿证据浮层。
   理由：Meta 落地页决策窗口约 30 秒，首屏必须一眼给出「在做的实物 + 可核实数字」，
   而不是四张同质化的白罐静物。
   圆角与裁切交给内部 img 自己处理。 */
.hero-visual { isolation: isolate; background: #F3FAF3; }
.hero-visual > img { display: block; border-radius: 1rem; }
.hero-visual::after {
  /* 底部压暗，保证浮层文字在任意亮度的图上都可读 */
  content: '';
  position: absolute; inset: auto 0 0 0; height: 34%;
  background: linear-gradient(to top, rgba(15, 23, 42, .55), rgba(15, 23, 42, 0));
  pointer-events: none;
}
.hero-proof {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; margin: 0;
  background: rgba(255, 255, 255, .18);
  border-top: 1px solid rgba(255, 255, 255, .28);
  backdrop-filter: blur(6px);
}
.hero-proof-item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px;
  background: rgba(15, 23, 42, .28);
}
.hero-proof-k {
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: rgba(255, 255, 255, .72);
}
.hero-proof-v {
  font-family: 'Roboto Slab', serif; font-weight: 800; font-size: 17px; line-height: 1.15;
  color: #FFFFFF;
}
@media (max-width: 640px) {
  .hero-proof-item { padding: 8px 9px; }
  .hero-proof-v { font-size: 15px; }
}

/* ---------- 8. 产品区版式（2026-11-30 改版） ----------
   六张等权卡片 = 视觉上说「这些都不重要」。
   改为「1 主 + 5 副」：核心品类（蛋白粉桶）跨 2 列、图更高，直接承担「这就是我们主打」的表达。
   筛选后（.is-filtered）回退等权——因为筛选结果同类，无主次。 */
.product-featured > .product-card.is-featured { grid-column: span 2; }
.product-featured > .product-card.is-featured .p-6 h3 { font-size: 1.25rem; }
.product-featured.is-filtered > .product-card.is-featured { grid-column: auto; }

/* 包装结构特写：嵌在卡片右下角的小圆图。
   行业客户验货时最先放大看的就是卷封边/风琴底/拉链轨道/喷码区——
   一张主图看不出结构，一个圆形特写就能。 */
.prod-detail {
  position: absolute; right: 12px; bottom: 12px; z-index: 2;
  width: 64px; height: 64px; border-radius: 9999px; overflow: hidden;
  border: 2.5px solid #FFFFFF; box-shadow: 0 4px 12px rgba(25, 31, 48, .22);
  display: block; background: #E6ECE6;
}
.prod-detail img { width: 100%; height: 100%; object-fit: cover; display: block; }

@media (max-width: 640px) {
  /* 手机上两列会让首卡文字被挤成窄条，统一单列等权 */
  .product-featured > .product-card.is-featured { grid-column: span 1; }
  .prod-detail { width: 52px; height: 52px; }
}

/* ---------- 9. 证书区（2026-11-30 改版） ----------
   原做法：6 张合规实景图压到 opacity-40 当背景 + 「Copy on request」浮标。
   两头不讨好：既不是真证书，又把「我们没有」直接画到了墙上。
   依据 2026-11-27_全站文案对齐基准 §3.6「未交付前只列名称+状态，不放图」，
   改为纯文字清单卡：一张纸质文档线条图标 + 明确状态徽标。
   把「不做假证」本身变成一个信任点，而不是短板。 */
.cert-card { display: flex; flex-direction: column; justify-content: space-between; min-height: 128px; }
.cert-sheet { width: 34px; height: 34px; flex-shrink: 0; color: #A8B5AE; }
.cert-sheet svg { width: 100%; height: 100%; }
.cert-foot { margin-top: 14px; padding-top: 11px; border-top: 1px dashed #E6ECE6; }
.cert-status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 9999px;
  border: 1px solid transparent;
}
.cert-status svg { width: 12px; height: 12px; }
.cert-status-ok   { color: #4E8629; background: #F3FAF3; border-color: #BCE0B4; }
.cert-status-wait { color: #9A6B00; background: #FDF8EC; border-color: #F0DCA8; }
.cert-status-none { color: #6B7A75; background: #F4F6F5; border-color: #DCE3DF; }
.cert-open {
  font-size: 11px; font-weight: 700; color: #4E8629; text-decoration: underline;
  background: none; border: 0; padding: 0; cursor: pointer;
}

/* ---------- 10. 相册能力条（2026-11-30 改版） ----------
   9 张等大 = 没重点。只留前 3 张做能力证明，其余折起。 */
.tour-item.tour-rest { display: none; }
#tour-grid.tour-expanded .tour-item.tour-rest { display: block; }

/* ---------- 12. 订阅区补漏（2026-11-30）----------
   ① 移动端单列时，图片撑到全宽会把卡片拉得过长，限高；
   ② 产品卡 tag 徽章在窄屏会压到标题，改成换行横排。 */
@media (max-width: 640px) {
  .product-featured > .product-card .h-72,
  .product-featured > .product-card .h-56 { height: 15rem; }
  .product-featured > .product-card h3 { font-size: 1.05rem; }
}
