/* Homepage heading fragments share the parent heading's black or white. */
.home-heading-accent, .home-heading-accent-light { color: inherit; }

/* 首页冷白首栏：配色限定在本区，避免影响全站公共组件。 */
.home-hero {
  --hero-surface: #f8fafc;
  --hero-border: #e2e8f0;
  --hero-accent: #0e7490;
  background: linear-gradient(110deg, #fff 0%, #f8fafc 52%, #f1f5f9 100%);
}

.home-hero .home-hero-chip {
  color: #475569;
  background: var(--hero-surface);
  border: 1px solid var(--hero-border);
}

.home-hero .home-hero-secondary {
  color: #243b53;
  background: #fff;
  border-color: var(--hero-border);
}

.home-hero .home-hero-secondary:hover {
  color: var(--hero-accent);
  background: var(--hero-surface);
  border-color: var(--hero-accent);
}

.home-hero-monitor {
  background: #fff;
  border: 1px solid var(--hero-border);
  box-shadow: 0 24px 60px -24px rgba(15, 23, 42, .18);
}

.home-hero-panel, .home-hero-metric {
  background: var(--hero-surface);
  border-color: var(--hero-border);
}

.home-hero-lanes > * + * { border-color: var(--hero-border); }
.home-hero :focus-visible { outline-color: var(--hero-accent); }
.home-hero ::selection { background: #cffafe; color: #0f172a; }

/* 极窄屏保留三个指标的并列关系，单位下移，防止三位数挤出卡片。 */
@media (max-width: 359px) {
  .home-hero-metric > .flex {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }
}

/* 减少动态效果时保留完整波形，避免动画停在离开画布的位置。 */
@media (prefers-reduced-motion: reduce) {
  .home-hero .ecg-path {
    animation: none;
    stroke-dasharray: none;
    stroke-dashoffset: 0;
  }
}

/* Section links sit beside desktop titles and follow the intro on small screens. */
.home-section-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px 32px;
}

.home-section-title { min-width: 0; }
.home-section-intro { max-width: 48rem; }
.home-section-more {
  justify-self: start;
  align-self: end;
  white-space: nowrap;
}

@media (min-width: 1024px) {
  .home-section-header { grid-template-columns: minmax(0, 1fr) auto; }
  .home-section-title { grid-area: 1 / 1; }
  .home-section-intro { grid-column: 1 / -1; }
  .home-section-more { grid-area: 1 / 2; }
}

/* 卡片高度由内容决定，统一收紧上下留白，避免移除图标后仍保留大块空白。 */
.home-product-card { padding: 24px; }

/* Homepage flagship: keep the supplied render complete and its colors intact. */
.home-pecg-card {
  display: grid;
  grid-template-areas: "media" "copy" "footer";
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  padding: 24px;
}

.home-pecg-media {
  grid-area: media;
  position: relative;
  align-self: center;
  justify-self: center;
  width: 100%;
  max-width: 360px;
  min-width: 0;
  overflow: hidden;
  border-radius: 16px;
}

.home-pecg-media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1316 / 645;
  object-fit: contain;
}

.home-pecg-copy {
  grid-area: copy;
  align-self: center;
  min-width: 0;
}

.home-pecg-footer {
  grid-area: footer;
  align-self: end;
}

@media (min-width: 640px) {
  .home-pecg-card, .home-product-card {
    padding-inline: 32px;
  }
}

@media (min-width: 1024px) {
  .home-pecg-card {
    grid-template-areas: "copy media" "footer footer";
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
    column-gap: 24px;
  }
  .home-pecg-media {
    max-width: 320px;
    justify-self: end;
  }
}

/* 带设备图的卡片在窄屏先图后文，宽屏左文右图，图片统一使用圆角方形展示区。 */
.home-product-card-content {
  display: grid;
  grid-template-areas: "media" "copy";
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  flex: 1;
}

.home-product-card-media {
  grid-area: media;
  align-self: center;
  justify-self: center;
  width: 100%;
  max-width: 208px;
  min-width: 0;
  overflow: hidden;
  border-radius: 16px;
}

.home-product-card-media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
}

.home-product-card-copy {
  grid-area: copy;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

@media (min-width: 640px) {
  .home-product-card-content {
    grid-template-areas: "copy media";
    grid-template-columns: minmax(0, 1fr) 180px;
  }
}

#home-product-stethoscope { scroll-margin-top: 7rem; }

.home-stethoscope-media img {
  /* 按胸件轮廓居中，补偿原图的透明留白和向下延伸的连接管。 */
  transform: translate(2.7%, 9%);
}

@media (min-width: 1024px) {
  .home-stethoscope-media img {
    /* 两张产品卡并排时略微上移听诊器，使设备主体更接近同一高度。 */
    transform: translate(2.7%, 1%);
  }
}
