/* Global variables for colors */
:root {
  --primary-color: #FF8C1A;
  --secondary-color: #FFA53A;
  --card-bg: #17191F;
  --background-color: #0D0E12;
  --text-main: #FFF3E6;
  --border-color: #A84F0C;
  --glow-color: #FFB04D;
  --deep-orange: #D96800;

  /* Neon dynamic colors - intelligent adaptation */
  --neon-primary: var(--primary-color); /* Orange */
  --neon-secondary: var(--secondary-color); /* Lighter Orange */
  --neon-accent: var(--glow-color); /* Gold/Yellowish */
  
  /* Header offset calculation (Marquee: 44px desktop / 36px mobile) + (Header Top: 68px desktop / 60px mobile) + (Main Nav: 52px desktop / 48px mobile) */
  /* Desktop: 44 + 68 + 52 = 164px. Add 2px for safety = 166px */
  --header-offset: 166px; 
}

/* Mobile header offset (Marquee: 36px mobile) + (Header Top: 60px mobile) + (Mobile Nav Buttons: 48px mobile) + (Main Nav: 0px height when closed) = 144px. Add 2px for safety = 146px */
@media (max-width: 768px) {
  :root { --header-offset: 146px; }
}

body {
  margin: 0;
  font-family: 'Arial', sans-serif;
  color: var(--text-main);
  background-color: var(--background-color);
  line-height: 1.6;
  padding-top: var(--header-offset); /* Mandatory body padding */
  overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Base styles for anchors */
a {
  text-decoration: none;
  color: inherit;
}

/* Keyframe Animations for Neon Effects */
@keyframes marquee-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.9; }
}

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

@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: var(--text-main);
  }
  50% {
    text-shadow: 
      0 0 5px var(--neon-secondary),
      0 0 10px var(--neon-secondary),
      0 0 15px var(--neon-secondary);
    color: var(--text-main);
  }
  100% {
    text-shadow: 
      0 0 5px var(--neon-accent),
      0 0 10px var(--neon-accent),
      0 0 15px var(--neon-accent);
    color: var(--text-main);
  }
}

/* Marquee Section Styling */
.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: var(--text-main);
  overflow: hidden;
  border-bottom: 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),
    0 0 30px var(--neon-primary),
    inset 0 0 20px rgba(255, 140, 26, 0.1); /* Based on primary color */
  z-index: 1001; /* Above header */
  display: flex;
  align-items: center;
}

.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-primary),
    0 0 10px var(--neon-primary),
    0 0 15px var(--neon-primary);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.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;
}

.marquee-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  text-shadow: 
    0 0 5px var(--neon-primary),
    0 0 10px var(--neon-primary),
    0 0 15px var(--neon-primary);
  line-height: 1.5;
  display: inline-block;
  vertical-align: middle;
  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-primary),
    0 0 20px var(--neon-primary),
    0 0 30px var(--neon-primary),
    0 0 40px var(--neon-primary);
  transform: scale(1.05);
  color: var(--text-main);
}

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

/* Site Header Styling */
.site-header {
  position: fixed;
  top: 44px; /* Matches desktop marquee height */
  left: 0;
  width: 100%;
  z-index: 1000; /* Below marquee */
  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 for header-top */
  box-shadow: 
    0 0 10px var(--neon-primary),
    0 0 20px var(--neon-primary),
    0 0 30px var(--neon-primary),
    inset 0 0 20px rgba(255, 140, 26, 0.1); /* Based on primary color */
}

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

/* Logo Styling - NO NEON */
.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--text-main); /* Regular color, not neon */
  text-decoration: none;
  display: block;
  flex-shrink: 0;
}
.logo img {
  display: block;
  max-width: 100%;
  height: auto;
  max-height: 60px; /* Desktop logo height */
  object-fit: contain;
}

/* Hamburger Menu (Mobile Only) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  position: relative;
  width: 40px;
  height: 40px;
  z-index: 1001; /* Above main nav */
}

.hamburger-icon {
  display: block;
  width: 30px;
  height: 3px;
  background-color: var(--text-main);
  margin: 6px 0;
  transition: all 0.3s ease;
  border-radius: 2px;
  /* Neon glow for hamburger icon */
  box-shadow: 
    0 0 5px var(--neon-accent),
    0 0 10px var(--neon-accent);
}

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

/* Desktop Navigation Buttons */
.desktop-nav-buttons {
  display: flex; /* Visible on desktop */
  gap: 15px;
  flex-shrink: 0;
}

/* Mobile Navigation Buttons */
.mobile-nav-buttons {
  display: none; /* Hidden on desktop */
  box-sizing: border-box;
  min-height: 48px; /* Mobile height */
  background-color: var(--card-bg); /* Dark background */
  padding: 10px 20px;
  justify-content: center;
  align-items: center;
  width: 100%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Main Navigation */
.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex; /* Visible on desktop */
  align-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460); /* Distinct dark background */
  border-top: 2px solid;
  border-bottom: 2px solid;
  animation: theme-colors 4s ease-in-out infinite reverse; /* Dynamic border color, reversed animation */
  box-shadow: 
    0 0 10px var(--neon-secondary),
    0 0 20px var(--neon-secondary),
    0 0 30px var(--neon-secondary),
    inset 0 0 20px rgba(255, 165, 58, 0.1); /* Based on secondary color */
}

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

.nav-link {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-main); /* Regular color, not neon */
  padding: 5px 0;
  transition: color 0.3s ease;
  position: relative;
  text-decoration: none;
}

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

/* Buttons Styling */
.btn {
  position: relative;
  background: linear-gradient(180deg, var(--secondary-color) 0%, var(--deep-orange) 100%); /* Custom button gradient */
  padding: 12px 25px;
  color: var(--text-main);
  font-size: 15px;
  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),
    0 0 10px var(--neon-primary);
  transition: all 0.3s ease;
  cursor: pointer;
  white-space: nowrap; /* Prevent text wrapping for desktop buttons */
}

.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),
    0 0 45px var(--neon-primary),
    inset 0 0 15px rgba(255, 140, 26, 0.3);
}

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

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

/* Footer Styling */
.site-footer {
  background-color: var(--background-color); /* Dark background */
  color: var(--text-main);
  padding: 40px 20px 20px;
  font-size: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

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

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.footer-logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--text-main);
  text-decoration: none;
}

.footer-description {
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.7);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.footer-heading {
  font-size: 18px;
  font-weight: bold;
  color: var(--text-main);
  margin-bottom: 15px;
}

.footer-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-nav a {
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.3s ease;
}

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

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.5);
}

/* Footer Slot Anchors (must be present and empty) */
.footer-slot-anchor-inner {
  min-height: 1px; /* Ensure it takes up minimal space if empty */
  width: 100%;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  /* Marquee */
  .marquee-section {
    height: 36px !important; /* Mobile height */
    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 {
    animation: marquee-scroll 25s linear infinite;
  }

  /* Site Header */
  .site-header {
    top: 36px; /* Matches mobile marquee height */
  }

  .header-top {
    min-height: 60px !important; /* Mobile height */
    height: 60px !important;
  }
  .header-container {
    padding: 0 15px;
    /* Mobile logo centering */
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-size: 24px;
  }
  .logo img {
    max-height: 56px !important; /* Mobile logo height */
  }
  
  /* Hamburger menu visible on mobile */
  .hamburger-menu {
    display: block; 
    flex-shrink: 0;
    margin-right: auto; /* Push logo to center */
    order: -1; /* Place it first */
  }

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

  /* Mobile Navigation Buttons (always visible on mobile) */
  .mobile-nav-buttons {
    display: flex !important; /* Visible on mobile */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding-left: 15px;
    padding-right: 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap; /* Prevent wrapping */
  }
  .mobile-nav-buttons .btn {
    flex: 1;
    min-width: 0;
    max-width: calc(50% - 5px); /* Two buttons, with gap */
    padding: 8px 12px; /* Smaller padding */
    font-size: 13px; /* Smaller font size */
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-align: center;
  }

  /* Main Navigation (mobile) */
  .main-nav {
    display: none; /* Hidden by default on mobile */
    position: fixed;
    top: 144px; /* (marquee 36px + header-top 60px + mobile-nav-buttons 48px) */
    left: 0;
    width: 80%; /* Sidebar width */
    max-width: 300px;
    height: calc(100% - 144px); /* Full height below header */
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 20px;
    transform: translateX(-100%); /* Off-screen by default */
    transition: transform 0.3s ease;
    z-index: 1000; /* Above overlay */
    background: linear-gradient(180deg, #1a1a2e, #0a0a0a); /* Dark background */
    border-right: 2px solid;
    animation: theme-colors 4s ease-in-out infinite; /* Dynamic border color */
    box-shadow: 
      5px 0 15px rgba(0,0,0,0.5),
      0 0 10px var(--neon-secondary);
  }
  .main-nav.active {
    display: flex; /* Show when active */
    transform: translateX(0); /* Slide in */
  }
  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    padding: 0;
    width: 100%;
    max-width: none;
  }
  .nav-link {
    width: 100%;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }
  .nav-link:last-child {
    border-bottom: none;
  }

  /* Mobile Overlay */
  .mobile-menu-overlay {
    top: 0; /* Cover entire screen */
    height: 100vh;
    width: 100vw;
  }
  
  /* Footer */
  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column layout */
  }
  .footer-col {
    align-items: center;
    text-align: center;
  }
  .footer-description {
    text-align: center;
  }
}

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