:root { --header-offset: 122px; --primary-color: #017439; --secondary-color: #FFFFFF; --btn-register-bg: #C30808; --btn-login-bg: #C30808; --btn-text-color: #FFFF00; }

html { scroll-behavior: smooth; }
body { margin: 0; font-family: 'Arial', sans-serif; line-height: 1.6; color: #333; padding-top: var(--header-offset); overflow-x: hidden; }
body.no-scroll { overflow: hidden; }

/* General container styles */
.header-container, .nav-container, .footer-top-grid { max-width: 1200px; margin: 0 auto; padding: 0 20px; box-sizing: border-box; }

/* 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, specific sections have colors */
}

/* Header Top Bar */
.header-top {
  background-color: #1a1a1a; /* Dark grey for contrast */
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

.header-top .header-container {
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px; /* Adjusted for container */
}

/* Logo */
.logo, .footer-logo {
  color: var(--secondary-color);
  font-size: 28px;
  font-weight: bold;
  text-decoration: none;
  display: block;
  padding: 5px 0;
  line-height: 1;
}
.logo img { display: block; max-height: 60px; height: auto; width: auto; max-width: 280px; object-fit: contain; }

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

/* Mobile Nav Buttons (hidden by default on desktop) */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default for desktop */
  min-height: 48px; /* Placeholder height, will be flex on mobile */
  background-color: var(--primary-color); /* Same as main-nav for consistency */
  padding: 0 20px;
}

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

.main-nav .nav-container {
  height: 100%;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: 0 20px;
}

.nav-link {
  color: var(--secondary-color);
  text-decoration: none;
  padding: 10px 15px;
  font-size: 16px;
  white-space: nowrap;
  transition: background-color 0.3s ease;
}

.nav-link:hover, .nav-link.active {
  background-color: rgba(255,255,255,0.1);
  border-radius: 4px;
}

/* Hamburger Menu (hidden by default on desktop) */
.hamburger-menu {
  display: none;
  cursor: pointer;
  width: 30px;
  height: 24px;
  position: relative;
  z-index: 1001;
  margin-left: 20px; /* Adjust as needed */
}

.hamburger-menu span {
  display: block;
  position: absolute;
  height: 4px;
  width: 100%;
  background: var(--secondary-color);
  border-radius: 9px;
  opacity: 1;
  left: 0;
  transform: rotate(0deg);
  transition: .25s ease-in-out;
}

.hamburger-menu span:nth-child(1) { top: 0px; }
.hamburger-menu span:nth-child(2) { top: 10px; }
.hamburger-menu span:nth-child(3) { top: 20px; }

.hamburger-menu.active span:nth-child(1) { top: 10px; transform: rotate(135deg); }
.hamburger-menu.active span:nth-child(2) { opacity: 0; left: -60px; }
.hamburger-menu.active span:nth-child(3) { top: 10px; transform: rotate(-135deg); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease, transform 0.2s ease;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  text-align: center;
}

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

.btn-login {
  background-color: var(--btn-login-bg);
  color: var(--btn-text-color);
}

.btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

/* Footer */
.site-footer {
  background-color: #222;
  color: #ccc;
  padding: 40px 0 20px;
  font-size: 14px;
}

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

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

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

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

.footer-col p {
  margin-bottom: 10px;
  word-wrap: break-word; /* Ensure description wraps */
  overflow-wrap: break-word;
}

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

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

.footer-logo {
  font-size: 24px;
  margin-bottom: 15px;
  display: inline-block;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #333;
  color: #999;
}

.footer-slot-anchor-inner { min-height: 1px; }

/* Overlay for mobile menu */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.7);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Mobile Styles */
@media (max-width: 768px) {
  :root { --header-offset: 110px; }

  /* Mobile Header Top Bar */
  .header-top {
    min-height: 60px !important;
    height: 60px !important;
    padding: 0 15px;
  }

  .header-top .header-container {
    width: 100%;
    max-width: none;
    padding: 0; /* Container padding handled by header-top */
    position: relative;
    justify-content: flex-start; /* Align hamburger left */
  }

  /* Mobile Logo Centering */
  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 0; /* Remove extra padding */
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 100px); /* Account for hamburger menu width */
  }

  .logo img { max-height: 56px !important; }

  /* Mobile Hamburger Menu */
  .hamburger-menu {
    display: block;
    margin-left: 0;
    position: relative;
    z-index: 1001;
  }

  /* Hide desktop buttons, show mobile buttons */
  .desktop-nav-buttons { display: none !important; }
  .mobile-nav-buttons {
    display: flex !important;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    width: 100%; max-width: 100%;
    box-sizing: border-box;
    padding: 8px 15px; /* Reduced padding */
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
  }
  .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;
  }

  /* Mobile Main Navigation */
  .main-nav {
    min-height: 48px !important;
    height: auto; /* Auto height for expanded menu */
    position: fixed;
    top: var(--header-offset); /* Position below fixed header and mobile buttons */
    left: 0;
    width: 280px; /* Mobile menu width */
    height: calc(100% - var(--header-offset));
    transform: translateX(-100%); /* Hidden by default */
    transition: transform 0.3s ease;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
    z-index: 999;
    display: none; /* Crucial: hidden by default */
  }

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

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

  .nav-link {
    width: 100%;
    padding: 12px 20px;
    text-align: left;
    box-sizing: border-box;
  }

  /* Mobile Footer */
  .footer-top-grid {
    grid-template-columns: 1fr;
    padding: 0 15px;
  }

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