/* Variables */
:root {
  --primary-color: #017439; /* Green */
  --secondary-color: #FFFFFF; /* White */
  --btn-register-bg: #C30808; /* Red */
  --btn-login-bg: #C30808; /* Red */
  --btn-text-color: #FFFF00; /* Yellow */
  --header-top-bg: #017439; /* Using primary color for header-top */
  --main-nav-bg: #02984D; /* Lighter green for main-nav for differentiation */
  --header-offset: 122px; /* Desktop: 68px (header-top) + 52px (main-nav) */
}

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

a {
  text-decoration: none;
  color: inherit;
}

/* Site Header */
.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(--secondary-color); /* Fallback, actual background handled by header-top and main-nav */
}

/* Header Top Section (Desktop) */
.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--header-top-bg);
  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; /* Padding for logo and buttons */
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--btn-text-color); /* Yellow for logo text */
  display: flex; /* For potential image logo alignment */
  align-items: center;
  justify-content: flex-start;
  text-decoration: none;
}

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

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

.btn {
  padding: 10px 18px;
  border-radius: 5px;
  font-weight: bold;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  text-decoration: none; /* Remove underline for buttons */
}

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

.btn-register:hover {
  background-color: #A30606; /* Darker red */
  transform: translateY(-2px);
}

.btn-login {
  background-color: var(--btn-login-bg);
  color: var(--btn-text-color);
  border: 1px solid var(--btn-login-bg);
}

.btn-login:hover {
  background-color: #A30606; /* Darker red */
  transform: translateY(-2px);
}

/* Mobile Nav Buttons (Hidden by default, shown on mobile) */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default for desktop */
  min-height: 48px; /* For mobile only */
  background-color: var(--header-top-bg); /* Same as header-top for consistency */
  width: 100%;
  padding: 0 15px; /* Mobile padding */
}

/* Main Navigation (Desktop) */
.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--main-nav-bg);
  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;
  flex-wrap: nowrap; /* Prevent menu items from wrapping on desktop */
}

.nav-link {
  color: var(--secondary-color);
  padding: 0 15px;
  font-weight: bold;
  font-size: 16px;
  height: 100%;
  display: flex;
  align-items: center;
  transition: background-color 0.3s ease;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Hamburger Menu (Hidden by default, shown on mobile) */
.hamburger-menu {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 25px;
  cursor: pointer;
  z-index: 1001; /* Above header */
}

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

.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);
}

/* Navigation Overlay (Hidden by default, shown on mobile) */
.nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nav-overlay.active {
  display: block;
  opacity: 1;
}

/* Footer */
.site-footer {
  background-color: var(--primary-color);
  color: var(--secondary-color);
  padding: 40px 0 20px;
  font-size: 14px;
}

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

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

.footer-logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--btn-text-color); /* Yellow for footer logo */
  margin-bottom: 15px;
  display: block;
  text-decoration: none;
}

.footer-description {
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.8);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

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

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

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

.footer-nav a {
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.3s ease;
}

.footer-nav a:hover {
  color: var(--btn-text-color); /* Yellow on hover */
}

.footer-contact p {
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.8);
}

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

.footer-bottom p {
  margin: 0;
}

/* Dynamic slot anchors - must be visible */
.footer-slot-anchor-inner {
  min-height: 1px; /* Ensure it's not completely collapsed */
}

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

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

  .header-container {
    width: 100%;
    max-width: none;
    padding: 0 15px;
    justify-content: space-between; /* Default: hamburger left, logo center, empty space right */
    position: relative; /* For absolute positioning of logo if needed */
  }

  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 100px); /* Leave space for hamburger */
    height: 100%;
  }
  
  .logo img {
    max-height: 56px !important;
  }

  .desktop-nav-buttons {
    display: none !important;
  }

  .hamburger-menu {
    display: flex; /* Show hamburger menu on mobile */
    position: relative;
    z-index: 1001;
  }

  /* Mobile Nav Buttons (Always visible on mobile) */
  .mobile-nav-buttons {
    display: flex !important;
    min-height: 48px;
    align-items: center;
    justify-content: center; /* Center buttons horizontally */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
    background-color: var(--header-top-bg); /* Same as header-top for consistency */
  }

  .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-wrap; /* For older browsers */
  }

  /* Main Navigation (Mobile - hidden by default, shown by JS) */
  .main-nav {
    min-height: 48px !important;
    height: auto; /* Allow height to adjust for content */
    position: fixed;
    top: var(--header-offset); /* Position below fixed header and mobile buttons */
    left: 0;
    width: 250px; /* Width of the sidebar menu */
    max-width: 80%;
    background-color: var(--main-nav-bg);
    transform: translateX(-100%); /* Hide off-screen by default */
    transition: transform 0.3s ease;
    flex-direction: column;
    padding: 20px 0;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    display: none; /* Hidden by default */
    overflow-y: auto; /* Allow scrolling for long menus */
    height: calc(100vh - var(--header-offset)); /* Take full viewport height minus header */
  }

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

  .nav-container {
    width: 100%;
    max-width: none;
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
  }

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

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

  /* Footer Mobile */
  .site-footer {
    padding: 30px 0 15px;
  }

  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column layout for mobile */
    padding: 0 15px;
  }

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

  .footer-bottom {
    margin-top: 20px;
    padding-top: 15px;
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Mobile content overflow prevention */
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: hidden;
  }
}

/* No scroll for body when menu is active */
body.no-scroll {
  overflow: 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;
}
