/* Product list/detail pages (PbootCMS listtpl/contenttpl) */

:root {
  --pbg: #f6f8fc;
  --ptext: #0f172a;
  --pmuted: #64748b;
  --pborder: rgba(15, 23, 42, 0.12);
  --pshadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  --pblue: #00327e;
  --pblue2: #00255e;
}

body.page-products {
  margin: 0;
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  color: var(--ptext);
  background: var(--pbg);
  /* 与首页一致：大屏整体放大 */
}

body.page-products {
  --pg-primary: var(--pblue);
  --pg-muted: var(--pmuted);
}

@media (min-width: 1600px) {
  body.page-products {
    zoom: min(1.75, max(1, 100vw / 1760));
  }
}

.page-products .container {
  width: 100%;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  padding-left: clamp(12px, 3vw, 32px);
  padding-right: clamp(12px, 3vw, 32px);
}

@media (min-width: 1200px) {
  .page-products .container {
    max-width: 75%;
  }
}

@media (min-width: 2000px) {
  .page-products .container {
    max-width: min(1820px, 80vw);
    padding-left: clamp(16px, 3.2vw, 44px);
    padding-right: clamp(16px, 3.2vw, 44px);
  }
}

@media (min-width: 2600px) {
  .page-products .container {
    max-width: min(2160px, 84vw);
  }
}

/* ---------- Page hero ---------- */
.p-hero {
  position: relative;
  padding-top: calc(var(--landing-header-height, 80px) + clamp(28px, 3.2vw, 56px));
  padding-bottom: clamp(24px, 3vw, 48px);
  background:
    radial-gradient(900px 500px at 70% 30%, rgba(0, 50, 126, 0.14) 0%, rgba(0, 50, 126, 0) 60%),
    linear-gradient(180deg, #ffffff 0%, #edf0f7 100%);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.p-hero__bg {
  width: 100%;
  height: auto;
  display: block;
}

.p-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.45);
  pointer-events: none;
  z-index: 1;
}

.p-hero > .container {
  position: relative;
  z-index: 2;
}

/* Image-based hero: full-width image, auto height, text overlay */
.p-hero--img {
  display: grid;
  grid-template-areas: "stack";
  padding-top: 0;
  padding-bottom: 0;
  background: none;
}

.p-hero--img .p-hero__bg {
  grid-area: stack;
}

.p-hero--img::before {
  grid-area: stack;
}

.p-hero--img > .container {
  grid-area: stack;
  padding-top: calc(var(--landing-header-height, 80px) + clamp(28px, 3.2vw, 56px));
  padding-bottom: clamp(24px, 3vw, 48px);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (max-width: 767px) {
  .p-hero--img {
    min-height: 240px;
  }

  .p-hero--img .p-hero__bg {
    height: 100%;
    object-fit: cover;
    object-position: center;
  }
}

.pl-content-head {
  margin-bottom: clamp(18px, 2.4vw, 30px);
}

.pl-content-head .pl-page-title {
  margin: 0;
  padding-top: 6px;
  text-align: center;
  font-weight: 800;
  letter-spacing: 0.015em;
  color: var(--pblue);
  font-size: clamp(20px, 1.9vw, 28px);
  line-height: 1.15;
}

.pl-content-head .pl-page-title::after {
  content: "";
  display: block;
  width: 96px;
  height: 4px;
  margin: 12px auto 0;
  border-radius: 999px;
  background: var(--pblue);
  opacity: 0.95;
}

.pl-content-head .pl-tabs {
  margin-top: clamp(12px, 2vw, 18px);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(10px, 1.4vw, 16px);
}

.pl-content-head .pl-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
  text-decoration: none;
  font-weight: 600;
  font-size: clamp(13px, 1.05vw, 15px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.pl-content-head .pl-tab:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 50, 126, 0.35);
  background: rgba(0, 50, 126, 0.08);
}

.pl-content-head .pl-tab.is-active {
  background: var(--pblue);
  border-color: var(--pblue);
  color: #fff;
}

.pl-content-head .pl-tab:focus-visible {
  outline: 3px solid rgba(0, 50, 126, 0.35);
  outline-offset: 2px;
}

.p-breadcrumb {
  font-size: clamp(13px, 1vw, 15px);
  color: rgba(255, 255, 255, 0.85);
}

.p-breadcrumb a {
  color: inherit;
  text-decoration: none;
}

.p-breadcrumb a:hover {
  color: #fff;
  text-decoration: underline;
}

.p-title {
  margin: clamp(10px, 1.2vw, 14px) 0 0;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 12px 28px rgba(2, 6, 23, 0.45);
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.15;
}

.p-subtitle {
  margin: 10px 0 0;
  max-width: 62rem;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 10px 22px rgba(2, 6, 23, 0.35);
  font-size: clamp(15px, 1.2vw, 18px);
  line-height: 1.6;
}

/* ---------- List grid ---------- */
.p-section {
  padding: clamp(26px, 3.2vw, 56px) 0;
}

.p-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: clamp(14px, 2vw, 24px);
}

.p-count {
  color: var(--pmuted);
  font-size: 14px;
}

.p-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(14px, 1.8vw, 24px);
}

@media (min-width: 768px) {
  .p-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1000px) {
  .p-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .p-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.p-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.p-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--pshadow);
}

.p-card__media {
  position: relative;
  background: #e6edf5;
}

.p-card__media::before {
  content: "";
  display: block;
  padding-top: 62%;
  background: linear-gradient(135deg, rgba(0, 50, 126, 0.12) 0%, rgba(15, 23, 42, 0.04) 70%);
}

.p-card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.p-card__body {
  padding: clamp(16px, 1.6vw, 22px);
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.p-card__title {
  margin: 0;
  font-size: clamp(13px, 0.9vw, 15px);
  font-weight: 600;
  line-height: 1.3;
  color: var(--ptext);
  text-transform: lowercase;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

.p-card__title::first-letter {
  text-transform: uppercase;
}

.p-card__desc {
  margin: 0;
  color: var(--pmuted);
  font-size: 14px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

.p-card__cta {
  margin-top: auto;
  padding-top: 6px;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--pblue);
}

.p-card__cta i {
  font-size: 12px;
}

.p-pagination { display: none; }

/* ---------- Detail ---------- */
.p-detail2 {
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2.2vw, 22px);
}

.p-related {
  margin-top: clamp(16px, 2.4vw, 28px);
}

.p-detail2__head {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
  padding: clamp(18px, 2vw, 28px);
}

.p-h1--top {
  margin-bottom: 8px;
}

.p-cardbox {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.p-cardbox__inner {
  padding: clamp(18px, 2vw, 28px);
}

.p-h3 {
  margin: 0 0 10px;
  font-size: clamp(16px, 1.35vw, 20px);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ptext);
}

.p-divider {
  width: 96px;
  height: 4px;
  border-radius: 999px;
  background: var(--pblue);
  opacity: 0.95;
  margin: 12px 0 18px;
}

.p-rich {
  color: #334155;
  line-height: 1.8;
  font-size: 16px;
  word-break: break-word;
}

.p-rich img {
  max-width: 100%;
  height: auto;
}

.p-params {
  color: var(--pmuted);
  font-size: 15px;
  line-height: 1.7;
  word-break: break-word;
}

.p-params table {
  width: 100%;
  border-collapse: collapse;
}

.p-params th,
.p-params td {
  border: 1px solid rgba(15, 23, 42, 0.08);
  padding: 10px 12px;
  vertical-align: top;
}

.p-params th {
  background: rgba(0, 50, 126, 0.06);
  color: var(--ptext);
  text-align: left;
  font-weight: 800;
}

.p-table-scroll {
  width: 100%;
}

@media (max-width: 767px) {
  .p-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .p-table-scroll table {
    min-width: 640px;
  }
}

.p-gallery__cat {
  margin: 0 0 10px;
  font-size: clamp(20px, 1.8vw, 36px);
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--pblue);
  text-align: center;
  line-height: 1.25;
  margin-bottom: 14px;
}

.p-gallery__stage {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
}

.p-gallery__main {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #f3f4f6;
  /* 让容器宽度跟随图片，并居中显示 */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  padding: 12px;
  margin: 0;
}

.p-gallery__main-img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 520px;
  object-fit: contain;
  object-position: center;
}

@media (max-width: 480px) {
  .p-gallery__main {
    padding: 10px;
  }
  .p-gallery__main-img {
    max-height: 360px;
  }
}

.p-gallery__thumbbar {
  margin-top: clamp(12px, 1.8vw, 16px);
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  gap: 12px;
  align-items: center;
  width: 100%;
}

.p-gallery__nav {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  color: var(--ptext);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.p-gallery__nav:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
  border-color: rgba(0, 50, 126, 0.25);
}

.p-gallery__nav:focus-visible {
  outline: 3px solid rgba(0, 50, 126, 0.35);
  outline-offset: 2px;
}

.p-gallery__thumbs {
  margin-top: clamp(12px, 1.8vw, 16px);
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scrollbar-width: none;
  margin-top: 0;
  padding-top: 2px;
}

.p-gallery__thumbs::-webkit-scrollbar {
  display: none;
}

.p-thumbitem {
  flex: 0 0 auto;
  width: 86px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.p-thumbitem__t {
  width: 100%;
  font-size: 11px;
  line-height: 1.25;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--pmuted);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  text-align: center;
  min-height: calc(2 * 1.25em);
}

.p-thumb {
  flex: 0 0 auto;
  width: 64px;
  height: 48px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  padding: 0;
  background: #fff;
  overflow: hidden;
  cursor: pointer;
}

@media (min-width: 1024px) {
  .p-thumb {
    width: 72px;
    height: 54px;
  }
}

.p-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.p-thumb.is-active {
  border-color: rgba(0, 50, 126, 0.6);
  outline: 3px solid rgba(0, 50, 126, 0.2);
}

.p-thumb:focus-visible {
  outline: 3px solid rgba(0, 50, 126, 0.35);
  outline-offset: 2px;
}

.p-h1 {
  margin: 0 0 10px;
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 900;
  line-height: 1.2;
  color: var(--ptext);
}

.p-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  color: var(--pmuted);
  font-size: 14px;
}

.p-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.p-btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  border-radius: 12px;
  padding: 10px 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  line-height: 1.2;
}

.p-btn--primary {
  background: var(--pblue);
  color: #fff;
}

.p-btn--primary:hover {
  background: var(--pblue2);
}

.p-btn--ghost {
  background: rgba(0, 50, 126, 0.08);
  color: var(--pblue);
}

.p-btn--ghost:hover {
  background: rgba(0, 50, 126, 0.12);
}

/* 兼容旧结构（如缓存仍命中旧模板） */
.p-content { display: none; }
.p-detail { display: none; }

.p-siblings {
  margin-top: clamp(16px, 2.4vw, 28px);
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 768px) {
  .p-siblings {
    grid-template-columns: 1fr 1fr;
  }
}

.p-sibling {
  padding: 14px 16px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.p-sibling__k {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--pmuted);
  letter-spacing: 0.08em;
}

.p-sibling__t {
  font-size: 15px;
  font-weight: 800;
  color: var(--ptext);
  line-height: 1.25;
}

.p-sibling:hover .p-sibling__t {
  color: var(--pblue);
}

