/* ============================================
   动画样式 - 滚动揭示、悬停、加载效果
   ============================================ */

/* 关键帧 */
@keyframes pulse-dot {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 8px var(--amber);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.3);
    box-shadow: 0 0 20px var(--amber-bright);
  }
}

@keyframes scroll-line {
  0% {
    top: -40px;
  }
  100% {
    top: 100%;
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.4;
    r: 3;
  }
  50% {
    opacity: 1;
    r: 5;
  }
}

.pulse {
  animation: pulse 2.5s ease-in-out infinite;
}

.pulse-2 {
  animation-delay: 1.2s;
}

/* 滚动揭示动画 */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* 错开延迟 */
.reveal:nth-child(1) { transition-delay: 0.0s; }
.reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal:nth-child(3) { transition-delay: 0.2s; }
.reveal:nth-child(4) { transition-delay: 0.3s; }
.reveal:nth-child(5) { transition-delay: 0.4s; }
.reveal:nth-child(6) { transition-delay: 0.5s; }
.reveal:nth-child(7) { transition-delay: 0.6s; }
.reveal:nth-child(8) { transition-delay: 0.7s; }

/* Hero 进入动画 */
.hero-tag {
  animation: fade-in-down 0.8s ease-out 0.1s both;
}

.hero-title {
  animation: fade-in-up 1s ease-out 0.3s both;
}

.hero-subtitle {
  animation: fade-in-up 1s ease-out 0.5s both;
}

.hero-stats {
  animation: fade-in-up 1s ease-out 0.7s both;
}

.hero-cta {
  animation: fade-in-up 1s ease-out 0.9s both;
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in-down {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 标题渐变文字动画 */
.hero-title-main {
  background-size: 200% 100%;
  animation: gradient-shift 6s ease-in-out infinite;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* 标签徽章光晕 */
.hero-tag {
  position: relative;
}

.hero-tag::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 100px;
  padding: 1px;
  background: linear-gradient(90deg, transparent, var(--amber), var(--cyan), transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.4;
  animation: gradient-shift 4s linear infinite;
}

/* 系统卡片悬停效果增强 */
.system-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(200, 151, 92, 0.04) 50%, transparent 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  border-radius: 12px;
}

.system-card:hover::after {
  opacity: 1;
}

.system-card[data-color="cyan"]::after {
  background: linear-gradient(135deg, transparent 0%, rgba(0, 212, 255, 0.05) 50%, transparent 100%);
}

/* 指标条动画触发 */
.metric-bar-fill.is-animated {
  /* width 通过 data-fill 动态设置 */
}

/* 数字计数动画 */
.hero-stat-num {
  transition: transform 0.3s ease;
}

.hero-stat:hover .hero-stat-num {
  transform: scale(1.1);
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--amber-dark);
  border-radius: 4px;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--amber);
}

/* 文本选择样式 */
::selection {
  background: rgba(200, 151, 92, 0.3);
  color: var(--text-primary);
}

::-moz-selection {
  background: rgba(200, 151, 92, 0.3);
  color: var(--text-primary);
}

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