/* General Reset & Base */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: #333;
  line-height: 1.6;
  padding-top: var(--header-offset); /* Critical for fixed header */
  overflow-x: hidden; /* Prevent horizontal scroll from layout issues */
}

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

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

/* Header Offset Variables */
:root {
  --header-offset: 122px; /* Desktop: 68px (header-top) + 52px (main-nav) */
}

/* Site Header - Fixed Positioning */
.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: #017439; /* Fallback for the whole header */
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Header Top Bar */
.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: #017439; /* Primary color */
  color: #FFFFFF;
}

.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 */
.logo {
  font-size: 28px;
  font-weight: bold;
  color: #FFFFFF;
  text-transform: uppercase;
  display: block; /* Ensure logo is visible */
}

/* Hamburger Menu (Desktop - hidden) */
.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 other header elements */
}

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

.hamburger-menu .bar:nth-child(1) { top: 0; }
.hamburger-menu .bar:nth-child(2) { top: 50%; transform: translateY(-50%); }
.hamburger-menu .bar:nth-child(3) { bottom: 0; }

.hamburger-menu.active .bar:nth-child(1) { transform: translateY(10.5px) rotate(45deg); }
.hamburger-menu.active .bar:nth-child(2) { opacity: 0; }
.hamburger-menu.active .bar:nth-child(3) { transform: translateY(-10.5px) rotate(-45deg); }

/* Desktop Navigation Buttons */
.desktop-nav-buttons {
  display: flex; /* Visible on desktop */
  gap: 12px;
  align-items: center;
}

/* Mobile Navigation Buttons (Desktop - hidden) */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden on desktop */
  min-height: 48px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

/* Main Navigation Bar */
.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex; /* Visible on desktop */
  align-items: center;
  overflow: hidden;
  background-color: #FFFFFF; /* Secondary color */
  color: #017439; /* Text color for main nav */
}

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

.nav-link {
  font-size: 16px;
  font-weight: bold;
  color: #017439; /* Primary color for nav links */
  padding: 5px 0;
  transition: color 0.3s ease;
  white-space: nowrap; /* Prevent wrapping */
}

.nav-link:hover {
  color: #005f2e; /* Slightly darker green on hover */
}

/* Buttons General Style */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 5px;
  font-weight: bold;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none; /* No underline for buttons */
  white-space: nowrap; /* Prevent text wrapping on desktop */
}

.btn-register {
  background-color: #C30808; /* Register color */
  color: #FFFF00; /* Register font color */
  border: 1px solid #C30808;
}

.btn-register:hover {
  background-color: #a30707;
  border-color: #a30707;
}

.btn-login {
  background-color: #C30808; /* Login color */
  color: #FFFF00; /* Login font color */
  border: 1px solid #C30808;
}

.btn-login:hover {
  background-color: #a30707;
  border-color: #a30707;
}

/* Overlay for Mobile Menu */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999; /* Below menu, above content */
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.overlay.active {
  visibility: visible;
  opacity: 1;
}

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

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

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

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

.footer-col .footer-nav a {
  color: #FFFFFF;
  transition: color 0.3s ease;
}

.footer-col .footer-nav a:hover {
  color: #f0f0f0;
}

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

.footer-description {
  margin-bottom: 15px;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

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

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

/* Dynamic slot anchor inner containers - ensure they don't hide content */
.footer-slot-anchor-inner {
  min-height: 1px; /* Ensure it takes up minimal space if empty */
}

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

  /* 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 Top Bar 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, use header-top padding */
    justify-content: space-between; /* Space between hamburger and logo */
    position: relative; /* For logo centering */
  }

  /* Hamburger Menu Mobile */
  .hamburger-menu {
    display: block; /* Visible on mobile */
    order: 1; /* Place on the left */
  }

  /* Logo Mobile - Centering for text logo, flex method for image logo */
  .logo {
    flex: 1 !important; /* Take available space */
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 100px); /* Leave space for hamburger and potential right-side element */
  }

  /* Desktop Nav Buttons (Hidden on Mobile) */
  .desktop-nav-buttons {
    display: none !important;
  }

  /* Mobile Nav Buttons (Visible on Mobile) */
  .mobile-nav-buttons {
    display: flex !important; /* Visible on mobile */
    min-height: 48px;
    align-items: center;
    justify-content: center; /* Center buttons horizontally */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px; /* Padding for the container */
    overflow: hidden;
    gap: 10px; /* Space between buttons */
    flex-wrap: nowrap; /* Ensure buttons stay in one line */
    background-color: #f0f0f0; /* Neutral background for mobile buttons */
  }

  .mobile-nav-buttons .btn {
    flex: 1; /* Distribute space equally */
    min-width: 0; /* Allow shrinking */
    max-width: calc(50% - 5px); /* Max width for two buttons with gap */
    box-sizing: border-box;
    padding: 8px 12px; /* Reduced padding */
    font-size: 13px; /* Reduced font size */
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Main Navigation Bar Mobile (Initially Hidden, Fixed) */
  .main-nav {
    display: none; /* Hidden by default */
    position: fixed; /* Fixed position for mobile menu */
    top: var(--header-offset); /* Position below header */
    left: 0;
    width: 280px; /* Width of the mobile menu */
    height: calc(100% - var(--header-offset)); /* Full height below header */
    background-color: #017439; /* Primary color for mobile menu */
    flex-direction: column; /* Vertical menu items */
    padding: 20px 0;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    transform: translateX(-100%); /* Slide out to the left */
    transition: transform 0.3s ease; /* Transition for sliding */
    z-index: 1000; /* Below hamburger menu */
    align-items: flex-start; /* Align menu items to the left */
  }

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

  .nav-container {
    width: 100%;
    max-width: none; /* Remove max-width */
    flex-direction: column; /* Vertical menu items */
    align-items: flex-start; /* Align text to left */
    gap: 15px; /* Spacing between vertical links */
    padding: 0 20px;
  }

  .nav-link {
    width: 100%; /* Full width for clickable area */
    color: #FFFFFF; /* White text for mobile menu */
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Separator */
  }

  .nav-link:last-child {
    border-bottom: none;
  }

  /* Footer Mobile */
  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
    padding: 0 15px;
  }

  .footer-col {
    margin-bottom: 20px;
  }

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