/*
 * 内页样式：产品列表 / 产品详情 / 关于我们
 *
 * 与 home.css 的关系：共用同一套令牌和基础排版（body / .wrap / .eyebrow / .display /
 * .h-sec / .lead / .btn / .card / .chips / .ftr / .rv），这个文件只补三个页型自己的布局。
 * 加载顺序必须是 inter.css → home.css → pages.css。
 *
 * 为什么单独一个文件而不是塞进 home.css：首页已经上线且被 nginx 缓存 30 天，
 * 改 home.css 会让所有访客重新下载一遍首页样式；拆开后改内页不影响首页。
 */

/* ============ 1. 页头 ============ */

/* 顶栏是 position:fixed（home.css §5），所以正文要自己让出 72px */
.phead {
  padding: calc(var(--hdr-h) + clamp(26px, 4.4vw, 62px)) 0 clamp(18px, 2.4vw, 30px);
}
.phead .display {
  font-size: clamp(34px, 4.6vw, 60px);
  margin-bottom: 14px;
}
.phead .lead { max-width: 56ch; }

/* 面包屑：HTML 由 ssr-server.js 的 generateBreadcrumb 生成，
   类名沿用了 bootstrap 的命名（breadcrumb-nav / breadcrumb / breadcrumb-item），
   但本页不加载 bootstrap，样式全部在这里重写。 */
.breadcrumb-nav {
  padding-top: calc(var(--hdr-h) + clamp(16px, 2vw, 26px));
}
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12.5px;
  color: var(--ink-3);
}
.breadcrumb-item a { color: var(--ink-2); }
.breadcrumb-item a:hover { color: var(--ink); }
.breadcrumb-item + .breadcrumb-item::before {
  content: '/';
  margin-right: 8px;
  color: var(--ink-3);
}
.breadcrumb-item.active { color: var(--ink); }

/* ============ 2. 产品列表 ============ */

.plist { padding-bottom: clamp(48px, 6vw, 96px); }
.plist .chips { margin-bottom: clamp(20px, 2.6vw, 32px); }

/* 空分类：不留一个空栅格 */
.empty {
  margin: 0;
  padding: 40px 0 56px;
  color: var(--ink-2);
  font-size: 14.5px;
}

/* 列表页的卡片数量可能很多，≤620px 时不跟首页那样做横向滚动 */
@media (max-width: 620px) {
  .plist #productList {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
    scroll-snap-type: none;
    gap: 10px;
  }
  .plist .card { flex: none; }
}

/* ============ 3. 产品详情 ============ */

.pdp { padding-bottom: clamp(40px, 5vw, 80px); }

.pdp__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: start;
  margin-top: clamp(16px, 2.4vw, 28px);
}

/* 右侧信息比图高时，图跟着滚，不然后半屏是一片白 */
.pdp__gallery {
  position: sticky;
  top: calc(var(--hdr-h) + 16px);
}

/*
 * min-width: 0 是必须的。
 * 栅格/弹性子项默认 min-width:auto，等于「不许比内容更窄」；图库里的缩略条
 * 有 8 张图时最小内容宽度约 584px，会把整列撑到 658px，于是手机（390）上整页
 * 被撑宽、要手动缩小才看得全。2026-11-21 实测：id=1 有 8 张图 → scrollWidth 678。
 */
.pdp__gallery,
.pdp__info,
.pdp__thumbs {
  min-width: 0;
}

.pdp__main {
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: #fff;
}
.pdp__main img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

/*
 * 渐进加载（2026-11-21）：
 * 主图 src 一开始是 480px 的小图，data-full 才是大图。大图解码完成后 JS 换成大图并加
 * .is-sharp，才「突然变清晰」。小图放大后会糊，所以先用一点模糊盖住放大的锯齿。
 *
 * 模糊只在 .js 下生效：脚本没跑起来时用户看到的是清晰的小图，不会永远糊着。
 */
.js .pdp__main img {
  filter: blur(10px);
  transform: scale(1.02);
  transition: filter 0.45s var(--ease-io), transform 0.45s var(--ease-io);
}
.js .pdp__main img.is-sharp {
  filter: none;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js .pdp__main img { filter: none; transform: none; transition: none; }
}

.pdp__thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.pdp__thumb {
  flex: none;
  width: 66px;
  height: 66px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.3s var(--ease-io), transform 0.3s var(--ease);
}
.pdp__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pdp__thumb:hover { border-color: var(--line-2); transform: translateY(-2px); }
.pdp__thumb.is-current { border-color: var(--navy); }

.pdp__info { padding-top: 4px; }
.pdp__cat {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.pdp__name {
  margin: 10px 0 0;
  font-size: clamp(26px, 3.2vw, 42px);
  font-weight: 700;
  letter-spacing: var(--ls-sec);
  line-height: 1.08;
  text-wrap: balance;
}
html[lang='zh-CN'] .pdp__name { line-height: 1.24; }

.pdp__price {
  margin-top: 16px;
  font-size: clamp(18px, 1.6vw, 22px);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.pdp__price:empty { display: none; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
}
.tags:empty { display: none; }
.product-tag {
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--ink-2);
  white-space: nowrap;
}

.pdp__desc {
  margin: 20px 0 0;
  color: var(--ink-2);
  font-size: clamp(14.5px, 1.1vw, 16px);
  line-height: 1.75;
  max-width: 60ch;
}
.pdp__desc:empty { display: none; }

.pdp__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: clamp(24px, 3vw, 34px);
}

/* 详细描述：长文本读起来要窄 */
.pdp__detail {
  margin-top: clamp(40px, 5vw, 72px);
  padding-top: clamp(28px, 3.4vw, 44px);
  border-top: 1px solid var(--line);
}
.pdp__detail h2 {
  margin: 0 0 16px;
  font-size: clamp(19px, 1.6vw, 23px);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.pdp__text {
  max-width: 68ch;
  color: var(--ink-2);
  font-size: clamp(14.5px, 1.1vw, 16px);
  line-height: 1.85;
}
.pdp__text:empty { display: none; }

/* 相关产品 */
.rel { margin-top: clamp(48px, 6vw, 88px); }
.rel h2 {
  margin: 0 0 clamp(16px, 2vw, 24px);
  font-size: clamp(19px, 1.6vw, 23px);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.rel__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 1.5vw, 20px);
}
/* 没有相关产品时整段（含标题）不显示。
   用 :has() 是因为「后端返回空数组」这件事模板里没有条件可写；
   Chrome 105+ / Safari 15.4+ / Firefox 121+ 支持，不支持的浏览器只会多一个空标题。 */
.rel:has(.rel__grid:empty) { display: none; }

@media (max-width: 860px) {
  /* 单列时同样要用 minmax(0, 1fr)：写成 1fr 的话最小宽度是 min-content，
     缩略图多的产品会把页面撑得比手机还宽（见上面 .pdp__gallery 的注释） */
  .pdp__grid { grid-template-columns: minmax(0, 1fr); }
  .pdp__gallery { position: static; }
  .rel__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============ 4. 关于我们 ============ */

.about__prose { max-width: 72ch; }
.about__prose p {
  margin: 0;
  color: var(--ink-2);
  font-size: clamp(15px, 1.2vw, 17px);
  line-height: 1.8;
}
.about__prose p + p { margin-top: 16px; }

/* 四个数字：复用 home.css 的 .stat / .stat__num / .stat__lbl */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-top: clamp(28px, 3.6vw, 44px);
  padding: clamp(20px, 2.8vw, 30px) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stats .stat__num { font-variant-numeric: tabular-nums; }
.stats .stat__num--text {
  font-size: clamp(15px, 1.4vw, 18px);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

/* 三张能力卡 */
.caps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 28px);
}
.cap {
  padding: clamp(18px, 2.4vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  transition: border-color 0.4s var(--ease-io), transform 0.5s var(--ease);
}
.cap:hover { border-color: var(--line-2); transform: translateY(-3px); }
.cap__k {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
.cap__t {
  margin-top: 12px;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.cap__d {
  margin-top: 8px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.7;
}

/* 里程碑时间线 */
.tl {
  position: relative;
  margin: 0;
  padding: 0 0 0 26px;
  list-style: none;
}
.tl::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--line-2);
}
.tl > li { position: relative; padding-bottom: clamp(22px, 2.6vw, 34px); }
.tl > li:last-child { padding-bottom: 0; }
.tl > li::before {
  content: '';
  position: absolute;
  left: -26px;
  top: 7px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  background: var(--bg);
}
.tl__year {
  display: inline-block;
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.tl__t {
  margin: 12px 0 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.tl__d {
  margin: 6px 0 0;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.75;
  max-width: 64ch;
}

/* 管理团队 */
.people { display: grid; gap: clamp(22px, 2.8vw, 34px); }
.person__name {
  margin: 0 0 8px;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.person__d {
  margin: 0;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.8;
  max-width: 68ch;
}

/* 合作品牌 */
.brands {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  padding: 0;
  list-style: none;
}
.brands li {
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--ink-2);
}

/* 愿景里的「愿景：」「核心价值观：」用深色，跟正文区分开 */
.about__prose strong { color: var(--ink); font-weight: 600; }

@media (max-width: 860px) {
  .caps { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 22px; }
}
