/* 3D地球组件样式 */

/* 主要内容区块 */
.main-content-section {
  padding: calc(80px + var(--spacing-xs)) 0 var(--spacing-sm) 0; /* 为固定导航栏留出空间 */
  position: relative;
  overflow: hidden;
  min-height: 50vh;
}

/* 移动端主要内容向上移动 */
@media (max-width: 768px) {
  .main-content-section {
    padding: calc(60px + var(--spacing-xs)) 0 var(--spacing-sm) 0; /* 减少移动端顶部间距 */
    margin-top: -30px; /* 向上移动30px */
  }

  .main-content-wrapper {
    gap: var(--spacing-sm); /* 移动端进一步减少间隙 */
  }

  .earth-section {
    padding: 0; /* 移动端移除earth-section的内边距 */
    margin: 0; /* 移除外边距 */
  }
}

/* 移动端默认：上下布局 */
.main-content-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md); /* 减少移动端间隙 */
}

/* 联系我们部分 */
.contact-section {
  width: 100%;
  order: 2; /* 移动端在下面 */
  min-height: auto; /* 移动端减少最小高度 */
  padding: var(--spacing-md) 0; /* 减少内边距 */
}

.contact-section .section-title {
  text-align: center;
  margin-bottom: var(--spacing-sm); /* 减少标题下方间距 */
}

.contact-section .section-subtitle {
  text-align: center;
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.6;
  margin-bottom: var(--spacing-md); /* 减少副标题下方间距 */
  opacity: 0.9;
}

.contact-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.enter-btn {
  font-size: 1.2rem;
  padding: var(--spacing-md) var(--spacing-xl);
  min-width: 150px;
  margin-top: var(--spacing-sm); /* 减少按钮上方间距 */
  transform: translateY(-30px); /* 移动端向上移动30px */
}

/* 3D地球部分 */
.earth-section {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  order: 1; /* 移动端在上面 */
}

/* 桌面端：左右布局 */
@media (min-width: 768px) {
  .main-content-section {
    padding: 70px 0 var(--spacing-xs) 0;
  }

  .main-content-wrapper {
    flex-direction: row;
    align-items: center;
    min-height: 50vh;
  }

  .contact-section {
    flex: 1;
    max-width: 500px;
    order: 1; /* 桌面端在左边 */
    transform: translateY(-150px); /* 向上移动150px */
  }

  .contact-section .section-title {
    text-align: left;
  }

  .contact-section .section-subtitle {
    text-align: left;
  }

  .contact-content {
    align-items: flex-start;
    text-align: left;
  }

  .earth-section {
    flex: 1;
    order: 2; /* 桌面端在右边 */
    transform: translateY(-150px); /* 向上移动150px */
  }
}

.earth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  position: relative;
}

.earth-content {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.earth-info {
  flex: 1;
  max-width: 500px;
}

.earth-info h2 {
  font-size: 2.5rem;
  margin-bottom: var(--spacing-md);
  background: linear-gradient(135deg, #1f2937 0%, #6366f1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.earth-info p {
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: var(--spacing-md);
  color: var(--text-secondary);
}

.earth-features {
  list-style: none;
  padding: 0;
  margin: var(--spacing-lg) 0;
}

.earth-features li {
  display: flex;
  align-items: center;
  margin-bottom: var(--spacing-sm);
  color: var(--text-secondary);
}

.earth-features li::before {
  content: '✨';
  margin-right: var(--spacing-sm);
  font-size: 1.2rem;
}

/* 3D地球模型容器 */
.earth-3d-wrapper {
  width: 750px;
  height: 750px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.earth-3d-container {
  width: 700px;
  height: 700px;
  position: relative;
  border-radius: 50%;
  overflow: hidden;
}

/* 1920×1080 桌面分辨率优化 */
@media (min-width: 1600px) {
  .main-content-section {
    padding: 70px 0 var(--spacing-sm) 0; /* 进一步减少大屏幕上下留白 */
  }

  .earth-3d-wrapper {
    width: 900px;
    height: 900px;
  }

  .earth-3d-container {
    width: 850px;
    height: 850px;
  }

  .earth-section {
    transform: translateY(-170px); /* 大屏幕向上移动更多 */
  }

  .contact-section {
    max-width: 600px;
    transform: translateY(-170px); /* 大屏幕向上移动更多 */
  }

  .main-content-wrapper {
    gap: calc(var(--spacing-xl) * 2);
  }

  .enter-btn {
    font-size: 1.4rem;
    padding: var(--spacing-lg) calc(var(--spacing-xl) * 1.5);
    min-width: 200px;
    transform: none; /* 桌面端取消向上移动效果 */
  }
}

/* iOS 自动播放内联视频优化 */
.earth-3d-container video[playsinline] {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-overflow-scrolling: touch;
}

.earth-3d-container canvas,
.earth-3d-container video.earth-video {
  border-radius: 50%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 移除鼠标抓手样式，仅用于视频 */
.earth-3d-container canvas:active {
  cursor: default;
}

/* 地球加载器 */
.earth-loader {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  z-index: 10;
  transition: opacity 0.5s ease;
}

.earth-loader .glass-card {
  text-align: center;
  padding: var(--spacing-lg);
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
}

.earth-loader .loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(139, 92, 246, 0.3);
  border-top: 3px solid rgba(139, 92, 246, 0.8);
  border-radius: 50%;
  animation: earthSpin 1s linear infinite;
  margin: 0 auto var(--spacing-sm);
}

@keyframes earthSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}





/* 响应式设计 */
@media (max-width: 992px) {
  .earth-3d-wrapper {
    width: 600px;
    height: 600px;
  }

  .earth-3d-container {
    width: 550px;
    height: 550px;
  }

  .main-content-section {
    padding: 85px 0 var(--spacing-xs) 0;
    min-height: 45vh;
  }
}

@media (max-width: 768px) {
  .earth-3d-wrapper {
    width: 400px; /* 减少宽度 */
    height: 400px; /* 减少高度 */
  }

  .earth-3d-container {
    width: 370px; /* 减少宽度 */
    height: 370px; /* 减少高度 */
  }

  .main-content-section {
    padding: 85px 0 var(--spacing-xs) 0;
    min-height: 40vh;
  }
}

@media (max-width: 480px) {
  .earth-3d-wrapper {
    width: 320px; /* 进一步减少宽度 */
    height: 320px; /* 进一步减少高度 */
  }

  .earth-3d-container {
    width: 300px; /* 进一步减少宽度 */
    height: 300px; /* 进一步减少高度 */
  }

  .main-content-section {
    padding: 85px 0 var(--spacing-xs) 0;
    min-height: 35vh;
  }
}

/* 性能优化 */
@media (prefers-reduced-motion: reduce) {
  .earth-loader .loader-spinner {
    animation: none;
  }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
  .earth-3d-container {
    border: 2px solid var(--text-primary);
  }
}

/* 暗色主题支持（未来扩展） */
@media (prefers-color-scheme: dark) {
  .earth-info h2 {
    background: linear-gradient(135deg, #f8fafc 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
}
