:root { --header-offset: 122px; }
body { padding-top: var(--header-offset); }

/* Base styles */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Arial', sans-serif; line-height: 1.6; color: #333; background-color: #FFFFFF; }

/* Site Header */
.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: #FFFFFF; /* Base background for the whole header */
}

/* Header Top */
.header-top {
  background-color: #017439; /* Primary color */
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
}
.header-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  height: 100%;
}

/* Logo */
.logo {
  font-family: 'Arial', sans-serif;
  font-size: 28px;
  font-weight: bold;
  color: #FFFF00; /* Contrast with #017439 */
  text-decoration: none;
  display: flex;
  align-items: center;
  height: 100%;
}
.logo img {
  display: block;
  max-height: 60px; /* Desktop max height */
  height: auto;
  width: auto;
  max-width: 280px;
  object-fit: contain;
}

/* Desktop Buttons */
.desktop-nav-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
}
.desktop-nav-buttons .btn {
  background-color: #C30808; /* Register/Login color */
  color: #FFFF00; /* Register/Login font color */
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease;
  white-space: nowrap;
}
.desktop-nav-buttons .btn:hover {
  background-color: #a00606; /* Darker red on hover */
}

/* Mobile Buttons (hidden by default for desktop) */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default for desktop */
  min-height: 48px;
  background-color: #017439; /* Same as header-top for consistency */
  width: 100%;
  padding: 0 15px;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* Main Nav */
.main-nav {
  background-color: #004d26; /* Darker green for main nav */
  min-height: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
}
.nav-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: 0 20px;
  height: 100%;
  gap: 25px;
}
.nav-link {
  color: #FFFFFF;
  text-decoration: none;
  font-weight: bold;
  padding: 5px 0;
  white-space: nowrap;
  transition: color 0.3s ease;
}
.nav-link:hover {
  color: #FFFF00; /* Yellow on hover */
}

/* Hamburger Menu (hidden by default for desktop) */
.hamburger-menu {
  display: none; /* Hidden by default for desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  position: relative;
  z-index: 1001;
  width: 45px; /* Give it a fixed width for spacing */
  height: 45px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.hamburger-menu span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: #FFFF00; /* Contrast with #017439 */
  margin-bottom: 5px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.hamburger-menu span:last-child { margin-bottom: 0; }

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

/* Overlay (hidden by default) */
.overlay {
  display: none;
  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;
}

/* Site Footer */
.site-footer {
  background-color: #017439;
  color: #FFFFFF;
  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;
}
.footer-col h3 {
  color: #FFFF00;
  margin-bottom: 15px;
  font-size: 16px;
}
.footer-logo {
  font-family: 'Arial', sans-serif;
  font-size: 24px;
  font-weight: bold;
  color: #FFFF00;
  text-decoration: none;
  display: block;
  margin-bottom: 15px;
}
.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: #FFFFFF;
  text-decoration: none;
  transition: color 0.3s ease;
}
.footer-nav a:hover {
  color: #FFFF00;
}
.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.2);
  max-width: 1200px;
  margin: 0 auto;
}
.footer-bottom p {
  margin: 0;
  color: #FFFFFF;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  :root { --header-offset: 110px; }
  body { overflow-x: hidden; }
  .page-content img { max-width: 100% !important; height: auto !important; display: block; }
  .page-content { overflow-x: hidden; max-width: 100%; }

  .site-header {
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  }

  /* Header Top - Mobile */
  .header-top {
    min-height: 60px !important;
    height: 60px !important;
    position: relative; /* For absolute logo centering */
  }
  .header-container {
    width: 100%;
    max-width: none; /* No max-width for mobile container */
    padding: 0 15px;
    justify-content: space-between;
  }

  /* Logo - Mobile Centering (Method 2 for text logo, robust) */
  .logo {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    max-width: calc(100% - 100px); /* Leave space for hamburger */
  }
  .logo img {
    max-height: 56px !important; /* Mobile max height */
  }

  /* Hamburger Menu - Mobile */
  .hamburger-menu {
    display: flex; /* Show hamburger menu */
    order: -1; /* Move to the left */
    z-index: 1002; /* Above logo and overlay */
  }
  /* Ensure space for hamburger on right if needed, or flex handles it */
  .header-container::after {
    content: '';
    width: 45px; /* Balance hamburger space on the right */
    height: 1px; /* Invisible spacer */
  }

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

  /* Mobile Buttons - Show on Mobile */
  .mobile-nav-buttons {
    display: flex !important;
    min-height: 48px;
    padding: 8px 15px;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    background-color: #017439;
  }
  .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;
  }

  /* Main Nav - Mobile (hidden by default, shown with JS) */
  .main-nav {
    display: none; /* Hidden by default */
    position: fixed;
    top: var(--header-offset); /* Start below fixed header+mobile buttons */
    left: 0;
    width: 80%; /* Sidebar width */
    max-width: 300px;
    height: calc(100% - var(--header-offset)); /* Fill remaining height */
    background-color: #004d26;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
    transform: translateX(-100%); /* Off-screen initially */
    transition: transform 0.3s ease;
    z-index: 1001;
    overflow-y: auto;
  }
  .main-nav.active {
    display: flex; /* Show when active */
    transform: translateX(0); /* Slide into view */
  }
  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
    height: auto;
    width: 100%;
    max-width: none;
  }
  .nav-link {
    width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  .nav-link:last-child {
    border-bottom: none;
  }

  /* Footer - Mobile */
  .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;
  }
}
/* 内容保护（系统追加，请勿删除） */
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;
}
