html { scroll-behavior: smooth; }
body { margin: 0; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; line-height: 1.6; color: #333333; padding-top: var(--header-offset); background-color: #FFFFFF; /* Matches specified background color */ }
:root { 
  --header-offset: 122px; 
  --primary-color: #017439; 
  --accent-color: #FFFFFF; 
  --btn-register-bg: #C30808; 
  --btn-login-bg: #C30808; 
  --btn-text-color: #000000; /* Adjusted for WCAG AA contrast (original #FFFF00 fails) */
}

.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: var(--accent-color); /* Fallback, specific sections define their own */ }

.header-top { box-sizing: border-box; min-height: 68px; height: 68px; display: flex; align-items: center; overflow: hidden; background-color: #005027; /* Darker green for header top, ensuring contrast with menu */ 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; }

.logo { font-size: 28px; font-weight: bold; color: var(--accent-color); text-decoration: none; display: block; padding: 0; margin: 0; }

.desktop-nav-buttons { display: flex; gap: 12px; align-items: center; }
.mobile-nav-buttons { box-sizing: border-box; display: none; min-height: 48px; background-color: #005027; /* Same as header-top for consistency */ width: 100%; }

.btn { text-decoration: none; padding: 10px 20px; border-radius: 5px; font-weight: bold; transition: background-color 0.3s ease, opacity 0.3s ease; white-space: nowrap; border: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.btn-register { background-color: var(--btn-register-bg); color: var(--btn-text-color); }
.btn-login { background-color: var(--btn-login-bg); color: var(--btn-text-color); }
.btn:hover { opacity: 0.85; }

.main-nav { box-sizing: border-box; min-height: 52px; height: 52px; display: flex; align-items: center; overflow: hidden; background-color: var(--primary-color); /* Primary green for main nav, distinct from header top */ width: 100%; }
.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; }
.nav-link { color: var(--accent-color); text-decoration: none; padding: 10px 15px; font-weight: bold; transition: color 0.3s ease; white-space: nowrap; }
.nav-link:hover { color: #f0f0f0; /* Lighter white on hover */ }

/* Hamburger menu for mobile */
.hamburger-menu { display: none; width: 30px; height: 20px; position: relative; cursor: pointer; z-index: 1002; margin-right: auto; /* Push logo to center on mobile */}
.hamburger-menu span { display: block; height: 2px; width: 100%; background-color: var(--accent-color); position: absolute; left: 0; transition: all 0.3s ease; border-radius: 1px; }
.hamburger-menu span:nth-child(1) { top: 0; }
.hamburger-menu span:nth-child(2) { top: 9px; }
.hamburger-menu span:nth-child(3) { top: 18px; }
.hamburger-menu.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.hamburger-menu.active span:nth-child(2) { opacity: 0; }
.hamburger-menu.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

.mobile-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.7); z-index: 999; }
.mobile-overlay.active { display: block; }

/* Footer styles */
.site-footer { background-color: #222; color: #f0f0f0; padding: 40px 0 20px; font-size: 14px; }
.footer-top-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; max-width: 1200px; margin: 0 auto; padding: 0 20px 30px; }
.footer-col h3 { color: var(--accent-color); font-size: 16px; margin-bottom: 15px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a { color: #ccc; text-decoration: none; transition: color 0.3s ease; }
.footer-col ul li a:hover { color: var(--accent-color); }
.footer-logo { font-size: 24px; font-weight: bold; color: var(--accent-color); text-decoration: none; display: block; margin-bottom: 15px; }
.footer-description { color: #ccc; line-height: 1.8; word-wrap: break-word; overflow-wrap: break-word; }
.footer-bottom { max-width: 1200px; margin: 0 auto; padding: 15px 20px 0; border-top: 1px solid #333; text-align: center; color: #aaa; }
.footer-bottom p { margin: 0; }

/* Dynamic slot anchors - ensure they are visible and don't hide content */
.footer-slot-anchor-inner { min-height: 1px; }

/* Responsive styles */
@media (max-width: 768px) {
  :root { --header-offset: 110px; }
  body { overflow-x: hidden; }

  .header-top { min-height: 60px !important; height: 60px !important; padding: 0 15px; }
  .header-container { max-width: none; padding: 0; position: relative; display: flex; justify-content: space-between; align-items: center; }
  
  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 0;
    padding: 0;
    max-width: calc(100% - 100px); /* Leave space for hamburger on left */
  }
  .hamburger-menu { display: block; order: -1; /* Place hamburger first */ margin-right: 0; margin-left: 0; /* Override desktop margin-right: auto */ }

  .desktop-nav-buttons { display: none !important; }
  .mobile-nav-buttons { 
    display: flex !important;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    width: 100%; max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
    background-color: #005027; /* Same as header-top */
  }
  .mobile-nav-buttons .btn {
    flex: 1; min-width: 0;
    max-width: calc(50% - 5px); /* 50% minus half of 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: 48px !important; /* Fixed height for main nav */
    display: none; /* Hidden by default for mobile */
    position: fixed; top: var(--header-offset); left: 0;
    width: 80%; /* Sidebar width */
    height: calc(100vh - var(--header-offset));
    flex-direction: column;
    background-color: rgba(0,0,0,0.9); /* Dark overlay background */
    z-index: 1001;
    transform: translateX(-100%); /* Off-screen to the left */
    transition: transform 0.3s ease-out;
    overflow-y: auto;
    padding-top: 20px;
  }
  .main-nav.active {
    display: flex; /* Make it visible */
    transform: translateX(0); /* Slide into view */
  }
  .nav-container { max-width: none; width: 100%; padding: 0 15px; flex-direction: column; align-items: flex-start; }
  .nav-link { width: 100%; padding: 12px 15px; border-bottom: 1px solid rgba(255,255,255,0.1); }
  .nav-link:last-child { border-bottom: none; }

  .footer-top-grid { grid-template-columns: 1fr; padding: 0 15px 30px; }
  .footer-col { margin-bottom: 20px; }
  .footer-bottom { padding: 15px 15px 0; }
  
  /* Mobile content overflow 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;
  }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
}
