:root {
  --primary-color: #2F6BFF;
  --auxiliary-color: #6FA3FF;
  --button-gradient: linear-gradient(180deg, #4A8BFF 0%, #2F6BFF 100%);
  --card-bg-color: #FFFFFF;
  --page-bg-color: #F4F7FB;
  --text-main-color: #1F2D3D;
  --border-color: #D6E2FF;
  --glow-color: #A5C4FF;
  --header-offset: 122px; /* Desktop: 68px (header-top) + 52px (main-nav) = 120px, +2px buffer */
}

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

a {
  text-decoration: none;
  color: var(--primary-color);
}

a:hover {
  color: var(--auxiliary-color);
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  background-color: var(--card-bg-color); /* Neutral background for the whole header container, specific sections will override */
}

/* Header Top Section (Logo + Desktop Buttons) */
.header-top {
  box-sizing: border-box;
  height: 68px; /* Desktop fixed height */
  display: flex;
  align-items: center;
  background-color: var(--primary-color); /* Darker color for top bar */
  color: #FFFFFF;
  overflow: hidden;
}

.header-top a {
  color: #FFFFFF;
}

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

.logo {
  font-size: 24px;
  font-weight: bold;
  text-transform: uppercase;
  color: #FFFFFF;
  display: block; /* Ensure it's not inline for flex behavior */
}

/* Image logo styling if applicable */
.logo img {
  display: block;
  max-height: 60px; /* Desktop max height */
  height: auto;
  width: auto;
  max-width: 280px;
  object-fit: contain;
}

.desktop-nav-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Mobile Nav Buttons - Hidden on desktop */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden on desktop */
  min-height: 48px; /* Mobile buttons row height */
  background-color: var(--card-bg-color); /* White background for mobile buttons */
  padding: 0 15px; /* Matches mobile container padding */
  box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* Subtle shadow */
}

.mobile-right-spacer {
  display: none; /* Hidden on desktop */
}

/* Main Navigation Section */
.main-nav {
  box-sizing: border-box;
  height: 52px; /* Desktop fixed height */
  display: flex;
  align-items: center;
  background-color: var(--auxiliary-color); /* Lighter color for nav bar */
  color: #FFFFFF;
  overflow: hidden;
}

.main-nav a {
  color: #FFFFFF;
  padding: 0 15px;
  height: 100%; /* Make links fill the height */
  display: flex;
  align-items: center;
  white-space: nowrap;
  font-size: 15px;
  transition: background-color 0.3s ease;
}

.main-nav a:hover {
  background-color: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
}

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

/* Buttons Styling */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 5px;
  font-size: 14px;
  font-weight: bold;
  color: #FFFFFF;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--button-gradient);
  border: none;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
  text-align: center;
}

.btn:hover {
  opacity: 0.9;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
  color: #FFFFFF; /* Keep text white on hover */
}

/* Hamburger Menu - Hidden on desktop */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1001; /* Above header */
  position: relative;
  width: 45px; /* Fixed width for balancing on mobile */
  height: 40px; /* Fixed height for balancing on mobile */
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.hamburger-menu .bar {
  display: block;
  width: 25px;
  height: 3px;
  background-color: #FFFFFF; /* White bars for hamburger */
  margin: 4px 0;
  transition: all 0.3s ease;
}

/* Overlay for mobile menu */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999; /* Below menu, above page content */
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.overlay.active {
  display: block;
  opacity: 1;
}

/* Footer Styling */
.site-footer {
  background-color: var(--primary-color);
  color: #FFFFFF;
  padding: 40px 0 20px;
  font-size: 14px;
}

.site-footer a {
  color: #FFFFFF;
  opacity: 0.8;
}

.site-footer a:hover {
  opacity: 1;
  text-decoration: underline;
}

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

.footer-col h3 {
  font-size: 16px;
  margin-bottom: 15px;
  color: #FFFFFF;
}

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

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

.footer-logo {
  font-size: 20px;
  font-weight: bold;
  text-transform: uppercase;
  margin-bottom: 15px;
  display: block;
}

.footer-description {
  margin-top: 0;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.footer-mid-slots {
  display: none; /* These slots are for backend injection, not for visual layout by default */
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin-top: 30px;
  padding-top: 20px;
  text-align: center;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 30px;
  padding-right: 30px;
}

.footer-bottom p {
  margin: 0;
}

/* Dynamic Slot Anchor Inner - Must be visible */
.footer-slot-anchor-inner {
  min-height: 1px; /* Ensure visibility for injection */
  overflow: visible;
}

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

  body {
    overflow-x: hidden;
  }

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

  .header-top {
    height: 60px; /* Mobile fixed height */
  }

  .header-container {
    padding: 0 15px; /* Smaller padding for mobile */
    justify-content: space-between;
  }

  .hamburger-menu {
    display: flex; /* Show hamburger on mobile */
    order: -1; /* Place it at the start */
  }

  /* Mobile logo centering */
  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-size: 20px; /* Smaller font size for mobile logo */
  }

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

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

  .mobile-right-spacer {
    display: block; /* Show on mobile to balance hamburger */
    width: 45px; /* Approximate width of hamburger menu */
    height: 40px; /* Match hamburger height */
  }

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    align-items: center;
    justify-content: center; /* Center buttons horizontally */
    min-height: 48px;
    width: 100%; max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
    background-color: var(--card-bg-color);
  }

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

  .main-nav {
    height: auto; /* Auto height for full menu */
    position: fixed;
    top: 0; /* Changed to 0 as it's an overlay */
    left: 0;
    width: 70%; /* Side menu width */
    max-width: 300px; /* Max width for side menu */
    height: 100vh; /* Full viewport height */
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding-top: 60px; /* Space for header-top content */
    transform: translateX(-100%); /* Hidden by default */
    transition: transform 0.3s ease;
    background-color: var(--auxiliary-color);
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    display: none; /* Hidden by default, JS toggles active class to show */
  }

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

  .main-nav .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 0 20px;
    width: 100%;
    height: auto;
    max-width: none; /* No max-width for mobile container */
  }

  .main-nav a {
    width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 16px;
    justify-content: flex-start;
  }

  .main-nav a:last-child {
    border-bottom: none;
  }

  /* Hamburger menu active state */
  .hamburger-menu.active .bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg); /* Adjusted for 4px margin */
  }
  .hamburger-menu.active .bar:nth-child(2) {
    opacity: 0;
  }
  .hamburger-menu.active .bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg); /* Adjusted for 4px margin */
  }

  .footer-top-grid {
    grid-template-columns: 1fr;
    padding: 0 15px;
  }

  .footer-col {
    margin-bottom: 20px;
  }

  .footer-bottom {
    padding-left: 15px;
    padding-right: 15px;
  }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
