/* ===== About 页基础 ===== */
.about-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  padding: 7rem 0 5rem;
}

/* ===== 背景层 ===== */
.about-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.about-bg-loop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 20% 50%;
  transform: scale(1.05);
  filter: brightness(1.1) contrast(1.05) saturate(0.95);
  opacity: 0;
  transition: opacity 0.8s ease;
}

.about-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 20% 50%;
  transform: scale(1.05);
  filter: brightness(1.35) contrast(1.05) saturate(0.95);
  z-index: 1;
  transition: opacity 0.8s ease;
}

.about-bg-reverse {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 20% 50%;
  transform: scale(1.05);
  filter: brightness(1.1) contrast(1.05) saturate(0.95);
  z-index: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
}

/* 从 work 返回 about 时的专属过渡视频：默认隐藏，进入时点亮，播完淡出 */
.about-bg-alt {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 20% 50%;
  transform: scale(1.05);
  /* 亮度与循环背景视频（.about-bg-loop）保持一致，保证衔接处画面连续 */
  filter: brightness(1.1) contrast(1.05) saturate(0.95);
  z-index: 2;
  opacity: 0;
  transition: opacity 0.6s ease;
}

body.about-alt-active .about-bg-alt {
  opacity: 1;
}

/* 使用专属过渡视频时隐藏默认过渡视频与反向视频，避免残帧透出 */
body.about-alt-active .about-bg-video,
body.about-alt-active .about-bg-reverse {
  opacity: 0;
}

body.video-ended .about-bg-alt {
  opacity: 0;
}

/* 过渡视频播放完成后，淡出过渡视频并显示循环背景视频 */
body.video-ended .about-bg-video {
  opacity: 0;
}

body.video-ended .about-bg-loop {
  opacity: 1;
}

/* 返回首页：隐藏循环视频，显示反向过渡视频 */
body.is-going-back .about-bg-loop {
  opacity: 0;
}

body.is-going-back .about-bg-reverse {
  opacity: 1;
}

/* 横轴从右往左扫描消失 */
.about-bg-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 50%, transparent 0%, rgba(0, 0, 0, 0.4) 45%, rgba(0, 0, 0, 0.82) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.2) 55%, rgba(0, 0, 0, 0.75) 100%);
  z-index: 1;
}

.about-grid-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background-image:
    linear-gradient(to right, rgba(138, 231, 68, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(138, 231, 68, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(90deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.2) 60%, rgba(0,0,0,0) 100%);
  -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.2) 60%, rgba(0,0,0,0) 100%);
  animation: gridShift 8s linear infinite;
  pointer-events: none;
}

@keyframes gridShift {
  0% { background-position: 0 0; }
  100% { background-position: 48px 48px; }
}

/* ===== 顶部标签 ===== */
.about-label {
  position: fixed;
  top: 1.55rem;
  left: 9.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  z-index: 100;
}

/* ===== 主内容区 ===== */
.about-content {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1400px;
  padding: 0 5vw;
  margin-left: 0;
}

.about-title {
  font-size: clamp(3.5rem, 10vw, 8rem);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
  transform: scaleY(0.9);
  transform-origin: left bottom;
  opacity: 0;
  animation: titleReveal 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.3s forwards;
}

@keyframes titleReveal {
  from {
    opacity: 0;
    transform: scaleY(0.9) translateX(-40px);
    clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
  }
  to {
    opacity: 1;
    transform: scaleY(0.9) translateX(0);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  }
}

.about-subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.75rem, 1.2vw, 1rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  opacity: 0.7;
  margin-bottom: 3.5rem;
  text-transform: uppercase;
}

/* ===== 时间线 ===== */
.timeline {
  position: relative;
  width: 100%;
}

.timeline-track {
  position: absolute;
  top: 0.6rem;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(138, 231, 68, 0.18);
  overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  transition: clip-path 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.timeline-track.is-exiting {
  clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
}

.timeline-progress {
  height: 100%;
  width: 0;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(138, 231, 68, 0.6);
  transition: width 1.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.timeline-progress.is-active {
  width: 100%;
}

.timeline-nodes {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding-top: 2.5rem;
}

.timeline-node {
  position: relative;
  flex: 1;
  max-width: 360px;
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.timeline-node.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.timeline-node:nth-child(1) { transition-delay: 0.2s; }
.timeline-node:nth-child(2) { transition-delay: 0.5s; }
.timeline-node:nth-child(3) { transition-delay: 0.8s; }

.node-marker {
  position: absolute;
  /* 节点盒顶距时间线顶 2.5rem，轨道中心在 0.6rem + 1px（轨道高 2px），
     故圆点中心需位于节点盒顶上方 1.9rem 处再下移 1px，使横轴穿过圆心 */
  top: calc(1px - 1.9rem);
  left: 0;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
}

.marker-core {
  position: absolute;
  inset: 0;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(138, 231, 68, 0.8);
}

.marker-pulse {
  position: absolute;
  inset: -8px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.5);
  animation: nodePulse 2.5s ease-out infinite;
}

@keyframes nodePulse {
  0% { opacity: 0.8; transform: scale(0.5); }
  100% { opacity: 0; transform: scale(2.2); }
}

.timeline-node:nth-child(2) .marker-pulse { animation-delay: 0.8s; }
.timeline-node:nth-child(3) .marker-pulse { animation-delay: 1.6s; }

.node-content {
  padding-top: 0.75rem;
}

.node-year {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.node-school {
  font-size: clamp(1rem, 1.5vw, 1.35rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  line-height: 1.2;
}

.node-detail {
  font-size: 0.72rem;
  color: var(--accent);
  opacity: 0.85;
  margin-bottom: 0.75rem;
  letter-spacing: 0.06em;
}

.node-desc {
  font-size: 0.85rem;
  line-height: 1.65;
  color: rgba(230, 230, 230, 0.65);
  max-width: 320px;
}

/* ===== 侧边栏 ===== */
.about-sidebar {
  position: fixed;
  right: 2.5rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1.5rem;
  text-align: right;
}

.about-sidebar .sidebar-text {
  display: flex;
  gap: 1.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: rgba(230, 230, 230, 0.6);
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.sidebar-data {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: rgba(138, 231, 68, 0.55);
}

.data-line {
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.data-line.is-visible {
  opacity: 1;
  transform: translateX(0);
}

/* ===== 右下角标签 ===== */
.corner-tag {
  position: fixed;
  right: 2.5rem;
  bottom: 2rem;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: rgba(230, 230, 230, 0.45);
}

.corner-line {
  width: 40px;
  height: 1px;
  background: rgba(138, 231, 68, 0.4);
}

/* ===== 导航当前页高亮 ===== */
.main-nav a.active::after {
  width: 100%;
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  .timeline-nodes {
    flex-wrap: wrap;
    gap: 3rem 2rem;
  }

  .timeline-node {
    flex: 1 1 40%;
    max-width: none;
  }

  .timeline-node:nth-child(3) {
    flex: 1 1 100%;
  }
}

@media (max-width: 768px) {
  .about-page {
    align-items: flex-start;
    padding-top: 6rem;
  }

  .about-content {
    padding: 0 1.5rem;
  }

  .about-subtitle {
    margin-bottom: 2.5rem;
  }

  .timeline-track {
    top: 0;
    left: 0.35rem;
    right: auto;
    width: 2px;
    height: 0;
    background: rgba(138, 231, 68, 0.18);
    transition: height 1.4s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .timeline-track.is-active {
    height: 100%;
  }

  .timeline-progress {
    width: 100%;
    height: 0;
    transition: height 1.4s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .timeline-progress.is-active {
    height: 100%;
    width: 100%;
  }

  .timeline-nodes {
    flex-direction: column;
    padding-top: 0;
    padding-left: 2rem;
    gap: 2.5rem;
  }

  .timeline-node {
    max-width: none;
  }

  .node-marker {
    top: 0.35rem;
    left: -2rem;
  }

  .about-sidebar {
    display: none;
  }

  .corner-tag {
    right: 1.25rem;
    bottom: 1.25rem;
  }
}
