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

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  background-color: #017439; /* Fallback for transparency */
}

.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: #015c2d; /* Darker green for top bar */
  color: #FFFFFF;
}

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

.logo {
  font-size: 24px;
  font-weight: bold;
  text-decoration: none;
  color: #FFFFFF;
  white-space: nowrap;
}

.logo img {
  display: block;
  max-height: 60px;
  height: auto;
  width: auto;
  max-width: 280px;
  object-fit: contain;
}

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

.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Default hidden, shown on mobile */
  min-height: 48px;
  background-color: #016b35; /* Slightly different green for mobile buttons */
}

.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex; /* Desktop default: flex */
  align-items: center;
  overflow: hidden;
  background-color: #017439; /* Main green for navigation */
  color: #FFFFFF;
}

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

.nav-link {
  text-decoration: none;
  color: #FFFFFF;
  padding: 0 15px;
  font-weight: 500;
  transition: color 0.3s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: #FFFF00;
}

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

.btn-register {
  background-color: #C30808;
  color: #FFFF00;
}

.btn-login {
  background-color: #C30808;
  color: #FFFF00;
}

/* Hamburger menu for mobile */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  width: 30px;
  height: 20px;
  position: relative;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  z-index: 1001; /* Ensure it's above other elements */
}

.hamburger-menu::before,
.hamburger-menu::after,
.hamburger-menu span {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  background-color: #FFFFFF;
  left: 0;
  transition: all 0.3s ease;
}

.hamburger-menu::before {
  top: 0;
}

.hamburger-menu::after {
  bottom: 0;
}

.hamburger-menu span {
  top: 50%;
  transform: translateY(-50%);
}

.hamburger-menu.active::before {
  transform: rotate(45deg);
  top: 9px;
}

.hamburger-menu.active::after {
  transform: rotate(-45deg);
  bottom: 9px;
}

.hamburger-menu.active span {
  transform: translateX(-50px);
  opacity: 0;
}

/* Overlay for mobile menu */
.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 999;
}

.overlay.active {
  display: block;
}

/* Footer styles */
.site-footer {
  background-color: #015c2d; /* Darker green for footer */
  color: #FFFFFF;
  padding: 40px 20px 20px;
}

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

.footer-col h3 {
  color: #FFFFFF;
  margin-bottom: 15px;
  font-size: 18px;
}

.footer-col p {
  font-size: 14px;
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

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

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

.footer-nav li a {
  color: #FFFFFF;
  text-decoration: none;
  font-size: 14px;
  line-height: 2;
  display: block;
  transition: color 0.3s ease;
}

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

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

/* Ensure anchor slots are visible */
.footer-slot-anchor-inner {
  min-height: 1px; /* Ensure visibility if no content */
}

/* Mobile styles */
@media (max-width: 768px) {
  :root {
    --header-offset: 110px;
  }

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

  .header-top {
    min-height: 60px !important;
    height: 60px !important;
    position: relative; /* For absolute positioning of hamburger */
  }

  .header-container {
    width: 100%;
    max-width: none;
    padding: 0 15px;
    justify-content: center; /* Center logo by default */
  }

  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }

  .logo img {
    max-height: 56px !important;
  }

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

  .hamburger-menu {
    display: block;
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
  }

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    min-height: 48px;
    align-items: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap; /* Ensure buttons stay on one line */
    justify-content: center; /* Center buttons if less than 2, or space-between if 2 */
  }

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

  .main-nav {
    display: none; /* Hidden by default */
    position: fixed;
    top: var(--header-offset); /* Position below header + mobile buttons */
    left: 0;
    width: 280px;
    max-width: 80%; /* Prevent menu from taking full width */
    height: calc(100% - var(--header-offset));
    background-color: #017439;
    overflow-y: auto;
    transform: translateX(-100%); /* Slide out to the left */
    transition: transform 0.3s ease;
    z-index: 1001;
    flex-direction: column; /* Vertical menu */
    align-items: flex-start;
    padding: 20px 0;
  }

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

  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 0 15px;
    width: 100%;
    max-width: none;
  }

  .nav-link {
    width: 100%;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 15px;
  }

  .nav-link:last-child {
    border-bottom: none;
  }

  .footer-top-grid {
    grid-template-columns: 1fr;
  }

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