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

/* Global resets for consistent styling */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  padding-top: var(--header-offset); /* Crucial for fixed header */
  overflow-x: hidden; /* Prevent horizontal scroll on body */
}

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

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

/* Header Styles */
.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 */
  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); /* Darker green for top bar */
  width: 100%;
  color: var(--secondary-color);
}

.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 logo and buttons */
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--secondary-color);
  text-transform: uppercase;
  padding: 0; /* Logo itself doesn't need padding, container handles it */
  display: block;
}

.desktop-nav-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: bold;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  text-decoration: none; /* Remove underline for buttons */
}

.btn-register {
  background-color: var(--register-btn-color);
  color: var(--btn-text-color);
  border: none;
}

.btn-register:hover {
  background-color: #a30606; /* Darker shade on hover */
  transform: translateY(-1px);
}

.btn-login {
  background-color: var(--login-btn-color);
  color: var(--btn-text-color);
  border: none;
}

.btn-login:hover {
  background-color: #a30606; /* Darker shade on hover */
  transform: translateY(-1px);
}

/* Mobile buttons - hidden by default on desktop */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden on desktop */
  min-height: 48px; /* Minimum height for mobile button row */
  background-color: var(--primary-color); /* Same as header-top */
  padding: 8px 15px; /* Padding for mobile buttons */
  width: 100%;
}

.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: #005c2e; /* Slightly darker green for nav bar */
  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;
  align-items: center;
  padding: 0 20px;
  width: 100%;
}

.nav-list {
  display: flex;
  gap: 25px;
  height: 100%;
  align-items: center;
}

.nav-list li {
  height: 100%;
  display: flex;
  align-items: center;
}

.nav-list a {
  color: var(--secondary-color);
  font-weight: bold;
  font-size: 16px;
  padding: 0 5px; /* Smaller padding for menu items to fit */
  transition: color 0.3s ease;
  height: 100%;
  display: flex;
  align-items: center;
}

.nav-list a:hover {
  color: #aaffaa; /* Lighter green on hover */
}

/* Hamburger menu - hidden on desktop */
.hamburger-menu {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 24px;
  position: relative;
  z-index: 1002; /* Above mobile menu overlay */
}

.hamburger-menu .bar {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--secondary-color);
  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) {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}
.hamburger-menu.active .bar:nth-child(2) {
  opacity: 0;
}
.hamburger-menu.active .bar:nth-child(3) {
  bottom: 50%;
  transform: translateY(50%) rotate(-45deg);
}

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

.mobile-menu-overlay.active {
  display: block;
  opacity: 1;
}

/* Footer Styles */
.site-footer {
  background-color: #222; /* Dark background for footer */
  color: #ddd;
  padding: 40px 20px 20px;
  font-size: 14px;
  box-sizing: border-box;
  width: 100%;
}

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

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

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

.footer-description {
  line-height: 1.8;
  color: #bbb;
  word-wrap: break-word; /* Ensure full display */
  overflow-wrap: break-word;
}

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

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

.footer-nav a:hover {
  color: var(--secondary-color);
}

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

.footer-bottom p {
  margin: 0;
}

/* Anchor slots - must be visible */
.footer-slot-anchor-inner {
  min-height: 1px; /* Ensure it takes up minimal space but is renderable */
  /* No display:none, visibility:hidden, opacity:0, height:0, max-height:0, overflow:hidden */
}

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

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

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

  /* Header mobile */
  .site-header {
    background-color: var(--primary-color);
  }

  .header-top {
    min-height: 60px !important;
    height: 60px !important;
    padding: 0 15px;
  }

  .header-container {
    padding: 0; /* Handled by header-top padding */
    width: 100%;
    max-width: none; /* Important: remove max-width */
    justify-content: space-between;
    position: relative; /* For absolute positioning of logo */
  }
  
  /* Mobile logo centering (method 1 - flexbox) */
  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    max-width: calc(100% - 100px); /* Leave space for hamburger */
  }
  .logo img {
    max-height: 56px !important; /* Match mobile header-top height */
    max-width: 100%;
    height: auto;
    display: block;
  }

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

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    min-height: 48px;
    height: auto; /* Allow height to adjust if text wraps */
    align-items: center;
    justify-content: center; /* Center buttons if only one */
    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);
  }
  .mobile-nav-buttons .btn {
    flex: 1; min-width: 0;
    max-width: calc(50% - 5px);
    box-sizing: border-box;
    padding: 8px 12px;
    font-size: 13px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.2;
  }

  .main-nav {
    display: none; /* Hidden by default, shown by JS */
    position: fixed;
    top: var(--header-offset); /* Below header-top and mobile-nav-buttons */
    left: 0;
    height: calc(100% - var(--header-offset)); /* Full height minus fixed header */
    width: 280px; /* Width of the mobile menu drawer */
    background-color: #004d26; /* Darker background for mobile menu */
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
    transform: translateX(-100%); /* Slide out of view */
    transition: transform 0.3s ease;
    z-index: 1001; /* Above overlay, below hamburger */
    overflow-y: auto; /* Allow scrolling for long menus */
    min-height: 48px; /* Fixed height for main-nav doesn't apply when drawer is open */
  }

  .main-nav.active {
    display: flex; /* Must set display to show */
    transform: translateX(0); /* Slide into view */
  }

  .nav-container {
    width: 100%;
    max-width: none; /* Important: remove max-width */
    padding: 0;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
  }

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

  .nav-list li {
    width: 100%;
    height: auto;
    margin-bottom: 10px;
  }

  .nav-list a {
    padding: 10px 0;
    width: 100%;
    font-size: 17px;
  }

  .hamburger-menu {
    display: block; /* Show hamburger menu */
    position: relative; /* Keep it in flow */
    z-index: 1002; /* Ensure it's clickable */
  }

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

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

  .footer-bottom {
    padding: 20px 15px 0;
  }
}

/* Body no-scroll 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;
}
