/* CSS层保护：优化选择器兼容性 */
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* 允许交互元素保持功能（兼容所有浏览器） */
button, a, input, textarea {
  -webkit-user-select: auto;
  -moz-user-select: auto;
  -ms-user-select: auto;
  user-select: auto;
  pointer-events: auto;
  cursor: pointer;
}

/* 防止文本选中高亮（兼容所有浏览器） */
::-moz-selection { background: transparent; }
::selection { background: transparent; }

/* 禁用截图图片的手机端长按保存功能 */
.screenshot-no-save {
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
}

/* 屏幕阅读器专用样式 - 用于无障碍访问 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.sr-only.focus\:not-sr-only:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* 版本标签样式 - 右上角徽章 */
.version-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: linear-gradient(135deg, #6C5CE7, #00CEFF);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.4);
  z-index: 10;
  white-space: nowrap;
  transform: scale(0.95);
  transition: all 0.3s ease;
}

.ios-download:hover .version-badge,
.android-download:hover .version-badge {
  transform: scale(1);
  box-shadow: 0 3px 12px rgba(108, 92, 231, 0.6);
}

/* 基础样式 - 客服按钮整体 */
.space-support-button {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0A1929, #0F3460);
  box-shadow: 0 4px 20px rgba(15, 52, 96, 0.5);
  z-index: 1000;
  overflow: hidden;
  transition: all 0.4s ease;
}

.space-support-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(15, 52, 96, 0.7);
}

/* 图标容器 - 包裹所有视觉元素 */
.icon-container {
  position: relative;
  width: 50px;
  height: 50px;
  z-index: 2;
}

/* 宇宙星球 - 背景主体 */
.planet {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 30%, #165DFF 0%, #0A2463 100%);
  box-shadow: inset 0 0 20px rgba(22, 93, 255, 0.6);
  animation: rotate 20s linear infinite;
}

.planet::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.05) 0,
    rgba(255, 255, 255, 0.05) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.3;
}

/* 环绕卫星 - 增强宇宙感 */
.satellite {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #A7B8FF;
  box-shadow: 0 0 10px rgba(167, 184, 255, 0.8);
  top: -5px;
  right: -5px;
  animation: orbit 8s linear infinite;
}

/* 通信信号 - 强化客服功能 */
.communication-signal {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1px solid rgba(22, 93, 255, 0.5);
  opacity: 0;
  animation: pulse 3s infinite;
}

/* 自定义客服图标 - 核心识别元素 */
.custom-avatar {
  position: absolute;
  width: 80%;
  height: 80%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  border-radius: 50%;
  overflow: hidden;
  background-color: #0A1929;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

/* 悬停光晕 - 交互反馈 */
.hover-glow {
  position: absolute;
  width: 150%;
  height: 150%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(22, 93, 255, 0.3) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.space-support-button:hover .hover-glow {
  opacity: 1;
}

/* 动画定义 - 关键帧 */
@keyframes rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes orbit {
  0% { transform: translate(25px, 0) rotate(0deg); }
  100% { transform: translate(25px, 0) rotate(360deg); }
}

@keyframes pulse {
  0% { 
    transform: scale(0.5);
    opacity: 0;
  }
  50% { 
    transform: scale(1.2);
    opacity: 0.8;
  }
  100% { 
    transform: scale(1.5);
    opacity: 0;
  }
}

/* 基础样式变量 */
:root {
  --primary: #3B82F6;
  --secondary: #10B981;
  --accent: #8B5CF6;
  --dark: #0F172A;
  --light: #F8FAFC;
}

.glass {
  backdrop-filter: blur(8px);
  background-color: rgba(15, 23, 42, 0.85);
}

.text-shadow {
  text-shadow: 0 0 8px rgba(59, 130, 246, 0.5), 0 0 16px rgba(59, 130, 246, 0.3);
}

.glow {
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5), 0 0 20px rgba(59, 130, 246, 0.3);
}

/* 自定义按钮样式 */
.custom-join-btn {
  display: block;
  width: 100%;
  padding: 4px 6px;
  text-align: center;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 500;
  font-size: 9px;
  color: white;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  outline: none;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.custom-join-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05), 0 0 15px rgba(59, 130, 246, 0.5);
}

.custom-join-btn:active {
  transform: translateY(0);
}

/* 动画定义 */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

/* 确保内容显示完整 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 彗星背景效果 */
.meteor-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

/* 确保页面内容在彗星之上 */
body > main,
body > footer {
  position: relative;
  z-index: 10;
}

body > nav {
  position: relative;
  z-index: 50;
}

/* 彗星主体 */
.meteor {
  position: absolute;
  width: 4px;
  height: 4px;
  background: radial-gradient(circle, rgba(255, 255, 255, 1) 0%, rgba(108, 92, 231, 0.9) 50%, rgba(0, 206, 255, 0.8) 100%);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(255, 255, 255, 1),
              0 0 24px rgba(108, 92, 231, 0.9),
              0 0 36px rgba(0, 206, 255, 0.7),
              0 0 48px rgba(255, 255, 255, 0.5);
  opacity: 0;
  z-index: 1;
}

/* 彗星主尾部 - 长而明亮，拖在核心后方 */
.meteor::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300px;
  height: 3px;
  background: linear-gradient(to left, 
    rgba(255, 255, 255, 0.95) 0%,
    rgba(108, 92, 231, 0.85) 10%,
    rgba(0, 206, 255, 0.75) 20%,
    rgba(108, 92, 231, 0.65) 35%,
    rgba(0, 206, 255, 0.55) 50%,
    rgba(108, 92, 231, 0.4) 65%,
    rgba(0, 206, 255, 0.3) 80%,
    rgba(108, 92, 231, 0.2) 90%,
    rgba(255, 255, 255, 0.1) 95%,
    transparent 100%);
  transform: translate(-50%, -50%);
  transform-origin: right center;
  filter: blur(0.8px);
  box-shadow: -50px 0 20px rgba(255, 255, 255, 0.4),
              -100px 0 25px rgba(108, 92, 231, 0.35),
              -150px 0 30px rgba(0, 206, 255, 0.3),
              -200px 0 25px rgba(108, 92, 231, 0.2),
              -250px 0 15px rgba(0, 206, 255, 0.15),
              -280px 0 10px rgba(255, 255, 255, 0.1);
  z-index: 0;
}

/* 彗星次尾部 - 更宽更柔和，拖在核心后方 */
.meteor::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 500px;
  height: 2px;
  background: linear-gradient(to left, 
    rgba(0, 206, 255, 0.7) 0%,
    rgba(108, 92, 231, 0.6) 15%,
    rgba(0, 206, 255, 0.5) 30%,
    rgba(108, 92, 231, 0.4) 45%,
    rgba(0, 206, 255, 0.3) 60%,
    rgba(108, 92, 231, 0.25) 75%,
    rgba(0, 206, 255, 0.2) 85%,
    rgba(255, 255, 255, 0.15) 92%,
    transparent 100%);
  transform: translate(-50%, -50%);
  transform-origin: right center;
  filter: blur(2px);
  box-shadow: -100px 0 20px rgba(0, 206, 255, 0.25),
              -200px 0 25px rgba(108, 92, 231, 0.2),
              -300px 0 30px rgba(0, 206, 255, 0.15),
              -400px 0 20px rgba(108, 92, 231, 0.1),
              -480px 0 10px rgba(255, 255, 255, 0.08);
  z-index: -1;
}

/* 彗星飞行动画 - 更慢更优雅 */
@keyframes meteor-fall {
  0% {
    opacity: 0;
    transform: translateY(-150px) translateX(0) rotate(35deg);
  }
  5% {
    opacity: 0.8;
  }
  10% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  95% {
    opacity: 0.6;
  }
  100% {
    opacity: 0;
    transform: translateY(calc(100vh + 300px)) translateX(300px) rotate(35deg);
  }
}

/* 彗星尾部展开动画 */
@keyframes comet-tail-main {
  0% {
    width: 0;
    opacity: 0;
    transform: translate(-50%, -50%);
  }
  8% {
    width: 180px;
    opacity: 0.6;
    transform: translate(-50%, -50%);
  }
  20% {
    width: 260px;
    opacity: 0.95;
    transform: translate(-50%, -50%);
  }
  50% {
    width: 300px;
    opacity: 1;
    transform: translate(-50%, -50%);
  }
  80% {
    width: 320px;
    opacity: 0.9;
    transform: translate(-50%, -50%);
  }
  100% {
    width: 350px;
    opacity: 0;
    transform: translate(-50%, -50%);
  }
}

@keyframes comet-tail-secondary {
  0% {
    width: 0;
    opacity: 0;
    transform: translate(-50%, -50%);
  }
  10% {
    width: 250px;
    opacity: 0.4;
    transform: translate(-50%, -50%);
  }
  25% {
    width: 400px;
    opacity: 0.7;
    transform: translate(-50%, -50%);
  }
  50% {
    width: 500px;
    opacity: 0.85;
    transform: translate(-50%, -50%);
  }
  80% {
    width: 550px;
    opacity: 0.65;
    transform: translate(-50%, -50%);
  }
  100% {
    width: 600px;
    opacity: 0;
    transform: translate(-50%, -50%);
  }
}

.meteor-animate {
  animation: meteor-fall linear forwards;
}

.meteor-animate::before {
  animation: comet-tail-main linear forwards;
}

.meteor-animate::after {
  animation: comet-tail-secondary linear forwards;
}

/* 小彗星样式 */
.meteor-small {
  width: 3px;
  height: 3px;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8),
              0 0 16px rgba(108, 92, 231, 0.6),
              0 0 24px rgba(0, 206, 255, 0.5);
}

.meteor-small::before {
  width: 200px;
  height: 2.5px;
}

.meteor-small::after {
  width: 350px;
  height: 2px;
}

/* 中等彗星样式 */
.meteor-medium {
  width: 4px;
  height: 4px;
  box-shadow: 0 0 12px rgba(255, 255, 255, 1),
              0 0 24px rgba(108, 92, 231, 0.9),
              0 0 36px rgba(0, 206, 255, 0.7);
}

.meteor-medium::before {
  width: 300px;
  height: 3px;
}

.meteor-medium::after {
  width: 500px;
  height: 2px;
}

/* 大彗星样式 */
.meteor-large {
  width: 6px;
  height: 6px;
  box-shadow: 0 0 16px rgba(255, 255, 255, 1),
              0 0 32px rgba(108, 92, 231, 1),
              0 0 48px rgba(0, 206, 255, 0.9),
              0 0 64px rgba(255, 255, 255, 0.5);
}

.meteor-large::before {
  width: 400px;
  height: 4px;
  box-shadow: -60px 0 25px rgba(255, 255, 255, 0.5),
              -120px 0 30px rgba(108, 92, 231, 0.45),
              -200px 0 35px rgba(0, 206, 255, 0.4),
              -280px 0 30px rgba(108, 92, 231, 0.3),
              -360px 0 20px rgba(0, 206, 255, 0.2);
}

.meteor-large::after {
  width: 650px;
  height: 3px;
  box-shadow: -120px 0 25px rgba(0, 206, 255, 0.3),
              -250px 0 30px rgba(108, 92, 231, 0.25),
              -400px 0 35px rgba(0, 206, 255, 0.2),
              -550px 0 25px rgba(108, 92, 231, 0.15),
              -630px 0 15px rgba(255, 255, 255, 0.1);
}

/* 响应式适配 - 手机端 */
@media (max-width: 640px) {
  /* 移动设备整体字体缩小到70% */
  body {
    font-size: 70%;
  }

  .space-support-button {
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
  }
  .icon-container {
    width: 40px;
    height: 40px;
  }
  .satellite {
    width: 8px;
    height: 8px;
  }
  .custom-avatar {
    width: 85%;
    height: 85%;
  }

  /* 移动端减少彗星尾部长度 */
  .meteor {
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8),
                0 0 16px rgba(108, 92, 231, 0.6),
                0 0 24px rgba(0, 206, 255, 0.5);
  }

  .meteor::before {
    width: 150px;
    height: 2.5px;
  }

  .meteor::after {
    width: 280px;
    height: 2px;
  }

  .meteor-small::before {
    width: 120px;
    height: 2px;
  }

  .meteor-small::after {
    width: 220px;
    height: 1.5px;
  }

  .meteor-medium::before {
    width: 220px;
    height: 2.5px;
  }

  .meteor-medium::after {
    width: 380px;
    height: 2px;
  }

  .meteor-large::before {
    width: 300px;
    height: 3px;
  }

  .meteor-large::after {
    width: 480px;
    height: 2.5px;
  }
}

/* 性能优化 - 减少动画（用户偏好） */
@media (prefers-reduced-motion: reduce) {
  .meteor-animate {
    animation: none;
    display: none;
  }
}

