/* Basic Reset & Body Padding */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333333; /* Default text color */
  padding-top: var(--header-offset); /* Fixed header offset */
  overflow-x: hidden; /* Prevent horizontal scroll for body */
}

.no-scroll { 
  overflow: hidden; 
}

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

/* Site Header - Fixed Positioning & Styling */
.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.1);
  background-color: #FFFFFF; /* Secondary color for overall header */
}

/* Header Top Section */
.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px; /* Fixed height for desktop */
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: #017439; /* Primary color for header-top */
  color: #FFFFFF;
  width: 100%;
  position: relative; /* For hamburger menu positioning */
}

.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 Styling */
.logo {
  font-weight: bold;
  font-size: 28px;
  color: #FFFF00; /* Yellow for logo text, high contrast on green */
  text-decoration: none;
  white-space: nowrap;
  display: flex; /* For potential image logo centering */
  align-items: center;
  height: 100%;
}
.logo img {
  display: block;
  max-height: 60px; /* Desktop image logo max height */
  height: auto;
  width: auto;
  max-width: 280px;
  object-fit: contain;
}

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

/* Mobile Navigation 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 */
  background-color: #f0f0f0; /* Light background for mobile buttons */
  width: 100%;
}

/* Main Navigation Section */
.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px; /* Fixed height for desktop */
  display: flex; /* Desktop default: visible */
  align-items: center;
  overflow: hidden;
  background-color: #FFFFFF; /* Secondary color 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;
  align-items: center;
  padding: 0 20px;
}

.nav-link {
  color: #017439; /* Primary color for links */
  text-decoration: none;
  padding: 10px 15px;
  white-space: nowrap;
  transition: background-color 0.3s ease, color 0.3s ease;
  font-weight: bold;
}

.nav-link:hover, .nav-link.active {
  background-color: #017439; /* Primary color on hover */
  color: #FFFFFF;
  border-radius: 4px;
}

/* Buttons Styling */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  border: none;
}

.btn-register {
  background-color: #C30808; /* Custom Register color */
  color: #FFFF00; /* Custom Register/Login font color */
}

.btn-login {
  background-color: #C30808; /* Custom Login color */
  color: #FFFF00; /* Custom Register/Login font color */
}

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

/* Hamburger Menu (hidden on desktop) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  width: 30px;
  height: 24px;
  position: absolute; /* Positioned relative to header-top */
  left: 15px; /* Adjust for padding */
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  z-index: 1001; /* Above header-top content */
}

.hamburger-menu span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: #FFFFFF; /* White for contrast on green header-top */
  border-radius: 2px;
  transition: all 0.3s ease-in-out;
}

.hamburger-menu.active span:nth-child(1) {
  transform: translateY(10.5px) rotate(45deg);
}
.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
}
.hamburger-menu.active span:nth-child(3) {
  transform: translateY(-10.5px) 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 mobile menu, above main content */
}

.overlay.active {
  display: block;
}

/* Footer Styling */
.site-footer {
  background-color: #333333; /* Dark background for footer */
  color: #cccccc;
  padding: 40px 20px 20px;
  font-size: 14px;
}

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

.footer-col h3 {
  color: #FFFFFF; /* White headings */
  font-size: 18px;
  margin-bottom: 15px;
}

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

.footer-description {
  margin-bottom: 15px;
  line-height: 1.8;
  word-wrap: break-word; /* Ensure long text wraps */
  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: #FFFFFF;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #555555;
  max-width: 1200px;
  margin: 0 auto;
}

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

/* Footer Slot Anchors - ensure they are visible */
.footer-slot-anchor-inner {
  min-height: 1px; /* Ensure element exists and can be seen */
  visibility: visible;
  opacity: 1;
  height: auto;
  max-height: unset;
  overflow: visible;
}

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

  /* Header Top */
  .header-top {
    min-height: 60px;
    height: 60px; /* Fixed height for mobile */
  }

  .header-container {
    padding-left: 15px;
    padding-right: 15px;
    /* For mobile, flex: 1 for hamburger, flex:1 for logo to center it, then empty flex:1 */
    justify-content: space-between; /* To push hamburger left, logo center */
    position: relative; /* For absolute positioning of logo */
  }

  /* Hamburger Menu */
  .hamburger-menu {
    display: flex; /* Visible on mobile */
    left: 15px;
  }

  /* Logo Centering on Mobile (Method 2: Absolute Positioning for robust centering) */
  .logo {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    max-width: calc(100% - 100px); /* Adjust width to not overlap hamburger/buttons */
  }
  .logo img {
    max-height: 56px !important; /* Mobile image logo max height */
    max-width: 100%;
  }

  /* 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-left: 15px;
    padding-right: 15px;
    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); /* Half width minus 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;
  }

  /* Main Navigation (mobile menu) */
  .main-nav {
    display: none; /* Hidden by default */
    position: fixed;
    top: var(--header-offset); /* Position below fixed 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 links */
    justify-content: flex-start;
    padding-top: 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    transform: translateX(-100%); /* Off-screen by default */
    transition: transform 0.3s ease-in-out;
    z-index: 1001; /* Above overlay */
    overflow-y: auto; /* Scroll if content is too long */
    max-height: calc(100vh - var(--header-offset)); /* Restrict max height, use 100vh for full viewport */
  }

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

  .main-nav .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 0 15px;
    height: auto; /* Allow content to define height */
    max-width: none; /* Remove max-width for mobile */
  }

  .main-nav .nav-link {
    width: 100%;
    padding: 12px 15px;
    color: #FFFFFF; /* White links on dark green background */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  .main-nav .nav-link:last-child {
    border-bottom: none;
  }
  .main-nav .nav-link:hover, .main-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: #FFFF00; /* Yellow for active/hover */
    border-radius: 0;
  }

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

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

  /* Mobile 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;
  }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
}
