:root {
  --header-offset: 122px;
  --color-primary: #2F6BFF;
  --color-secondary: #6FA3FF;
  --color-button-gradient: linear-gradient(180deg, #4A8BFF 0%, #2F6BFF 100%);
  --color-card-bg: #FFFFFF;
  --color-background: #F4F7FB;
  --color-text-main: #1F2D3D;
  --color-border: #D6E2FF;
  --color-glow: #A5C4FF;
  --header-top-bg: #1A4A99; /* Darker shade for header-top */
  --main-nav-bg: var(--color-secondary); /* Secondary color for main-nav */
}

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

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

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

/* --- Header Styles --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.header-top {
  box-sizing: border-box;
  height: 68px; /* Fixed height for desktop */
  display: flex;
  align-items: center;
  background-color: var(--header-top-bg);
  color: #FFFFFF;
  overflow: hidden;
}

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

.logo {
  font-size: 24px;
  font-weight: bold;
  color: #FFFFFF;
  text-decoration: none;
  display: block; /* Ensure it's not hidden */
}

.logo img {
  display: block;
  max-height: 60px; /* Fixed height for desktop logo image */
  height: auto;
  width: auto;
  max-width: 280px;
  object-fit: contain;
}

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

.btn {
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: bold;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.3s ease;
  text-decoration: none; /* Remove underline for buttons */
  color: #FFFFFF; /* Default button text color */
  box-sizing: border-box;
}

.btn-primary {
  background: var(--color-button-gradient);
  border: none;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-secondary {
  background-color: var(--color-secondary);
  border: 1px solid var(--color-secondary);
}

.btn-secondary:hover {
  opacity: 0.9;
}

.main-nav {
  box-sizing: border-box;
  height: 52px; /* Fixed height for desktop */
  background-color: var(--main-nav-bg);
  display: flex;
  align-items: center;
  overflow: hidden;
  width: 100%;
  color: #FFFFFF;
}

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

.nav-link {
  color: #FFFFFF;
  padding: 0 15px;
  line-height: 52px; /* Match main-nav height */
  display: block;
  font-size: 15px;
  white-space: nowrap;
  transition: background-color 0.3s ease;
}

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

/* Mobile specific elements, hidden by default on desktop */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  width: 30px;
  height: 24px;
  position: relative;
  cursor: pointer;
  z-index: 1001; /* Above header-top */
}

.hamburger-menu span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: #FFFFFF;
  position: absolute;
  left: 0;
  transition: all 0.3s ease;
}

.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-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden on desktop */
  min-height: 48px; /* Min-height for mobile button bar */
  background-color: var(--color-card-bg); /* A neutral background for mobile buttons */
  width: 100%;
  padding: 8px 15px;
  justify-content: center; /* Center buttons horizontally */
  align-items: center;
  gap: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

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

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

/* --- Footer Styles --- */
.site-footer {
  background-color: #1F2D3D; /* Dark background for footer */
  color: #E0E0E0;
  padding: 40px 20px 20px;
  font-size: 14px;
}

.site-footer a {
  color: #E0E0E0;
  text-decoration: none;
}

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

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

.footer-col h3 {
  font-size: 16px;
  margin-top: 0;
  margin-bottom: 15px;
  color: #FFFFFF;
}

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

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

.footer-logo {
  font-size: 22px;
  font-weight: bold;
  color: #FFFFFF;
  margin-bottom: 15px;
  display: block;
}

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

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  text-align: center;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-bottom p {
  margin: 0;
}

/* Dynamic slot anchors - ensure they are visible */
.footer-slot-anchor-inner {
  min-height: 10px; /* Ensure visibility for injection */
  width: 100%;
}

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

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

  /* Header adjustments for mobile */
  .header-top {
    height: 60px; /* Fixed height for mobile */
    padding: 0 15px;
    justify-content: space-between; /* To push hamburger left and logo/desktop-nav-buttons apart */
  }

  .header-container {
    padding: 0;
    max-width: none;
    width: 100%;
    position: relative; /* For logo centering with absolute positioning method 2 if needed */
  }

  .hamburger-menu {
    display: block; /* Visible on mobile */
  }

  /* Mobile logo centering (Method 1: Flexbox + !important) */
  .logo {
    flex: 1 !important; /* Allow logo to take up available space */
    display: flex !important; /* Make logo itself a flex container */
    justify-content: center !important; /* Center content within logo */
    align-items: center !important; /* Vertically center content */
    max-width: calc(100% - 100px); /* Leave space for hamburger and potential other elements */
    /* If text logo, text-align: center; could also work within flex item */
  }

  .logo img {
    max-height: 56px !important; /* Fixed height for mobile logo image */
  }

  .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; /* Fixed min-height for mobile buttons */
    padding: 8px 15px;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap; /* Ensure buttons stay in one row */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden; /* Prevent overflow */
  }

  .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;
    overflow-wrap: break-word;
  }

  .main-nav {
    display: none; /* Hidden by default on mobile */
    position: fixed;
    top: var(--header-offset); /* Position below fixed header and mobile buttons */
    left: 0;
    width: 280px; /* Sidebar width */
    height: calc(100% - var(--header-offset)); /* Fill remaining height */
    background-color: #1F2D3D; /* Darker background for mobile menu */
    flex-direction: column;
    padding: 20px 0;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    transform: translateX(-100%); /* Off-screen by default */
    transition: transform 0.3s ease;
    z-index: 1000; /* Below overlay, but above content */
    align-items: flex-start; /* Align menu items to left */
    overflow-y: auto; /* Enable scrolling for long menus */
  }

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

  .nav-container {
    flex-direction: column; /* Stack menu items vertically */
    padding: 0;
    width: 100%;
    max-width: none;
    height: auto;
    align-items: flex-start;
  }

  .nav-link {
    width: 100%;
    padding: 12px 20px; /* Adjust padding for mobile menu items */
    line-height: normal;
    text-align: left;
    font-size: 16px;
  }

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

  /* Footer adjustments for mobile */
  .footer-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 20px;
  }

  .footer-col:not(.footer-about) {
    text-align: left;
  }

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

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

  /* Ensure content images in page content are responsive */
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
}

/* No-scroll for body when menu is open */
body.no-scroll {
  overflow: hidden;
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
