/* General Resets & Base Styles */
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: 'Arial', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main-color);
  line-height: 1.6;
  overflow-x: hidden; /* Prevent horizontal scroll */
  padding-top: var(--header-offset); /* Ensure content is not hidden by fixed header */
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Color Variables and Dynamic Neon Animations */
:root {
  /* Site Base Colors */
  --primary-color: #11A84E;
  --secondary-color: #22C768;
  --bg-color: #08160F;
  --card-bg-color: #11271B;
  --text-main-color: #F2FFF6;
  --text-secondary-color: #A7D9B8;
  --border-color: #2E7A4E;
  --glow-color: #57E38D;
  --gold-color: #F2C14E;
  --divider-color: #1E3A2A;
  --deep-green-color: #0A4B2C;
  --button-gradient: linear-gradient(180deg, #2AD16F 0%, #13994A 100%);

  /* Neon Dynamic Colors - based on site primary/secondary/accent */
  --neon-primary: var(--glow-color); /* Using Glow for primary neon */
  --neon-secondary: var(--secondary-color);
  --neon-accent: var(--gold-color); /* Using Gold for accent neon */
  
  /* Header Offset - calculated based on marquee + header-top + main-nav */
  /* Desktop: Marquee(44) + HeaderTop(68) + MainNav(52) = 164px. Use 166px. */
  --header-offset: 166px; 
}

@media (max-width: 768px) {
  /* Mobile: Marquee(36) + HeaderTop(60) + MainNav(48) = 144px. Use 146px. */
  :root { --header-offset: 146px; }
}

/* Dynamic Neon Glow Animations */
@keyframes rainbow-border {
  0% { border-color: #ff0000; box-shadow: 0 0 10px #ff0000, 0 0 20px #ff0000; }
  16.6% { border-color: #ff8000; box-shadow: 0 0 10px #ff8000, 0 0 20px #ff8000; }
  33.3% { border-color: #ffff00; box-shadow: 0 0 10px #ffff00, 0 0 20px #ffff00; }
  50% { border-color: #00ff00; box-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00; }
  66.6% { border-color: #0000ff; box-shadow: 0 0 10px #0000ff, 0 0 20px #0000ff; }
  83.3% { border-color: #8000ff; box-shadow: 0 0 10px #8000ff, 0 0 20px #8000ff; }
  100% { border-color: #ff0000; box-shadow: 0 0 10px #ff0000, 0 0 20px #ff0000; }
}

@keyframes hue-spin {
  0% { filter: hue-rotate(0deg); box-shadow: 0 0 10px var(--neon-primary), 0 0 20px var(--neon-primary); }
  100% { filter: hue-rotate(360deg); box-shadow: 0 0 10px var(--neon-primary), 0 0 20px var(--neon-primary); }
}

@keyframes alternate-colors {
  0% { border-color: var(--neon-primary); box-shadow: 0 0 10px var(--neon-primary), 0 0 20px var(--neon-primary); }
  100% { border-color: var(--neon-secondary); box-shadow: 0 0 10px var(--neon-secondary), 0 0 20px var(--neon-secondary); }
}

@keyframes gradient-flow {
  0% { background-position: 0% 50%; box-shadow: 0 0 10px #ff0000, 0 0 20px #ff8000; }
  50% { background-position: 100% 50%; box-shadow: 0 0 10px #00ffff, 0 0 20px #0000ff; }
  100% { background-position: 0% 50%; box-shadow: 0 0 10px #ff0000, 0 0 20px #ff8000; }
}

@keyframes random-glow {
  0% { border-color: #ff00ff; box-shadow: 0 0 20px #ff00ff; }
  20% { border-color: #00ffff; box-shadow: 0 0 20px #00ffff; }
  40% { border-color: #ffff00; box-shadow: 0 0 20px #ffff00; }
  60% { border-color: #00ff00; box-shadow: 0 0 20px #00ff00; }
  80% { border-color: #ff0000; box-shadow: 0 0 20px #ff0000; }
  100% { border-color: #ff00ff; box-shadow: 0 0 20px #ff00ff; }
}

@keyframes theme-colors {
  0%, 100% {
    border-color: var(--neon-primary);
    box-shadow: 
      0 0 10px var(--neon-primary),
      0 0 20px var(--neon-primary);
  }
  33% {
    border-color: var(--neon-secondary);
    box-shadow: 
      0 0 10px var(--neon-secondary),
      0 0 20px var(--neon-secondary);
  }
  66% {
    border-color: var(--neon-accent);
    box-shadow: 
      0 0 10px var(--neon-accent),
      0 0 20px var(--neon-accent);
  }
}

@keyframes text-glow-flow {
  0% {
    text-shadow: 
      0 0 5px var(--neon-primary),
      0 0 10px var(--neon-primary),
      0 0 15px var(--neon-primary);
    color: #ffffff;
  }
  50% {
    text-shadow: 
      0 0 5px var(--neon-secondary),
      0 0 10px var(--neon-secondary),
      0 0 15px var(--neon-secondary);
    color: #ffffff;
  }
  100% {
    text-shadow: 
      0 0 5px var(--neon-accent),
      0 0 10px var(--neon-accent),
      0 0 15px var(--neon-accent);
    color: #ffffff;
  }
}

/* Header Styles */
.site-header {
  position: fixed;
  top: 44px; /* Matches marquee height */
  left: 0;
  width: 100%;
  z-index: 1000; /* Below marquee */
  background: linear-gradient(135deg, #0a0a0a, #1a1a2e, #16213e); /* Dark background */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  border-bottom: 2px solid;
  animation: theme-colors 4s ease-in-out infinite; /* Dynamic border color */
  box-sizing: border-box;
}

.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, #0a0a0a, #1a1a2e, #16213e); /* Dark background */
  border-bottom: 2px solid;
  animation: theme-colors 4s ease-in-out infinite; /* Dynamic border color */
  box-shadow: 
    0 0 5px var(--neon-primary),
    0 0 10px var(--neon-primary),
    0 0 15px var(--neon-primary);
}

.header-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px; /* Padding for logo and buttons */
  box-sizing: border-box;
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--text-main-color); /* Regular color, no neon */
  text-decoration: none;
  /* 🚨 LOGO 不使用霓虹灯效果 */
  text-shadow: none;
  box-shadow: none;
  filter: none;
  transition: none;
}
.logo img {
  display: block;
  max-width: 100%;
  height: auto;
  max-height: 60px; /* Desktop logo max height */
  object-fit: contain;
  /* 🚨 LOGO 图片不使用霓虹灯效果 */
  box-shadow: none;
  filter: none;
  transition: none;
}

.hamburger-menu {
  display: none; /* Hidden on desktop */
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 25px;
  cursor: pointer;
  z-index: 1001; /* Above logo on mobile */
  position: relative;
}

.hamburger-menu .bar {
  width: 100%;
  height: 3px;
  background-color: var(--neon-primary); /* Neon color for bars */
  transition: all 0.3s ease;
  border-radius: 2px;
  box-shadow: 
    0 0 3px var(--neon-primary),
    0 0 6px var(--neon-primary); /* Neon glow for bars */
}

.hamburger-menu.active .bar:nth-child(1) {
  transform: translateY(11px) rotate(45deg);
}
.hamburger-menu.active .bar:nth-child(2) {
  opacity: 0;
}
.hamburger-menu.active .bar:nth-child(3) {
  transform: translateY(-11px) rotate(-45deg);
}

/* Desktop Buttons */
.desktop-nav-buttons {
  display: flex; /* Visible on desktop */
  gap: 10px;
  align-items: center;
}

/* Mobile Buttons (hidden on desktop) */
.mobile-nav-buttons {
  display: none; /* Hidden on desktop by default */
  box-sizing: border-box;
  min-height: 48px;
  height: auto; /* Allow height to adjust if text wraps */
  background: linear-gradient(135deg, #16213e, #1a1a2e, #0a0a0a); /* Different dark background */
  border-bottom: 2px solid;
  animation: alternate-colors 3s ease-in-out infinite; /* Different dynamic border color */
  box-shadow: 
    0 0 5px var(--neon-secondary),
    0 0 10px var(--neon-secondary);
  padding: 8px 15px;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap; /* Prevent wrapping */
}

/* Main Navigation */
.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex; /* Desktop default: flex */
  align-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a2e, #16213e, #0a0a0a); /* Different dark background */
  border-bottom: 2px solid;
  animation: hue-spin 4s linear infinite; /* Different dynamic border color */
  box-shadow: 
    0 0 5px var(--neon-accent),
    0 0 10px var(--neon-accent),
    0 0 15px var(--neon-accent);
}

.nav-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 25px;
  padding: 0 20px;
  box-sizing: border-box;
}

.nav-link {
  color: var(--text-main-color); /* Regular color, no neon */
  font-weight: 500;
  padding: 8px 0;
  transition: color 0.3s ease;
  position: relative;
  text-shadow: none; /* No neon text shadow for nav links */
}

.nav-link:hover {
  color: var(--neon-primary); /* Simple hover effect */
}

/* Buttons */
.btn {
  position: relative;
  background: var(--button-gradient); /* Custom button gradient */
  padding: 10px 20px; /* Desktop padding */
  color: var(--text-main-color);
  font-weight: bold;
  text-decoration: none;
  border-radius: 5px;
  border: 2px solid;
  animation: theme-colors 4s ease-in-out infinite; /* Dynamic border color */
  text-shadow: 
    0 0 5px var(--text-main-color),
    0 0 10px var(--neon-primary); /* Glow for button text */
  transition: all 0.3s ease;
  cursor: pointer;
  white-space: nowrap; /* Prevent text wrap on desktop */
}

.btn:hover {
  animation-duration: 2s; /* Faster animation on hover */
  transform: translateY(-2px);
  box-shadow: 
    0 0 15px var(--neon-primary),
    0 0 30px var(--neon-primary),
    inset 0 0 15px rgba(102, 126, 234, 0.4);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 999; /* Below main nav */
  display: none; /* Hidden by default */
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
  display: block;
  opacity: 1;
}

/* Footer Styles */
.site-footer {
  background-color: var(--card-bg-color); /* Regular dark background */
  color: var(--text-secondary-color);
  padding: 40px 20px 20px;
  font-size: 14px;
  border-top: 1px solid var(--divider-color);
}

.footer-top-grid {
  display: flex;
  flex-direction: column; /* Default to column for mobile */
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* Desktop 4 columns */
  gap: 30px;
}

.footer-col h3 {
  color: var(--text-main-color);
  font-size: 16px;
  margin-bottom: 15px;
}

.footer-logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--text-main-color);
  margin-bottom: 15px;
  display: inline-block;
}

.footer-description {
  line-height: 1.8;
  color: var(--text-secondary-color);
  word-wrap: break-word; /* Ensure full display */
  overflow-wrap: break-word;
}

.footer-nav li {
  margin-bottom: 8px;
}

.footer-nav a {
  color: var(--text-secondary-color);
  transition: color 0.3s ease;
}

.footer-nav a:hover {
  color: var(--primary-color);
}

.footer-bottom {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--divider-color);
  color: var(--text-secondary-color);
  /* 🚨 .footer-bottom 内禁止任何 <a> */
  display: block; /* Ensure it's not flex and contains no links */
}

.footer-bottom p {
  margin: 0;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  /* Header adjustments */
  .site-header {
    top: 36px; /* Matches mobile marquee height */
  }

  .header-top {
    min-height: 60px !important;
    height: 60px !important;
    padding: 0 15px;
  }

  .header-container {
    padding: 0;
    justify-content: space-between;
    position: relative;
  }

  .hamburger-menu {
    display: flex; /* Show hamburger on mobile */
    position: relative;
    z-index: 1002;
  }

  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-size: 24px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 100px); /* Leave space for hamburger and potential right element */
  }

  .logo img {
    max-height: 56px !important; /* Mobile logo max height */
  }

  .desktop-nav-buttons {
    display: none !important; /* Hide desktop buttons on mobile */
  }

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 8px 15px;
    gap: 10px;
    flex-wrap: nowrap; /* Ensure buttons stay in one line */
    justify-content: center;
  }

  .mobile-nav-buttons .btn {
    flex: 1;
    min-width: 0;
    max-width: calc(50% - 5px); /* Max width for two buttons with 10px gap */
    padding: 8px 12px;
    font-size: 13px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-align: center;
  }

  .main-nav {
    display: none; /* Hidden by default on mobile */
    position: fixed;
    top: var(--header-offset); /* Below the header */
    left: 0;
    width: 250px; /* Mobile menu width */
    height: calc(100% - var(--header-offset)); /* Full height below header */
    flex-direction: column;
    background: var(--card-bg-color); /* Menu background */
    transform: translateX(-100%); /* Start off-screen */
    transition: transform 0.3s ease-in-out;
    z-index: 1000; /* Above overlay */
    overflow-y: auto; /* Scrollable if many links */
    border-right: 2px solid;
    animation: theme-colors 4s ease-in-out infinite; /* Dynamic border color */
    box-shadow: 
      0 0 10px var(--neon-primary),
      0 0 20px var(--neon-primary);
  }

  .main-nav.active {
    display: flex; /* Show menu when active */
    transform: translateX(0); /* Slide into view */
  }

  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    width: 100%;
    max-width: none;
    gap: 15px;
  }

  .nav-link {
    width: 100%;
    padding: 10px 0;
    border-bottom: 1px solid var(--divider-color);
  }
  .nav-link:last-child {
    border-bottom: none;
  }

  /* Footer adjustments */
  .site-footer {
    padding: 30px 15px 15px;
  }
  .footer-cols {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 20px;
  }
  .footer-col h3 {
    margin-top: 20px;
  }
  .footer-bottom {
    margin-top: 30px;
    padding-top: 15px;
  }

  /* Mobile content overflow protection */
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: hidden;
  }
}

/* Body no-scroll for mobile menu */
body.no-scroll {
  overflow: hidden;
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@media (max-width: 768px) {
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: hidden;
  }
}
