:root {
  --header-offset: 122px; /* 68px (header-top) + 52px (main-nav) + 2px buffer */
  --primary-color: #11A84E;
  --accent-color: #22C768;
  --text-main-color: #F2FFF6;
  --text-secondary-color: #A7D9B8;
  --background-color: #08160F;
  --card-bg-color: #11271B;
  --deep-green-color: #0A4B2C;
  --border-color: #2E7A4E;
  --button-gradient: linear-gradient(180deg, #2AD16F 0%, #13994A 100%);
  --divider-color: #1E3A2A;
}

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

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

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

/* Site Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  box-sizing: border-box; /* Ensure padding/border included in width */
  background-color: var(--deep-green-color); /* Fallback, but header-top and main-nav will define their own */
}

/* Header Top Section */
.header-top {
  box-sizing: border-box;
  height: 68px; /* Desktop fixed height */
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--deep-green-color); /* Deep Green for top bar */
  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; /* Padding for logo/buttons from container edge */
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--text-main-color);
  white-space: nowrap;
  flex-shrink: 0; /* Prevent logo from shrinking */
}

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

/* 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; /* Mobile fixed height, but only visible on mobile */
  background-color: var(--card-bg-color); /* Different background for mobile buttons */
  width: 100%;
  padding: 0 15px; /* Adjust padding for mobile */
}

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

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

.main-nav ul {
  display: flex;
  gap: 25px; /* Spacing between nav items */
}

.main-nav a {
  padding: 10px 0;
  font-weight: bold;
  font-size: 16px;
  color: var(--text-main-color);
  white-space: nowrap;
  transition: color 0.3s ease;
}

.main-nav a:hover {
  color: var(--text-secondary-color);
}

/* 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 logo on mobile */
  margin-right: 15px; /* Space between hamburger and logo */
}

.hamburger-menu span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--text-main-color);
  margin: 5px 0;
  transition: all 0.3s ease;
}

/* Hamburger Menu Active State (for X icon) */
.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 (hidden by default) */
.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 content */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.overlay.active {
  display: block; /* Show on active */
  opacity: 1;
  visibility: visible;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 8px;
  background: var(--button-gradient);
  color: var(--text-main-color);
  font-weight: bold;
  font-size: 15px;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  text-decoration: none; /* Remove underline */
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* Footer */
.site-footer {
  background-color: var(--background-color); /* Dark background */
  padding: 40px 20px 20px;
  color: var(--text-secondary-color);
  font-size: 14px;
  box-sizing: border-box;
  width: 100%;
}

.footer-top-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto 30px auto;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--divider-color); /* Divider */
}

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

.footer-logo {
  font-size: 26px;
  font-weight: bold;
  color: var(--text-main-color);
  margin-bottom: 15px;
  display: block;
}

.footer-description {
  line-height: 1.6;
  margin-bottom: 15px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  color: var(--text-secondary-color);
}

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

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

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

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

.footer-bottom p {
  margin: 0;
}

/* Dynamic Slot Anchors - ensure they are visible and don't hide content */
.footer-slot-anchor-inner {
  min-height: 1px; /* Ensure visibility for injection */
  display: block;
  width: 100%;
}

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

  body {
    padding-top: var(--header-offset);
    overflow-x: hidden; /* Prevent body overflow on mobile */
  }

  /* 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: hidden;
  }

  /* Header adjustments */
  .header-top {
    height: 60px !important; /* Mobile fixed height */
    padding: 0 15px; /* Adjust for smaller screens */
  }

  .header-container {
    padding: 0; /* Remove container padding, hamburger/logo/buttons will handle it */
    justify-content: space-between;
    position: relative; /* For absolute logo centering */
  }

  .hamburger-menu {
    display: block; /* Show hamburger on mobile */
    margin-right: 0; /* No margin as logo will be centered */
    position: relative; /* Keep hamburger above logo if needed */
    z-index: 1002; /* Ensure it's clickable */
  }

  .logo {
    flex: 1; /* Allow logo to take available space */
    text-align: center; /* Center text logo */
    position: absolute; /* Absolute position for centering */
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 100px); /* Leave space for hamburger and potential right element */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 24px;
    z-index: 1001;
  }

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

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    min-height: 48px; /* Mobile fixed height */
    align-items: center;
    justify-content: center; /* Center buttons horizontally */
    width: 100%; max-width: 100%;
    box-sizing: border-box;
    padding: 8px 15px; /* Adjust padding for mobile */
    overflow: hidden; /* Prevent button overflow */
    gap: 10px;
    flex-wrap: nowrap; /* Ensure buttons stay in one line */
    background-color: var(--card-bg-color); /* Match background with card BG */
    border-bottom: 1px solid var(--border-color); /* Add a subtle border */
  }

  .mobile-nav-buttons .btn {
    flex: 1; min-width: 0; /* Distribute space evenly */
    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 to wrap */
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .main-nav {
    height: auto; /* Auto height for expanded menu */
    min-height: 48px !important; /* Mobile fixed height for hidden state */
    position: fixed; /* Fixed position for mobile menu */
    top: var(--header-offset); /* Position below fixed header and mobile buttons */
    left: 0;
    width: 80%; /* Menu width */
    max-width: 300px; /* Max width for mobile menu */
    background-color: var(--deep-green-color); /* Use deep green for mobile menu */
    transform: translateX(-100%); /* Hidden by default */
    transition: transform 0.3s ease-in-out;
    display: none; /* Crucial: hide by default for mobile */
    flex-direction: column; /* Vertical layout for mobile menu items */
    justify-content: flex-start;
    padding: 20px 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.4);
    overflow-y: auto; /* Allow scrolling if menu content is long */
    height: calc(100vh - var(--header-offset)); /* Fill remaining viewport height */
  }

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

  .nav-container {
    flex-direction: column; /* Vertical nav items */
    padding: 0;
    height: auto;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 0; /* No gap for vertical list */
    width: 100%;
  }

  .main-nav li {
    width: 100%;
    border-bottom: 1px solid var(--border-color); /* Separator for menu items */
  }
  .main-nav li:last-child {
    border-bottom: none;
  }

  .main-nav a {
    display: block;
    padding: 15px 20px;
    width: 100%;
    box-sizing: border-box;
    font-size: 16px;
  }

  /* Footer adjustments */
  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column layout */
    gap: 20px;
    padding-left: 15px;
    padding-right: 15px;
  }

  .footer-col {
    text-align: center; /* Center footer content */
  }

  .footer-col h3 {
    margin-top: 20px;
  }

  .footer-logo {
    margin-bottom: 10px;
  }

  .footer-nav ul {
    text-align: center;
  }

  .footer-bottom {
    padding-left: 15px;
    padding-right: 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;
  }
}
/* 内容保护（系统追加，请勿删除） */
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;
}
