:root {
  --primary-color: #017439;
  --secondary-color: #FFFFFF;
  --button-register-color: #C30808;
  --button-login-color: #C30808;
  --button-font-color: #FFFF00;
  --header-offset: 122px; /* 68px (header-top) + 52px (main-nav) + 2px buffer */
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding-top: var(--header-offset);
  background-color: var(--secondary-color); /* General page background */
  color: #333333;
}

/* Site Header - Fixed position */
.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, but header-top and main-nav define their own */
}

/* 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: var(--primary-color); /* Primary color for header top */
  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: 28px;
  font-weight: bold;
  color: var(--secondary-color); /* White for logo text */
  text-decoration: none;
  display: flex; /* For potential image logo alignment */
  align-items: center;
  height: 100%;
}
.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;
}

/* 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 button bar */
  background-color: var(--secondary-color); /* White background for mobile buttons */
  border-bottom: 1px solid #eee; /* Subtle separator */
}

/* Main Navigation Section */
.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: var(--secondary-color); /* Secondary color for main nav */
  width: 100%;
  border-top: 1px solid rgba(0, 0, 0, 0.1); /* Separator from header-top */
}

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

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

.main-nav ul li a {
  color: var(--primary-color); /* Primary color for nav links */
  text-decoration: none;
  font-weight: bold;
  font-size: 16px;
  padding: 10px 0;
  display: block;
  transition: color 0.3s ease;
}

.main-nav ul li a:hover,
.main-nav ul li a.active {
  color: #004d2b; /* Slightly darker green on hover */
}

/* Hamburger Menu (hidden on desktop) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1001; /* Above header */
}

.hamburger-menu .bar {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--secondary-color); /* White bars */
  margin: 5px 0;
  transition: all 0.3s ease;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap; /* Prevent wrapping on desktop */
  box-sizing: border-box;
}

.btn-register {
  background-color: var(--button-register-color); /* #C30808 */
  color: var(--button-font-color); /* #FFFF00 */
  border: 1px solid var(--button-register-color);
}
.btn-register:hover {
  background-color: #a30707; /* Darker red */
  border-color: #a30707;
}

.btn-login {
  background-color: var(--button-login-color); /* #C30808 */
  color: var(--button-font-color); /* #FFFF00 */
  border: 1px solid var(--button-login-color);
}
.btn-login:hover {
  background-color: #a30707; /* Darker red */
  border-color: #a30707;
}

/* 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;
}
.overlay.active {
  display: block;
}

/* Footer Styles */
.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;
}

.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.2);
}

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

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

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

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

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

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

.footer-nav a:hover {
  color: rgba(255, 255, 255, 0.7);
}

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

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

/* Dynamic slot anchors */
.footer-slot-anchor-inner, .footer-slot-anchor-outer {
  min-height: 1px; /* Ensure they take up space if empty for layout */
}

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

  body {
    padding-top: var(--header-offset);
    overflow-x: hidden; /* Prevent body overflow */
  }

  .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 !important;
    height: 60px !important;
    position: relative; /* For absolute logo positioning */
  }

  .header-container {
    width: 100%;
    max-width: none; /* Remove max-width on mobile */
    padding: 0 15px; /* Smaller padding for mobile */
    justify-content: space-between; /* Hamburger left, logo center, space for right */
  }

  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important; /* Center text/image logo */
    align-items: center !important;
    font-size: 24px;
    max-width: calc(100% - 100px); /* Limit logo width to prevent overlap with hamburger */
  }
  .logo img {
    max-height: 56px !important; /* Max height for mobile logo */
  }

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

  .hamburger-menu {
    display: block; /* Show hamburger menu on mobile */
    order: -1; /* Place hamburger on the left */
    margin-right: auto; /* Push logo to center */
    color: var(--secondary-color); /* White color for hamburger */
  }

  /* Mobile Navigation Buttons */
  .mobile-nav-buttons {
    display: flex !important;
    min-height: 48px;
    align-items: center;
    justify-content: center; /* Center buttons horizontally */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
  }

  .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;
    text-align: center;
  }

  /* Main Navigation Mobile (hidden by default, slides in) */
  .main-nav {
    display: none; /* Hidden by default */
    position: fixed;
    top: var(--header-offset); /* Position below fixed header and mobile buttons */
    left: 0;
    width: 80%; /* Menu width */
    max-width: 300px; /* Max width for menu */
    height: calc(100% - var(--header-offset)); /* Full height below header */
    background-color: var(--secondary-color); /* White background for mobile menu */
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    transform: translateX(-100%); /* Start off-screen */
    transition: transform 0.3s ease;
    z-index: 1001; /* Above header */
    overflow-y: auto; /* Enable scrolling for long menus */
    border-top: none; /* Remove border from desktop version */
  }
  .main-nav.active {
    display: flex; /* Show menu when active */
    transform: translateX(0); /* Slide in */
  }
  .main-nav .nav-container {
    width: 100%;
    max-width: none;
    padding: 0;
    flex-direction: column;
    align-items: flex-start;
  }
  .main-nav ul {
    flex-direction: column;
    width: 100%;
    gap: 0; /* Remove gap */
  }
  .main-nav ul li {
    width: 100%;
    border-bottom: 1px solid #eee; /* Separator for menu items */
  }
  .main-nav ul li:last-child {
    border-bottom: none;
  }
  .main-nav ul li a {
    padding: 15px 10px;
    font-size: 16px;
    color: var(--primary-color); /* Primary color for mobile nav links */
  }

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

  /* Footer Mobile */
  .site-footer {
    padding: 30px 15px 15px;
  }
  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column layout */
    margin-bottom: 20px;
    gap: 30px;
  }
  .footer-col {
    text-align: center;
  }
  .footer-col h3 {
    margin-bottom: 10px;
  }
  .footer-nav {
    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;
}
