:root {
  --header-offset: 122px;
  --primary-color: #2F6BFF;
  --accent-color: #6FA3FF;
  --button-gradient: linear-gradient(180deg, #4A8BFF 0%, #2F6BFF 100%);
  --card-bg: #FFFFFF;
  --page-bg: #F4F7FB;
  --text-main: #1F2D3D;
  --text-black: #000000;
  --border-color: #D6E2FF;
  --glow-color: #A5C4FF;
}

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

/* --- 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.1);
  background-color: var(--card-bg); /* Use a neutral background for the whole header container */
  box-sizing: border-box;
}

.header-top {
  box-sizing: border-box;
  height: 68px; /* Desktop fixed height */
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: #1A4CAF; /* Darker blue */
  color: #FFFFFF;
  width: 100%;
}

.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; /* Desktop padding */
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: #FFFFFF;
  text-decoration: none;
  display: block;
  flex-shrink: 0; /* Prevent shrinking */
}

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

.desktop-nav-buttons {
  display: flex; /* Global default for desktop */
  gap: 12px;
  align-items: center;
  flex-shrink: 0; /* Prevent shrinking */
}

.btn {
  padding: 10px 18px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: bold;
  white-space: nowrap;
  transition: all 0.3s ease;
  color: #FFFFFF;
  background: var(--button-gradient);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn:hover {
  opacity: 0.9;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.btn-login {
  background: #FFFFFF; /* White button for login */
  color: var(--primary-color);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}
.btn-login:hover {
  background: #f0f0f0;
  color: var(--primary-color);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

/* Mobile specific button container - hidden on desktop */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden on desktop by default */
  min-height: 48px; /* Mobile fixed height */
  background-color: var(--page-bg); /* Neutral background */
  width: 100%;
  padding: 0 15px; /* Mobile padding */
  justify-content: center; /* Centered for mobile */
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  overflow: hidden; /* Ensure no overflow */
}

/* Main Navigation */
.main-nav {
  box-sizing: border-box;
  height: 52px; /* Desktop fixed height */
  display: flex; /* Desktop default display */
  align-items: center;
  overflow: hidden;
  background-color: var(--accent-color); /* Lighter blue */
  width: 100%;
}

.nav-container {
  box-sizing: border-box;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: row; /* Desktop horizontal */
  justify-content: center;
  align-items: center;
  padding: 0 20px; /* Desktop padding */
  gap: 25px; /* Spacing between nav links */
}

.nav-link {
  color: #FFFFFF;
  text-decoration: none;
  font-weight: 600;
  padding: 5px 0;
  white-space: nowrap;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: var(--primary-color);
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

/* Hamburger Menu (hidden on desktop) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  position: relative;
  z-index: 1001; /* Above header-top content */
  flex-shrink: 0;
}

.hamburger-icon {
  display: block;
  width: 25px;
  height: 3px;
  background-color: #FFFFFF;
  position: relative;
  transition: background-color 0.3s ease;
}

.hamburger-icon::before,
.hamburger-icon::after {
  content: '';
  display: block;
  width: 25px;
  height: 3px;
  background-color: #FFFFFF;
  position: absolute;
  transition: transform 0.3s ease;
}

.hamburger-icon::before {
  top: -8px;
}

.hamburger-icon::after {
  top: 8px;
}

.hamburger-menu.active .hamburger-icon {
  background-color: transparent;
}

.hamburger-menu.active .hamburger-icon::before {
  transform: translateY(8px) rotate(45deg);
}

.hamburger-menu.active .hamburger-icon::after {
  transform: translateY(-8px) rotate(-45deg);
}

/* Mobile Off-canvas Menu */
.main-nav.active {
  transform: translateX(0); /* Slide in */
  display: flex; /* Make it visible when active */
}

.nav-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: 998; /* Below menu, above body */
  cursor: pointer;
}

.nav-overlay.active {
  display: block;
}

/* --- Site Footer --- */
.site-footer {
  background-color: var(--text-main); /* Dark background for footer */
  color: #FFFFFF;
  padding: 40px 20px 20px;
  font-size: 14px;
  line-height: 1.6;
}

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

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

.footer-col .footer-logo {
  font-size: 28px;
  font-weight: bold;
  color: #FFFFFF;
  text-decoration: none;
  margin-bottom: 15px;
  display: block;
}

.footer-col .footer-description {
  color: #CCCCCC;
  margin-bottom: 15px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

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

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

.footer-nav a {
  color: #CCCCCC;
  text-decoration: none;
  transition: color 0.3s ease;
}

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

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

.footer-slot-anchor-inner {
  min-height: 1px; /* Ensure it takes up space */
}

/* Anchor visibility constraint: ensure these are not hidden by CSS */
.footer-slot-anchor-inner,
.footer-slot-anchor-inner > * {
  display: initial !important; /* Override any potential display:none */
  visibility: initial !important; /* Override any potential visibility:hidden */
  opacity: initial !important; /* Override any potential opacity:0 */
  height: initial !important;
  max-height: initial !important;
  overflow: initial !important;
}

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

  body {
    padding-top: var(--header-offset);
    overflow-x: hidden; /* Ensure body doesn't scroll horizontally */
  }

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

  .site-header {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); /* Slightly less shadow for mobile */
  }

  .header-top {
    height: 60px; /* Mobile fixed height */
    padding: 0 15px; /* Mobile padding */
    position: relative; /* For absolute logo centering */
  }

  .header-container {
    padding: 0; /* Container padding handled by header-top */
    justify-content: space-between; /* Hamburger left, logo center (visually), empty right */
    position: static; /* Reset for mobile */
  }

  .hamburger-menu {
    display: block; /* Show hamburger on mobile */
    color: #FFFFFF;
    position: relative;
    z-index: 1001; /* Ensure it's above logo for interaction */
    margin-left: -10px; /* Adjust padding */
  }
  .hamburger-menu .hamburger-icon,
  .hamburger-menu .hamburger-icon::before,
  .hamburger-menu .hamburger-icon::after {
    background-color: #FFFFFF; /* Ensure white color */
  }

  /* Mobile Logo Centering (Method 1: Flexbox) */
  .logo {
    flex: 1 !important; /* Take available space */
    display: flex !important;
    justify-content: center !important; /* Center content within flex item */
    align-items: center !important;
    position: absolute; /* Take out of flow to center truly */
    left: 50%;
    transform: translateX(-50%);
    height: 100%; /* Ensure it spans header-top height */
    max-width: calc(100% - 100px); /* Leave space for hamburger and potential right element */
  }
  .logo img {
    max-height: 56px !important; /* Mobile max height */
    max-width: 100%;
    height: auto;
  }

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

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    min-height: 48px;
    height: auto; /* Allow height to adjust if text wraps */
    padding: 8px 15px; /* Adjust padding for buttons */
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap; /* Prevent buttons from wrapping */
    background-color: var(--page-bg); /* Use page background for this section */
    box-shadow: inset 0 -1px 0 rgba(0,0,0,0.05); /* subtle separator */
  }

  .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 10px gap */
    padding: 8px 12px; /* Smaller padding for mobile buttons */
    font-size: 13px; /* Smaller font for mobile buttons */
    white-space: normal; /* Allow text wrap */
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-align: center;
    border-radius: 20px; /* Slightly smaller border-radius */
  }

  .main-nav {
    display: none; /* Hide main nav by default on mobile */
    position: fixed; /* Fixed for off-canvas */
    top: var(--header-offset); /* Position below fixed header and mobile buttons */
    left: 0;
    width: 80%; /* Off-canvas width */
    height: calc(100% - var(--header-offset)); /* Fill remaining height */
    background-color: var(--text-main); /* Dark background for off-canvas menu */
    transform: translateX(-100%); /* Start off-screen */
    transition: transform 0.3s ease-out;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    overflow-y: auto; /* Scrollable if content is long */
    box-sizing: border-box;
    padding: 20px 0;
  }

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

  .nav-container {
    flex-direction: column; /* Vertical menu items */
    gap: 0; /* No gap for vertical list */
    padding: 0 20px; /* Padding for menu items */
    width: 100%;
    max-width: none; /* No max-width for mobile container */
    height: auto;
  }

  .nav-link {
    display: block;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    text-align: left;
    width: 100%;
  }
  .nav-link:last-child {
    border-bottom: none;
  }
  .nav-link:hover {
    color: var(--accent-color);
  }

  /* Footer responsive */
  .site-footer {
    padding: 30px 15px 15px;
  }

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

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

  .footer-col h3 {
    margin-bottom: 10px;
  }
  .footer-col .footer-logo {
    text-align: left;
  }

  .footer-bottom {
    padding-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;
  }
}
