/* Storytelling — 全链路能力叙事时间线 */

.story-chain {
  --story-primary: #3b82f6;
  --story-secondary: #8b5cf6;
  --story-surface: #fafaf8;
  --story-text: #111827;
  --story-muted: #6b7280;
  --story-border: rgba(17, 24, 39, 0.08);

  position: relative;
  padding: 5rem 0 4rem;
  background: var(--story-surface);
  color: var(--story-text);
  font-family: Inter, var(--font-sans-cn);
  overflow: hidden;
}

.story-chain-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.story-chain-dots {
  position: absolute;
  inset: 0;
  opacity: 0.45;
  background-image: radial-gradient(circle, rgba(59, 130, 246, 0.18) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 92%);
}

.story-chain-glow {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
}

.story-chain-glow--left {
  top: 8%;
  left: -8%;
  background: rgba(59, 130, 246, 0.35);
}

.story-chain-glow--right {
  bottom: 5%;
  right: -6%;
  background: rgba(139, 92, 246, 0.28);
}

.story-chain-inner {
  position: relative;
  z-index: 1;
}

.story-chain-intro {
  max-width: 720px;
  margin: 0 auto 4rem;
  text-align: center;
}

.story-chain-eyebrow {
  margin-bottom: 1rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.7rem;
}

.story-chain-title {
  font-family: "Abril Fatface", Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--story-text);
  letter-spacing: -0.02em;
}

.story-chain-lead {
  margin-top: 1rem;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--story-muted);
}

.story-timeline {
  position: relative;
}

.story-timeline-rail {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: var(--story-border);
  border-radius: 999px;
}

.story-timeline-progress {
  display: block;
  width: 100%;
  height: 0%;
  background: linear-gradient(180deg, var(--story-primary), var(--story-secondary));
  border-radius: inherit;
  transition: height 0.15s ease-out;
}

.story-chapters {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.story-chapter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: center;
}

.story-chapter--reverse .story-chapter-visual {
  order: 2;
}

.story-chapter--reverse .story-chapter-copy {
  order: 1;
}

.story-chapter-media {
  position: relative;
  margin: 0;
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  border: 1px solid var(--story-border);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 16px 40px rgba(59, 130, 246, 0.08);
  background: #fff;
}

.story-chapter-media img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

.story-chapter.is-active .story-chapter-media img,
.story-chapter:hover .story-chapter-media img {
  transform: scale(1.03);
}

.story-chapter-badge {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.story-chapter-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--story-border);
  font-family: var(--font-label-en);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--story-primary);
}

.story-chapter-card {
  transition:
    transform 0.45s cubic-bezier(0.19, 1, 0.22, 1),
    box-shadow 0.45s ease,
    border-color 0.45s ease;
}

.story-chapter.is-active .story-chapter-card,
.story-chapter:hover .story-chapter-card {
  transform: translateY(-4px);
  border-color: rgba(59, 130, 246, 0.25);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 20px 48px rgba(59, 130, 246, 0.12);
}

.story-chapter-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.story-chapter-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
}

.story-chapter-narrative {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--story-muted);
}

.story-chapter-next {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
}

.lucide-icon-inline {
  margin-left: 0.1rem;
}

/* Magic UI blur-fade — 默认可见，JS 就绪后再启用入场动画 */
.story-blur-fade {
  opacity: 1;
  filter: none;
  transform: none;
}

.story-chain.is-animated .story-blur-fade {
  opacity: 0;
  filter: blur(8px);
  transform: translateY(20px);
  transition:
    opacity 0.75s cubic-bezier(0.19, 1, 0.22, 1),
    filter 0.75s cubic-bezier(0.19, 1, 0.22, 1),
    transform 0.75s cubic-bezier(0.19, 1, 0.22, 1);
}

.story-chain.is-animated .story-blur-fade.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

@media (max-width: 992px) {
  .story-timeline-rail {
    display: none;
  }

  .story-chapter,
  .story-chapter--reverse {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .story-chapter--reverse .story-chapter-visual,
  .story-chapter--reverse .story-chapter-copy {
    order: unset;
  }

  .story-chapters {
    gap: 3rem;
  }
}

@media (max-width: 640px) {
  .story-chain {
    padding: 3.5rem 0 3rem;
  }

  .story-chain-intro {
    margin-bottom: 2.5rem;
  }

  .story-chapter-meta {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .story-blur-fade,
  .story-chain.is-animated .story-blur-fade {
    opacity: 1;
    filter: none;
    transform: none;
    transition: none;
  }

  .story-chapter-media img,
  .story-chapter-card {
    transition: none;
  }

  .story-timeline-progress {
    transition: none;
  }
}
