/* ============================================================
   昱麟 YULIN · 首页主视觉（ECG 照片重建模型）
   沿用 site.css 白蓝 Medibazar 设计令牌（--blue / --blue-dark / --blue-bg）。
   仅消费 index.html 提供的 DOM 合同；product-experience.js 只追加 canvas
   并维护 #product-scene 的 data-renderer-state / .is-ready / .is-interactive。
   ============================================================ */

/* ---------- 主视觉区 ---------- */
.experience { position: relative; }
.experience-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr);
  gap: 32px;
  align-items: center;
  padding: 44px 0 22px;
}
.experience-copy { min-width: 0; }
.experience-copy .hero-title { margin-top: 12px; }

/* 左侧真实 ECG 指标条（带 YL-ECG-01 归属标识，避免被理解为四类设备通用指标） */
.hero-metrics-label {
  margin-top: 26px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue-dark);
}
.hero-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 36px;
  margin-top: 0;
}
.hero-metrics div { display: flex; flex-direction: column; }
.hero-metrics dt { font-size: 12px; color: var(--muted); }
.hero-metrics dd { color: var(--blue-dark); font-size: 30px; font-weight: 650; line-height: 1.35; }
.hero-metrics small { font-size: 14px; font-weight: 500; }

/* ---------- 右侧模型卡（ECG 照片重建主视觉） ---------- */
.experience-visual {
  min-width: 0;
  background: #fff;
  border: 1px solid #dce8f8;
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 14px 14px 12px;
}
.scene-caption {
  min-height: 24px;
  text-align: center;
  color: var(--blue-dark);
  font-size: 14px;
  font-weight: 600;
  padding-bottom: 8px;
}
.product-scene {
  position: relative;
  width: 100%;
  height: clamp(320px, min(30vw, calc(100dvh - 360px)), 500px);
  overflow: hidden;
  border-radius: 12px;
  background: var(--blue-bg);
  touch-action: pan-y;
  isolation: isolate;
}
.product-scene canvas { display: block; width: 100%; height: 100%; }
/* poster 常显；仅在 JS 真实首帧渲染后（is-ready）隐藏，避免闪烁与假模型回退 */
.product-scene:not(.is-ready) canvas { visibility: hidden; }
.product-scene.is-ready #scene-poster { visibility: hidden; }
.product-scene.is-interactive { cursor: grab; }
.product-scene.is-interactive:active { cursor: grabbing; }
.product-scene:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
#scene-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
}

/* 统一合同控件（位于 #product-scene 宿主之外） */
.scene-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 10px;
}
.scene-controls button {
  min-height: 44px;
  min-width: 44px;
  border: 1px solid #d4e2f4;
  border-radius: 8px;
  padding: 8px 14px;
  background: #fff;
  color: var(--blue-dark);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.scene-controls button:not(:disabled):hover { background: #e7f0fe; }
.scene-controls button[aria-pressed="true"] {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  color: #fff;
}
.scene-controls button:disabled { opacity: .45; cursor: default; }
.scene-controls button:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.scene-controls [hidden] { display: none; }
.scene-status {
  min-height: 20px;
  margin-top: 8px;
  font-size: 12px;
  text-align: center;
  color: var(--muted);
}
.scene-note { margin-top: 2px; font-size: 11px; text-align: center; color: var(--muted); }
.experience-noscript { padding-block: 20px; color: var(--muted); }

/* ---------- 紧凑 ECG 实验流程承接 ---------- */
.ecg-flow { padding: 4px 0 2px; }
.ecg-flow-inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  background: #fff;
  border: 1px solid #dce8f8;
  border-radius: 16px;
  padding: 18px 20px;
}
.ecg-step { display: flex; gap: 12px; align-items: flex-start; }
.ecg-step b {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.ecg-step strong { display: block; font-size: 15px; font-weight: 700; }
.ecg-step span { display: block; font-size: 13px; color: var(--muted); line-height: 1.6; margin-top: 2px; }
.ecg-flow-note { margin: 12px 4px 0; font-size: 12px; color: #888; }

/* ---------- 响应式 ---------- */
/* 1280px（.page 左右各 216px）下两列约 400px，仍舒适；再窄则堆叠单列，避免挤压。 */
@media (max-width: 1240px) {
  .experience-layout { grid-template-columns: 1fr; gap: 22px; padding-top: 34px; }
  .experience-copy { max-width: 720px; }
  .product-scene { height: clamp(300px, 36dvh, 420px); }
}

@media (max-width: 768px) {
  .experience-layout { padding-top: 26px; }
  .experience-copy .hero-eyebrow { font-size: 12px; }
  .hero-metrics-label { margin-top: 22px; margin-bottom: 8px; }
  .hero-metrics { gap: 16px 28px; margin-top: 0; }
  .hero-metrics dd { font-size: 26px; }
  .experience-visual { padding: 10px 10px 8px; border-radius: 14px; }
  .scene-caption { font-size: 12px; padding-bottom: 6px; min-height: 20px; }
  .product-scene { height: clamp(220px, 30dvh, 320px); border-radius: 10px; }
  .scene-controls { margin-top: 8px; }
  .scene-controls button { min-height: 42px; padding-inline: 12px; font-size: 12px; }
  .scene-status { margin-top: 6px; font-size: 11px; line-height: 1.6; }
  .scene-note { font-size: 10px; line-height: 1.5; }
  .ecg-flow-inner { grid-template-columns: 1fr; gap: 14px; padding: 14px 16px; }
  .ecg-flow-note { margin-top: 10px; font-size: 11px; }
}

/* 低矮视口：模型卡高度取固定下限，保证控件与状态不被挤出。 */
@media (max-width: 1100px) and (max-height: 700px) {
  .product-scene { height: 240px; }
}

@media (prefers-reduced-motion: reduce) {
  .scene-controls button { transition: none; }
}
