html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }
body { margin: 0; font-family: 'Arial', sans-serif; line-height: 1.6; color: #333; background-color: #FFFFFF; }

/* Fixed Header Offset */
:root { --header-offset: 122px; }
body { padding-top: var(--header-offset); }

/* Site Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: #FFFFFF; /* Base for fixed header */
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Header Top Section */
.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: #017439; /* Primary color for top bar */
  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-left: 20px;
  padding-right: 20px;
}

/* Logo */
.logo {
  color: #FFFF00; /* Yellow for text logo */
  font-size: 24px;
  font-weight: bold;
  text-decoration: none;
  display: block;
}
.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 on desktop) */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden globally */
  min-height: 48px;
  background-color: #FFFFFF; /* White background for mobile button bar */
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Main Navigation Bar */
.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex; /* Desktop default: flex */
  align-items: center;
  overflow: hidden;
  background-color: #f0f0f0; /* Light grey, distinct from top bar */
  width: 100%;
}

.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;
  flex-wrap: nowrap;
}

.nav-link {
  color: #333;
  text-decoration: none;
  padding: 10px 15px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.3s ease, background-color 0.3s ease;
}
.nav-link:hover {
  color: #017439; /* Primary color on hover */
  background-color: #e0e0e0;
  border-radius: 4px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  white-space: nowrap;
  border: none;
}
.btn-register {
  background-color: #C30808; /* Red */
  color: #FFFF00; /* Yellow */
}
.btn-register:hover {
  background-color: #a00606;
  transform: translateY(-1px);
}
.btn-login {
  background-color: #C30808; /* Red */
  color: #FFFF00; /* Yellow */
}
.btn-login:hover {
  background-color: #a00606;
  transform: translateY(-1px);
}

/* Hamburger Menu (hidden on desktop) */
.hamburger-menu {
  display: none; /* Hidden globally */
  width: 30px;
  height: 24px;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  z-index: 1002; /* Above other header elements on mobile */
}
.hamburger-menu span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: #FFFFFF; /* White lines */
  border-radius: 2px;
  transition: all 0.3s ease-in-out;
}
.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); }

/* Navigation Overlay (hidden on desktop) */
.nav-overlay {
  display: none; /* Hidden globally */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0,0,0,0.5);
  z-index: 999;
}
.nav-overlay.active {
  display: block;
}

/* Footer */
.site-footer {
  background-color: #017439; /* Primary color for footer background */
  color: #FFFFFF; /* White text for footer */
  padding: 40px 20px 20px;
  font-size: 14px;
}

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

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

.footer-logo {
  color: #FFFF00; /* Yellow for footer logo */
  font-size: 28px;
  font-weight: bold;
  text-decoration: none;
  display: block;
  margin-bottom: 15px;
}

.footer-description {
  margin-bottom: 15px;
  line-height: 1.8;
  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; /* White for footer links */
  text-decoration: none;
  transition: color 0.3s ease;
}
.footer-nav a:hover {
  color: #FFFF00; /* Yellow on hover */
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.2);
  padding-top: 20px;
  margin-top: 20px;
  text-align: center;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}
.footer-bottom p {
  margin: 0;
  color: #FFFFFF;
}

/* Footer slot anchor inner (must be visible) */
.footer-slot-anchor-inner {
  min-height: 1px; /* Ensure visibility for injection */
}

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

  /* Header Top Section */
  .header-top {
    min-height: 60px !important;
    height: 60px !important;
  }

  .header-container {
    width: 100%;
    max-width: none;
    padding-left: 15px;
    padding-right: 15px;
    justify-content: space-between;
    position: relative;
  }

  /* Hamburger Menu (visible on mobile) */
  .hamburger-menu {
    display: flex; /* Visible on mobile */
    order: -1; /* Place on left */
    margin-right: auto; /* Push logo to center */
    z-index: 2; /* Ensure clickable */
  }

  /* Logo Centering (Mobile) */
  .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; /* Smaller max-height for mobile logo */
  }

  /* 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;
    gap: 10px;
    flex-wrap: nowrap;
    justify-content: center;
  }
  .mobile-nav-buttons .btn {
    flex: 1; min-width: 0;
    max-width: calc(50% - 5px); /* For two buttons */
    box-sizing: border-box;
    padding: 8px 12px;
    font-size: 13px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Main Navigation Bar (hidden by default on mobile, shown by JS) */
  .main-nav {
    min-height: auto;
    height: calc(100vh - var(--header-offset)); /* Fill remaining viewport height */
    display: none; /* Hidden by default */
    position: fixed;
    top: var(--header-offset); /* Start below header */
    left: 0;
    width: 280px; /* Fixed width for slide-out menu */
    background-color: #FFFFFF; /* White background for menu */
    z-index: 1001; /* Above overlay */
    overflow-y: auto; /* Scrollable if content overflows */
    flex-direction: column; /* Vertical menu items */
    transform: translateX(-100%); /* Slide out from left */
    transition: transform 0.3s ease-out;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
  }
  .main-nav.active {
    display: flex; /* Show menu when active */
    transform: translateX(0); /* Slide into view */
  }

  .nav-container {
    width: 100%;
    max-width: none;
    padding: 20px 15px;
    flex-direction: column;
    align-items: flex-start;
    height: auto;
  }
  .nav-link {
    width: 100%;
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
  }
  .nav-link:last-child {
    border-bottom: none;
  }

  /* Navigation Overlay (visible when active) */
  .nav-overlay {
    z-index: 999;
  }

  /* Prevent Body Scroll when menu is open */
  body.no-scroll {
    overflow: hidden;
  }

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

  /* Footer Mobile */
  .footer-top-grid {
    grid-template-columns: 1fr;
    padding: 0 15px;
  }
  .footer-col {
    margin-bottom: 20px;
  }
  .footer-col:last-child {
    margin-bottom: 0;
  }
  .site-footer {
    padding-left: 15px;
    padding-right: 15px;
  }
  .footer-bottom {
    padding-left: 0;
    padding-right: 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;
  }
}
