:root {
  --primary-color: #017439;
  --secondary-color: #FFFFFF;
  --btn-register-bg: #C30808;
  --btn-login-bg: #C30808;
  --btn-text-color: #FFFF00;
  --header-offset: 122px; /* Desktop: 68px (header-top) + 52px (main-nav) = 120px, +2px safety */
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  padding-top: var(--header-offset);
  overflow-x: hidden; /* Prevent horizontal scroll for body */
}

/* Site Header - Fixed position, always visible */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  background-color: var(--primary-color); /* Fallback/base color */
  box-sizing: border-box;
}

/* Header Top - Contains Logo and Desktop Buttons */
.header-top {
  height: 68px; /* Fixed height for desktop */
  background-color: var(--primary-color); /* Primary color for top bar */
  display: flex;
  align-items: center;
  justify-content: space-between; /* To place hamburger if needed, and header-container */
  padding: 0 20px; /* Outer padding for header-top */
  box-sizing: border-box;
  overflow: hidden; /* Prevent content overflow */
}

.header-container {
  width: 100%;
  max-width: 1200px; /* Container max-width */
  margin: 0 auto; /* Center container */
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  box-sizing: border-box;
}

/* Logo */
.logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--secondary-color); /* White text for logo */
  text-decoration: none;
  display: block; /* Ensure it's block for proper sizing */
  height: 100%; /* Take full height of header-top */
  display: flex; /* For vertical centering of text */
  align-items: center;
  white-space: nowrap; /* Prevent logo text from wrapping */
}

.logo img {
  display: block;
  max-height: 60px; /* Max height for image logo on desktop */
  height: auto;
  width: auto;
  max-width: 280px;
  object-fit: contain;
}

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

/* Mobile Navigation Buttons - Hidden on desktop */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default on desktop */
  min-height: 48px; /* Fixed height for mobile */
  background-color: var(--secondary-color); /* Distinct background for mobile buttons */
  width: 100%;
  max-width: 100%;
  padding: 0 15px; /* Padding for mobile buttons container */
  overflow: hidden;
}

/* Main Navigation Bar */
.main-nav {
  height: 52px; /* Fixed height for desktop */
  background-color: var(--secondary-color); /* Secondary color for nav bar, distinct from header-top */
  display: flex; /* Desktop: visible */
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden; /* Prevent content overflow */
}

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

.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 25px; /* Spacing between menu items */
}

.main-nav ul li a {
  color: #333333; /* Dark text for menu items on white background */
  text-decoration: none;
  font-weight: bold;
  padding: 10px 0;
  display: block;
  transition: color 0.3s ease;
  white-space: nowrap; /* Prevent menu items from wrapping */
}

.main-nav ul li a:hover {
  color: var(--primary-color); /* Hover effect */
}

/* Hamburger Menu - Hidden on desktop */
.hamburger-menu {
  display: none; /* Hidden by default on desktop */
  background: none;
  border: none;
  font-size: 30px;
  color: var(--secondary-color); /* White hamburger icon */
  cursor: pointer;
  padding: 0;
  line-height: 1;
  z-index: 1002; /* Above header-top content */
}

/* 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;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.overlay.active {
  display: block;
  opacity: 1;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  text-align: center;
  transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
  white-space: nowrap;
  box-sizing: border-box;
  border: none;
  cursor: pointer;
}

.btn-register {
  background-color: var(--btn-register-bg); /* Red for Register */
  color: var(--btn-text-color); /* Yellow text */
  box-shadow: 0 4px 8px rgba(195, 8, 8, 0.3);
}

.btn-register:hover {
  background-color: #A30707; /* Darker red on hover */
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(195, 8, 8, 0.4);
}

.btn-login {
  background-color: var(--btn-login-bg); /* Red for Login */
  color: var(--btn-text-color); /* Yellow text */
  box-shadow: 0 4px 8px rgba(195, 8, 8, 0.3);
}

.btn-login:hover {
  background-color: #A30707; /* Darker red on hover */
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(195, 8, 8, 0.4);
}

/* Footer */
.site-footer {
  background-color: var(--primary-color); /* Primary color for footer */
  color: var(--secondary-color); /* White text for footer */
  padding: 40px 20px 20px;
  font-size: 14px;
  line-height: 1.6;
  box-sizing: border-box;
}

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

.footer-col h4 {
  color: var(--secondary-color);
  font-size: 16px;
  margin-bottom: 15px;
  position: relative;
}

.footer-col h4::after {
  content: '';
  display: block;
  width: 30px;
  height: 2px;
  background-color: var(--secondary-color);
  margin-top: 5px;
}

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

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

.footer-col ul li a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-col ul li a:hover {
  color: #ADD8E6; /* Light blue for hover */
}

.footer-logo {
  font-size: 22px;
  font-weight: bold;
  color: var(--secondary-color);
  text-decoration: none;
  margin-bottom: 15px;
  display: block;
}

.footer-description {
  margin: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

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

.footer-bottom p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
}

/* Slot anchor inner containers - ensure they are visible and don't hide content */
.footer-slot-anchor-inner {
  min-height: 10px; /* Ensure visibility for injection */
  margin-top: 15px;
}

/* Mobile Styles */
@media (max-width: 768px) {
  :root {
    --header-offset: 110px; /* Mobile: 60px (header-top) + 48px (mobile-nav-buttons) = 108px, +2px safety */
  }

  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }

  .header-top {
    height: 60px; /* Fixed height for mobile */
    padding: 0 15px; /* Smaller padding for mobile */
    justify-content: space-between; /* Hamburger left, Logo centered (via flex:1) */
  }

  .header-container {
    width: auto; /* Allow header-container to shrink */
    max-width: none; /* No max-width for container on mobile */
    margin: 0; /* Reset margin */
    padding: 0; /* Reset padding */
    flex-grow: 1; /* Allow it to grow to center logo */
    justify-content: center; /* Center logo within its space */
  }

  .logo {
    flex: 1 !important; /* Allow logo to take space for centering */
    display: flex !important;
    justify-content: center !important; /* Center logo horizontally */
    align-items: center !important;
    margin: 0 !important; /* Reset any margin */
    padding: 0 !important; /* Reset any padding */
    max-width: calc(100% - 60px); /* Account for hamburger width */
  }

  .logo img {
    max-height: 56px !important; /* Max height for image logo on mobile */
  }

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

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons on mobile */
    min-height: 48px; /* Fixed height for mobile buttons */
    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;
    gap: 10px;
    flex-wrap: nowrap; /* Prevent buttons from wrapping */
    background-color: var(--secondary-color); /* Ensure distinct background */
  }

  .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 for mobile buttons */
    font-size: 13px; /* Smaller font size for mobile buttons */
    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; /* Minimum height for nav bar */
    position: fixed; /* Fixed position for mobile menu */
    top: var(--header-offset); /* Position below header-top and mobile-buttons */
    left: 0;
    width: 80%; /* Menu width */
    max-width: 300px; /* Max width for menu */
    background-color: var(--primary-color); /* Menu background color */
    transform: translateX(-100%); /* Hidden by default */
    transition: transform 0.3s ease;
    flex-direction: column; /* Vertical layout for menu items */
    align-items: flex-start; /* Align menu items to left */
    padding: 20px 0; /* Padding for menu content */
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    z-index: 1001; /* Above overlay */
    overflow-y: auto; /* Enable scrolling for long menus */
    display: none; /* Crucial: hidden by default, shown with .active */
  }

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

  .nav-container {
    width: 100%;
    max-width: none; /* No max-width for container on mobile */
    padding: 0 15px; /* Smaller padding for mobile */
    flex-direction: column; /* Vertical menu items */
    align-items: flex-start;
  }

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

  .main-nav ul li {
    width: 100%;
  }

  .main-nav ul li a {
    color: var(--secondary-color); /* White text for mobile menu */
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .main-nav ul li:last-child a {
    border-bottom: none;
  }

  .hamburger-menu {
    display: block; /* Show hamburger menu on mobile */
    order: -1; /* Position to the left */
    margin-right: auto; /* Push logo to center */
    padding-left: 0; /* No padding on left for hamburger */
  }

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

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

  .footer-col:last-child {
    margin-bottom: 0;
  }

  .footer-col h4 {
    margin-top: 20px;
  }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
}
