/* V18 手機主視覺修正：僅處理 AI 陪跑、企業培訓與 ISO 首頁指定區塊。 */

.training-garden-page .v2-button--mobile {
  display: none;
}

@media (max-width: 620px) {
  /* AI 陪跑：取消會把透明人物圖推到畫面外的縮放與位移，完整保留人物。 */
  .hero-entry-ai .hero.hero-runner-banner .ai-hero-visual {
    animation: none;
    transform: none;
  }

  .hero-entry-ai .hero.hero-runner-banner .ai-hero-runner {
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: 72% center;
    transform: none;
  }

  /* 企業培訓：把三張流程卡改成低矮橫列，留下主視覺的觀看空間。 */
  .training-garden-page .v2-hero {
    height: 900px;
    min-height: 900px;
  }

  .training-garden-page .v2-hero-grid {
    height: 828px;
    min-height: 828px;
  }

  .training-garden-page .v2-hero-copy {
    padding-top: 68px;
  }

  .training-garden-page .v2-hero-copy .v2-button {
    display: none;
  }

  .training-garden-page .v2-button--mobile {
    position: absolute;
    z-index: 7;
    right: 0;
    bottom: 140px;
    left: 0;
    display: inline-flex;
    width: 100%;
    margin: 0;
    border: 1px solid rgba(255,255,255,.35);
    background: linear-gradient(105deg,#68429c,#4a73d5);
    color: #fff;
    box-shadow: 0 10px 26px rgba(43,42,112,.22);
  }

  .training-garden-page .garden-dream.b1 {
    top: 45%;
  }

  .training-garden-page .garden-dream.b2 {
    top: 44%;
  }

  .training-garden-page .garden-dream.b3 {
    top: 58%;
  }

  .training-garden-page .garden-dream.b4 {
    top: 60%;
  }

  .training-garden-page .v2-hero-route {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 62px;
  }

  .training-garden-page .v2-hero-route li,
  .training-garden-page .v2-hero-route li:nth-child(1),
  .training-garden-page .v2-hero-route li:nth-child(2),
  .training-garden-page .v2-hero-route li:nth-child(3) {
    min-height: 66px;
    grid-template-columns: 1fr;
    align-content: center;
    gap: 2px;
    padding: 7px 5px;
    text-align: center;
  }

  .training-garden-page .v2-hero-route span {
    font-size: 21px;
  }

  .training-garden-page .v2-hero-route strong {
    font-size: 11px;
    line-height: 1.3;
  }

  .training-garden-page .v2-hero-route small {
    display: none;
  }

  .training-garden-page .garden-motion-toggle {
    right: 12px;
    bottom: 12px;
  }

  /* ISO 數據：明確鎖定寬高相同，避免任何圓形被格線拉成橢圓。 */
  .hero-entry-iso .stats-grid .stat:nth-child(1),
  .hero-entry-iso .stats-grid .stat:nth-child(2) {
    width: 132px;
    height: 132px;
    min-width: 132px;
    min-height: 132px;
    aspect-ratio: 1 / 1;
    align-self: center;
  }

  .hero-entry-iso .stats-grid .stat:nth-child(3) {
    width: 160px;
    height: 160px;
    min-width: 160px;
    min-height: 160px;
    aspect-ratio: 1 / 1;
    align-self: center;
  }

  /* ISO 流程：每一段線只連接相鄰圓心，最後一顆後方不再延伸。 */
  .hero-entry-iso .process-steps::before {
    display: none;
  }

  .hero-entry-iso .process-step:not(:nth-child(8))::after {
    content: "";
    position: absolute;
    z-index: 0;
    left: calc(var(--process-node-size) / 2 - 1px);
    top: calc(var(--process-node-size) / 2);
    bottom: calc(-1 * var(--process-node-size) / 2);
    width: 2px;
    background: rgba(73, 118, 123, .72);
    pointer-events: none;
  }
}

/* 部分手機瀏覽器會以較寬的版面寬度顯示；以下規則涵蓋到 900px。 */
@media (max-width: 900px) {
  .training-garden-page .v2-hero {
    height: 820px;
    min-height: 820px;
  }

  .training-garden-page .v2-hero-grid {
    height: 748px;
    min-height: 748px;
  }

  .training-garden-page .v2-hero-copy {
    padding-top: 74px;
  }

  .training-garden-page .garden-dream.b1 {
    top: 62%;
  }

  .training-garden-page .v2-hero-route {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 64px;
  }

  .training-garden-page .v2-hero-route li,
  .training-garden-page .v2-hero-route li:nth-child(1),
  .training-garden-page .v2-hero-route li:nth-child(2),
  .training-garden-page .v2-hero-route li:nth-child(3) {
    min-height: 68px;
    grid-template-columns: 38px minmax(0, 1fr);
    align-content: center;
    gap: 8px;
    padding: 8px 10px;
    text-align: left;
  }

  .training-garden-page .v2-hero-route span {
    font-size: 24px;
  }

  .training-garden-page .v2-hero-route strong {
    font-size: 12px;
    line-height: 1.35;
  }

  .training-garden-page .v2-hero-route small {
    display: none;
  }

  .training-garden-page .v2-scroll {
    display: none;
  }

  .training-garden-page .garden-motion-toggle {
    right: 14px;
    bottom: 14px;
  }

  /* ISO：手機與直向平板統一改為兩欄內容，避免標題被擠成直排。 */
  .hero-entry-iso .process-layout {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .hero-entry-iso .process-guide {
    position: static;
    top: auto;
  }

  .hero-entry-iso .process-steps {
    grid-template-columns: 1fr;
    gap: 0;
    padding-left: 28px;
  }

  .hero-entry-iso .process-steps::before {
    display: none;
  }

  .hero-entry-iso .process-step,
  .hero-entry-iso .process-step.in {
    position: relative;
    display: grid;
    grid-template-columns: var(--process-node-size) minmax(0, 1fr);
    column-gap: 22px;
    min-height: 132px;
    padding: 0 0 24px;
    text-align: left;
  }

  .hero-entry-iso .process-step::before {
    position: relative;
    left: auto;
    top: auto;
    grid-column: 1;
    grid-row: 1 / 3;
    margin: 0;
  }

  .hero-entry-iso .process-step h3,
  .hero-entry-iso .process-step p {
    grid-column: 2;
    min-width: 0;
  }

  .hero-entry-iso .process-step h3 {
    align-self: end;
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.55;
  }

  .hero-entry-iso .process-step p {
    align-self: start;
    margin: 6px 0 0;
    font-size: .9rem;
    line-height: 1.65;
  }

  .hero-entry-iso .process-step:not(:nth-child(8))::after {
    content: "";
    position: absolute;
    z-index: 0;
    left: calc(var(--process-node-size) / 2 - 1px);
    top: calc(var(--process-node-size) / 2);
    bottom: calc(-1 * var(--process-node-size) / 2);
    width: 2px;
    background: rgba(73, 118, 123, .72);
    pointer-events: none;
  }

  .hero-entry-iso .process-step:nth-child(8)::after {
    content: none;
  }
}

@media (max-width: 620px) {
  /* 企業培訓：最終手機排列為文字、照片泡泡、行動按鈕、三張重點卡片。 */
  .training-garden-page .v2-hero {
    height: 900px;
    min-height: 900px;
  }

  .training-garden-page .v2-hero-grid {
    height: 828px;
    min-height: 828px;
  }

  .training-garden-page .garden-dream.b1 { top: 45%; }
  .training-garden-page .garden-dream.b2 { top: 44%; }
  .training-garden-page .garden-dream.b3 { top: 58%; }
  .training-garden-page .garden-dream.b4 { top: 60%; }

  .training-garden-page .v2-hero-route li,
  .training-garden-page .v2-hero-route li:nth-child(1),
  .training-garden-page .v2-hero-route li:nth-child(2),
  .training-garden-page .v2-hero-route li:nth-child(3) {
    grid-template-columns: 1fr;
    text-align: center;
  }
}
