:root { --header-offset: 122px; }
body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: #333;
  padding-top: var(--header-offset); /* IMPORTANT: Only here */
  overflow-x: hidden; /* For mobile content overflow */
}

body.no-scroll {
  overflow: hidden;
}

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

/* Header */
.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.2);
  background-color: transparent; /* Base, actual colors set on header-top/main-nav */
}

/* Header Top */
.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: #017439; /* Primary color */
  width: 100%;
  color: #FFFF00; /* Logo 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-left: 20px;
  padding-right: 20px;
}

.logo {
  font-weight: bold;
  font-size: 24px;
  color: #FFFF00; /* Logo text color */
  text-decoration: none;
  line-height: 1;
  display: flex;
  align-items: center;
  height: 100%;
}

.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;
  gap: 12px;
  align-items: center;
}

.btn {
  background-color: #C30808; /* Red for buttons */
  color: #FFFF00; /* Yellow for button text */
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  white-space: nowrap;
  transition: background-color 0.3s ease;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:hover {
  background-color: #a30707; /* Darker red on hover */
}

/* Mobile Nav Buttons (hidden by default on desktop) */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden on desktop by default */
  min-height: 48px; /* Minimum height for mobile */
  background-color: #017439; /* Same as header-top for consistency */
  width: 100%;
  padding-left: 15px;
  padding-right: 15px;
  overflow: hidden; /* Prevent content overflow */
  gap: 10px;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center; /* Center buttons if only one */
}

/* Main Navigation */
.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex; /* Desktop default: flex */
  align-items: center;
  overflow: hidden;
  background-color: #FFFFFF; /* Auxiliary color for nav bar */
  width: 100%;
}

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

.nav-link {
  color: #333; /* Dark text on white background */
  font-weight: bold;
  padding: 5px 0;
  transition: color 0.3s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: #017439; /* Primary color on hover */
}

/* Hamburger Menu (hidden by default 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 */
  flex-shrink: 0;
}

.hamburger-menu span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: #FFFF00; /* Yellow for hamburger lines */
  margin: 5px 0;
  transition: all 0.3s ease;
}

/* Hamburger active state */
.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);
}

/* 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; /* Below menu, above header */
}
.overlay.active {
  display: block;
}

/* Footer */
.site-footer {
  background-color: #017439; /* Primary color for footer */
  color: #FFFFFF;
  padding: 40px 20px 20px;
  font-size: 14px;
}

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

.footer-col h3 {
  color: #FFFF00; /* Yellow for footer headings */
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 16px;
}

.footer-logo {
  font-weight: bold;
  font-size: 24px;
  color: #FFFF00; /* Yellow for footer logo */
  margin-bottom: 15px;
  display: block;
}

.footer-description {
  line-height: 1.6;
  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: #FFFFFF;
  transition: color 0.3s ease;
}

.footer-nav a:hover {
  color: #FFFF00; /* Yellow on hover */
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin-top: 20px;
}

.footer-bottom p {
  margin: 0;
  color: #FFFFFF;
}

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

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

  /* Mobile Header Top */
  .header-top {
    min-height: 60px !important;
    height: 60px !important;
  }
  .header-container {
    width: 100%;
    max-width: none;
    padding-left: 15px;
    padding-right: 15px;
    justify-content: space-between; /* Hamburger and Logo on sides */
  }
  .logo {
    flex: 1 !important; /* Make logo take available space */
    display: flex !important;
    justify-content: center !important; /* Center the logo text */
    align-items: center !important;
    max-width: calc(100% - 100px); /* Adjust max-width to leave space for hamburger */
  }
  .logo img {
    max-height: 56px !important; /* Mobile max height */
  }
  .desktop-nav-buttons {
    display: none !important; /* Hide desktop buttons on mobile */
  }
  .hamburger-menu {
    display: block; /* Show hamburger menu on mobile */
    order: -1; /* Place hamburger first */
  }

  /* Mobile Nav Buttons */
  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    min-height: 48px; /* Fixed height */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding-left: 15px;
    padding-right: 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap; /* Ensure buttons stay on one line */
    align-items: center;
    justify-content: center; /* Center buttons horizontally */
  }
  .mobile-nav-buttons .btn {
    flex: 1; /* Distribute space equally */
    min-width: 0;
    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;
  }

  /* Mobile Main Navigation */
  .main-nav {
    min-height: 48px !important;
    height: calc(100% - var(--header-offset)) !important; /* Take remaining height */
    position: fixed; /* Fixed position for off-screen menu */
    top: var(--header-offset);
    left: 0;
    width: 80%; /* Menu width */
    max-width: 300px; /* Max menu width */
    flex-direction: column; /* Vertical menu */
    transform: translateX(-100%); /* Hidden off-screen */
    transition: transform 0.3s ease;
    background-color: #017439; /* Primary color for mobile menu background */
    overflow-y: auto; /* Scroll if content overflows */
    z-index: 1001; /* Above header */
    display: none; /* Hidden by default */
  }
  .main-nav.active {
    transform: translateX(0); /* Slide in */
    display: flex; /* Make it visible when active */
  }
  .nav-container {
    width: 100%;
    max-width: none; /* No max-width on mobile */
    padding-left: 15px;
    padding-right: 15px;
    flex-direction: column;
    align-items: flex-start; /* Align menu items to left */
    gap: 15px; /* Spacing between menu items */
    padding-top: 20px;
    padding-bottom: 20px;
  }
  .nav-link {
    width: 100%; /* Full width for links */
    color: #FFFFFF; /* White text on primary background */
    padding: 10px 0;
  }
  .nav-link:hover {
    color: #FFFF00; /* Yellow on hover */
  }

  /* Mobile Content 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 is already set globally */

  /* Footer adjustments */
  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
  }
  .footer-col {
    margin-bottom: 20px;
  }
  .footer-col:last-child {
    margin-bottom: 0;
  }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
}
