/* 荣誉资质页专用：改 --honors-visible 可调整一屏展示数量。 */
.honors-gallery {
  --honors-visible: 3;
  --honors-gap: 20px;
  min-width: 0;
  container-type: inline-size;
}
.honors-intro {
  margin-top: 14px;
  font-size: 16px;
  line-height: 1.8;
}
.honors-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-block: 24px;
}
.honors-categories[hidden],
.honors-list > li[hidden] {
  display: none;
}
.honors-categories button {
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  border-radius: var(--radius-control);
  background: #e4eef5;
  color: var(--blue-deep);
  font-size: 16px;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease;
}
.honors-categories button:hover,
.honors-categories button[aria-pressed="true"] {
  background: var(--blue);
  color: #fff;
}
.honors-list {
  display: grid;
  grid-template-columns: repeat(var(--honors-visible), minmax(0, 1fr));
  gap: var(--honors-gap);
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}
.honors-list > li {
  min-width: 0;
}
/* 未启用脚本时直接展示全部证书；启用后才变为左右翻看的轨道。 */
.honors-showcase.is-ready {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 12px;
}
.is-ready .honors-list {
  display: flex;
  grid-column: 2;
  grid-row: 1;
  overflow-x: auto;
  margin: 0;
  padding-block: 8px;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.is-ready .honors-list::-webkit-scrollbar {
  display: none;
}
.is-ready .honors-list > li {
  flex: 0 0 calc((100% - (var(--honors-visible) - 1) * var(--honors-gap)) / var(--honors-visible));
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.honors-card {
  display: block;
  height: 100%;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: #fff;
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.honors-card:hover,
.honors-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 4px 10px -3px rgba(12, 44, 70, 0.18);
}
.honors-card figure {
  height: 100%;
}
/* 证书使用 contain，四边完整保留；不沿用产品照片的裁切。 */
.honors-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  padding: 12px;
  object-fit: contain;
  background: #fff;
}
.honors-card figcaption {
  min-height: 62px;
  padding: 10px 12px 12px;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
}
.honors-showcase .product-page-arrow {
  position: static;
  width: 40px;
  height: 64px;
  border: 0;
  transform: none;
}
.honors-showcase .product-page-arrow:hover:not(:disabled),
.honors-showcase .product-page-arrow:focus-visible:not(:disabled) {
  transform: translateY(-2px);
}
.honors-showcase .product-page-arrow--prev {
  grid-column: 1;
  grid-row: 1;
}
.honors-showcase .product-page-arrow--next {
  grid-column: 3;
  grid-row: 1;
}
.honors-status {
  position: absolute;
  inset-inline: 0;
  height: 0;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
/* 原生对话框支持 Escape 关闭和键盘焦点约束。 */
.honors-viewer {
  width: min(1100px, calc(100% - 40px));
  max-width: none;
  max-height: calc(100svh - 40px);
  padding: 48px 20px 16px;
  border: 0;
  border-radius: var(--radius-card);
  background: #fff;
  color: var(--ink);
}
.honors-viewer::backdrop {
  background: rgba(5, 24, 38, 0.8);
}
.honors-viewer-close {
  position: absolute;
  top: 4px;
  right: 8px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--paper);
  color: var(--blue-deep);
  font-size: 30px;
  cursor: pointer;
}
.honors-viewer-close:hover {
  background: var(--blue);
  color: #fff;
}
.honors-viewer img {
  width: auto;
  height: auto;
  max-height: min(72svh, 900px);
  margin-inline: auto;
  object-fit: contain;
}
.honors-viewer figcaption {
  margin-top: 12px;
  font-size: 16px;
  line-height: 1.5;
  text-align: center;
}
html:has(.honors-viewer[open]) {
  overflow: hidden;
}
/* 侧栏也占宽度，按正文实际空间切换张数，避免平板上的证书太小。 */
@container (max-width: 760px) {
  .honors-showcase {
    --honors-visible: 2;
    --honors-gap: 16px;
  }
}
@container (max-width: 480px) {
  .honors-showcase {
    --honors-visible: 1;
  }
}
@media (max-width: 1100px) {
  .honors-gallery {
    --honors-visible: 2;
    --honors-gap: 16px;
  }
  .honors-showcase.is-ready {
    grid-template-columns: 32px minmax(0, 1fr) 32px;
    gap: 8px;
  }
  .honors-showcase .product-page-arrow {
    width: 32px;
    height: 56px;
  }
}
@media (max-width: 700px) {
  .honors-gallery,
  .honors-showcase {
    --honors-visible: 1;
  }
  .honors-categories {
    gap: 6px;
    margin-block: 20px;
  }
  .honors-categories button {
    padding-inline: 12px;
  }
  .honors-showcase.is-ready {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .is-ready .honors-list {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .honors-showcase .product-page-arrow {
    width: 48px;
    height: 44px;
  }
  .honors-showcase .product-page-arrow--prev {
    grid-column: 1;
    grid-row: 2;
    justify-self: end;
  }
  .honors-showcase .product-page-arrow--next {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
  }
  .honors-viewer {
    width: calc(100% - 24px);
    padding-inline: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .honors-card,
  .honors-categories button {
    transition: none;
  }
  .honors-card:hover,
  .honors-card:focus-visible,
  .honors-showcase .product-page-arrow:hover:not(:disabled),
  .honors-showcase .product-page-arrow:focus-visible:not(:disabled) {
    transform: none;
  }
  .is-ready .honors-list {
    scroll-behavior: auto;
  }
}
