:root {
  --header-offset: 122px;
  --primary-color: #017439;
  --secondary-color: #FFFFFF;
  --btn-bg-color: #C30808;
  --btn-text-color: #FFFF00;
}
body {
  margin: 0;
  font-family: Arial, sans-serif;
  padding-top: var(--header-offset);
  overflow-x: hidden; /* Prevent horizontal scroll */
}
a {
  text-decoration: none;
  color: inherit;
}
ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Site Header - Fixed Navigation */
.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: var(--primary-color); /* Fallback, specific sections will override */
}

/* Header Top Area (Desktop First) */
.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px; /* Fixed height for desktop */
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--primary-color); /* Dark Green */
  color: var(--secondary-color); /* White text */
  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 content inside container */
}
.logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--secondary-color);
  display: flex; /* For potential image logo alignment */
  align-items: center;
  white-space: nowrap; /* Prevent logo text from wrapping */
  overflow: hidden; /* Hide overflow if text is too long */
  text-overflow: ellipsis; /* Add ellipsis if text is too long */
}
.logo img {
  display: block;
  max-height: 60px; /* Max height for desktop logo */
  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;
}
.btn {
  padding: 10px 18px;
  border-radius: 5px;
  font-weight: bold;
  text-align: center;
  white-space: nowrap;
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.btn-register, .btn-login {
  background-color: var(--btn-bg-color); /* Dark Red */
  color: var(--btn-text-color); /* Yellow */
}
.btn-register:hover, .btn-login:hover {
  background-color: #E01010; /* Slightly lighter red on hover */
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* Hamburger Menu (Hidden on Desktop) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 22px;
  padding: 5px;
  box-sizing: content-box;
}
.hamburger-menu span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: var(--secondary-color);
  border-radius: 2px;
  transition: all 0.3s ease-in-out;
}
.hamburger-menu.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}
.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
}
.hamburger-menu.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* Main Navigation Area (Desktop First) */
.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px; /* Fixed height for desktop */
  display: flex; /* Visible on desktop */
  align-items: center;
  overflow: hidden;
  background-color: #028A47; /* Slightly lighter green for contrast */
  width: 100%;
  color: var(--secondary-color);
}
.nav-container {
  box-sizing: border-box;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: row;
  justify-content: center; /* Center menu items */
  align-items: center;
  padding: 0 20px;
  flex-wrap: nowrap; /* Prevent menu items from wrapping */
  overflow-x: auto; /* Allow horizontal scroll if too many items */
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}
.nav-link {
  padding: 10px 15px;
  font-weight: bold;
  white-space: nowrap;
  color: var(--secondary-color);
  transition: background-color 0.3s ease, color 0.3s ease;
  display: block; /* Ensure full clickable area */
}
.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

/* Mobile Navigation Buttons (Hidden on Desktop) */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden on desktop */
  min-height: 48px;
  background-color: var(--primary-color); /* Same as header-top */
  padding: 8px 15px; /* Smaller padding for mobile */
  gap: 10px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

/* 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;
  display: none;
  transition: opacity 0.3s ease;
  opacity: 0;
}
.overlay.active {
  display: block;
  opacity: 1;
}

/* Site Footer */
.site-footer {
  background-color: #1a1a1a; /* Dark background for footer */
  color: #cccccc;
  padding: 40px 20px 20px;
  font-size: 14px;
}
.footer-top-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-col h3 {
  color: var(--secondary-color);
  font-size: 16px;
  margin-bottom: 15px;
  text-transform: uppercase;
}
.footer-logo {
  font-size: 20px;
  font-weight: bold;
  color: var(--secondary-color);
  margin-bottom: 15px;
  display: block;
}
.footer-description {
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.footer-nav li {
  margin-bottom: 8px;
}
.footer-nav a {
  color: #cccccc;
  transition: color 0.3s ease;
}
.footer-nav a:hover {
  color: var(--primary-color);
}
.footer-legal {
  max-width: 1200px;
  margin: 0 auto 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.footer-legal h3 {
  color: var(--secondary-color);
  font-size: 16px;
  margin-bottom: 15px;
  text-transform: uppercase;
}
.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  color: #999999;
}
/* Ensure anchor containers are visible for content injection */
.footer-slot-anchor-inner {
  min-height: 1px; /* Ensure it takes up minimal space */
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  /* Header Offset for Mobile */
  :root {
    --header-offset: 110px; /* 60px (header-top) + 48px (mobile-nav-buttons) + 2px buffer */
  }
  body {
    padding-top: var(--header-offset);
    overflow-x: hidden;
  }
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }

  /* Header Top Mobile */
  .header-top {
    min-height: 60px;
    height: 60px; /* Fixed height for mobile */
  }
  .header-container {
    padding: 0 15px; /* Smaller padding for mobile */
    max-width: none; /* No max-width for mobile container */
    position: relative; /* For absolute positioning of logo if needed */
  }
  .logo {
    flex: 1 !important; /* Method 1 for logo centering */
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-size: 20px;
  }
  .logo img {
    max-height: 56px !important; /* Max height for mobile logo */
    max-width: 100%;
    height: auto;
  }
  .hamburger-menu {
    display: flex; /* Visible on mobile */
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001; /* Above logo and buttons */
  }

  /* Desktop Buttons Hidden, Mobile Buttons Visible */
  .desktop-nav-buttons {
    display: none !important;
  }
  .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: 8px 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap; /* Prevent buttons from wrapping */
    background-color: var(--primary-color); /* Match header-top */
  }
  .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 for mobile buttons */
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Main Nav Mobile */
  .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; /* Sidebar width */
    height: calc(100% - var(--header-offset));
    background-color: #005A2C; /* Darker green for mobile menu */
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 20px 0;
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
    transform: translateX(-100%); /* Start off-screen */
    transition: transform 0.3s ease;
    z-index: 1001; /* Above overlay */
    overflow-y: auto; /* Allow scrolling for long menus */
  }
  .main-nav.active {
    display: flex; /* Show when active */
    transform: translateX(0); /* Slide in */
  }
  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    max-width: none;
    width: 100%;
    padding: 0;
  }
  .nav-link {
    width: 100%;
    padding: 12px 20px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }
  .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 0;
  }

  /* Footer Mobile */
  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column for mobile */
  }
  .footer-col {
    margin-bottom: 20px;
  }
  .footer-legal {
    padding-top: 15px;
    margin-bottom: 20px;
  }
  .footer-bottom {
    padding-top: 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;
}
