/* Universal Box-Sizing */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Root variables for header offset */
:root {
  --header-offset: 122px; /* Desktop: 68px (header-top) + 52px (main-nav) + 2px buffer */
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: #1F2D3D; /* Text Main */
  background-color: #F4F7FB; /* Background */
  padding-top: var(--header-offset);
  overflow-x: hidden; /* Prevent body overflow on desktop */
}

/* Site Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* Suspended effect */
  background-color: #2F6BFF; /* Primary color as a base for header */
}

/* Header Top Section */
.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px; /* Fixed height for desktop */
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: #2F6BFF; /* Primary color */
  width: 100%;
  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 20px; /* Padding for logo and buttons */
}

/* Logo */
.logo {
  font-size: 24px;
  font-weight: bold;
  color: #FFFFFF;
  text-decoration: none;
  display: flex; /* For potential image logo centering */
  align-items: center;
  height: 100%;
}
.logo img {
  display: block;
  max-height: 60px; /* Desktop image logo height */
  height: auto;
  width: auto;
  max-width: 280px;
  object-fit: contain;
}

/* Hamburger Menu (Desktop - Hidden) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  position: relative;
  z-index: 1002;
  margin-right: 15px; /* Space between hamburger and logo */
}
.hamburger-icon {
  display: block;
  width: 100%;
  height: 3px;
  background-color: #FFFFFF;
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  transition: all 0.3s ease;
}
.hamburger-icon::before,
.hamburger-icon::after {
  content: '';
  display: block;
  width: 100%;
  height: 3px;
  background-color: #FFFFFF;
  position: absolute;
  left: 0;
  transition: all 0.3s ease;
}
.hamburger-icon::before {
  top: -10px;
}
.hamburger-icon::after {
  top: 10px;
}

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

/* Mobile Navigation Buttons (Desktop - Hidden) */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden on desktop */
  min-height: 48px; /* Min-height for mobile when visible */
  background-color: #6FA3FF; /* Accent color for mobile buttons bar */
  width: 100%;
}

/* Main Navigation */
.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px; /* Fixed height for desktop */
  display: flex; /* Visible on desktop */
  align-items: center;
  overflow: hidden;
  background-color: #6FA3FF; /* Accent color, different from header-top */
  width: 100%;
}

.nav-container {
  box-sizing: border-box;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: 0 20px;
  flex-wrap: nowrap; /* Prevent menu items from wrapping */
  overflow-x: auto; /* Allow horizontal scroll if too many items */
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  scrollbar-width: none; /* Hide scrollbar for Firefox */
  -ms-overflow-style: none; /* Hide scrollbar for IE/Edge */
}
.nav-container::-webkit-scrollbar {
  display: none; /* Hide scrollbar for Chrome/Safari/Opera */
}

.nav-link {
  color: #FFFFFF;
  text-decoration: none;
  padding: 10px 15px;
  font-size: 16px;
  white-space: nowrap; /* Prevent menu items from wrapping */
  transition: background-color 0.3s ease;
  min-height: 100%; /* Ensure links fill parent height */
  display: flex;
  align-items: center;
}

.nav-link:hover, .nav-link.active {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  font-size: 15px;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #FFFFFF; /* Ensure button text is visible */
  background: linear-gradient(180deg, #4A8BFF 0%, #2F6BFF 100%); /* Button gradient */
  border: none;
  box-shadow: 0 4px 10px rgba(47, 107, 255, 0.3); /* Glow */
}

.btn:hover {
  opacity: 0.9;
  box-shadow: 0 6px 15px rgba(47, 107, 255, 0.4);
}

/* Mobile Navigation Overlay */
.mobile-nav-overlay {
  display: none; /* Hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 999; /* Below main nav but above content */
}
.mobile-nav-overlay.active {
  display: block;
}

/* Footer */
.site-footer {
  background-color: #1F2D3D; /* Darker background for footer */
  color: #F4F7FB; /* Light text on dark background */
  padding: 40px 20px 20px;
  font-size: 14px;
}

.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: 16px;
  margin-bottom: 15px;
}

.footer-col p {
  line-height: 1.6;
  word-wrap: break-word; /* Ensure description wraps */
  overflow-wrap: break-word;
  color: #D6E2FF; /* Border color for softer text */
}

.footer-logo {
  font-size: 20px;
  font-weight: bold;
  color: #FFFFFF;
  text-decoration: none;
  display: block;
  margin-bottom: 15px;
}

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

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

.footer-nav a {
  color: #D6E2FF; /* Softer link color */
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-nav a:hover {
  color: #FFFFFF;
}

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

/* Footer slot anchor inner */
.footer-slot-anchor-inner {
  min-height: 1px; /* Ensure it occupies space */
}

/* Responsive Styles */
@media (max-width: 768px) {
  /* Header offset for mobile */
  :root {
    --header-offset: 110px; /* Mobile: 60px (header-top) + 48px (mobile-nav-buttons) + 2px buffer */
  }
  
  body {
    padding-top: var(--header-offset);
    overflow-x: hidden; /* Prevent body overflow on mobile */
  }

  /* Mobile Header Top */
  .header-top {
    min-height: 60px !important;
    height: 60px !important; /* Fixed height for mobile */
    padding: 0 15px; /* Adjust padding for mobile */
    justify-content: space-between; /* Space out hamburger, logo */
  }

  .header-container {
    padding: 0; /* Container padding handled by header-top now */
    max-width: none; /* No max-width on mobile */
    width: 100%;
    position: relative; /* For logo absolute positioning if needed */
  }

  /* Hamburger Menu (Mobile - Visible) */
  .hamburger-menu {
    display: block; /* Visible on mobile */
  }
  .hamburger-menu.active .hamburger-icon {
    background-color: transparent;
  }
  .hamburger-menu.active .hamburger-icon::before {
    top: 0;
    transform: rotate(45deg);
  }
  .hamburger-menu.active .hamburger-icon::after {
    top: 0;
    transform: rotate(-45deg);
  }

  /* Mobile Logo Centering (Method 1: Flexbox) */
  .logo {
    flex: 1 !important; /* Take available space */
    display: flex !important;
    justify-content: center !important; /* Center horizontally */
    align-items: center !important;
    position: absolute; /* Allows it to ignore hamburger menu width */
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 70px); /* Account for hamburger width (~30px) + its margin (15px) + right-side balance (25px) */
  }
  .logo img {
    max-height: 56px !important; /* Mobile image logo height */
    max-width: 100%;
  }

  /* Desktop Buttons (Mobile - Hidden) */
  .desktop-nav-buttons {
    display: none !important;
  }

  /* Mobile Buttons (Mobile - Visible) */
  .mobile-nav-buttons {
    display: flex !important; /* Visible on mobile */
    min-height: 48px;
    align-items: center;
    justify-content: center; /* Center buttons if less than 2 */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px; /* Padding for buttons */
    overflow: hidden; /* Prevent buttons from overflowing */
    gap: 10px; /* Space between buttons */
    flex-wrap: nowrap; /* Ensure buttons stay in one line */
    background-color: #6FA3FF; /* Accent color */
  }
  .mobile-nav-buttons .btn {
    flex: 1; /* Distribute space evenly */
    min-width: 0; /* Allow shrinking */
    max-width: calc(50% - 5px); /* Max width for two buttons with 10px gap */
    box-sizing: border-box;
    padding: 8px 12px; /* Smaller padding for mobile buttons */
    font-size: 13px; /* Smaller font for mobile buttons */
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Mobile Main Navigation */
  .main-nav {
    display: none; /* Hidden by default */
    position: fixed;
    top: var(--header-offset); /* Below the header and mobile buttons */
    left: 0;
    width: 280px; /* Sidebar width */
    height: calc(100% - var(--header-offset)); /* Fill remaining height */
    background-color: #1F2D3D; /* Darker background for mobile menu */
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 0;
    transform: translateX(-100%); /* Slide out from left */
    transition: transform 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    overflow-y: auto; /* Allow scrolling for long menus */
    -webkit-overflow-scrolling: touch;
    z-index: 1001; /* Above overlay */
  }
  .main-nav.active {
    display: flex; /* Show when active */
    transform: translateX(0); /* Slide in */
  }

  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
    width: 100%;
    max-width: none; /* No max-width on mobile */
  }

  .nav-link {
    width: 100%;
    padding: 12px 20px;
    color: #F4F7FB;
    justify-content: flex-start;
  }
  .nav-link:hover, .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
  }

  /* Footer Grid for Mobile */
  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
    text-align: center;
  }
  .footer-col {
    margin-bottom: 20px;
  }
  .footer-col h3 {
    margin-top: 20px;
  }
  .footer-nav {
    text-align: center;
  }

  /* Mobile image overflow prevention */
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
