:root {
  --header-offset: 122px; /* Desktop: 68px (top bar assumed) + 52px (main nav) = 120px + 2px buffer */
  --primary-color: #F2C14E;
  --secondary-color: #FFD36B;
  --button-gradient: linear-gradient(180deg, #FFD86A 0%, #DDA11D 100%);
  --card-bg: #111111;
  --background-color: #0A0A0A;
  --text-main-color: #FFF6D6;
  --border-color: #3A2A12;
  --glow-color: #FFD36B;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding-top: var(--header-offset); /* Critical for fixed header */
  background-color: var(--background-color);
  color: var(--text-main-color);
  overflow-x: hidden; /* Prevent horizontal scroll on body */
}

/* Header Styles */
.site-header {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: var(--background-color); /* Solid background */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); /* Suspended effect */
  z-index: 1000;
  min-height: 70px; /* Ensure content adaptation */
  display: flex;
  align-items: center;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 30px; /* Adjusted padding for better fit */
  display: flex;
  align-items: center;
  width: 100%; /* Ensure it takes full width within max-width */
  box-sizing: border-box; /* Include padding in width */
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--primary-color);
  text-decoration: none;
  flex-shrink: 0;
  margin-right: 20px; /* Space between logo and nav */
  display: block; /* Ensure logo is visible */
}

.hamburger-menu {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  font-size: 30px;
  color: var(--primary-color);
  cursor: pointer;
  padding: 5px;
  line-height: 1;
  flex-shrink: 0;
}

.main-nav {
  flex: 1;
  display: flex; /* Desktop: horizontal */
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 25px;
  padding: 0;
  margin: 0;
}

.main-nav .nav-link {
  color: var(--text-main-color);
  text-decoration: none;
  font-size: 17px;
  padding: 8px 12px;
  transition: color 0.3s ease, background-color 0.3s ease;
  border-radius: 5px;
  white-space: nowrap; /* Prevent wrapping */
}

.main-nav .nav-link:hover {
  color: var(--primary-color);
  background-color: rgba(255, 255, 255, 0.08); /* Subtle hover effect */
}

.desktop-nav-buttons {
  margin-left: auto;
  display: flex; /* Visible on desktop */
  gap: 10px;
  flex-shrink: 0;
}

.mobile-nav-buttons {
  display: none !important; /* Hidden on desktop, critical override */
}

.btn {
  background: var(--button-gradient);
  color: var(--border-color); /* Dark text for light gradient */
  padding: 10px 20px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: bold;
  font-size: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4), 0 0 15px var(--glow-color);
}

.mobile-menu-overlay {
  display: none; /* Hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 998; /* Below menu, above content */
  transition: opacity 0.3s ease;
  opacity: 0;
  pointer-events: none; /* Allow interaction with elements below when hidden */
}

.mobile-menu-overlay.active {
  display: block;
  opacity: 1;
  pointer-events: auto; /* Enable interaction when active */
}

/* Footer Styles */
.site-footer {
  background-color: var(--background-color);
  color: var(--text-main-color);
  padding: 40px 20px 20px;
  border-top: 1px solid var(--border-color);
}

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

.footer-col h3 {
  color: var(--primary-color);
  font-size: 18px;
  margin-bottom: 15px;
}

.footer-col p {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 10px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.footer-col a {
  color: var(--text-main-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

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

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

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

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 246, 214, 0.7);
  border-top: 1px solid rgba(58, 42, 18, 0.5);
  padding-top: 20px;
  margin-top: 20px;
}

/* Dynamic Slot Anchors (must remain empty) */
.footer-slot-anchor, .footer-slot-anchor-inner {
  /* These elements are for backend injection and should not be styled to hide content */
}


/* Mobile Styles */
@media (max-width: 768px) {
  :root {
    --header-offset: 110px; /* Mobile: 60px (top bar assumed) + 48px (main nav) = 108px + 2px buffer */
  }

  body {
    padding-top: var(--header-offset);
    overflow-x: hidden; /* Ensure body overflow is hidden */
  }

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

  .site-header {
    min-height: 60px; /* Adjusted for mobile */
  }

  .header-container {
    width: 100%;
    max-width: none; /* Critical: no max-width on mobile */
    padding: 10px 15px; /* Adjusted padding */
    justify-content: space-between; /* Space out items */
  }

  .hamburger-menu {
    display: block; /* Visible on mobile */
    order: 0; /* Leftmost */
    margin-right: 10px;
  }

  .logo {
    flex: 1 !important; /* Allow logo to take available space */
    text-align: center; /* Center text logo */
    font-size: 24px;
    order: 1; /* Middle */
    margin-right: 0; /* Remove right margin from desktop */
    display: flex !important; /* For flex-based centering of potential image logo */
    justify-content: center !important;
    align-items: center !important;
  }

  .logo img { /* If logo is an image */
    display: block !important;
    max-width: 100%;
    height: auto;
    max-height: 40px;
  }

  .main-nav {
    display: none; /* Hidden by default on mobile */
    flex-direction: column; /* Vertical for mobile menu */
    position: fixed;
    top: var(--header-offset); /* Position below fixed header */
    left: 0;
    width: 280px; /* Sidebar width */
    height: calc(100% - var(--header-offset)); /* Full height below header */
    background-color: var(--card-bg); /* Use a darker background for the menu */
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.5);
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    transform: translateX(-100%); /* Off-screen by default */
    transition: transform 0.3s ease;
    z-index: 999; /* Below overlay, above content */
    align-items: flex-start; /* Align menu items to the left */
    gap: 10px;
  }

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

  .main-nav .nav-link {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .main-nav .nav-link:last-child {
    border-bottom: none;
  }

  .desktop-nav-buttons {
    display: none !important; /* Hidden on mobile, critical override */
  }

  .mobile-nav-buttons {
    display: flex !important; /* Visible on mobile, critical override */
    order: 2; /* Rightmost */
    gap: 8px;
  }

  .mobile-nav-buttons .btn {
    padding: 8px 15px;
    font-size: 14px;
    border-radius: 20px;
  }

  .footer-content-wrapper {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 20px;
  }

  .footer-col {
    text-align: center; /* Center footer content */
  }

  .footer-nav ul {
    display: flex;
    flex-direction: column;
    align-items: center; /* Center list items */
  }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
