html { scroll-behavior: smooth; }
body {
  font-family: 'Arial', sans-serif;
  margin: 0;
  padding-top: var(--header-offset); /* Critical for fixed header */
  color: #333333;
  background-color: #FFFFFF; /* From custom colors */
  overflow-x: hidden; /* Prevent horizontal scroll from content */
}

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

/* Site Header - Fixed Navigation */
.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: #017439; /* Primary color */
}

/* 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: #017439; /* Primary color */
  width: 100%;
  color: #FFFFFF;
}

.header-container {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between; /* Logo left, buttons right */
  align-items: center;
  padding: 0 20px; /* Inner padding */
}

/* Logo Styling */
.logo {
  font-size: 24px;
  font-weight: bold;
  color: #FFFF00; /* Register/Login font color */
  text-decoration: none;
  display: flex;
  align-items: center;
  height: 100%;
}
.logo img { /* If logo is an image */
  display: block;
  max-height: 60px; /* Matches header-top height */
  height: auto;
  width: auto;
  max-width: 280px;
  object-fit: contain;
}

/* Hamburger Menu (Hidden on Desktop) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 24px;
  position: relative;
  flex-direction: column;
  justify-content: space-between;
  z-index: 1002; /* Above other header elements */
}
.hamburger-menu span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: #FFFFFF;
  border-radius: 2px;
  transition: all 0.3s ease;
}
.hamburger-menu.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger-menu.active span:nth-child(2) { opacity: 0; }
.hamburger-menu.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

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

/* Mobile Navigation Buttons (Hidden on Desktop) */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden on desktop by default */
  min-height: 48px; /* Fixed height for mobile */
  background-color: #017439; /* Primary color */
  width: 100%;
  align-items: center;
  justify-content: center;
  padding: 0 15px; /* Added for mobile padding */
}

/* Button Styling */
.btn {
  background-color: #C30808; /* Register/Login button color */
  color: #FFFF00; /* Register/Login font color */
  padding: 10px 15px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease, transform 0.2s ease;
  white-space: nowrap; /* Prevent text wrap on desktop */
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  border: none;
  cursor: pointer;
  text-align: center;
}
.btn:hover {
  background-color: #E00; /* Slightly darker red on hover */
  transform: translateY(-1px);
}

/* Main Navigation */
.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: #028a4a; /* Slightly lighter green for distinction */
  width: 100%;
  color: #FFFFFF;
}

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

.nav-item {
  color: #FFFFFF;
  text-decoration: none;
  padding: 0 15px;
  font-size: 16px;
  font-weight: bold;
  transition: color 0.3s ease;
  white-space: nowrap;
}
.nav-item:hover {
  color: #FFFF00; /* Yellow on hover */
}

/* 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 Styling */
.site-footer {
  background-color: #017439; /* Primary color */
  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;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-col {
  display: flex;
  flex-direction: column;
}

.footer-col h3 {
  font-size: 18px;
  margin-bottom: 15px;
  color: #FFFF00; /* Highlighted color */
}

.footer-logo {
  font-size: 22px;
  font-weight: bold;
  color: #FFFF00; /* Highlighted color */
  text-decoration: none;
  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; /* Yellow on hover */
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  margin-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1); /* Separator line */
  font-size: 13px;
  color: #CCCCCC;
}

/* Footer Slot Anchors - Must be visible for content injection */
.footer-slot-anchor-inner {
  min-height: 1px; /* Ensure visibility for potential content */
}

/* Mobile Specific Styles */
@media (max-width: 768px) {
  /* Header offset for mobile */
  :root { --header-offset: 110px; } /* Mobile: 60px (header-top) + 48px (mobile-nav-buttons) + 2px */
  body { padding-top: var(--header-offset); overflow-x: hidden; }

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

  /* Header Top Mobile */
  .site-header {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
  }
  .header-top {
    min-height: 60px;
    height: 60px; /* Fixed height for mobile */
  }
  .header-container {
    padding: 0 15px; /* Smaller padding for mobile */
    justify-content: space-between; /* Hamburger left, logo center, desktop buttons hidden */
    position: relative; /* For absolute logo positioning */
  }

  /* Hamburger Menu (Visible on Mobile) */
  .hamburger-menu {
    display: flex; /* Visible on mobile */
    margin-right: auto; /* Push logo to center */
  }

  /* Logo Centering on Mobile */
  .logo {
    flex: 1 !important; /* Allows logo to take available space for centering */
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    position: absolute !important; /* Absolute positioning for exact center */
    left: 50% !important;
    transform: translateX(-50%) !important;
    max-width: calc(100% - 100px); /* Account for hamburger and potential right-side elements */
  }
  .logo img {
    max-height: 56px !important; /* Matches mobile header-top height */
  }

  /* Desktop Navigation Buttons (Hidden on Mobile) */
  .desktop-nav-buttons {
    display: none !important;
  }

  /* Mobile Navigation Buttons (Visible on Mobile) */
  .mobile-nav-buttons {
    display: flex !important; /* Visible on mobile */
    min-height: 48px;
    align-items: center;
    width: 100%; max-width: 100%;
    box-sizing: border-box;
    padding-left: 15px; padding-right: 15px;
    overflow: hidden; /* Prevent buttons from overflowing */
    gap: 10px;
    flex-wrap: nowrap; /* Ensure buttons stay in one row */
    justify-content: center; /* Center the buttons if there's space */
    background-color: #017439; /* Primary color */
  }
  .mobile-nav-buttons .btn {
    flex: 1; min-width: 0;
    max-width: calc(50% - 5px); /* Max width for two buttons with gap */
    box-sizing: border-box;
    padding: 8px 12px; /* Smaller padding */
    font-size: 13px; /* Smaller font size */
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Main Navigation Mobile (Hidden by default, slides in) */
  .main-nav {
    display: none; /* Hidden by default */
    position: fixed;
    top: var(--header-offset); /* Below header-top and mobile-nav-buttons */
    left: 0;
    width: 80%; /* Menu takes 80% width */
    max-width: 300px; /* Max width for menu */
    height: calc(100% - var(--header-offset)); /* Fill remaining height */
    background-color: #017439; /* Primary color */
    flex-direction: column;
    transform: translateX(-100%); /* Slide out to the left */
    transition: transform 0.3s ease;
    z-index: 1001;
    overflow-y: auto; /* Scrollable if many items */
    padding: 20px 0;
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
  }
  .main-nav.active {
    display: flex; /* Show when active */
    transform: translateX(0); /* Slide in */
  }
  .nav-container {
    flex-direction: column; /* Vertical on mobile */
    padding: 0 15px;
    align-items: flex-start; /* Align items to the left */
  }
  .nav-item {
    width: 100%;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 15px;
  }
  .nav-item:last-child {
    border-bottom: none;
  }

  /* Footer Mobile */
  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
  }
  .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;
}
