/* 全局变量 */
:root {
  --color-primary: #0A192F;
  --color-accent: #64FFDA;
  --color-text: #E6F1FF;
  --color-text-secondary: #8892B0;
  --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 页面过渡动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes floatUp {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* 页面加载动画 */
.page-enter {
  animation: fadeIn 0.6s ease-out;
}

.slide-enter {
  animation: slideIn 0.5s ease-out;
}

/* 滚动渐显效果 */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: var(--transition-smooth);
}

.scroll-reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* 导航栏效果 */
.nav-blur {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(10, 25, 47, 0.85);
  box-shadow: 0 4px 20px rgba(100, 255, 218, 0.1);
}

/* 按钮悬停效果 */
.btn-glow {
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.btn-glow::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(100, 255, 218, 0.3), transparent);
  transition: left 0.5s;
}

.btn-glow:hover::before {
  left: 100%;
}

.btn-glow:hover {
  border-color: var(--color-accent);
  box-shadow: 0 0 20px rgba(100, 255, 218, 0.4);
  transform: translateY(-2px);
}

/* 卡片悬停效果 */
.card-hover {
  transition: var(--transition-smooth);
  cursor: pointer;
}

.card-hover:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(100, 255, 218, 0.15);
}

/* 粒子背景效果 */
.particle-bg {
  position: relative;
  overflow: hidden;
}

.particle-bg::before {
  content: '';
  position: absolute;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(100, 255, 218, 0.05) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: particleMove 20s linear infinite;
}

@keyframes particleMove {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(-50px, -50px);
  }
}

/* 光晕效果 */
.glow-effect {
  position: relative;
}

.glow-effect::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(100, 255, 218, 0.3), transparent 70%);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.glow-effect:hover::after {
  width: 300px;
  height: 300px;
}

/* 数据流动画 */
@keyframes dataFlow {
  0% {
    transform: translateX(-100%) translateY(0);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateX(100%) translateY(-20px);
    opacity: 0;
  }
}

.data-flow {
  animation: dataFlow 3s ease-in-out infinite;
}

/* 滚动提示动画 */
.scroll-indicator {
  animation: floatUp 2s ease-in-out infinite;
}

/* 渐变文字效果 */
.gradient-text {
  background: linear-gradient(135deg, #64FFDA 0%, #00D4FF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 图片懒加载效果 */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.5s;
}

img[loading="lazy"].loaded {
  opacity: 1;
}

/* 响应式图片容器 */
.img-container {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.img-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(100, 255, 218, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.4s;
}

.img-container:hover::before {
  opacity: 1;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--color-accent);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #52E5C4;
}

/* 移动端菜单动画 */
@keyframes menuSlideIn {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

.mobile-menu-open {
  animation: menuSlideIn 0.3s ease-out;
}

/* 加载状态 */
.loading-spinner {
  border: 3px solid rgba(100, 255, 218, 0.2);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 文字打字效果 */
@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

.typing-effect {
  overflow: hidden;
  white-space: nowrap;
  animation: typing 2s steps(40, end);
}

/* 网格背景 */
.grid-bg {
  background-image: 
    linear-gradient(rgba(100, 255, 218, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100, 255, 218, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* 性能优化 */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.will-change-transform {
  will-change: transform;
}