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

body {
  padding-top: var(--header-offset);
  margin: 0;
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333333;
  overflow-x: hidden; /* Prevent body overflow-x */
}

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

.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: #333333; /* Dark grey for contrast */
  width: 100%;
  padding: 0; /* Container handles padding */
}

.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 30px; /* Desktop padding */
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: #FFFFFF; /* White text on dark background */
  text-decoration: none;
  display: block; /* Ensure it's block for proper alignment */
  white-space: nowrap;
}

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

.btn {
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  white-space: nowrap;
  transition: background-color 0.3s ease, color 0.3s ease;
  text-align: center;
  border: none;
  cursor: pointer;
}

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

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

.btn-register:hover, .btn-login:hover {
  filter: brightness(1.2);
}

.hamburger-menu {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.hamburger-icon {
  display: block;
  width: 24px;
  height: 2px;
  background-color: #FFFFFF; /* White icon on dark background */
  position: relative;
  transition: background-color 0.3s ease;
}

.hamburger-icon::before,
.hamburger-icon::after {
  content: '';
  display: block;
  width: 100%;
  height: 2px;
  background-color: #FFFFFF; /* White icon on dark background */
  position: absolute;
  transition: transform 0.3s ease;
}

.hamburger-icon::before {
  top: -8px;
}

.hamburger-icon::after {
  top: 8px;
}

/* Hamburger active state */
.hamburger-menu.active .hamburger-icon {
  background-color: transparent;
}

.hamburger-menu.active .hamburger-icon::before {
  transform: translateY(8px) rotate(45deg);
}

.hamburger-menu.active .hamburger-icon::after {
  transform: translateY(-8px) rotate(-45deg);
}

.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden on desktop */
  min-height: 48px;
  background-color: #F0F0F0; /* A light background for mobile buttons */
  width: 100%;
  padding: 10px 30px; /* Desktop-like padding for mobile button row */
  justify-content: center;
  align-items: center;
  gap: 10px;
  overflow: hidden; /* Prevent overflow */
  z-index: 990; /* Below main-nav and hamburger */
}

.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex; /* Visible on desktop */
  align-items: center;
  overflow: hidden;
  background-color: #017439; /* Primary green */
  width: 100%;
  position: static; /* Default for desktop */
  padding: 0; /* Container handles padding */
}

.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; /* Desktop padding */
}

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

.nav-list li a {
  color: #FFFFFF; /* White text on green background */
  text-decoration: none;
  font-weight: bold;
  padding: 5px 0;
  transition: color 0.3s ease;
  white-space: nowrap; /* Prevent wrapping */
}

.nav-list li a:hover {
  color: #FFFF00; /* Yellow on hover */
}

.mobile-nav-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;
  cursor: pointer;
}

.mobile-nav-overlay.active {
  display: block;
}

/* Footer styles */
.site-footer {
  background-color: #333333; /* Dark background for footer */
  color: #FFFFFF;
  padding-top: 40px;
  font-size: 14px;
}

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

.footer-col h3 {
  color: #FFFF00; /* Yellow for footer headings */
  font-size: 16px;
  margin-bottom: 15px;
}

.footer-logo {
  font-size: 20px;
  font-weight: bold;
  color: #FFFFFF;
  text-decoration: none;
  margin-bottom: 15px;
  display: block;
}

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

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

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

.footer-nav li a {
  color: #FFFFFF;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-nav li a:hover {
  color: #FFFF00;
}

.footer-slot-anchor-inner {
  /* This is just a placeholder for dynamic content, keep it empty */
}

.footer-bottom {
  background-color: #222222; /* Even darker background for copyright */
  padding: 15px 30px;
  text-align: center;
  font-size: 13px;
}

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

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

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

  .header-top {
    min-height: 60px !important;
    height: 60px !important;
    padding: 0 15px; /* Mobile padding for the top bar itself */
  }

  .header-container {
    width: 100%;
    max-width: none;
    padding: 0; /* Reset container padding, header-top handles it */
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .hamburger-menu {
    display: block; /* Visible on mobile */
    margin-right: 15px;
    width: 40px; /* Make hamburger clickable area wider */
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .hamburger-menu .hamburger-icon {
    width: 20px; /* Smaller icon */
    height: 2px;
  }

  .hamburger-menu .hamburger-icon::before,
  .hamburger-menu .hamburger-icon::after {
    height: 2px;
  }

  .hamburger-menu .hamburger-icon::before {
    top: -6px;
  }
  .hamburger-menu .hamburger-icon::after {
    top: 6px;
  }

  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    position: static !important;
    left: auto !important;
    transform: none !important;
    max-width: calc(100% - 80px); /* Account for hamburger space */
    font-size: 20px; /* Adjust font size for mobile */
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .desktop-nav-buttons {
    display: none !important; /* Hidden on mobile */
  }

  .mobile-nav-buttons {
    display: flex !important; /* Visible on mobile */
    min-height: 48px;
    padding: 10px 15px; /* Adjust padding for mobile */
    width: 100%; max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
    justify-content: center; /* Center buttons if less than 2 */
  }

  .mobile-nav-buttons .btn {
    flex: 1; min-width: 0;
    max-width: calc(50% - 5px); /* Ensure two buttons fit with gap */
    box-sizing: border-box;
    padding: 8px 12px;
    font-size: 13px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .main-nav {
    min-height: 48px !important;
    height: calc(100% - var(--header-offset)); /* Full height below header */
    display: none; /* Hidden by default for mobile */
    flex-direction: column; /* Vertical layout for mobile menu items */
    position: fixed; /* Fixed position for slide-out menu */
    top: var(--header-offset); /* Position below fixed header */
    left: 0;
    width: 280px; /* Width of the mobile menu */
    background-color: #017439; /* Primary green */
    transform: translateX(-100%); /* Slide out to the left */
    transition: transform 0.3s ease;
    z-index: 1001; /* Above overlay */
    padding-top: 20px; /* Padding inside the menu */
    overflow-y: auto; /* Scroll if content is too long */
  }

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

  .nav-container {
    width: 100%;
    max-width: none;
    padding: 0 15px; /* Mobile padding for menu content */
    height: auto;
  }

  .nav-list {
    flex-direction: column;
    gap: 15px;
  }

  .nav-list li a {
    display: block;
    padding: 10px 0;
    font-size: 16px;
  }

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

  .footer-col {
    margin-bottom: 20px; /* Spacing between columns */
  }

  .footer-bottom {
    padding: 15px 15px; /* Adjust padding */
  }

  /* Mobile overflow prevention */
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
}
