/* ============================================
   全局样式与变量
   ============================================ */
:root {
  --primary: #6A7CFF;
  --accent: #46E6B0;
  --dark: #0B1021;
  --surface: #101633;
  --border: #1D2547;
  --glow-primary: rgba(106, 124, 255, 0.25);
  --glow-accent: rgba(70, 230, 176, 0.25);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--dark);
  /* 桌面端启用一屏一屏滚动 */
  scroll-snap-type: y mandatory;
}

body {
  background-color: var(--dark);
  background-image:
    radial-gradient(circle at 20% 20%, rgba(106,124,255,0.18), transparent 32%),
    radial-gradient(circle at 80% 10%, rgba(70,230,176,0.14), transparent 28%),
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
  font-family: 'Inter', system-ui, sans-serif;
  color: #F1F5F9;
  overflow-x: hidden;
  position: relative;
  /* 让 body 也参与滚动吸附，兼容部分浏览器 */
  scroll-snap-type: y mandatory;
  scroll-padding-top: 0;
  min-height: 100%;
}

/* 每个主内容分区作为一屏对齐 */
body > main > section {
  scroll-snap-align: start;
  scroll-snap-stop: always;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.04;
  pointer-events: none;
  z-index: 20; /* Keep noise on top of sections */
}

/* ============================================
   玻璃态效果
   ============================================ */
.glass {
  background: rgba(16, 22, 51, 0.75);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass:hover {
  border-color: rgba(106, 124, 255, 0.5);
  box-shadow: 0 20px 60px rgba(106, 124, 255, 0.15);
}

/* ============================================
   按钮与交互元素
   ============================================ */
.cta-btn {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.cta-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cta-btn:hover::before {
  opacity: 1;
}

.cta-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 20px 50px rgba(106,124,255,0.4);
}

.cta-btn:active {
  transform: translateY(-1px) scale(1.01);
}

/* ============================================
   导航栏
   ============================================ */
header {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 50;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

header.scrolled {
  background: rgba(11, 16, 33, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

.nav-active {
  color: var(--accent) !important;
  position: relative;
}

.nav-active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  border-radius: 2px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

/* ============================================
   进入动画类
   ============================================ */
.fade-in-up {
  opacity: 0;
  transform: translateY(80px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-left {
  opacity: 0;
  transform: translateX(-80px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-right {
  opacity: 0;
  transform: translateX(80px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* ============================================
   视差滚动效果
   ============================================ */
.parallax-slow {
  will-change: transform;
  transform: translateZ(0);
}

.parallax-fast {
  will-change: transform;
  transform: translateZ(0);
}

/* ============================================
   卡片悬停效果
   ============================================ */
.card-hover {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.card-hover::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.card-hover:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 25px 60px rgba(106, 124, 255, 0.25);
}

.card-hover:hover::before {
  opacity: 1;
}

/* ============================================
   数字计数动画
   ============================================ */
.counter {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* ============================================
   图片加载动画
   ============================================ */
.image-reveal {
  opacity: 0;
  transform: scale(1.1);
  transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.image-reveal.loaded {
  opacity: 1;
  transform: scale(1);
}

/* ============================================
   渐变文字效果
   ============================================ */
.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

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

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), var(--accent));
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--accent), var(--primary));
}

/* ============================================
   响应式设计
   ============================================ */
@media (max-width: 768px) {
  .fade-in-left,
  .fade-in-right {
    transform: translateY(40px);
  }

  .fade-in-left.visible,
  .fade-in-right.visible {
    transform: translateY(0);
  }

  /* 移动端降低吸附强度，避免滚动太“卡” */
  html {
    scroll-snap-type: y proximity;
  }
  body > main > section {
    scroll-snap-stop: normal;
  }
}

/* ============================================
   减少动画偏好
   ============================================ */
@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;
  }

  .fade-in-up,
  .fade-in-left,
  .fade-in-right,
  .fade-in-scale {
    opacity: 1;
    transform: none;
  }
}

/* ============================================
   加载动画
   ============================================ */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.loading-shimmer {
  animation: shimmer 2s infinite;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.05) 100%
  );
  background-size: 1000px 100%;
}

/* ============================================
   3D 变换效果
   ============================================ */
.transform-3d {
  transform-style: preserve-3d;
  perspective: 1000px;
}

.card-3d {
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-3d:hover {
  transform: rotateY(5deg) rotateX(-5deg) translateZ(20px);
}

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

.glow-effect::after {
  content: '';
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle, var(--primary), transparent 70%);
  opacity: 0;
  filter: blur(20px);
  transition: opacity 0.4s ease;
  z-index: -1;
}

.glow-effect:hover::after {
  opacity: 0.6;
}

/* ============================================
   Section Backgrounds
   ============================================ */
.section-bg-advantages {
  background-color: #0B1021;
  background-image:
      radial-gradient(circle at 0% 0%, rgba(106, 124, 255, 0.08) 0%, transparent 40%),
      radial-gradient(circle at 100% 100%, rgba(70, 230, 176, 0.05) 0%, transparent 40%),
      linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
}
.section-bg-partners {
  background: linear-gradient(180deg, #131b31 0%, #0e1424 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.section-bg-ads {
  background: linear-gradient(to bottom right, #000000, #050508);
}

.section-bg-system {
  background-color: #131b31;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(106, 124, 255, 0.04) 0%, transparent 20%),
    radial-gradient(circle at 90% 80%, rgba(70, 230, 176, 0.04) 0%, transparent 20%),
    linear-gradient(180deg, #131b31 0%, #0e1424 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.section-bg-tech {
  background: linear-gradient(to bottom, #020204, #000000);
}

.section-bg-contact {
  background: linear-gradient(180deg, #131b31 0%, #000000 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

#partners span.icon-bg {
  background: linear-gradient(45deg, #37437e, #164b45);
  border-radius: 12px;
}

/* ============================================
   Scroll to Top Button
   ============================================ */
.scroll-top-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: rgba(16, 22, 51, 0.8);
  border: 1px solid rgba(106, 124, 255, 0.3);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.scroll-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.scroll-top-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--glow-primary);
  transform: translateY(-2px);
}
