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

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

/* Base styles for anchors and buttons */
a {
  text-decoration: none;
  color: var(--color-text-main);
  transition: color 0.3s ease;
}

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

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

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  color: var(--color-text-main); /* Keep text color consistent on hover */
}

/* Site Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
}

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

.header-container {
  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 */
  box-sizing: border-box;
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--color-gold); /* Using gold for logo */
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block; /* Ensure visibility */
}

/* If logo is an image (currently text, but for future proofing) */
.logo img {
  display: block;
  max-height: 60px; /* Matches header-top height */
  height: auto;
  width: auto;
  max-width: 280px;
  object-fit: contain;
}

.hamburger-menu {
  display: none; /* Hidden on desktop */
}

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

.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden on desktop by default */
  min-height: 48px; /* Fixed height for mobile buttons bar */
  background-color: var(--color-primary); /* Background for mobile buttons bar */
  padding: 0 15px; /* Mobile padding for the bar */
}

.main-nav {
  background-color: var(--color-primary); /* Distinct from header-top */
  min-height: 52px;
  height: 52px;
  display: flex; /* Visible on desktop */
  align-items: center;
  overflow: hidden;
  box-sizing: border-box;
}

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

.nav-link {
  padding: 0 15px;
  font-size: 16px;
  font-weight: bold;
  color: var(--color-text-main);
  transition: color 0.3s ease;
  white-space: nowrap;
}

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

/* Footer styles */
.site-footer {
  background-color: var(--color-card-bg); /* Dark background for footer */
  color: var(--color-text-secondary);
  padding: 40px 0 20px;
  font-size: 14px;
  box-sizing: border-box;
}

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

.footer-col h3 {
  color: var(--color-text-main);
  font-size: 18px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--color-divider);
  padding-bottom: 10px;
}

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

.footer-logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--color-gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
  margin-bottom: 15px;
}

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

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

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

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

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

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

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

  .site-header {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }

  .header-top {
    min-height: 60px !important;
    height: 60px !important;
    position: relative; /* For absolute positioning of logo if needed */
  }

  .header-container {
    padding: 0 15px;
    max-width: none;
    width: 100%;
    justify-content: space-between; /* Hamburger left, logo center, empty right */
    position: static; /* Reset from desktop flex positioning if needed */
  }
  
  /* Hamburger menu visible on mobile */
  .hamburger-menu {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 25px;
    height: 20px;
    cursor: pointer;
    z-index: 1001; /* Above header */
    position: relative;
    padding: 10px 0; /* Make clickable area larger */
  }

  .hamburger-menu .bar {
    display: block;
    height: 2px;
    width: 100%;
    background-color: var(--color-text-main);
    border-radius: 1px;
    transition: all 0.3s ease;
  }

  .hamburger-menu.active .bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
  }

  .hamburger-menu.active .bar:nth-child(2) {
    opacity: 0;
  }

  .hamburger-menu.active .bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
  }

  /* Logo Centering for mobile */
  .logo {
    flex: 1 !important; /* Take remaining space */
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    position: absolute; /* Absolute position to center, relative to header-top */
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 100px); /* Leave space for hamburger and potential right element */
    height: 100%;
    z-index: 1; /* Below hamburger */
  }

  .logo img {
    max-height: 56px !important; /* Matches mobile header-top height */
    max-width: 100%;
  }

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

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons on mobile */
    min-height: 48px;
    align-items: center;
    justify-content: center; /* Center buttons horizontally */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px;
    overflow: hidden; /* Prevent overflow */
    gap: 10px;
    flex-wrap: nowrap; /* Ensure buttons stay in one line */
    background-color: var(--color-primary); /* Using primary for consistency */
  }

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

  .main-nav {
    display: none; /* Hidden by default on mobile */
    position: fixed;
    top: var(--header-offset); /* Position below the fixed header (header-top + mobile-nav-buttons) */
    left: 0;
    width: 75%; /* Slide-out menu width */
    height: calc(100% - var(--header-offset)); /* Fill remaining height */
    background-color: var(--color-card-bg); /* Menu background */
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    transform: translateX(-100%); /* Start off-screen */
    transition: transform 0.3s ease;
    z-index: 999; /* Below hamburger, above overlay */
    overflow-y: auto; /* Enable scrolling for long menus */
  }

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

  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 0 15px;
    max-width: none;
    width: 100%;
    height: auto; /* Auto height for content */
  }

  .nav-link {
    width: 100%;
    padding: 12px 15px;
    border-bottom: 1px solid var(--color-divider);
    text-align: left;
    font-size: 15px;
  }
  
  .nav-link:last-child {
    border-bottom: none;
  }

  /* Overlay for mobile menu */
  .overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998; /* Below menu */
  }

  .overlay.active {
    display: block;
  }

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

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

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

/* Ensure color contrast for links in dark backgrounds */
.site-header a, .main-nav a, .footer-nav a {
  color: var(--color-text-main);
}
.site-header a:hover, .main-nav a:hover, .footer-nav a:hover {
  color: var(--color-gold);
}
.btn {
  color: var(--color-text-main); /* Ensure button text is main text color */
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
/* 内容保护（系统追加，请勿删除） */
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
input, textarea, select, [contenteditable="true"] {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}
