:root {
  --header-offset: 122px; /* Desktop: 68px (header-top) + 52px (main-nav) = 120px, +2px for safety */
  --primary-color: #113B7A;
  --accent-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;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Arial', sans-serif;
  margin: 0;
  padding-top: var(--header-offset); /* Only one place for padding-top */
  background-color: var(--deep-navy);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden; /* Global overflow protection */
}

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

a:hover {
  color: var(--accent-color);
  text-decoration: underline;
}

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

.btn:hover {
  opacity: 0.9;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), 0 0 15px var(--glow-color);
  color: var(--text-main); /* Ensure text color stays main on hover */
  text-decoration: none;
}

/* 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.3);
  background-color: var(--deep-navy); /* Fallback, header-top and main-nav define specific colors */
}

.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--deep-navy); /* Header Top background */
  width: 100%;
  border-bottom: 1px solid var(--divider-color);
}

.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 25px; /* Added padding for logo and buttons */
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--gold-color);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex; /* For image logo alignment */
  align-items: center;
  text-decoration: none;
}

.logo img {
  display: block;
  max-height: 60px; /* Desktop logo 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 by default on desktop */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden globally */
  min-height: 48px; /* Placeholder height, will be overwritten for mobile */
  background-color: var(--primary-color); /* A different color from header-top */
  width: 100%;
  border-bottom: 1px solid var(--divider-color);
}

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

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

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

/* Hamburger Menu - Hidden by default on desktop */
.hamburger-menu {
  display: none; /* Hidden globally */
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  position: relative;
  z-index: 1002; /* Above header-top, below mobile menu */
  margin-right: auto; /* Push logo to center when hamburger is visible */
}

.hamburger-menu span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--text-main);
  margin-bottom: 5px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger-menu span:last-child {
  margin-bottom: 0;
}

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

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

/* Mobile styles */
@media (max-width: 768px) {
  :root {
    --header-offset: 110px; /* Mobile: 60px (header-top) + 48px (main-nav) = 108px, +2px for safety */
  }

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

  .header-top {
    min-height: 60px !important;
    height: 60px !important;
  }

  .header-container {
    width: 100%;
    max-width: none; /* Remove max-width on mobile */
    padding: 0 15px;
    justify-content: space-between;
  }

  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    order: 0;
  }

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

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

  .hamburger-menu {
    display: block;
    order: -1; /* Place it at the start */
  }

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

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

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

  /* Mobile Nav Buttons - Displayed on mobile */
  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons on mobile */
    min-height: 48px;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
    background-color: var(--primary-color);
    border-bottom: 1px solid var(--divider-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;
  }

  .main-nav {
    display: none; /* Hidden by default on mobile, shown with .active */
    position: fixed;
    flex-direction: column;
    width: 280px; /* Mobile menu width */
    height: 100vh;
    top: 0;
    left: 0;
    background-color: var(--card-bg); /* Mobile menu background */
    z-index: 1001;
    overflow-y: auto;
    transform: translateX(-100%); /* Off-screen by default */
    transition: transform 0.3s ease;
    padding-top: 20px; /* Padding inside the mobile menu */
  }

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

  .nav-container {
    width: 100%;
    max-width: none; /* Remove max-width on mobile */
    flex-direction: column;
    align-items: flex-start; /* Align menu items to the left */
    padding: 0 15px;
    gap: 15px;
  }

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

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

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

.footer-top-grid {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-cols-wrapper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

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

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

.footer-logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--gold-color);
  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: 8px;
}

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

.footer-nav a:hover {
  color: var(--accent-color);
  text-decoration: underline;
}

.footer-slot-anchor-inner {
  /* Placeholder for injected content, must not be hidden */
  min-height: 1px; /* Ensure it takes up space */
}

.footer-bottom {
  border-top: 1px solid var(--divider-color);
  padding-top: 20px;
  margin-top: 20px;
  text-align: center;
  color: var(--text-secondary);
  background-color: var(--deep-navy); /* Match header-top for consistency */
  padding-bottom: 20px; /* Added padding to footer-bottom */
  box-sizing: border-box;
}

.footer-bottom p {
  margin: 0;
}

@media (max-width: 768px) {
  .site-footer {
    padding: 30px 15px 15px;
  }
  .footer-cols-wrapper {
    grid-template-columns: 1fr; /* Single column layout for mobile */
    gap: 30px;
  }
  .footer-col h3 {
    margin-top: 0;
  }
  .footer-bottom {
    padding-top: 15px;
    margin-top: 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;
  }
}
/* 内容保护（系统追加，请勿删除） */
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;
}
