/* ============ 基础设置 ============ */
html {
  scroll-behavior: smooth;
}

/* ============ 自定义工具类 ============ */
.content-auto {
  content-visibility: auto;
}

.text-shadow {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.text-shadow-lg {
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.8);
}

.text-shadow-xl {
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9), 0 6px 24px rgba(0, 0, 0, 0.85);
}

.bg-blur {
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.glass {
  background: rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

/* ============ 导航栏 ============ */
#navbar nav {
  background: rgba(26, 31, 44, 0.45);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.nav-logo-text,
.nav-link,
#menu-toggle {
  color: #ffffff;
  transition: color 0.3s ease;
}

#navbar.navbar-scrolled nav {
  background: rgba(255, 255, 255, 0.78);
  border-bottom: 1px solid rgba(26, 31, 44, 0.08);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

#mobile-menu {
  background: rgba(22, 26, 37, 0.92);
}

#navbar.navbar-scrolled #mobile-menu {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

#navbar.navbar-scrolled .nav-logo-text,
#navbar.navbar-scrolled .nav-link,
#navbar.navbar-scrolled #menu-toggle {
  color: #1a1f2c;
}

#navbar.navbar-scrolled #mobile-menu .nav-link {
  color: #1a1f2c;
}

/* ============ QQ群二维码 ============ */
.qr-code {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.qr-code img {
  width: 128px;
  height: 128px;
  object-fit: cover;
  display: block;
}

.qr-code:hover {
  z-index: 20;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.qr-code:hover img {
  width: auto;
  height: auto;
  max-width: 400px;
  max-height: 400px;
  object-fit: contain;
}

/* ============ 版本更新日志（updates.md） ============ */
#changelog h3 {
  font-weight: 700;
  font-size: 1.125rem;
  border-left: 4px solid #e6b800;
  padding: 0.25rem 0 0.25rem 1rem;
  margin-bottom: 0.5rem;
}

#changelog h3:nth-of-type(even) {
  border-color: #333333;
}

#changelog ul {
  list-style: disc;
  padding-left: 1.5rem;
  margin: 0.5rem 0 1.5rem;
  color: #666666;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

#changelog p {
  color: #666666;
}

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

@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-15px);
  }
  100% {
    transform: translateY(0px);
  }
}

/* ============ 首页背景轮播 ============ */
.slideshow {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  animation: slideshow 20s infinite;
}

.slide:nth-child(1) { animation-delay: 0s; }
.slide:nth-child(2) { animation-delay: 5s; }
.slide:nth-child(3) { animation-delay: 10s; }
.slide:nth-child(4) { animation-delay: 15s; }

@keyframes slideshow {
  0% { opacity: 0; }
  8% { opacity: 1; }
  25% { opacity: 1; }
  33% { opacity: 0; }
  100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .slide {
    animation: none;
    opacity: 0;
  }
  .slide:nth-child(1) {
    opacity: 1;
  }
}

/* ============ 无规律漂浮动画 ============ */
.float-1 {
  animation: drift1 8s ease-in-out infinite;
}

.float-2 {
  animation: drift2 9.5s ease-in-out infinite;
}

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

.float-4 {
  animation: drift4 10s ease-in-out infinite;
}

@keyframes drift1 {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(12px, -18px); }
  50% { transform: translate(-14px, -6px); }
  75% { transform: translate(8px, -26px); }
}

@keyframes drift2 {
  0%, 100% { transform: translate(0, 0); }
  30% { transform: translate(-16px, -12px); }
  60% { transform: translate(14px, -28px); }
  85% { transform: translate(-10px, -6px); }
}

@keyframes drift3 {
  0%, 100% { transform: translate(0, 0); }
  40% { transform: translate(14px, -22px); }
  70% { transform: translate(-18px, -4px); }
}

@keyframes drift4 {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-12px, -8px); }
  45% { transform: translate(16px, -30px); }
  65% { transform: translate(-14px, -14px); }
  85% { transform: translate(10px, -24px); }
}

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

::-webkit-scrollbar-track {
  background: #161a25;
}

::-webkit-scrollbar-thumb {
  background: #e6b800;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #c79c00;
}

/* ============ 减少动画偏好 ============ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .animate-float,
  .float-1,
  .float-2,
  .float-3,
  .float-4 {
    animation: none;
  }
}
