/* 生产流程九宫格：蛇形排序 + 流程连线 + 右侧大图（独立模块） */

#process.process-grid-module {
  scroll-margin-top: 5rem;
  min-height: 100vh;
  min-height: 100dvh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

#process.process-grid-module > .container {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.process-grid-module__layout {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 1170px;
  margin: 0 auto;
  min-height: 0;
}

.process-grid-module__layout-body {
  display: grid;
  gap: 1.5rem;
  width: 100%;
}

@media (width >= 1024px) {
  .process-grid-module__layout-body {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
    transform-origin: top center;
  }
}

/* ---- 蛇形九宫格 ---- */
.process-grid-module__grid-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
}

@media (width >= 1024px) {
  .process-grid-module__grid-wrap {
    align-self: start;
  }
}

.process-grid-module__flow {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.process-grid-module__flow-line {
  stroke: #cbd5e1;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dark .process-grid-module__flow-line {
  stroke: rgba(255, 255, 255, 0.18);
}

.process-grid-module__flow-node circle {
  fill: var(--brand-red, #c30319);
}

.process-grid-module__flow-node path {
  fill: none;
  stroke: #fff;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.process-grid-module__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

@media (width >= 640px) {
  .process-grid-module__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem 2.5rem;
  }

  .process-grid-module__item:nth-child(1) { grid-row: 1; grid-column: 1; }
  .process-grid-module__item:nth-child(2) { grid-row: 1; grid-column: 2; }
  .process-grid-module__item:nth-child(3) { grid-row: 1; grid-column: 3; }
  .process-grid-module__item:nth-child(4) { grid-row: 2; grid-column: 3; }
  .process-grid-module__item:nth-child(5) { grid-row: 2; grid-column: 2; }
  .process-grid-module__item:nth-child(6) { grid-row: 2; grid-column: 1; }
  .process-grid-module__item:nth-child(7) { grid-row: 3; grid-column: 1; }
  .process-grid-module__item:nth-child(8) { grid-row: 3; grid-column: 2; }
  .process-grid-module__item:nth-child(9) { grid-row: 3; grid-column: 3; }
}

@media (width >= 1024px) {
  .process-grid-module__grid {
    gap: 2.375rem 3rem;
  }
}

.process-grid-module__item {
  min-width: 0;
  align-self: start;
}

.process-grid-module__card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 0.625rem;
  border: 1px solid rgb(195 3 25 / 0.12);
  background: #fff;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  cursor: pointer;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

.process-grid-module__card:hover,
.process-grid-module__card:focus-visible {
  outline: none;
  border-color: rgba(48, 86, 211, 0.28);
  box-shadow: 0 8px 24px rgba(48, 86, 211, 0.1);
}

.process-grid-module__item.is-active .process-grid-module__card {
  border-color: #e11d48;
  box-shadow:
    0 0 0 2px rgb(195 3 25 / 0.2),
    0 10px 28px rgba(225, 29, 72, 0.14);
  transform: translateY(-2px);
}

.dark .process-grid-module__card {
  background: #1f2937;
  border-color: rgba(255, 255, 255, 0.08);
}

.process-grid-module__num {
  position: absolute;
  top: 0.45rem;
  left: 0.45rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0 0.3rem;
  border-radius: 0.3rem;
  background: #e11d48;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.3);
  pointer-events: none;
}

/* 图片区：仅本区域 1:1 正方形，下方标题单独占位 */
.process-grid-module__media {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f3f4f6;
}

.dark .process-grid-module__media {
  background: #111827;
}

.process-grid-module__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.process-grid-module__item.is-active .process-grid-module__media img,
.process-grid-module__card:hover .process-grid-module__media img {
  transform: scale(1.04);
}

.process-grid-module__title {
  flex-shrink: 0;
  margin: 0;
  padding: 0.55rem 0.4rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.35;
  color: #111928;
  background: #fff;
  border-top: 1px solid rgba(48, 86, 211, 0.08);
}

@media (width >= 640px) {
  .process-grid-module__title {
    padding: 0.6rem 0.45rem;
    font-size: 0.8125rem;
  }
}

.dark .process-grid-module__title {
  color: #fff;
  background: #1f2937;
  border-top-color: rgba(255, 255, 255, 0.08);
}

/* ---- 右侧大图：图片区 1:1 正方形，说明在下方 ---- */
.process-grid-module__aside {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-width: 0;
}

@media (width >= 1024px) {
  .process-grid-module__aside {
    align-self: start;
    box-sizing: border-box;
  }

  .process-grid-module__hero-wrap {
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .process-grid-module__hero {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
  }
}

.process-grid-module__hero-wrap {
  width: 100%;
}

.process-grid-module__hero {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
  overflow: hidden;
  border-radius: 0.75rem;
  border: 1px solid rgba(48, 86, 211, 0.12);
  background: #fff;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.08);
}

.dark .process-grid-module__hero {
  background: #1f2937;
  border-color: rgba(255, 255, 255, 0.08);
}

/* 大图区域：仅本区域 1:1 正方形，说明文字在下方单独占位 */
.process-grid-module__hero-media {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #fdf2f3;
}

.dark .process-grid-module__hero-media {
  background: #111827;
}

.process-grid-module__hero-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.process-grid-module__hero.is-swapping .process-grid-module__hero-media img {
  opacity: 0.88;
}

.process-grid-module__hero-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.5rem;
  border-radius: 0.5rem;
  background: rgba(225, 29, 72, 0.92);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 8px 24px rgba(225, 29, 72, 0.35);
}

.process-grid-module__hero figcaption {
  flex-shrink: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  color: #111928;
  background: #fff;
  border-top: 1px solid rgba(48, 86, 211, 0.1);
}

.dark .process-grid-module__hero figcaption {
  color: #fff;
  background: #1f2937;
  border-top-color: rgba(255, 255, 255, 0.08);
}

@media (width <= 639px) {
  .process-grid-module__item:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    max-width: 50%;
    margin: 0 auto;
  }

  .process-grid-module__aside {
    max-width: 480px;
    margin: 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .process-grid-module__card,
  .process-grid-module__media img,
  .process-grid-module__hero-media img {
    transition: none !important;
    transform: none !important;
  }
}
