/* General Body and Root Variables */
:root {
  --primary-color: #017439;
  --secondary-color: #FFFFFF;
  --register-login-btn-bg: #C30808;
  --register-login-btn-text: #FFFF00;
  --header-top-bg: #005c2d; /* Darker green for header top */
  --main-nav-bg: #017439; /* Primary green for main nav */
  --footer-bg: #004d24; /* Even darker green for footer */
  --header-offset: 122px; /* 68px (header-top) + 52px (main-nav) + 2px buffer */
}

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

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

a:hover {
  text-decoration: underline;
}

/* Button Base Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: bold;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  box-sizing: border-box;
}

.btn:hover {
  transform: translateY(-2px);
  text-decoration: none;
}

/* Specific Button Colors */
.btn-login {
  background-color: var(--register-login-btn-bg);
  color: var(--register-login-btn-text);
  border: 1px solid var(--register-login-btn-bg);
}
.btn-login:hover {
  background-color: #e00b0b; /* Slightly darker red */
}

.btn-register {
  background-color: var(--register-login-btn-bg);
  color: var(--register-login-btn-text);
  border: 1px solid var(--register-login-btn-bg);
}
.btn-register:hover {
  background-color: #e00b0b; /* Slightly darker red */
}

/* Site Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
  overflow-x: hidden; /* Prevent header overflow-x */
}

/* Header Top Area */
.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  background-color: var(--header-top-bg);
  color: var(--secondary-color);
  width: 100%;
  overflow: hidden; /* Prevent content overflow in header-top */
}

.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; /* Padding for content inside container */
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--secondary-color);
  text-decoration: none;
  display: block; /* Ensure logo is a block element for sizing */
  height: 100%; /* Occupy full height of header-top */
  display: flex;
  align-items: center;
}

.logo img {
  display: block;
  max-height: 60px; /* Max height for desktop logo */
  height: auto;
  width: auto;
  max-width: 280px; /* Limit logo width */
  object-fit: contain;
}

.desktop-nav-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Mobile Navigation Buttons (hidden on desktop) */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default on desktop */
  min-height: 48px;
  background-color: #004722; /* Slightly different background for mobile buttons */
  width: 100%;
  padding: 0 15px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: nowrap;
  overflow: hidden;
}

/* Main Navigation */
.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  background-color: var(--main-nav-bg);
  width: 100%;
  overflow: hidden; /* Prevent content overflow in main-nav */
}

.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(--secondary-color);
  padding: 0 15px;
  font-size: 16px;
  font-weight: 500;
  transition: color 0.3s ease;
  height: 100%; /* Occupy full height of nav-container */
  display: flex;
  align-items: center;
  white-space: nowrap; /* Prevent nav links from wrapping */
}

.nav-link:hover {
  color: #a0a0a0; /* Lighter grey on hover */
  text-decoration: none;
}

/* Hamburger Menu (hidden on desktop) */
.hamburger-menu {
  display: none; /* Hidden by default on desktop */
  width: 30px;
  height: 24px;
  position: relative;
  cursor: pointer;
  z-index: 1001; /* Above logo and buttons */
}

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

.hamburger-menu span:nth-child(1) { top: 0; }
.hamburger-menu span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.hamburger-menu span:nth-child(3) { bottom: 0; }

.hamburger-menu.active span:nth-child(1) { top: 50%; transform: translateY(-50%) rotate(45deg); }
.hamburger-menu.active span:nth-child(2) { opacity: 0; }
.hamburger-menu.active span:nth-child(3) { bottom: 50%; transform: translateY(50%) rotate(-45deg); }

/* Mobile Menu Overlay */
.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.7);
  z-index: 999;
}

/* Footer */
.site-footer {
  background-color: var(--footer-bg);
  color: var(--secondary-color);
  padding: 40px 20px 20px;
  font-size: 14px;
  line-height: 1.8;
  box-sizing: border-box;
}

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

.footer-col h3 {
  color: var(--secondary-color);
  font-size: 18px;
  margin-bottom: 15px;
}

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

.footer-col .footer-description {
  color: #ccc;
  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: #ccc;
  transition: color 0.3s ease;
}

.footer-nav a:hover {
  color: var(--secondary-color);
  text-decoration: underline;
}

.footer-bottom {
  text-align: center;
  border-top: 1px solid #005c2d; /* Lighter border for separation */
  padding-top: 20px;
  margin-top: 20px;
  color: #ccc;
}

.footer-bottom p {
  margin: 0;
}

/* Dynamic Slot Anchor Inner */
.footer-slot-anchor-inner {
  min-height: 10px; /* Ensure visibility for injection */
  margin-top: 10px;
}

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

  body {
    padding-top: var(--header-offset);
    overflow-x: hidden;
  }

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

  .header-container {
    padding: 0 15px; /* Smaller padding for mobile */
    max-width: none; /* No max-width for mobile container */
    justify-content: space-between; /* Hamburger left, Logo center, empty space right */
    position: relative; /* For absolute positioning of logo */
  }

  .logo {
    font-size: 24px;
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    max-width: calc(100% - 100px); /* Leave space for hamburger and potential right-side elements */
  }

  .logo img {
    max-height: 56px !important; /* Max height for mobile logo */
    max-width: 100%;
  }

  .hamburger-menu {
    display: block; /* Show hamburger menu on mobile */
    order: -1; /* Place hamburger menu to the far left */
    margin-right: auto; /* Push logo to center */
  }

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

  /* Mobile Navigation Buttons */
  .mobile-nav-buttons {
    display: flex !important;
    min-height: 48px;
    height: auto; /* Allow height to adjust based on content */
    padding: 8px 15px;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    overflow: hidden;
  }

  .mobile-nav-buttons .btn {
    flex: 1;
    min-width: 0;
    max-width: calc(50% - 5px); /* Max width for two buttons with 10px gap */
    padding: 8px 12px;
    font-size: 13px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Main Navigation (Mobile) */
  .main-nav {
    display: none; /* Hidden by default on mobile */
    position: fixed;
    top: var(--header-offset); /* Position below fixed header and mobile buttons */
    left: 0;
    width: 280px; /* Width of the mobile menu */
    height: calc(100% - var(--header-offset)); /* Full height below header */
    background-color: var(--main-nav-bg);
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 20px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    transform: translateX(-100%); /* Start off-screen */
    transition: transform 0.3s ease;
    overflow-y: auto; /* Enable scrolling for long menus */
    z-index: 1000; /* Below overlay, above body */
  }

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

  .nav-container {
    flex-direction: column;
    padding: 0 15px;
    max-width: none; /* No max-width for mobile container */
    height: auto;
    align-items: flex-start;
  }

  .nav-link {
    width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    justify-content: flex-start;
    font-size: 16px;
  }

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

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

  /* Footer Mobile */
  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column layout for mobile */
    text-align: center;
  }

  .footer-col {
    margin-bottom: 20px;
  }

  .footer-col h3 {
    text-align: center;
  }

  .footer-nav {
    text-align: center;
  }

  .footer-nav li {
    display: inline-block; /* Inline-block for horizontal links in mobile footer */
    margin: 0 8px 8px;
  }

  .footer-nav li a {
    white-space: nowrap; /* Prevent wrapping for inline links */
  }

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