/* 卡片悬停发光效果 */
.glow-card {
  position: relative;
  overflow: hidden;
}

.glow-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(37, 99, 235, 0.2),
    transparent
  );
  transition: 0.5s;
}

.glow-card:hover::before {
  left: 100%;
}
/* 背景星空效果 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: -1;
  transition: opacity 0.5s, visibility 0.5s;
  pointer-events: none;
}

#bigDipperCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* 按钮脉冲效果 */
.btn-pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
}

/* 数字动画 */
.counter {
  display: inline-block;
  overflow: hidden;
  height: 2rem;
}

.counter-digit {
  display: inline-block;
  animation: count-up 1s ease-in-out;
}

@keyframes count-up {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

/* 分割线动画 */
.divider {
  position: relative;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    var(--primary-color),
    transparent
  );
  margin: 2rem 0;
  overflow: visible;
}

.divider::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-color);
  transform: translate(-50%, -50%);
  animation: move-divider 3s infinite linear;
}

@keyframes move-divider {
  0% {
    left: 0;
  }
  100% {
    left: 100%;
  }
}

/* 悬浮卡片 */
.floating-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.floating-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3),
    0 10px 10px -5px rgba(0, 0, 0, 0.1);
}

/* 进度条动画 */
.progress-bar {
  height: 4px;
  background: var(--light-bg);
  border-radius: 2px;
  overflow: hidden;
  margin: 1rem 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(
    to right,
    var(--primary-color),
    var(--secondary-color)
  );
  border-radius: 2px;
  width: 0;
  transition: width 1s ease-in-out;
}

/* 科技感边框 */
.tech-border {
  position: relative;
}

.tech-border::before,
.tech-border::after {
  content: "";
  position: absolute;
  background: var(--primary-color);
}

.tech-border.top-left::before {
  top: 0;
  left: 0;
  width: 0;
  height: 2px;
  animation: line-grow-width 1s ease-out forwards;
}

.tech-border.top-left::after {
  top: 0;
  left: 0;
  width: 2px;
  height: 0;
  animation: line-grow-height 1s ease-out 0.5s forwards;
}

@keyframes line-grow-width {
  to {
    width: 50px;
  }
}

@keyframes line-grow-height {
  to {
    height: 50px;
  }
}

/* 元素进入视口动画 */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.appear {
  opacity: 1;
  transform: translateY(0);
}

.slide-in-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.slide-in-left.appear {
  opacity: 1;
  transform: translateX(0);
}

.slide-in-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.slide-in-right.appear {
  opacity: 1;
  transform: translateX(0);
}

/* 媒体查询中的动画调整 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
