:root {
  --header-offset: 122px; /* 68px (header-top) + 52px (main-nav) + 2px (margin) */
  --primary-color: #113B7A;
  --secondary-color: #1D5FD1;
  --card-bg: #10233F;
  --text-main: #F3F8FF;
  --text-secondary: #AFC4E8;
  --border-color: #244D84;
  --glow-color: #4FA8FF;
  --gold-color: #F2C14E;
  --divider-color: #1B3357;
  --deep-navy: #08162B;
}

/* Base Styles */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* Header Styles */
.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.2);
}

.header-top {
  background-color: var(--primary-color); /* Deep Blue */
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  width: 100%;
}

.header-container {
  width: 100%;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--text-main);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 200px; /* Limit logo width */
  display: flex;
  align-items: center;
}
.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;
}

.btn {
  background: linear-gradient(180deg, #2B73F6 0%, #1144A6 100%);
  color: var(--text-main);
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: bold;
  transition: background-color 0.3s ease, transform 0.2s ease;
  white-space: nowrap;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* Mobile buttons - Hidden by default on desktop */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden on desktop */
  min-height: 48px; /* Default min-height for mobile */
  background-color: var(--card-bg); /* Different color for distinction */
  width: 100%;
  padding: 0 15px; /* Add padding for mobile */
  gap: 10px;
  align-items: center;
  justify-content: center;
  overflow: hidden; /* Prevent content overflow */
}

.main-nav {
  background-color: var(--secondary-color); /* Lighter Blue */
  min-height: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  overflow: hidden;
  width: 100%;
}

.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;
  gap: 25px;
}

.nav-link {
  color: var(--text-main);
  font-weight: bold;
  padding: 5px 0;
  transition: color 0.3s ease;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 120px; /* Limit nav link width */
}

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

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

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

.hamburger-menu span:nth-child(1) { top: 0; }
.hamburger-menu span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.hamburger-menu span:nth-child(3) { bottom: 0; }

.hamburger-menu.active span:nth-child(1) { top: 50%; transform: translateY(-50%) rotate(45deg); }
.hamburger-menu.active span:nth-child(2) { opacity: 0; }
.hamburger-menu.active span:nth-child(3) { bottom: 50%; transform: translateY(50%) rotate(-45deg); }

/* Mobile Navigation Overlay */
.mobile-nav-overlay {
  display: none; /* Hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 999; /* Below mobile nav, above main content */
}

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

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

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

.footer-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 var(--divider-color);
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.footer-logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--text-main);
  margin-bottom: 10px;
}

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

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

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

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

/* Dynamic Slot Anchor Styles (must be visible) */
.footer-slot-anchor, .footer-slot-anchor-inner {
  min-height: 1px; /* Ensure visibility for injection */
  display: block;
}

/* Media Queries for Responsiveness */
@media (max-width: 768px) {
  :root {
    --header-offset: 110px; /* 60px (header-top) + 48px (mobile-nav-buttons) + 2px (margin) */
  }

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

  /* Header adjustments */
  .header-top {
    min-height: 60px !important;
    height: 60px !important;
  }

  .header-container {
    width: 100%;
    max-width: none; /* Allow container to take full width */
    padding: 0 15px;
    position: relative; /* For absolute positioning of logo */
    justify-content: space-between; /* To push hamburger left */
  }
  
  /* Mobile Logo Centering (Method 2: Absolute Positioning for text logo) */
  .logo {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important; /* Keep display flex for general alignment */
    align-items: center !important;
    justify-content: center !important;
    max-width: calc(100% - 100px); /* Leave space for hamburger (approx 30px) and padding */
    font-size: 24px; /* Adjust font size for mobile */
    height: 100%; /* Ensure it spans full height of container for centering */
  }

  .hamburger-menu {
    display: flex; /* Show hamburger menu on mobile */
    align-items: center;
    position: relative; /* Keep it in flow on the left */
    z-index: 2; /* Higher z-index for hamburger */
  }

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

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    min-height: 48px;
    align-items: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
    justify-content: center;
    background-color: var(--card-bg); /* Use card-bg for mobile button strip */
    box-shadow: 0 1px 5px rgba(0,0,0,0.1); /* Add subtle shadow */
  }

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

  .main-nav {
    min-height: 48px !important;
    height: auto !important; /* Allow height to expand for menu items */
    position: fixed; /* Fixed for off-canvas menu */
    top: var(--header-offset); /* Position below fixed header and mobile buttons */
    left: 0;
    bottom: 0;
    width: 280px; /* Width of the off-canvas menu */
    background-color: var(--primary-color); /* Menu background color */
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 20px 0;
    transform: translateX(-100%); /* Hide off-canvas menu by default */
    transition: transform 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    display: none; /* Hide completely when not active */
    overflow-y: auto; /* Enable scrolling for long menus */
  }

  .main-nav.active {
    transform: translateX(0); /* Show off-canvas menu */
    display: flex; /* Make sure it's visible */
  }

  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 0 20px;
    gap: 15px;
    width: 100%;
    max-width: none;
    height: auto; /* Allow height to adjust */
  }

  .nav-link {
    width: 100%;
    padding: 10px 0;
    border-bottom: 1px solid var(--divider-color);
    font-size: 16px;
    max-width: none; /* Remove max-width constraint */
  }
  .nav-link:last-child {
      border-bottom: none;
  }

  .mobile-nav-overlay.active {
    display: block; /* Show overlay when menu is active */
  }

  /* Footer adjustments */
  .footer-grid {
    grid-template-columns: 1fr; /* Single column layout for mobile */
    gap: 25px;
  }
  .footer-col {
    align-items: center;
    text-align: center;
  }
  .footer-nav {
    padding-left: 0;
  }
  .footer-description {
    max-width: 90%; /* Constrain width for better readability */
  }

  /* Prevent images in content from overflowing */
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
