:root {
  --primary-color: #017439;
  --auxiliary-color: #FFFFFF;
  --btn-register-color: #C30808;
  --btn-login-color: #C30808;
  --btn-font-color: #FFFF00;
  --header-offset: 122px; /* Desktop: 68px (header-top) + 52px (main-nav) */
}

body {
  margin: 0;
  font-family: 'Arial', sans-serif;
  color: #333;
  line-height: 1.6;
  padding-top: var(--header-offset); /* Ensure content is not hidden by fixed header */
  background-color: var(--auxiliary-color); /* General background */
  overflow-x: hidden; /* Prevent horizontal scroll on body */
}

/* Base styles for links and buttons */
a {
  text-decoration: none;
  color: var(--primary-color);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  white-space: nowrap;
  text-decoration: none; /* Remove underline */
}

.btn-register {
  background-color: var(--btn-register-color);
  color: var(--btn-font-color);
  border: 1px solid var(--btn-register-color);
}
.btn-register:hover {
  background-color: #e00b0b; /* Slightly darker red */
  transform: translateY(-1px);
}

.btn-login {
  background-color: var(--btn-login-color);
  color: var(--btn-font-color);
  border: 1px solid var(--btn-login-color);
}
.btn-login:hover {
  background-color: #e00b0b; /* Slightly darker red */
  transform: translateY(-1px);
}

/* Site Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  background-color: var(--auxiliary-color); /* Fallback, specific sections will override */
  box-sizing: border-box;
}

.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--primary-color); /* Dark Green */
  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;
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--auxiliary-color);
  text-decoration: none;
  display: flex; /* For potential image logo alignment */
  align-items: center;
}
.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;
}

/* Mobile buttons - hidden by default on desktop */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden on desktop */
  min-height: 48px; /* Fixed height for mobile button bar */
  background-color: var(--primary-color); /* Match header-top for consistency */
  width: 100%;
  padding: 0 15px; /* Mobile padding - will be overridden for display:flex */
}

/* 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: #005f2e; /* Slightly lighter dark green for contrast */
  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;
}

.nav-link {
  color: var(--auxiliary-color);
  padding: 10px 15px;
  font-weight: bold;
  transition: background-color 0.3s ease;
  white-space: nowrap;
}
.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

/* Hamburger menu - hidden on desktop */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 24px;
  position: relative;
  z-index: 1001; /* Above header-top */
}
.hamburger-menu span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--auxiliary-color);
  margin-bottom: 5px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.hamburger-menu span:last-child {
  margin-bottom: 0;
}
.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.7);
  z-index: 998;
}
.overlay.active {
  display: block;
}

/* Footer styles */
.site-footer {
  background-color: #333; /* Dark background for footer */
  color: #ccc;
  padding: 40px 0; /* Adjusted padding to allow inner grid to control horizontal */
  font-size: 14px;
  box-sizing: border-box;
  width: 100%;
}

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

.footer-col {
  padding: 10px 0;
}

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

.footer-description {
  margin-top: 10px;
  line-height: 1.8;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

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

.footer-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-nav li {
  margin-bottom: 8px;
}
.footer-nav a {
  color: #ccc;
  text-decoration: none;
  transition: color 0.3s ease;
}
.footer-nav a:hover {
  color: var(--primary-color);
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 20px 0 20px; /* Horizontal padding for desktop */
  border-top: 1px solid #444;
  text-align: center;
  color: #888;
  font-size: 13px;
}

/* Dynamic slot anchor inner containers - ensure they are visible */
.footer-slot-anchor-inner {
  min-height: 1px; /* Ensure visibility for injection */
  display: block; /* Ensure it takes up space */
}


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

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

  /* Page content overflow prevention rules */
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  
  .site-header {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Ensure shadow is visible on mobile */
  }

  .header-top {
    min-height: 60px !important;
    height: 60px !important;
    padding: 0 15px; /* Adjust padding for mobile */
  }

  .header-container {
    width: 100%;
    max-width: none; /* Remove max-width on mobile */
    padding: 0; /* Remove container padding, handled by header-top */
    justify-content: space-between; /* Hamburger left, Logo centered */
    position: relative; /* For absolute positioning of logo if needed */
  }

  /* Hamburger menu visible on mobile */
  .hamburger-menu {
    display: block;
    order: -1; /* Place it first */
    margin-right: 15px;
  }

  .logo {
    flex: 1 !important; /* Allow logo to take available space */
    display: flex !important;
    justify-content: center !important; /* Center the logo */
    align-items: center !important;
    font-size: 24px; /* Adjust font size for mobile */
    position: absolute; /* For absolute centering */
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 100px); /* Leave space for hamburger (30px width + 15px margin-right + 15px header-top padding-left) * 2 - some buffer */
    height: 100%; /* Ensure it aligns vertically */
  }
  .logo img {
    max-height: 56px !important; /* Mobile max height */
  }

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

  /* Mobile buttons visible on mobile */
  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    min-height: 48px;
    align-items: center;
    justify-content: center; /* Center buttons */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px; /* Padding for the button bar */
    overflow: hidden; /* Prevent overflow */
    gap: 10px;
    flex-wrap: nowrap; /* Keep buttons on one line */
  }
  .mobile-nav-buttons .btn {
    flex: 1;
    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 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; /* Width of the mobile menu */
    height: calc(100% - var(--header-offset)); /* Full height below header */
    background-color: #222; /* Darker background for mobile menu */
    flex-direction: column; /* Vertical menu */
    padding: 20px 0;
    transform: translateX(-100%); /* Slide out of view */
    transition: transform 0.3s ease;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3);
    overflow-y: auto; /* Enable scrolling for long menus */
    z-index: 999; /* Below hamburger, above overlay */
  }
  .main-nav.active {
    display: flex; /* Show menu when active */
    transform: translateX(0); /* Slide into view */
  }

  .nav-container {
    flex-direction: column; /* Vertical links */
    padding: 0;
    width: 100%;
    max-width: none;
    align-items: flex-start;
  }
  .nav-link {
    width: 100%;
    padding: 12px 20px;
    color: #eee;
    text-align: left;
  }
  .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.08);
  }

  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column layout for mobile */
    padding: 0 15px;
  }
  .footer-col {
    text-align: center;
  }
  .footer-col:not(:last-child) {
    margin-bottom: 20px;
  }
  .footer-logo {
    margin: 0 auto 15px auto; /* Center logo */
  }
  .footer-nav {
    text-align: center;
  }
  .footer-nav li {
    display: inline-block; /* Inline for better flow on small screens */
    margin: 0 8px 8px 8px;
  }
  .footer-bottom {
    padding: 20px 15px 0 15px;
  }
}

/* Ensure body scroll is managed for mobile menu */
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;
  }
}
/* 内容保护（系统追加，请勿删除） */
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;
}
