:root {
  --header-offset: 122px; /* Desktop: header-top (68px) + main-nav (52px) + 2px buffer */
  --color-primary: #113B7A;
  --color-accent: #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 {
  margin: 0;
  font-family: Arial, sans-serif;
  color: var(--color-text-main);
  background-color: var(--color-deep-navy);
  padding-top: var(--header-offset); /* Important: Body padding for fixed header */
  overflow-x: hidden; /* Prevent horizontal scroll on desktop too */
}

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

/* --- 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.5); /* Suspended effect */
  box-sizing: border-box;
}

.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--color-deep-navy); /* Darker background for header-top */
  width: 100%;
  padding: 0 20px; /* Padding for header-top content */
}

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

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--color-gold); /* Gold color for logo text */
  text-transform: uppercase;
  display: block; /* Ensure logo is visible */
  flex-shrink: 0;
}

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

.btn {
  padding: 10px 20px;
  border-radius: 5px;
  background: var(--color-button-gradient);
  color: var(--color-text-main);
  font-weight: bold;
  white-space: nowrap;
  text-align: center;
  text-decoration: none; /* Remove underline for buttons */
  transition: background 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.btn:hover {
  background: linear-gradient(180deg, #3C83FF 0%, #1652C0 100%); /* Slightly different hover gradient */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

/* Mobile Nav Buttons - Hidden by default on desktop */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default on desktop */
  min-height: 48px; /* Fixed height for mobile buttons */
  width: 100%;
  background-color: var(--color-primary); /* Different background from header-top */
  padding: 0 20px; /* Padding for mobile button bar */
}

.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--color-primary); /* Primary background for main nav */
  width: 100%;
  padding: 0 20px; /* Padding for main nav content */
}

.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;
  width: 100%;
}

.nav-link {
  padding: 0 15px;
  line-height: 52px; /* Vertically center text in desktop nav */
  color: var(--color-text-main);
  font-weight: bold;
  white-space: nowrap;
  transition: color 0.3s ease, background-color 0.3s ease;
}

.nav-link:hover {
  color: var(--color-gold);
  background-color: rgba(255, 255, 255, 0.1);
}

/* Hamburger Menu for Mobile */
.hamburger-menu {
  display: none; /* Hidden by default on desktop */
  width: 30px;
  height: 25px;
  position: relative;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
  z-index: 1001; /* Above header */
  flex-shrink: 0;
}

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

.hamburger-menu.active span:nth-child(1) {
  transform: translateY(11px) rotate(45deg);
}
.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
}
.hamburger-menu.active span:nth-child(3) {
  transform: translateY(-11px) 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; /* Below menu, above body */
}
.overlay.active {
  display: block;
}

/* --- Site Footer --- */
.site-footer {
  background-color: var(--color-deep-navy); /* Deep Navy background for footer */
  padding: 40px 20px 20px;
  color: var(--color-text-secondary);
  font-size: 14px;
  box-sizing: border-box;
}

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

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

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

.footer-description {
  line-height: 1.6;
  word-wrap: break-word; /* Ensure description wraps */
  overflow-wrap: break-word;
}

.footer-col p {
  margin-bottom: 8px;
}

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

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

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

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

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

.footer-bottom p {
  margin: 0;
}

/* Anchor visibility constraint */
.footer-slot-anchor-inner {
  min-height: 1px; /* Smallest possible height to ensure visibility for content injection */
  display: block;
}

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

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

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

  /* Header Top for Mobile */
  .site-header {
    background-color: var(--color-deep-navy); /* Ensure consistent background on mobile */
  }
  .header-top {
    min-height: 60px;
    height: 60px;
    padding: 0 15px; /* Smaller padding for mobile */
    position: relative; /* Needed for absolute positioning of logo */
  }

  .header-container {
    width: 100%;
    max-width: none; /* No max-width on mobile */
    justify-content: space-between; /* Space out hamburger and logo */
    position: relative; /* Ensure it's a positioning context for children */
  }

  .logo {
    font-size: 24px;
    position: absolute !important; /* Force absolute positioning */
    left: 50% !important; /* Center horizontally */
    transform: translateX(-50%) !important; /* Adjust for element's own width */
    display: flex !important; /* Use flex for potential vertical centering */
    align-items: center !important; /* Vertical centering */
    justify-content: center !important; /* Horizontal centering for flex content */
    max-width: calc(100% - 100px); /* Ensure it doesn't overlap hamburger/right space */
    height: 100%; /* Take full height to align vertically */
    white-space: nowrap; /* Keep logo text on one line */
    overflow: hidden; /* Hide overflow if max-width is hit */
    text-overflow: ellipsis; /* Add ellipsis if text is too long */
  }

  .logo img {
    max-height: 56px !important; /* Smaller logo for mobile */
    max-width: 100%;
    height: auto;
  }

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

  .hamburger-menu {
    display: flex; /* Show hamburger menu */
    order: -1; /* Place to the left */
    margin-right: auto; /* Push logo to center */
  }

  /* Mobile Nav Buttons - Visible on mobile */
  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    min-height: 48px;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%; /* Ensure it doesn't overflow */
    box-sizing: border-box;
    padding: 0 15px; /* Smaller padding */
    overflow: hidden; /* Prevent horizontal scroll for buttons */
    gap: 10px;
    flex-wrap: nowrap; /* Keep buttons on one line */
    background-color: var(--color-primary); /* Consistent with main-nav */
  }

  .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 gap */
    box-sizing: border-box;
    padding: 8px 12px; /* Smaller padding */
    font-size: 13px; /* Smaller font size */
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Main Nav for Mobile (Hamburger Menu Content) */
  .main-nav {
    display: none; /* Hidden by default */
    position: fixed;
    top: var(--header-offset); /* Below fixed header and mobile buttons */
    left: 0;
    width: 250px; /* Width of the slide-out menu */
    height: calc(100% - var(--header-offset)); /* Fill remaining height */
    background-color: var(--color-deep-navy); /* Dark background for mobile menu */
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    transform: translateX(-100%); /* Slide out from left */
    transition: transform 0.3s ease;
    z-index: 1000; /* Same as header, overlay is 999 */
    overflow-y: auto; /* Allow scrolling for long menus */
    box-sizing: border-box;
  }

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

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

  .nav-link {
    width: 100%;
    padding: 12px 20px;
    line-height: normal;
    text-align: left;
    border-bottom: 1px solid var(--color-divider);
  }

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

  /* Footer for Mobile */
  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column layout for mobile footer */
    gap: 30px;
  }

  .footer-col {
    text-align: left;
  }
  .footer-col h3 {
    text-align: left;
  }
  .footer-logo {
    text-align: left;
  }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
