/* 应用动画到网站元素 */

/* 导航栏动画 */
.navbar {
  animation: fadeIn 0.5s ease-out forwards;
}

.navbar .logo {
  transition: all 0.3s ease;
}

.navbar .logo:hover .logo-img {
  animation: pulse 1.2s infinite ease-in-out;
}

.navbar .links .link {
  position: relative;
  overflow: hidden;
}

.navbar .links .link::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--main-color);
  transition: width 0.3s ease;
}

.navbar .links .link:hover::before {
  width: 100%;
}

/* 页面标题动画 */
.section-title, .section-main-title {
  position: relative;
  overflow: hidden;
}

.section-title::after, .section-main-title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--main-color) 0%, rgba(57, 190, 255, 0.5) 100%);
  animation: borderPulse 3s infinite;
}

/* 按钮动画 */
.join-server-btn, .how-to-join, .join-qq, .download-faq-btn, .wiki-faq-btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  background-size: 200% 100%;
}

.join-server-btn:hover, .how-to-join:hover, .join-qq:hover, .download-faq-btn:hover, .wiki-faq-btn:hover {
  transform: translateY(-3px);
  animation: buttonGlow 2s infinite;
}

.join-server-btn::after, .how-to-join::after, .join-qq::after, .download-faq-btn::after, .wiki-faq-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: 0.5s;
}

.join-server-btn:hover::after, .how-to-join:hover::after, .join-qq:hover::after, .download-faq-btn:hover::after, .wiki-faq-btn:hover::after {
  left: 100%;
  animation: shimmer 2s infinite;
}

/* 卡片和面板效果 */
.game, .accordion-item {
  transition: all 0.3s ease;
  transform: translateZ(0);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

/* 修复服务器特性区域 */
.server-features {
  transition: all 0.3s ease;
  transform: translateZ(0);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 15px;
  margin: 15px 0;
  box-shadow: var(--card-shadow);
  border: none; /* 移除边框，避免多余的线条 */
}

.game:hover, .accordion-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--hover-shadow);
  border-color: rgba(57, 190, 255, 0.3);
}

/* Logo动画 */
.logo-img-header {
  animation: float 6s ease-in-out infinite;
  filter: drop-shadow(0 0 10px rgba(57, 190, 255, 0.5));
}

/* 标签动画 */
.tag {
  transition: all 0.3s ease;
}

.tag:hover {
  transform: scale(1.1);
  box-shadow: 0 5px 15px rgba(57, 190, 255, 0.5);
}

/* 特性项目动画 */
.feature-item {
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 8px 0;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
}

.feature-item:hover {
  transform: translateX(5px);
  background: rgba(57, 190, 255, 0.05);
  border-color: rgba(57, 190, 255, 0.3);
}

.feature-item i {
  transition: all 0.3s ease;
  background: rgba(57, 190, 255, 0.1);
  padding: 8px;
  border-radius: 50%;
  margin-right: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 32px;
  height: 32px;
}

.feature-item:hover i {
  transform: scale(1.2);
  color: var(--main-color);
  background: rgba(57, 190, 255, 0.2);
}

.feature-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-grow: 1;
}

.feature-label {
  font-size: 14px;
  color: var(--description-color);
  font-weight: 500;
}

.feature-value {
  font-size: 16px;
  color: var(--white-color);
  font-weight: 600;
}

/* 页面滚动显示动画 */
.scroll-animation {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  will-change: opacity, transform;
}

.scroll-animation.animate {
  opacity: 1;
  transform: translateY(0);
}

.scroll-animation-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  will-change: opacity, transform;
}

.scroll-animation-left.animate {
  opacity: 1;
  transform: translateX(0);
}

.scroll-animation-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  will-change: opacity, transform;
}

.scroll-animation-right.animate {
  opacity: 1;
  transform: translateX(0);
}

/* FAQ手风琴动画 */
.accordion-item-header {
  transition: all 0.3s ease;
  border-radius: 8px;
  background: rgba(57, 190, 255, 0.05);
  border: 1px solid rgba(57, 190, 255, 0.1);
}

.accordion-item-header:hover {
  background: rgba(57, 190, 255, 0.1);
}

.accordion-item-header::after {
  transition: all 0.3s ease;
}

.accordion-item-header.active::after {
  transform: rotate(45deg);
}

.accordion-item-body {
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-top: none;
  border-radius: 0 0 8px 8px;
}

/* 底部社交链接动画 */
#footer .social-icons a {
  transition: all 0.4s ease;
}

#footer .social-icons a:hover {
  transform: translateY(-5px) scale(1.05);
}

#footer .social-icons a i, 
#footer .social-icons a svg {
  transition: all 0.3s ease;
}

#footer .social-icons a:hover i,
#footer .social-icons a:hover svg {
  animation: pulse 1.5s infinite ease-in-out;
}

/* 图像加载效果优化 */
.lazy-image {
  opacity: 0;
  transition: opacity 0.8s ease-in-out, transform 0.8s ease-in-out;
  will-change: opacity, transform;
  transform-origin: center center;
}

/* 图片加载动画样式 */
.image-container {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  background: rgba(36, 39, 43, 0.5);
  min-height: 250px; /* 确保容器有最小高度 */
  transition: all 0.5s ease;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.image-container:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  z-index: 2;
  transition: 0.5s;
}

.image-container.loading:before {
  left: 100%;
  animation: shimmer 2s infinite;
}

.image-container:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
  transform: translateY(-5px) scale(1.02);
  border-color: rgba(57, 190, 255, 0.3);
}

.image-container:hover .game-image {
  transform: scale(1.05);
}

.image-container.loading {
  background: linear-gradient(90deg, rgba(36, 39, 43, 0.6), rgba(36, 39, 43, 0.8), rgba(36, 39, 43, 0.6));
  background-size: 200% 100%;
  animation: shimmerBackground 2s infinite;
}

.image-container.loaded {
  background: transparent;
}

.image-container:after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(57, 190, 255, 0.2) 0%,
    transparent 50%,
    rgba(57, 190, 255, 0.1) 100%
  );
  opacity: 0;
  transition: opacity 0.5s;
  z-index: 1;
  pointer-events: none;
}

.image-container.loaded:after {
  opacity: 0.5;
}

.image-container.loaded:hover:after {
  opacity: 0.8;
}

.game-image {
  width: 100%;
  height: auto;
  display: block;
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform: scale(1);
  z-index: 1;
}

.image-container.loaded .game-image {
  transform: scale(1);
  opacity: 1;
  animation: imageFadeIn 0.8s ease-in-out;
}

.image-container.loading .game-image {
  opacity: 0.15;
  filter: blur(5px);
}

@keyframes shimmerBackground {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

@keyframes imageFadeIn {
  0% {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes loadingPulse {
  0% {
    opacity: 0.6;
    transform: scale(0.98);
  }
  50% {
    opacity: 0.8;
    transform: scale(1);
  }
  100% {
    opacity: 0.6;
    transform: scale(0.98);
  }
}

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

.loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  opacity: 0;
  visibility: hidden;
  z-index: 5;
}

.loading-spinner:before,
.loading-spinner:after {
  content: '';
  position: absolute;
  border-radius: 50%;
}

.loading-spinner:before {
  width: 100%;
  height: 100%;
  border: 4px solid rgba(255, 255, 255, 0.2);
  box-sizing: border-box;
}

.loading-spinner:after {
  width: 100%;
  height: 100%;
  border: 4px solid transparent;
  border-top-color: var(--main-color);
  border-left-color: var(--main-color);
  box-sizing: border-box;
  animation: rotate 1.5s cubic-bezier(0.77, 0, 0.175, 1) infinite;
}

.image-container.loading .loading-spinner {
  opacity: 1;
  visibility: visible;
}

.error-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--red-color);
  font-size: 16px;
  font-weight: bold;
  background: rgba(0, 0, 0, 0.5);
  padding: 8px 16px;
  border-radius: 4px;
  z-index: 5;
  display: none;
}

.image-container.error .error-message {
  display: flex;
  animation: fadeIn 0.5s ease-in-out;
}

.image-container.error {
  background: rgba(255, 124, 124, 0.1);
  border-color: rgba(255, 124, 124, 0.3);
}

/* 修复服务器列表标题区域 */
.section-main-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--main-color) 0%, rgba(57, 190, 255, 0.5) 100%);
  box-shadow: 0 0 10px rgba(57, 190, 255, 0.3);
  animation: none; /* 移除可能冲突的动画 */
}

/* 修复QQ群区域标题 */
#discord .content .section-title {
  margin-bottom: 20px;
  position: relative;
  display: inline-block;
}

#discord .content .section-title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 80px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--main-color) 0%, rgba(57, 190, 255, 0.5) 100%);
  box-shadow: 0 0 10px rgba(57, 190, 255, 0.3);
  animation: none; /* 移除可能冲突的动画 */
}

#discord .content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border: none; /* 移除可能的边框 */
}

/* 修复FAQ区域标题 */
#faq .content .info .section-title {
  position: relative;
  display: inline-block;
  margin-bottom: 20px;
}

#faq .content .info .section-title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 80px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--main-color) 0%, rgba(57, 190, 255, 0.5) 100%);
  box-shadow: 0 0 10px rgba(57, 190, 255, 0.3);
  animation: none; /* 移除可能冲突的动画 */
}

/* 全局修复，移除可能导致边框问题的冲突样式 */
section::after, 
section::before,
.content::after, 
.content::before {
  display: none !important;
  content: none !important;
}

/* 修复section标题下方的线条问题 */
.section-title::after {
  height: 3px !important;
  width: 60px !important;
  bottom: -10px !important;
  background: linear-gradient(90deg, var(--main-color) 0%, rgba(57, 190, 255, 0.5) 100%) !important;
  box-shadow: 0 0 10px rgba(57, 190, 255, 0.3) !important;
  border: none !important;
  border-radius: 2px !important;
  animation: none !important;
} 