/**
 * GEO Timeline — premium motion layer (additive only).
 * Scope: .geo-tl-section … 不覆盖未挂载时的基础样式。
 * 无鼠标联动：背景光斑为固定坐标；卡片无 scrub 视差，仅 scroll 入场 + 高亮 scrub。
 */

/* --- 禁用与 GSAP 冲突的 .reveal 过渡（本区块内由脚本驱动） --- */
.geo-tl-section .geo-tl-head.reveal,
.geo-tl-section .geo-process-timeline .geo-tl-step.reveal {
  opacity: 1;
  transform: none;
  transition: none;
}

/* ========== 七 · 背景氛围（极低透明度） ========== */
.geo-tl-section {
  position: relative;
  isolation: isolate;
}

.geo-tl-section::before {
  content: "";
  position: absolute;
  inset: -12% -8%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 42% at 18% 22%, rgba(59, 130, 246, 0.07), transparent 62%),
    radial-gradient(ellipse 48% 40% at 88% 68%, rgba(139, 92, 246, 0.06), transparent 58%),
    radial-gradient(ellipse 40% 35% at 50% 100%, rgba(56, 189, 248, 0.045), transparent 55%);
  opacity: 1;
}

.geo-tl-section::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 72% 60% at 50% 38%, black 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 72% 60% at 50% 38%, black 0%, transparent 78%);
}

.geo-tl-section .container,
.geo-tl-section .geo-tl-rail {
  position: relative;
  z-index: 1;
}

/* 轻粒子层（纯 CSS 漂移，避免 JS 粒子开销） */
.geo-tl-rail {
  position: relative;
}

.geo-tl-rail::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
  background-image: radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.09) 0, transparent 2px),
    radial-gradient(circle at 78% 55%, rgba(56, 189, 248, 0.07) 0, transparent 2px),
    radial-gradient(circle at 45% 80%, rgba(167, 139, 250, 0.06) 0, transparent 2px);
  background-size: 180% 180%;
  animation: geo-tl-bg-drift 48s ease-in-out infinite alternate;
}

@keyframes geo-tl-bg-drift {
  0% {
    background-position: 0% 0%, 100% 40%, 50% 100%;
  }
  100% {
    background-position: 100% 20%, 0% 80%, 60% 0%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .geo-tl-rail::before {
    animation: none;
  }
}

/* ========== 二 · 横线：渐变 + glow + 流动高光 ========== */
.geo-tl-section .geo-process-timeline__track {
  --geo-tl-line: 0;
  --geo-tl-activate: 0;
}

.geo-tl-section .geo-process-timeline__track::before {
  height: 3px;
  border-radius: 9999px;
  background: linear-gradient(
    90deg,
    rgba(191, 219, 254, 0.35) 0%,
    rgba(96, 165, 250, 0.95) 22%,
    rgba(129, 140, 248, 0.9) 55%,
    rgba(196, 181, 253, 0.55) 100%
  );
  box-shadow:
    0 0 12px rgba(59, 130, 246, 0.18),
    0 0 28px rgba(99, 102, 241, 0.1);
  transform: translateY(-50%) scaleX(var(--geo-tl-line));
  transform-origin: left center;
  opacity: calc(0.35 + 0.65 * var(--geo-tl-line));
  filter: saturate(1.05);
}

.geo-tl-section .geo-process-timeline__track::after {
  content: "";
  position: absolute;
  left: calc(100% / (2 * var(--geo-n)));
  width: calc(100% - 100% / var(--geo-n));
  top: 50%;
  transform: translateY(-50%);
  height: 14px;
  margin-top: -1px;
  border-radius: 9999px;
  z-index: 0;
  pointer-events: none;
  opacity: 0.42;
  background: linear-gradient(
    110deg,
    transparent 0%,
    rgba(255, 255, 255, 0) 38%,
    rgba(255, 255, 255, 0.55) 50%,
    rgba(255, 255, 255, 0) 62%,
    transparent 100%
  );
  background-size: 220% 100%;
  animation: geo-tl-line-sheen 7.5s ease-in-out infinite;
  mask-image: linear-gradient(90deg, black 0%, black calc(var(--geo-tl-line) * 100%), transparent calc(var(--geo-tl-line) * 100%));
  -webkit-mask-image: linear-gradient(90deg, black 0%, black calc(var(--geo-tl-line) * 100%), transparent calc(var(--geo-tl-line) * 100%));
}

@keyframes geo-tl-line-sheen {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

/* 入场结束后由 JS 添加 geo-tl-line-lit，保持克制光感；hover 节点时由 :has 再微增强 */
.geo-tl-section.geo-tl-line-lit .geo-process-timeline__track::before {
  box-shadow:
    0 0 16px rgba(59, 130, 246, 0.28),
    0 0 40px rgba(99, 102, 241, 0.16);
}

@media (hover: hover) and (pointer: fine) {
  .geo-tl-section.geo-tl-line-lit:has(.geo-process-timeline__node.geo-tl-node:hover) .geo-process-timeline__track::before {
    box-shadow:
      0 0 20px rgba(59, 130, 246, 0.34),
      0 0 48px rgba(99, 102, 241, 0.2);
  }
}

/* ========== 三 · 节点：磨砂玻璃 + 状态 ========== */
.geo-tl-section .geo-process-timeline__node.geo-tl-node {
  position: relative;
  isolation: isolate;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow:
    0 2px 8px rgba(15, 23, 42, 0.06),
    0 12px 32px -16px rgba(59, 130, 246, 0.12);
  color: rgb(37 99 235);
  transition:
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.45s ease,
    color 0.45s ease;
}

.geo-tl-section .geo-process-timeline__node.geo-tl-node::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  border: 1px solid rgba(59, 130, 246, 0);
  opacity: 0;
  transform: scale(0.92);
  pointer-events: none;
  transition:
    opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.45s ease;
}

.geo-tl-section .geo-tl-step.is-active .geo-process-timeline__node.geo-tl-node {
  transform: scale(1.06);
  color: rgb(29 78 216);
  border-color: rgba(147, 197, 253, 0.85);
  box-shadow:
    0 0 0 1px rgba(191, 219, 254, 0.55),
    0 8px 28px -6px rgba(59, 130, 246, 0.28),
    0 20px 48px -20px rgba(99, 102, 241, 0.18);
}

.geo-tl-section .geo-tl-step.is-active .geo-process-timeline__node.geo-tl-node::after {
  opacity: 1;
  transform: scale(1.18);
  border-color: rgba(96, 165, 250, 0.35);
  animation: geo-tl-node-pulse 2.4s ease-out infinite;
}

@keyframes geo-tl-node-pulse {
  0% {
    transform: scale(1);
    opacity: 0.55;
  }
  70% {
    transform: scale(1.35);
    opacity: 0;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

@media (hover: hover) and (pointer: fine) {
  .geo-tl-section .geo-process-timeline__node.geo-tl-node:hover {
    border-color: rgba(147, 197, 253, 0.95);
    box-shadow:
      0 0 0 1px rgba(191, 219, 254, 0.65),
      0 8px 28px -6px rgba(59, 130, 246, 0.28),
      0 16px 40px -12px rgba(99, 102, 241, 0.18);
    color: rgb(29 78 216);
  }

}

/* ========== 四 · 卡片 glass ========== */
.geo-tl-section .geo-process-timeline__body.geo-tl-card {
  position: relative;
  border-radius: 1rem;
  padding: 0.65rem 0.55rem;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.58) 0%, rgba(248, 250, 252, 0.42) 100%);
  backdrop-filter: blur(12px) saturate(1.15);
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.65) inset,
    0 10px 40px -28px rgba(15, 23, 42, 0.12);
  transition:
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.5s ease,
    opacity 0.55s ease;
}

.geo-tl-section .geo-process-timeline__body.geo-tl-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.35) 0%, transparent 42%, transparent 58%, rgba(147, 197, 253, 0.12) 100%);
  opacity: 0.55;
}

/* 不使用 transform，避免与 GSAP 卡片 scrub 视差（仅 y）冲突 */
.geo-tl-section .geo-tl-step.is-dim .geo-tl-card {
  opacity: 0.42;
  filter: saturate(0.82) brightness(0.97);
}

.geo-tl-section .geo-tl-step.is-active .geo-tl-card {
  opacity: 1;
  border-color: rgba(191, 219, 254, 0.75);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 14px 44px -22px rgba(59, 130, 246, 0.18);
}

@media (hover: hover) and (pointer: fine) {
  .geo-tl-section .geo-tl-step:not(.is-dim):hover .geo-tl-card {
    transform: translateY(-4px);
    border-color: rgba(191, 219, 254, 0.85);
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.75) inset,
      0 18px 48px -24px rgba(59, 130, 246, 0.22);
  }
}

.geo-tl-section .geo-process-timeline__title {
  position: relative;
  z-index: 1;
}

.geo-tl-section .geo-process-timeline__detail {
  position: relative;
  z-index: 1;
}

/* ========== 五 · 卡片 transform-origin（供激活态 scale 与 hover 上浮） ========== */
.geo-tl-section .geo-process-timeline__step--above .geo-tl-card {
  transform-origin: 50% 100%;
}

.geo-tl-section .geo-process-timeline__step--below .geo-tl-card {
  transform-origin: 50% 0%;
}

/* ========== 八 · 移动端纵向 ========== */
@media (max-width: 1023px) {
  .geo-tl-section .geo-process-timeline__track::before,
  .geo-tl-section .geo-process-timeline__track::after {
    display: none;
  }

  .geo-tl-section .geo-process-timeline__track {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
    align-items: stretch;
    padding-top: 0.5rem;
    padding-bottom: 0.75rem;
  }

  .geo-tl-section .geo-process-timeline__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    min-height: 0;
  }

  .geo-tl-section .geo-process-timeline__node.geo-tl-node {
    order: 1;
  }

  .geo-tl-section .geo-process-timeline__body.geo-tl-card {
    order: 2;
    width: 100%;
    max-width: 22rem;
    margin-left: auto;
    margin-right: auto;
    padding: 0.75rem 0.85rem;
  }

  .geo-tl-section .geo-process-timeline__step--above .geo-process-timeline__body,
  .geo-tl-section .geo-process-timeline__step--below .geo-process-timeline__body {
    grid-row: unset;
    padding-top: 0;
    padding-bottom: 0;
  }

  .geo-tl-section .geo-tl-step.is-dim .geo-tl-card {
    opacity: 0.55;
    transform: none;
    filter: none;
  }

  .geo-tl-section .geo-tl-step.is-active .geo-process-timeline__node.geo-tl-node {
    transform: scale(1.04);
  }

  .geo-tl-section .geo-tl-step.is-active .geo-process-timeline__node.geo-tl-node::after {
    animation-duration: 3.2s;
  }
}
