/* Base & Reset */
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333333;
  background-color: #FFFFFF;
}

/* Header Offset for Fixed Header */
:root {
  --header-offset: 122px; /* 68px (header-top) + 52px (main-nav) + 2px (buffer) */
}
body {
  padding-top: var(--header-offset);
}

/* Site Header - Fixed Positioning & Styling */
.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.2);
  background-color: #FFFFFF; /* Fallback, actual background set on header-top/main-nav */
}

/* Header Top Bar */
.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: #017439; /* Main color */
  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 Styling */
.logo {
  font-size: 28px;
  font-weight: bold;
  color: #FFFFFF;
  text-decoration: none;
  display: flex;
  align-items: center;
}
.logo img {
  display: block;
  max-height: 60px;
  height: auto;
  width: auto;
  max-width: 280px;
  object-fit: contain;
}

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

/* Mobile Navigation Buttons (hidden by default) */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden on desktop */
  min-height: 48px;
}

/* General Button Styling */
.btn {
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 16px;
  font-weight: bold;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  border: none;
}

/* Specific Button Colors (WCAG AA compliant text color) */
.btn-register {
  background-color: #C30808; /* Red */
  color: #000000; /* Black for WCAG AA contrast with red background */
}
.btn-register:hover {
  background-color: #a00606;
  transform: translateY(-1px);
}
.btn-login {
  background-color: #C30808; /* Red */
  color: #000000; /* Black for WCAG AA contrast with red background */
}
.btn-login:hover {
  background-color: #a00606;
  transform: translateY(-1px);
}

/* Main Navigation Bar */
.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: #005f2e; /* Darker green, contrasting with 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: #FFFFFF;
  text-decoration: none;
  padding: 10px 15px;
  font-size: 16px;
  font-weight: 500;
  transition: background-color 0.3s ease, color 0.3s ease;
  border-radius: 4px;
  white-space: nowrap;
}
.nav-link:hover,
.nav-link.active {
  background-color: rgba(255,255,255,0.15);
  color: #FFFFFF;
}

/* Hamburger Menu (hidden by default on desktop) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  position: relative;
  z-index: 1001;
}
.hamburger-icon {
  display: block;
  width: 25px;
  height: 3px;
  background-color: #FFFFFF;
  margin: 5px 0;
  transition: all 0.3s ease;
}

/* Mobile Menu Overlay (hidden by default) */
.mobile-menu-overlay {
  display: none; /* Hidden on desktop */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  z-index: 999; /* Below main menu */
}
.mobile-menu-overlay.active {
  display: block;
}

/* Footer Styling */
.site-footer {
  background-color: #017439; /* Main color */
  color: #FFFFFF;
  padding: 40px 20px 20px;
  font-size: 14px;
}

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

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

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

.footer-description {
  line-height: 1.6;
  opacity: 0.9;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

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

.footer-nav li a {
  color: #FFFFFF;
  text-decoration: none;
  margin-bottom: 8px;
  display: block;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}
.footer-nav li a:hover {
  opacity: 1;
  text-decoration: underline;
}

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

/* Ensure slot anchors are visible for injection */
.footer-slot-anchor-inner {
  min-height: 1px;
  margin-top: 10px; /* Provide some spacing for injected content */
}

/* Responsive Styles */
@media (max-width: 768px) {
  /* Header Offset for Fixed Header on Mobile */
  :root {
    --header-offset: 110px; /* 60px (header-top) + 48px (mobile-nav-buttons) + 2px (buffer) */
  }

  .site-header {
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  }

  /* Header Top Bar Mobile */
  .header-top {
    min-height: 60px !important;
    height: 60px !important;
  }
  .header-container {
    width: 100%;
    max-width: none;
    padding: 0 15px;
    position: relative;
  }

  /* Mobile Hamburger Menu */
  .hamburger-menu {
    display: block; /* Show hamburger on mobile */
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
  }
  .hamburger-menu.active .hamburger-icon:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .hamburger-menu.active .hamburger-icon:nth-child(2) {
    opacity: 0;
  }
  .hamburger-menu.active .hamburger-icon:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  /* Logo Centering on Mobile */
  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }
  .logo img {
    max-height: 56px !important;
  }

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

  /* Show Mobile Navigation Buttons */
  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    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: #005f2e; /* Same as main nav background */
  }
  .mobile-nav-buttons .btn {
    flex: 1;
    min-width: 0;
    max-width: calc(50% - 5px); /* Account for gap */
    box-sizing: border-box;
    padding: 8px 12px;
    font-size: 13px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    border-radius: 20px;
  }

  /* Mobile Main Navigation (Hamburger Menu Content) */
  .main-nav {
    display: none; /* Hidden by default */
    position: fixed;
    top: var(--header-offset); /* Starts below the fixed header + mobile buttons */
    left: 0;
    width: 80%;
    max-width: 300px;
    height: calc(100% - var(--header-offset));
    background-color: #005f2e; /* Darker green */
    transform: translateX(-100%); /* Off-screen to the left */
    transition: transform 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    flex-direction: column; /* Ensure vertical stacking */
    align-items: flex-start;
    padding: 20px;
  }
  .main-nav.active {
    display: flex; /* Show when active */
    transform: translateX(0); /* Slide into view */
  }
  .nav-container {
    width: 100%;
    max-width: none;
    padding: 0;
    flex-direction: column;
    align-items: flex-start;
  }
  .nav-link {
    width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: left;
    font-size: 15px;
  }
  .nav-link:last-child {
    border-bottom: none;
  }

  /* Footer Mobile Layout */
  .footer-grid {
    grid-template-columns: 1fr; /* Single column layout */
    gap: 30px;
  }
  .footer-col {
    text-align: center;
  }
  .footer-nav li a {
    display: inline-block;
    margin: 0 8px 8px;
  }
  .footer-logo {
    text-align: center;
  }

  /* Mobile Content Area 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;
}
