/* ========================================
   Hero 3D 视差背景 - 基于图片 + 动画
======================================== */

/* 主题变量 */
:root {
  --hero-text: #ffffff;
  --hero-text-secondary: #cccccc;

  /* NVIDIA 绿光色 */
  --nvidia-green: #76b900;
  --nvidia-green-glow: rgba(118, 185, 0, 0.4);
  --nvidia-green-bright: #8dd500;

  /* 左侧门户（个人用户）- NVIDIA 绿光 */
  --hero-left-primary: var(--nvidia-green);
  --hero-left-glow: var(--nvidia-green-glow);

  /* 右侧门户（企业用户）- NVIDIA 绿光 */
  --hero-right-primary: var(--nvidia-green);
  --hero-right-glow: var(--nvidia-green-glow);

  /* 玻璃态效果 */
  --hero-glass-bg: rgba(255, 255, 255, 0.03);
  --hero-glass-border: rgba(255, 255, 255, 0.15);
  --hero-glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* ========================================
   Hero 容器 - 全屏背景 + 3D 透视
======================================== */
.hero-3d-container {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: #000814;
  perspective: 1000px;
  perspective-origin: 50% 50%;
}

/* 背景图层（宇宙星空） - 增强 3D 效果 */
.hero-bg-layer {
  position: absolute;
  top: -10%;
  left: -10%;
  width: 120%;
  height: 120%;
  background-image: url('/images/universe-bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  will-change: transform;
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  animation: breathe 25s ease-in-out infinite;
  transform-style: preserve-3d;
}

/* 增强呼吸动画 - 更明显的 3D 效果 */
@keyframes breathe {
  0%, 100% {
    transform: scale(1) translateZ(0) rotateX(0deg);
  }
  25% {
    transform: scale(1.08) translateZ(20px) rotateX(1deg);
  }
  50% {
    transform: scale(1.15) translateZ(40px) rotateX(0deg);
  }
  75% {
    transform: scale(1.08) translateZ(20px) rotateX(-1deg);
  }
}

/* ========================================
   鼠标跟随光标 - 已禁用
======================================== */
.mouse-follower {
  display: none;
}

/* ========================================
   流星效果
======================================== */
.meteor {
  position: absolute;
  height: 2px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 1) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  pointer-events: none;
  z-index: 3;
  animation: meteorFall 2s linear forwards;
  box-shadow:
    0 0 10px rgba(255, 255, 255, 0.8),
    0 0 20px rgba(100, 200, 255, 0.6),
    0 0 30px rgba(180, 120, 255, 0.4);
  transform-origin: left center;
}

.meteor::before {
  content: '';
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 10px rgba(255, 255, 255, 1);
  left: 0;
  top: 50%;
  transform: translateY(-50%);
}

@keyframes meteorFall {
  0% {
    transform: translateX(0) translateY(0) rotate(-45deg);
    width: 0;
    opacity: 1;
  }
  10% {
    width: 100px;
    opacity: 1;
  }
  100% {
    transform: translateX(-300px) translateY(300px) rotate(-45deg);
    width: 100px;
    opacity: 0;
  }
}

/* ========================================
   3D 粒子系统
======================================== */
.hero-particles-3d {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
  transform-style: preserve-3d;
  perspective: 1000px;
}

.particle-3d {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform, opacity;
  box-shadow: 0 0 10px currentColor;
  animation: particleFloat 20s infinite ease-in-out;
}

@keyframes particleFloat {
  0%, 100% {
    transform: translateY(0) translateZ(0) scale(1);
  }
  25% {
    transform: translateY(-20px) translateZ(50px) scale(1.2);
  }
  50% {
    transform: translateY(0) translateZ(100px) scale(1.5);
  }
  75% {
    transform: translateY(20px) translateZ(50px) scale(1.2);
  }
}

/* 星星闪烁叠加层 */
.hero-stars-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 0 3px rgba(255, 255, 255, 0.8);
}

.star.twinkle {
  animation: twinkle 3s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Canvas 层（备用） */
#hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ========================================
   加载动画
======================================== */
.hero-loader {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000814;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: opacity 0.8s ease;
}

.hero-loader.fade-out {
  opacity: 0;
  pointer-events: none;
}

.hero-logo-burst {
  font-size: 80px;
  font-weight: 900;
  color: #76B900;
  text-shadow: 0 0 20px rgba(118, 185, 0, 0.5);
  opacity: 0;
  transform: scale(0.5);
}

/* ========================================
   音乐控制按钮
======================================== */
.music-control {
  position: fixed;
  top: 120px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 1000;
}

.music-control:hover {
  background: rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.1);
}

/* 提示脉冲动画 */
.music-control.hint-pulse {
  animation: hintPulse 1.5s ease-in-out 2;
}

@keyframes hintPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(118, 185, 0, 0.7);
  }
  50% {
    transform: scale(1.15);
    box-shadow: 0 0 0 15px rgba(118, 185, 0, 0);
  }
}

.music-icon {
  font-size: 24px;
  position: absolute;
}

.music-waves {
  display: flex;
  gap: 3px;
  align-items: flex-end;
  height: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.music-waves.active {
  opacity: 1;
}

.music-waves span {
  width: 3px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 2px;
  animation: musicWave 0.8s ease-in-out infinite;
}

.music-waves span:nth-child(1) {
  height: 8px;
  animation-delay: 0s;
}

.music-waves span:nth-child(2) {
  height: 14px;
  animation-delay: 0.2s;
}

.music-waves span:nth-child(3) {
  height: 10px;
  animation-delay: 0.4s;
}

@keyframes musicWave {
  0%, 100% {
    transform: scaleY(1);
  }
  50% {
    transform: scaleY(1.5);
  }
}

/* ========================================
   主题切换器
======================================== */
.theme-switcher {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: all 0.3s ease;
  z-index: 50;
  backdrop-filter: blur(10px);
}

.theme-switcher:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* ========================================
   双门户布局 - 移除卡片，纯文字悬浮
======================================== */
.hero-portals {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  z-index: 10;
  transform-style: preserve-3d;
}

.hero-divider {
  position: absolute;
  left: 50%;
  top: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 30%,
    rgba(255, 255, 255, 0.3) 70%,
    transparent 100%
  );
  transform: translateX(-50%);
  z-index: 5;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.hero-portal {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 60px;
  opacity: 0;
  transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-style: preserve-3d;
}

.hero-portal.left {
  transform: translateZ(-50px) rotateY(-8deg);
}

.hero-portal.right {
  transform: translateZ(-50px) rotateY(8deg);
}

/* 移除卡片背景 */
.portal-glass {
  display: none;
}

.portal-content {
  position: relative;
  z-index: 2;
  max-width: 480px;
  text-align: center;
  transform-style: preserve-3d;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.portal-content > * {
  opacity: 0;
  transform: translateY(20px) translateZ(0);
}

.portal-icon {
  width: 100px;
  height: 100px;
  margin: 0 auto 32px;
  background: rgba(255, 255, 255, 0.1);
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  font-weight: 700;
  color: var(--hero-text);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  transform: translateZ(30px);
  transition: all 0.3s ease;
}

.portal-icon:hover {
  transform: translateZ(50px) scale(1.1);
}

.hero-portal.left .portal-icon {
  color: var(--hero-left-primary);
  border-color: var(--hero-left-primary);
  box-shadow: 0 8px 32px var(--hero-left-glow);
}

.hero-portal.right .portal-icon {
  color: var(--hero-right-primary);
  border-color: var(--hero-right-primary);
  box-shadow: 0 8px 32px var(--hero-right-glow);
}

.portal-title {
  font-size: 48px;
  font-weight: 900;
  color: var(--hero-text);
  margin-bottom: 20px;
  line-height: 1.2;
  transform: translateZ(20px);
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

.portal-subtitle {
  font-size: 20px;
  color: var(--hero-text-secondary);
  margin-bottom: 36px;
  line-height: 1.6;
  transform: translateZ(10px);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.portal-features {
  list-style: none;
  margin-bottom: 44px;
  text-align: left;
  width: 100%;
  transform: translateZ(10px);
}

.portal-features li {
  padding: 12px 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 17px;
  position: relative;
  padding-left: 32px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  transition: all 0.3s ease;
}

.portal-features li:hover {
  transform: translateX(5px) translateZ(5px);
  color: #fff;
}

.portal-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  font-weight: 700;
  font-size: 20px;
  text-shadow: 0 0 10px currentColor;
}

.hero-portal.left .portal-features li::before {
  color: var(--hero-left-primary);
}

.hero-portal.right .portal-features li::before {
  color: var(--hero-right-primary);
}

.portal-cta {
  display: block;
  width: fit-content;
  margin: 20px auto 0;
  padding: 18px 48px;
  border-radius: 12px;
  font-size: 19px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  transform: translateZ(30px);
  text-shadow: none;
}

.hero-portal.left .portal-cta {
  background: var(--nvidia-green);
  color: #000;
  box-shadow: 0 8px 30px var(--nvidia-green-glow);
}

.hero-portal.left .portal-cta:hover {
  transform: translateZ(50px) translateY(-3px);
  box-shadow: 0 12px 40px var(--nvidia-green-glow);
  background: var(--nvidia-green-bright);
}

.hero-portal.right .portal-cta {
  background: var(--nvidia-green);
  color: #000;
  box-shadow: 0 8px 30px var(--nvidia-green-glow);
}

.hero-portal.right .portal-cta:hover {
  transform: translateZ(50px) translateY(-3px);
  box-shadow: 0 12px 40px var(--nvidia-green-glow);
  background: var(--nvidia-green-bright);
}

/* ========================================
   响应式 - 移动端
======================================== */
@media (max-width: 768px) {
  .hero-portals {
    flex-direction: column;
  }

  .hero-divider {
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    transform: translateY(-50%);
  }

  .hero-portal {
    padding: 40px 20px;
  }

  .hero-portal.left,
  .hero-portal.right {
    transform: none;
  }

  .portal-glass {
    inset: 20px;
  }

  .portal-title {
    font-size: 32px;
  }

  .portal-subtitle {
    font-size: 16px;
  }

  .hero-bg-layer {
    animation: none;
  }
}
