/**
 * 动画与交互效果
 */

/* 页面加载动画 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(102, 252, 241, 0.1);
  }
  50% {
    box-shadow: 0 0 40px rgba(102, 252, 241, 0.2);
  }
}

.animate-fade-in-up {
  opacity: 0;
  animation: fadeInUp 0.7s ease forwards;
}

.animate-fade-in {
  opacity: 0;
  animation: fadeIn 0.8s ease forwards;
}

.animate-slide-in-left {
  opacity: 0;
  animation: slideInLeft 0.7s ease forwards;
}

/* 滚动触发动画 */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.no-js .reveal,
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hero 区域 */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding-top: 80px;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 900px;
  padding: 0 1.5rem;
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 2px;
  color: var(--accent-amber);
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-strong);
  padding: 0.5rem 1rem;
}

.hero-title {
  font-size: clamp(2.75rem, 8vw, 5.5rem);
  line-height: 1.05;
  margin-bottom: 1.5rem;
}

.hero-title .gradient-text {
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-amber) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto 2.5rem;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 1px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
  40% { transform: translateX(-50%) translateY(-10px); }
  60% { transform: translateX(-50%) translateY(-5px); }
}

/* 错开动画 */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

/* 文章头部 */
.article-hero {
  position: relative;
  min-height: 60vh;
  display: flex;
  align-items: flex-end;
  padding: 6rem 0 4rem;
  margin-bottom: 3rem;
  overflow: hidden;
}

.article-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.article-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.35);
}

.article-hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(11, 12, 16, 0.3) 0%, rgba(11, 12, 16, 0.95) 100%);
}

.article-hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
}

.article-hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  max-width: 900px;
  margin-bottom: 1.5rem;
}

.article-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.article-hero-meta i {
  color: var(--accent-amber);
  margin-right: 0.375rem;
}

/* 页面标题横幅 */
.page-banner {
  padding: 10rem 0 4rem;
  text-align: center;
  background: linear-gradient(180deg, rgba(31, 40, 51, 0.4) 0%, transparent 100%);
  border-bottom: 1px solid var(--border-color);
}

.page-banner-title {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  margin-bottom: 1rem;
}

.page-banner-desc {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* 装饰线条 */
.deco-line {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-amber), var(--accent-cyan));
  margin-bottom: 1.5rem;
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}
