/* Shared CSS for Marquee, Header, and Footer */

/* Base variables for dynamic neon colors */
:root {
  --primary-color: #26A9E0;
  --secondary-color: #FFFFFF;
  --login-color: #EA7C07;

  /* Neon specific colors, derived from primary or vibrant complements */
  --neon-base-1: var(--primary-color); /* Primary blue */
  --neon-base-2: #00ffff; /* Cyan */
  --neon-base-3: #ff00ff; /* Magenta */
  --neon-base-4: #ffff00; /* Yellow */

  /* Header offset calculation */
  --header-offset: 166px; /* Desktop: Marquee(44) + HeaderTop(68) + MainNav(52) = 164px, +2px margin */
}

body {
  margin: 0;
  font-family: 'Arial', sans-serif;
  color: #ffffff;
  background-color: #0a0a0a; /* Dark background for overall site */
  padding-top: var(--header-offset); /* Crucial for fixed header */
  overflow-x: hidden; /* Prevent horizontal scroll from fixed elements */
}

body.no-scroll {
  overflow: hidden;
}

/* Animations for dynamic neon effects */
@keyframes theme-colors {
  0%, 100% {
    border-color: var(--neon-base-1);
    box-shadow:
      0 0 10px var(--neon-base-1),
      0 0 20px var(--neon-base-1);
  }
  33% {
    border-color: var(--neon-base-2);
    box-shadow:
      0 0 10px var(--neon-base-2),
      0 0 20px var(--neon-base-2);
  }
  66% {
    border-color: var(--neon-base-3);
    box-shadow:
      0 0 10px var(--neon-base-3),
      0 0 20px var(--neon-base-3);
  }
}

@keyframes text-glow-flow {
  0% {
    text-shadow:
      0 0 5px var(--neon-base-1),
      0 0 10px var(--neon-base-1),
      0 0 15px var(--neon-base-1);
    color: #ffffff;
  }
  33% {
    text-shadow:
      0 0 5px var(--neon-base-2),
      0 0 10px var(--neon-base-2),
      0 0 15px var(--neon-base-2);
    color: #ffffff;
  }
  66% {
    text-shadow:
      0 0 5px var(--neon-base-3),
      0 0 10px var(--neon-base-3),
      0 0 15px var(--neon-base-3);
    color: #ffffff;
  }
  100% {
    text-shadow:
      0 0 5px var(--neon-base-1),
      0 0 10px var(--neon-base-1),
      0 0 15px var(--neon-base-1);
    color: #ffffff;
  }
}

/* Marquee Section Styles */
.marquee-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 44px; /* Desktop height */
  box-sizing: border-box;
  background: linear-gradient(135deg, #0a0a0a, #1a1a2e, #16213e); /* Dark background */
  color: #ffffff;
  overflow: hidden;
  border-bottom: 2px solid;
  animation: theme-colors 4s ease-in-out infinite; /* Dynamic border color */
  box-shadow:
    0 0 10px var(--neon-base-1),
    0 0 20px var(--neon-base-1),
    0 0 30px var(--neon-base-1),
    inset 0 0 20px rgba(38, 169, 224, 0.1); /* Based on primary color */
  z-index: 1001; /* Above header */
}

.marquee-container {
  width: 100%;
  max-width: 100%;
  height: 100%;
  margin: 0 auto;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 0 20px;
  box-sizing: border-box;
}

.marquee-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  z-index: 2;
  position: relative;
}

.marquee-icon-emoji {
  font-size: 24px;
  display: inline-block;
  animation: marquee-pulse 2s ease-in-out infinite, text-glow-flow 3s ease-in-out infinite alternate;
  text-shadow:
    0 0 5px var(--neon-base-1),
    0 0 10px var(--neon-base-1),
    0 0 15px var(--neon-base-1);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

@keyframes marquee-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.9; }
}

.marquee-wrapper {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.marquee-content {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  animation: marquee-scroll 30s linear infinite;
  gap: 30px;
  padding-right: 30px; /* Ensure space before content repeats */
}

.marquee-text {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  text-decoration: none;
  animation: text-glow-flow 3s ease-in-out infinite alternate;
  cursor: pointer;
  transition: all 0.3s ease;
}

.marquee-text:hover {
  text-shadow:
    0 0 10px var(--neon-base-1),
    0 0 20px var(--neon-base-1),
    0 0 30px var(--neon-base-1),
    0 0 40px var(--neon-base-1);
  transform: scale(1.05);
  color: #ffffff;
}

.marquee-separator {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0 15px;
  text-shadow:
    0 0 3px var(--neon-base-1),
    0 0 6px var(--neon-base-1);
}

@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Header Section Styles */
.site-header {
  position: fixed;
  top: 44px; /* Below marquee */
  left: 0;
  width: 100%;
  z-index: 1000; /* Below marquee */
  box-sizing: border-box;
}

.header-top {
  box-sizing: border-box;
  min-height: 68px; /* Desktop height */
  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;
  box-shadow:
    0 0 10px var(--neon-base-2), /* Different color for contrast */
    0 0 20px var(--neon-base-2),
    0 0 30px var(--neon-base-2),
    inset 0 0 20px rgba(0, 255, 255, 0.1);
}

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

.logo {
  color: var(--secondary-color); /* White for clear contrast, no neon */
  font-size: 24px;
  font-weight: bold;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  /* NO NEON EFFECTS ON LOGO */
}
.logo img {
  display: block;
  max-height: 60px;
  height: auto;
  width: auto;
  max-width: 280px;
  object-fit: contain;
  /* NO NEON EFFECTS ON LOGO */
}

.desktop-nav-buttons {
  display: flex; /* Always flex on desktop */
  gap: 10px;
  flex-shrink: 0;
}

/* Main Navigation Styles */
.main-nav {
  box-sizing: border-box;
  min-height: 52px; /* Desktop height */
  height: 52px;
  display: flex; /* Desktop default: visible, horizontal */
  align-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460); /* Different dark background */
  border-top: 2px solid;
  border-bottom: 2px solid;
  animation: theme-colors 4s ease-in-out infinite reverse; /* Dynamic border color, reversed for contrast */
  box-shadow:
    0 0 10px var(--neon-base-3), /* Different color for contrast */
    0 0 20px var(--neon-base-3),
    0 0 30px var(--neon-base-3),
    inset 0 0 20px rgba(255, 0, 255, 0.1);
}

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

.nav-link {
  color: #ffffff; /* Regular white text for nav links, not neon */
  text-decoration: none;
  padding: 10px 15px;
  font-size: 16px;
  font-weight: 500;
  transition: color 0.3s ease, background-color 0.3s ease;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color); /* Primary blue on hover/active */
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

/* Hamburger Menu (Mobile Only) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 24px;
  cursor: pointer;
  z-index: 1002; /* Above logo on mobile */
  position: relative;
  margin-right: 15px; /* Space between hamburger and logo */
}

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

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

/* Mobile Nav Buttons (Desktop Hidden, Mobile Visible) */
.mobile-nav-buttons {
  display: none; /* Hidden on desktop */
}

/* Mobile Menu Overlay (Hidden on Desktop) */
.mobile-menu-overlay {
  display: none; /* Hidden on desktop */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 999; /* Below mobile menu, above content */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Button Styles (Neon) */
.btn {
  position: relative;
  background: linear-gradient(135deg, var(--neon-base-1), var(--neon-base-2)); /* Dynamic gradient */
  padding: 12px 20px;
  color: #ffffff;
  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 #ffffff,
    0 0 10px var(--neon-base-1);
  transition: all 0.3s ease;
  font-weight: 600;
  white-space: nowrap; /* Prevent text wrapping on desktop */
  box-sizing: border-box;
  font-size: 15px; /* Adjust font size to fit */
}

.btn:hover {
  animation-duration: 2s; /* Faster color change on hover */
  transform: translateY(-2px);
  box-shadow:
    0 0 15px var(--neon-base-1),
    0 0 30px var(--neon-base-1),
    inset 0 0 15px rgba(38, 169, 224, 0.5);
}

/* Footer Styles (Regular, no neon) */
.site-footer {
  background-color: #1a1a1a; /* Dark background */
  color: #cccccc;
  padding: 40px 20px 20px;
  font-size: 14px;
  line-height: 1.6;
  box-sizing: border-box;
}

.site-footer a {
  color: #ffffff;
  text-decoration: none;
  transition: color 0.3s ease;
}

.site-footer a:hover {
  color: var(--primary-color); /* Use primary color on hover */
}

.footer-top-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto 30px;
}

.footer-col h3 {
  color: #ffffff;
  font-size: 18px;
  margin-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
}

.footer-logo {
  color: var(--primary-color); /* Primary color for footer logo */
  font-size: 24px;
  font-weight: bold;
  text-decoration: none;
  display: block;
  margin-bottom: 15px;
}

.footer-description {
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.6;
  color: #cccccc;
}

.footer-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

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

.footer-nav a {
  color: #cccccc;
  display: block;
}

/* Dynamic slot styling for footer */
.footer-dynamic-col .footer-slot-anchor-inner,
.footer-dynamic-row .footer-slot-anchor-inner {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px; /* For mid rows */
  width: 100%;
}
.footer-dynamic-col .footer-slot-anchor-inner {
  gap: 5px; /* For col 4 */
}
.footer-dynamic-col .footer-slot-anchor-inner img,
.footer-dynamic-row .footer-slot-anchor-inner img {
  max-height: 50px;
  height: auto;
  width: auto;
  object-fit: contain;
}

.footer-legal-links {
  max-width: 1200px;
  margin: 0 auto 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
}

.footer-legal-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-legal-nav a {
  color: #999999;
  font-size: 13px;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  color: #999999;
  font-size: 13px;
}

/* Responsive Design */
@media (max-width: 768px) {
  :root {
    --header-offset: 146px; /* Mobile: Marquee(36) + HeaderTop(60) + MobileNavButtons(48) = 144px, +2px margin */
  }

  /* Mobile Marquee */
  .marquee-section {
    height: 36px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }
  .marquee-container {
    gap: 10px !important;
    padding: 0 12px !important;
  }
  .marquee-icon {
    width: 20px !important;
    height: 20px !important;
  }
  .marquee-icon-emoji {
    font-size: 14px !important;
  }
  .marquee-text {
    font-size: 14px !important;
  }
  .marquee-separator {
    font-size: 14px !important;
    margin: 0 10px !important;
  }
  .marquee-content {
    gap: 20px;
    animation: marquee-scroll 25s linear infinite;
  }

  /* Mobile Header */
  .site-header {
    top: 36px; /* Below mobile marquee */
  }

  .header-top {
    min-height: 60px !important;
    height: 60px !important;
  }
  .header-container {
    width: 100%;
    max-width: none; /* Important for mobile full width */
    padding: 0 15px;
    justify-content: flex-start; /* Align hamburger left */
  }

  .hamburger-menu {
    display: flex; /* Show hamburger on mobile */
    order: 0; /* Place hamburger first */
  }

  .logo {
    flex: 1 !important; /* Allow logo to take remaining space */
    display: flex !important;
    justify-content: center !important; /* Center logo horizontally */
    align-items: center !important;
    order: 1; /* Place logo after hamburger */
    font-size: 20px;
    margin-left: -30px; /* Counteract hamburger pushing it right */
  }
  .logo img {
    max-height: 40px !important; /* Smaller logo on mobile */
  }

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

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px 15px;
    overflow: hidden;
    gap: 10px;
    justify-content: center;
    flex-wrap: nowrap; /* Ensure buttons stay in one row */
    background: linear-gradient(135deg, #0f3460, #16213e, #1a1a2e); /* Dark background for button row */
    border-bottom: 2px solid;
    animation: theme-colors 4s ease-in-out infinite;
    box-shadow:
      0 0 8px var(--neon-base-1),
      0 0 16px var(--neon-base-1),
      inset 0 0 10px rgba(38, 169, 224, 0.1);
  }
  .mobile-nav-buttons .btn {
    flex: 1;
    min-width: 0;
    max-width: calc(50% - 5px); /* Half width minus gap */
    padding: 8px 12px; /* Smaller padding */
    font-size: 13px; /* Smaller font */
    text-align: center;
    white-space: normal; /* Allow wrapping */
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .main-nav {
    min-height: auto !important; /* Height handled by content */
    height: auto !important;
    position: fixed; /* Fixed for mobile drawer */
    top: var(--header-offset); /* Below header + mobile buttons */
    left: 0;
    width: 100%;
    max-width: 300px; /* Drawer width */
    transform: translateX(-100%); /* Hidden by default */
    transition: transform 0.3s ease;
    flex-direction: column; /* Vertical links */
    justify-content: flex-start;
    align-items: flex-start;
    padding: 20px 0;
    background-color: #1a1a2e; /* Solid dark background for menu */
    border-right: 2px solid;
    animation: theme-colors 4s ease-in-out infinite;
    box-shadow:
      0 0 10px var(--neon-base-1),
      0 0 20px var(--neon-base-1),
      inset 0 0 20px rgba(38, 169, 224, 0.1);
    z-index: 1000; /* Above overlay */
    display: none; /* Hidden by default, JS toggles 'active' */
  }
  .main-nav.active {
    transform: translateX(0); /* Show menu */
    display: flex; /* Make it visible */
  }
  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 0 15px;
    width: 100%;
    max-width: none;
  }
  .nav-link {
    width: 100%;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }
  .nav-link:last-child {
    border-bottom: none;
  }

  /* Mobile Footer */
  .site-footer {
    padding: 30px 15px 15px;
  }
  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column layout */
    margin-bottom: 20px;
  }
  .footer-col {
    margin-bottom: 20px;
  }
  .footer-col:last-child {
    margin-bottom: 0;
  }
  .footer-legal-links {
    margin-bottom: 15px;
    padding-top: 15px;
  }
  .footer-legal-nav {
    flex-direction: column;
    gap: 8px;
  }

  /* 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;
  }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
