:root {
  --primary-color: #113B7A;
  --secondary-color: #1D5FD1;
  --button-gradient: linear-gradient(180deg, #2B73F6 0%, #1144A6 100%);
  --card-bg: #10233F;
  --text-main: #F3F8FF;
  --text-secondary: #AFC4E8;
  --border-color: #244D84;
  --glow-color: #4FA8FF;
  --gold-color: #F2C14E;
  --divider-color: #1B3357;
  --deep-navy: #08162B;
  --header-offset: 122px; /* Desktop: 68px (header-top) + 52px (main-nav) + 2px buffer */
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Arial', sans-serif;
  margin: 0;
  padding-top: var(--header-offset);
  color: var(--text-main);
  background-color: var(--deep-navy);
  direction: ltr;
  overflow-x: hidden; /* Global overflow-x hidden for body */
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  background-color: var(--deep-navy); /* Base header background */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--card-bg); /* Distinct from main-nav */
  width: 100%;
}

.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; /* Internal padding for logo/buttons */
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--gold-color); /* Use gold for brand name */
  text-decoration: none;
  display: block; /* Ensure it's not inline */
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.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 {
  box-sizing: border-box;
  display: none; /* Hidden by default on desktop */
  min-height: 48px;
  background-color: var(--deep-navy); /* Match header base for consistency */
  border-top: 1px solid var(--divider-color);
}

.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--deep-navy); /* Distinct from header-top */
  width: 100%;
  border-top: 1px solid var(--border-color); /* Subtle separation */
  position: static; /* Desktop default */
}

.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;
  gap: 20px; /* Space between nav links */
  padding: 0 20px; /* Internal padding for nav links */
}

.nav-link {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 500;
  padding: 10px 0;
  white-space: nowrap;
  transition: color 0.3s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--gold-color);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 25px;
  background: var(--button-gradient);
  color: var(--text-main);
  font-weight: bold;
  text-decoration: none;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  min-width: 0;
}

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

/* Hamburger Menu (Mobile Only) */
.hamburger-menu {
  display: none; /* Hidden by default on desktop */
  width: 30px;
  height: 24px;
  position: relative;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  z-index: 1001; /* Above other header elements */
  flex-shrink: 0;
}

.hamburger-icon,
.hamburger-icon::before,
.hamburger-icon::after {
  content: '';
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--text-main);
  position: absolute;
  transition: all 0.3s ease;
}

.hamburger-icon {
  top: 50%;
  transform: translateY(-50%);
}

.hamburger-icon::before {
  top: -8px;
}

.hamburger-icon::after {
  top: 8px;
}

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

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

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

/* Footer Styles */
.site-footer {
  background-color: var(--deep-navy);
  color: var(--text-secondary);
  padding: 40px 0 20px;
  font-size: 14px;
  line-height: 1.6;
}

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

.footer-col {
  padding: 10px 0;
}

.footer-col h3 {
  color: var(--text-main);
  font-size: 16px;
  margin-bottom: 15px;
}

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

.footer-description {
  color: var(--text-secondary);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

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

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

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

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

.footer-bottom {
  border-top: 1px solid var(--divider-color);
  margin-top: 30px;
  padding-top: 20px;
  text-align: center;
  color: var(--text-secondary);
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 20px;
}

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

  body {
    padding-top: var(--header-offset);
  }

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

  .header-top {
    min-height: 60px !important;
    height: 60px !important;
    padding: 0 15px; /* Smaller padding for mobile */
  }

  .header-container {
    width: 100%;
    max-width: none; /* No max-width on mobile */
    padding: 0; /* Remove internal padding on mobile, let header-top padding handle it */
  }

  .logo {
    flex: 1 !important; /* Take remaining space */
    display: flex !important;
    justify-content: center !important; /* Center logo */
    align-items: center !important;
    position: static !important; /* Override any absolute positioning */
    transform: none !important;
    max-width: calc(100% - 80px); /* Account for hamburger space */
  }
  
  .logo img {
    max-height: 56px !important; /* Mobile max height */
  }

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

  .hamburger-menu {
    display: block; /* Show hamburger on mobile */
    order: -1; /* Place hamburger at the beginning */
    margin-right: auto; /* Push logo to center if it wasn't flex-centered */
  }

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    min-height: 48px;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px; /* Smaller padding for mobile */
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
  }

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

  .main-nav {
    display: none; /* Hidden by default, shown by JS */
    flex-direction: column;
    position: fixed;
    top: var(--header-offset); /* Start below the fixed header */
    left: 0;
    width: 280px; /* Width of the mobile menu */
    height: calc(100% - var(--header-offset)); /* Full height below header */
    background-color: var(--deep-navy); /* Menu background */
    overflow-y: auto;
    transform: translateX(-100%); /* Off-screen by default */
    transition: transform 0.3s ease;
    z-index: 1000; /* Below overlay, above site content */
    border-top: none; /* Remove border from desktop */
    padding: 20px 0; /* Add padding inside menu */
  }

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

  .nav-container {
    flex-direction: column;
    align-items: flex-start; /* Align links to the left */
    width: 100%;
    max-width: none; /* No max-width on mobile */
    padding: 0 20px; /* Padding for menu items */
    gap: 10px; /* Smaller gap for vertical links */
  }

  .nav-link {
    width: 100%;
    padding: 10px 0;
    border-bottom: 1px solid var(--divider-color); /* Separator for links */
  }

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

  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column layout for footer */
    padding: 0 15px;
  }

  .footer-col {
    padding: 15px 0;
    border-bottom: 1px solid var(--divider-color);
  }

  .footer-col:last-of-type {
    border-bottom: none;
  }

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

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

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

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

  .footer-bottom {
    padding: 0 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;
  }
}
