/* =====================================================================
   硬件产品 3D 列表 + 点击图片弹窗加载 3D
   CHG-PCB3D-LIST-001  2026-11-06
   页面: products/index.html
   说明: 只新增类名, 不改动 pcb3d.css / main.css 的既有规则,
         避免影响首页与 YX-YP 3D 页的既有样式。
   ===================================================================== */

/* ---------------- 列表页头 ---------------- */
.plist-hero {
  padding: var(--space-8) 0 var(--space-7);
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(900px 420px at 50% 0%, rgba(0, 180, 255, 0.10), transparent 68%),
    linear-gradient(180deg, rgba(9, 11, 17, 0.20), transparent);
}
.plist-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.plist-eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--accent);
}
.plist-title {
  font-size: clamp(28px, 4.2vw, 46px);
  line-height: 1.22;
  color: var(--text-1);
  font-weight: 800;
  margin: 0 0 16px;
}
.plist-title span { color: var(--accent); }
.plist-sub {
  color: var(--text-2);
  font-size: 15.5px;
  line-height: 1.9;
  max-width: 820px;
  margin: 0;
}
.plist-sub b { color: var(--text-1); font-weight: 600; }

/* ---------------- 产品卡片网格 ---------------- */
.plist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: var(--space-5);
}
.p3d-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.p3d-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* 图片区: 点击即弹窗加载 3D */
.p3d-card-shot {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: #0B0D12;
  cursor: zoom-in;
  overflow: hidden;
}
.p3d-card-shot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.35s ease;
}
.p3d-card:hover .p3d-card-shot img { transform: scale(1.03); }
.p3d-card-shot:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.p3d-shot-tag {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--text-1);
  background: rgba(10, 12, 18, 0.72);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(4px);
}
.p3d-shot-cta {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  color: #06121A;
  background: var(--grad-accent);
  box-shadow: 0 6px 18px rgba(0, 180, 255, 0.28);
}
.p3d-card-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.p3d-card-body h3 {
  margin: 0;
  font-size: 18px;
  color: var(--text-1);
  font-weight: 700;
  line-height: 1.4;
}
.p3d-card-model {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent);
  letter-spacing: 0.04em;
}
.p3d-card-desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--text-2);
}
.p3d-card-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.p3d-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 6px;
}
.p3d-card-actions .btn { font-size: 13.5px; padding: 9px 16px; }

/* ---------------- 3D 弹窗 ---------------- */
.p3d-modal {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: none;
}
.p3d-modal.open { display: block; }
.p3d-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 10, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.p3d-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(1160px, 94vw);
  max-height: 92vh;
  margin: 4vh auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.p3d-modal-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px 14px 22px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
.p3d-modal-title {
  margin: 0;
  font-size: 19px;
  line-height: 1.4;
  color: var(--text-1);
  font-weight: 700;
}
.p3d-modal-model {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent);
  margin-top: 4px;
  letter-spacing: 0.04em;
}
.p3d-modal-close {
  margin-left: auto;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-2);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.p3d-modal-close:hover { border-color: var(--border-accent); color: var(--text-1); }
.p3d-modal-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.p3d-modal-stage {
  position: relative;
  padding: 18px;
  min-width: 0;
}
.p3d-stage { border-radius: 14px; }
.p3d-stage model-viewer { height: min(60vh, 540px); }
/* 进度条藏掉: 载入时顶部那条亮蓝线会被当成页面元素(而且 model-viewer 的
   progress bar 是 100% 宽度, 看上去像一条分割线)。载入提示已有文字承担。 */
.p3d-stage model-viewer { --progress-bar-color: transparent; }
.p3d-stage .pcb3d-loading { font-size: 13px; }
.p3d-modal-loading {
  position: absolute;
  inset: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  font-size: 13px;
  color: var(--text-3);
  pointer-events: none;
  transition: opacity 0.35s ease;
  border-radius: 14px;
}
.p3d-modal-loading.hide { opacity: 0; visibility: hidden; }
.p3d-modal-loading.err { color: var(--warn); }
.p3d-modal-info {
  border-left: 1px solid var(--border);
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.p3d-info-desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--text-2);
}
.p3d-info-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.p3d-info-fact {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--bg-card);
}
.p3d-info-fact b {
  display: block;
  font-size: 15px;
  color: var(--text-1);
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
}
.p3d-info-fact span {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--text-3);
}
.p3d-info-actions { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.p3d-info-actions .btn { width: 100%; text-align: center; }
.p3d-info-note {
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--text-4);
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

/* 弹窗内 3D 操作条 */
.p3d-modal-stage .pcb3d-bar { border-radius: 0 0 14px 14px; }
.p3d-modal-stage .pcb3d-hint { margin-left: auto; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 960px) {
  .p3d-modal-dialog {
    width: 96vw;
    margin: 2vh auto;
    max-height: 96vh;
  }
  .p3d-modal-body { grid-template-columns: minmax(0, 1fr); }
  .p3d-modal-info {
    border-left: 0;
    border-top: 1px solid var(--border);
    padding: 16px 18px 18px;
  }
  .p3d-stage model-viewer { height: min(46vh, 380px); }
  .p3d-modal-loading { inset: 18px; }
}
@media (max-width: 560px) {
  .plist-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
  .p3d-info-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .p3d-modal-stage { padding: 12px; }
  .p3d-modal-loading { inset: 12px; }
  .p3d-modal-stage .pcb3d-bar { padding: 10px; gap: 8px; }
  .p3d-modal-stage .pcb3d-hint { display: none; }
  .p3d-card-actions .btn { flex: 1 1 auto; text-align: center; }
}

/* 打开弹窗时锁住页面滚动 */
body.p3d-locked { overflow: hidden; }
