:root {
  --primary-color: #017439;
  --secondary-color: #FFFFFF;
  --button-register-bg: #C30808;
  --button-login-bg: #C30808;
  --button-text-color: #FFFF00;
  --header-offset: 122px; /* 68px (header-top) + 52px (main-nav) */
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  line-height: 1.6;
  color: #333;
  padding-top: var(--header-offset); /* Crucial for fixed header */
  overflow-x: hidden; /* Prevent horizontal scroll from body */
}

a {
  text-decoration: none;
  color: var(--primary-color);
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  background-color: var(--secondary-color); /* Default background, individual sections will override */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
}

.header-top {
  background-color: var(--primary-color);
  min-height: 68px;
  height: 68px; /* Fixed height for desktop */
  display: flex;
  align-items: center;
  overflow: hidden;
  box-sizing: border-box;
}

.header-container {
  width: 100%;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px; /* Padding for content inside container */
  box-sizing: border-box;
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--secondary-color);
  text-decoration: none;
  display: block; /* Ensure logo is visible */
  flex-shrink: 0;
  line-height: 1; /* Prevent extra height from line-height */
}

.logo img {
  display: block;
  max-height: 60px; /* Desktop image logo height */
  height: auto;
  width: auto;
  max-width: 280px;
  object-fit: contain;
}

.desktop-nav-buttons {
  display: flex; /* Desktop default: show buttons */
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}

.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Desktop default: hide mobile buttons */
  min-height: 48px; /* Placeholder height, actual height depends on content */
  background-color: #F0F0F0; /* Light background for mobile buttons */
  width: 100%;
  padding: 0 15px; /* Adjust padding for mobile */
  justify-content: center; /* Center buttons horizontally */
  align-items: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.main-nav {
  background-color: var(--secondary-color); /* Different background from header-top */
  min-height: 52px;
  height: 52px; /* Fixed height for desktop */
  display: flex; /* Desktop default: show main nav */
  align-items: center;
  overflow: hidden;
  box-sizing: border-box;
}

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

.nav-link {
  color: var(--primary-color);
  padding: 10px 15px;
  font-weight: bold;
  white-space: nowrap;
  transition: color 0.3s ease, background-color 0.3s ease;
  font-size: 15px;
}

.nav-link:hover, .nav-link.active {
  color: var(--button-register-bg); /* Highlight color */
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

/* Hamburger menu (hidden on desktop) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 25px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  z-index: 1001;
  margin-right: 15px; /* Space between hamburger and logo */
}

.hamburger-menu span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--secondary-color);
  transition: all 0.3s ease;
  border-radius: 2px;
}

.hamburger-menu.active span:nth-child(1) {
  transform: translateY(11px) rotate(45deg);
}

.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
  transform: translateY(-11px) rotate(-45deg);
}

/* Mobile spacer */
.mobile-spacer {
  display: none; /* Hidden on desktop */
}

/* Buttons */
.btn {
  padding: 10px 18px;
  border-radius: 25px;
  font-weight: bold;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  text-decoration: none;
  border: 2px solid transparent;
  box-sizing: border-box;
  font-size: 14px;
}

.btn-register {
  background-color: var(--button-register-bg);
  color: var(--button-text-color);
  border-color: var(--button-register-bg);
}

.btn-register:hover {
  background-color: #9C0707; /* Darker red */
}
.btn-login {
  background-color: var(--button-login-bg);
  color: var(--button-text-color);
  border-color: var(--button-login-bg);
}

.btn-login:hover {
  background-color: #9C0707; /* Darker red */
}

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

/* Footer styles */
.site-footer {
  background-color: #333; /* Dark background for footer */
  color: #f0f0f0;
  padding: 40px 20px 20px;
  box-sizing: border-box;
  font-size: 14px;
}

.site-footer a {
  color: #f0f0f0;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--button-text-color);
}

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

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

.footer-logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--secondary-color);
  margin-bottom: 15px;
  display: block;
}

.footer-description {
  margin-bottom: 15px;
  line-height: 1.8;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.footer-title {
  font-size: 18px;
  color: var(--secondary-color);
  margin-bottom: 15px;
  font-weight: bold;
}

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

.footer-nav li {
  margin-bottom: 10px;
}

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

.footer-bottom p {
  margin: 0;
  color: #aaa;
}

/* Footer slot anchors - must be visible */
.footer-slot-anchor-inner {
  min-height: 1px; /* Ensure it takes up space, but doesn't hide content */
  width: 100%;
}

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

  body {
    padding-top: var(--header-offset);
    overflow-x: hidden;
  }
  
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: hidden;
  }

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

  .header-top {
    min-height: 60px;
    height: 60px; /* Fixed height for mobile */
    padding-left: 15px;
    padding-right: 15px;
  }

  .header-container {
    padding: 0; /* Container padding handled by header-top */
    justify-content: space-between; /* Hamburger left, Logo center, spacer right */
    position: relative; /* For absolute positioning of logo if needed */
  }
  
  .logo {
    flex: 1 !important; /* Specific rule for mobile logo centering */
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 0; /* Remove any default margins */
    padding: 0; /* Remove any default padding */
  }

  .logo img {
    max-height: 56px !important; /* Mobile image logo height */
  }

  .mobile-spacer {
    display: block; /* Show spacer to balance hamburger */
    width: 30px; /* To balance the hamburger menu on the left */
    flex-shrink: 0;
  }

  .hamburger-menu {
    display: flex; /* Show hamburger on mobile */
    position: relative;
    z-index: 1001; /* Above logo and desktop buttons */
    margin: 0; /* Remove margin from desktop */
    flex-shrink: 0;
  }
  
  .desktop-nav-buttons {
    display: none !important; /* Hide desktop buttons on mobile */
  }

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons on mobile */
    min-height: 48px;
    background-color: #F0F0F0; /* Light grey background for mobile buttons */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 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); /* Two buttons with 10px gap */
    padding: 8px 12px;
    font-size: 13px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .main-nav {
    display: none; /* Mobile default: hide main nav */
    position: fixed;
    top: var(--header-offset); /* Position below fixed header and mobile buttons */
    left: 0;
    width: 80%; /* Menu width */
    height: calc(100% - var(--header-offset)); /* Fill remaining height */
    background-color: var(--primary-color); /* Menu background */
    flex-direction: column;
    padding: 20px 0;
    box-sizing: border-box;
    transform: translateX(-100%); /* Start off-screen */
    transition: transform 0.3s ease;
    z-index: 1000; /* Below hamburger, above overlay */
    overflow-y: auto; /* Allow scrolling if menu content is long */
  }

  .main-nav.active {
    display: flex; /* Show menu when active */
    transform: translateX(0); /* Slide in */
  }

  .nav-container {
    flex-direction: column;
    padding: 0;
    max-width: none;
    width: 100%;
    height: auto;
  }

  .nav-link {
    color: var(--secondary-color); /* White text for dark menu background */
    padding: 15px 20px;
    width: 100%;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .nav-link:last-child {
    border-bottom: none;
  }

  .nav-link:hover, .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--button-text-color); /* Yellow highlight on hover */
    border-radius: 0;
  }

  .overlay.active {
    display: block; /* Show overlay when menu is active */
  }

  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 20px;
  }

  .footer-col {
    text-align: center; /* Center footer content on mobile */
  }
  .footer-col:first-child {
    text-align: left; /* Keep logo and description left aligned for readability */
  }
  .footer-logo {
    margin-bottom: 10px;
    text-align: center;
  }
  .footer-description {
    text-align: left;
  }
  .footer-title {
    text-align: center;
  }
  .footer-nav {
    text-align: center; /* Center nav items */
  }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
}
