/* 5～8 步驟共用版型：桌機雙列折返，手機單列向下 */
.framework-section .framework--extended {
  display: grid;
  align-items: stretch;
  justify-content: stretch;
  gap: 26px 30px;
  margin: 0;
  padding: 18px;
  list-style: none;
}

.framework-section .framework--steps-5,
.framework-section .framework--steps-6 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.framework-section .framework--steps-7,
.framework-section .framework--steps-8 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.framework--extended .framework__step {
  position: relative;
  min-width: 0;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  color: #17315d;
}

.framework--extended span.framework__number,
.framework--extended span.framework__label {
  width: auto;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: center;
  box-shadow: none;
}

.framework--extended span.framework__number {
  display: none;
}

.framework--extended span.framework__label {
  width: min(100%, 180px);
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, .78);
  border-radius: 999px;
  background: #f5f6ff;
  box-shadow: 0 5px 14px rgba(9, 19, 53, .18);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.45;
}

.framework--extended .framework__step:nth-child(3n + 2) .framework__label { background: #e0f4f1; }
.framework--extended .framework__step:nth-child(3n) .framework__label { background: #f7e9f8; }

.framework--steps-7 .framework__label,
.framework--steps-8 .framework__label { width: min(100%, 150px); }

.framework--extended .framework__step::after {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  color: #ded9fa;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.framework--steps-5 .framework__step:nth-child(1),
.framework--steps-6 .framework__step:nth-child(1) { grid-column: 1; grid-row: 1; }
.framework--steps-5 .framework__step:nth-child(2),
.framework--steps-6 .framework__step:nth-child(2) { grid-column: 2; grid-row: 1; }
.framework--steps-5 .framework__step:nth-child(3),
.framework--steps-6 .framework__step:nth-child(3) { grid-column: 3; grid-row: 1; }
.framework--steps-5 .framework__step:nth-child(4),
.framework--steps-6 .framework__step:nth-child(4) { grid-column: 3; grid-row: 2; }
.framework--steps-5 .framework__step:nth-child(5),
.framework--steps-6 .framework__step:nth-child(5) { grid-column: 2; grid-row: 2; }
.framework--steps-6 .framework__step:nth-child(6) { grid-column: 1; grid-row: 2; }

.framework--steps-7 .framework__step:nth-child(1),
.framework--steps-8 .framework__step:nth-child(1) { grid-column: 1; grid-row: 1; }
.framework--steps-7 .framework__step:nth-child(2),
.framework--steps-8 .framework__step:nth-child(2) { grid-column: 2; grid-row: 1; }
.framework--steps-7 .framework__step:nth-child(3),
.framework--steps-8 .framework__step:nth-child(3) { grid-column: 3; grid-row: 1; }
.framework--steps-7 .framework__step:nth-child(4),
.framework--steps-8 .framework__step:nth-child(4) { grid-column: 4; grid-row: 1; }
.framework--steps-7 .framework__step:nth-child(5),
.framework--steps-8 .framework__step:nth-child(5) { grid-column: 4; grid-row: 2; }
.framework--steps-7 .framework__step:nth-child(6),
.framework--steps-8 .framework__step:nth-child(6) { grid-column: 3; grid-row: 2; }
.framework--steps-7 .framework__step:nth-child(7),
.framework--steps-8 .framework__step:nth-child(7) { grid-column: 2; grid-row: 2; }
.framework--steps-8 .framework__step:nth-child(8) { grid-column: 1; grid-row: 2; }

.framework--steps-5 .framework__step:nth-child(1)::after,
.framework--steps-5 .framework__step:nth-child(2)::after,
.framework--steps-6 .framework__step:nth-child(1)::after,
.framework--steps-6 .framework__step:nth-child(2)::after,
.framework--steps-7 .framework__step:nth-child(-n + 3)::after,
.framework--steps-8 .framework__step:nth-child(-n + 3)::after {
  content: "→";
  top: 50%;
  right: -24px;
  transform: translateY(-50%);
}

.framework--steps-5 .framework__step:nth-child(3)::after,
.framework--steps-6 .framework__step:nth-child(3)::after,
.framework--steps-7 .framework__step:nth-child(4)::after,
.framework--steps-8 .framework__step:nth-child(4)::after {
  content: "↓";
  bottom: -23px;
  left: 50%;
  transform: translateX(-50%);
}

.framework--steps-5 .framework__step:nth-child(4)::after,
.framework--steps-6 .framework__step:nth-child(4)::after,
.framework--steps-6 .framework__step:nth-child(5)::after,
.framework--steps-7 .framework__step:nth-child(5)::after,
.framework--steps-7 .framework__step:nth-child(6)::after,
.framework--steps-8 .framework__step:nth-child(5)::after,
.framework--steps-8 .framework__step:nth-child(6)::after,
.framework--steps-8 .framework__step:nth-child(7)::after {
  content: "←";
  top: 50%;
  left: -24px;
  transform: translateY(-50%);
}

@media (max-width: 760px) {
  .framework-section .framework--extended {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 14px;
  }

  .framework--extended .framework__step {
    grid-column: 1 !important;
    grid-row: auto !important;
    width: 100%;
    min-height: 46px;
    justify-self: center;
  }

  .framework--extended span.framework__label { width: min(100%, 260px); }

  .framework--extended .framework__step:not(:last-child)::after {
    content: "↓";
    top: auto;
    right: auto;
    bottom: -23px;
    left: 50%;
    transform: translateX(-50%);
  }

  .framework--extended .framework__step:last-child::after { content: none; }
}
