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

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

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

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  background-color: var(--card-bg); /* Use a neutral background for the whole header to let sub-sections define color */
}

.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--primary-color); /* Primary color for header top */
  width: 100%;
  color: #fff; /* Text color for header-top */
}

.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 {
  font-size: 28px;
  font-weight: bold;
  color: #fff; /* Logo text color on primary background */
  text-transform: uppercase;
  display: flex; /* For potential image logo centering */
  align-items: center;
  height: 100%;
}

.logo img {
  display: block;
  max-height: 60px;
  height: auto;
  width: auto;
  max-width: 280px;
  object-fit: contain;
}

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

.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default on desktop */
  min-height: 48px;
  background-color: var(--background-color); /* Different background from header-top and main-nav */
  width: 100%;
  padding: 0 20px;
}

.btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: bold;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #fff; /* Default button text color */
  border: none;
  background: var(--button-gradient); /* Use custom button gradient */
}

.btn:hover {
  opacity: 0.9;
  box-shadow: 0 4px 12px var(--glow-color);
}

.btn-secondary {
  background: none;
  border: 2px solid #fff;
  color: #fff;
}
.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}


.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex; /* Desktop: visible */
  align-items: center;
  overflow: hidden;
  background-color: var(--accent-color); /* Accent color for main nav */
  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;
  gap: 25px; /* Spacing between nav links */
}

.nav-link {
  color: #fff;
  font-weight: bold;
  padding: 5px 0;
  position: relative;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background-color: #fff;
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Hamburger menu for mobile */
.hamburger-menu {
  display: none; /* Hidden by default on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1001;
  position: relative;
  width: 30px;
  height: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hamburger-menu .bar {
  display: block;
  width: 100%;
  height: 3px;
  background-color: #fff; /* Bars color */
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Overlay for 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.5);
  z-index: 999;
  transition: opacity 0.3s ease;
  opacity: 0;
}

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

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

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

.site-footer a:hover {
  color: var(--accent-color);
}

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

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

.footer-logo {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 15px;
  display: block;
  color: #fff;
}

.footer-description {
  margin-bottom: 15px;
  line-height: 1.8;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

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

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

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Mobile specific styles */
@media (max-width: 768px) {
  :root {
    --header-offset: 110px; /* 60px (header-top) + 48px (mobile-nav-buttons) */
  }

  /* Mobile Header Top */
  .header-top {
    min-height: 60px !important;
    height: 60px !important;
    padding: 0 15px; /* Padding for the whole header-top */
    justify-content: space-between; /* To push hamburger to left */
  }

  .header-container {
    width: 100%;
    max-width: none; /* No max-width on mobile */
    padding: 0; /* No internal padding, header-top has it */
    position: relative; /* For absolute positioning of logo */
  }

  /* Hamburger menu visible on mobile */
  .hamburger-menu {
    display: flex;
    z-index: 1002; /* Above logo if absolute */
    order: 1; /* Ensure it's first */
  }

  /* Hamburger menu animation */
  .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);
  }

  /* Logo centering for mobile (Method 2: absolute positioning) */
  .logo {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    max-width: calc(100% - 100px); /* Ensure space for hamburger */
    height: 100%;
    color: #fff; /* Logo color on header-top */
    z-index: 1; /* Below hamburger */
  }

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

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

  /* Mobile buttons visible on mobile */
  .mobile-nav-buttons {
    display: flex !important; /* Visible on mobile */
    min-height: 48px;
    align-items: center;
    justify-content: center; /* Center buttons */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px; /* Smaller padding */
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
    background-color: var(--background-color); /* Matches body background */
    border-bottom: 1px solid rgba(0,0,0,0.05); /* Subtle separator */
  }

  .mobile-nav-buttons .btn {
    flex: 1;
    min-width: 0;
    max-width: calc(50% - 5px); /* For 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 (mobile menu) */
  .main-nav {
    min-height: 48px !important;
    height: auto !important; /* Auto height for expanded menu */
    display: none; /* Hidden by default */
    flex-direction: column;
    position: fixed; /* Fixed position for mobile menu */
    top: var(--header-offset); /* Position below fixed header and mobile buttons */
    left: 0;
    width: 80%; /* Menu width */
    max-width: 300px;
    height: calc(100% - var(--header-offset)); /* Full height below header */
    background-color: var(--primary-color); /* Menu background */
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    transform: translateX(-100%); /* Off-screen by default */
    transition: transform 0.3s ease;
    z-index: 1001; /* Above overlay */
    padding-top: 20px; /* Internal padding */
    overflow-y: auto; /* Scroll if content is long */
  }

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

  .nav-container {
    flex-direction: column;
    align-items: flex-start; /* Align menu items to left */
    padding: 0 20px;
    gap: 15px;
    height: auto;
  }

  .nav-link {
    width: 100%;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

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

  .nav-link::after {
    display: none; /* No underline animation on mobile */
  }

  /* Footer mobile */
  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column layout */
    gap: 20px;
    padding-left: 15px;
    padding-right: 15px;
  }

  .footer-col {
    text-align: center;
  }

  .footer-col ul {
    text-align: center;
  }

  .footer-col h3 {
    text-align: center;
  }

  .footer-about {
    text-align: center;
  }

  .footer-logo {
    margin-left: auto;
    margin-right: auto;
  }

  /* 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;
  }

  /* No scroll on body when menu is open */
  body.no-scroll {
    overflow: hidden;
  }

  .overlay {
    z-index: 999; /* Ensure overlay is below menu but above main content */
  }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
