:root {
  --header-offset: 122px; /* Desktop: header-top (68px) + main-nav (52px) + 2px buffer */
  --primary-color: #26A9E0;
  --secondary-color: #FFFFFF;
  --header-top-bg: #26A9E0; /* Primary color for header-top */
  --main-nav-bg: #1A7FB5; /* Darker blue for main-nav for contrast */
  --btn-register-bg: #0E83BB; /* Darker blue for Register button */
  --btn-login-bg: #EA7C07; /* Orange for Login button */
  --text-dark: #333333;
  --text-light: #FFFFFF;
}

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

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

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  background-color: var(--secondary-color); /* Fallback, sections define their own */
}

/* Header Top Section */
.header-top {
  box-sizing: border-box;
  min-height: 68px; /* Desktop fixed height */
  height: 68px; /* Desktop fixed height */
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--header-top-bg);
  width: 100%;
  color: var(--text-light);
}

.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 desktop container */
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--text-light);
  text-decoration: none;
  display: block; /* Ensure logo is block-level for flex alignment */
}

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

.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  color: var(--text-light); /* Default button text color */
  border: none;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

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

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

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Main Navigation Section */
.main-nav {
  box-sizing: border-box;
  min-height: 52px; /* Desktop fixed height */
  height: 52px; /* Desktop fixed height */
  display: flex; /* Desktop default: visible */
  align-items: center;
  overflow: hidden;
  background-color: var(--main-nav-bg);
  width: 100%;
  color: var(--text-light);
}

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

.nav-link {
  color: var(--text-light);
  padding: 10px 15px;
  font-weight: bold;
  transition: background-color 0.3s ease, color 0.3s ease;
  white-space: nowrap;
  text-decoration: none; /* Remove underline for nav links */
}

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

/* Hamburger Menu (Hidden on Desktop) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1001;
  position: relative;
  width: 30px;
  height: 24px;
  flex-direction: column;
  justify-content: space-between;
}

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

/* Mobile Nav Buttons (Hidden on Desktop) */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden on desktop by default */
  min-height: 48px; /* Mobile fixed height placeholder */
  background-color: var(--header-top-bg); /* Same as header-top for consistency */
  width: 100%;
  padding: 0 20px; /* Default padding, will be adjusted in media query */
  justify-content: center; /* Center buttons horizontally */
  align-items: center;
  gap: 10px;
  overflow: hidden; /* Prevent overflow */
}

/* 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: 998; /* Below mobile menu, above main content */
}

.overlay.active {
  display: block;
}

/* Footer Styles */
.site-footer {
  background-color: #333333; /* Dark background for footer */
  color: #cccccc;
  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-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.footer-logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--text-light);
  text-decoration: none;
  margin-bottom: 15px;
  display: inline-block;
}

.footer-description {
  line-height: 1.8;
  color: #cccccc;
  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: #cccccc;
  text-decoration: none;
  transition: color 0.3s ease;
}

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

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  color: #999999;
}

.footer-bottom p {
  margin: 0;
}

/* Footer Slot Anchors - ensure they are visible and don't hide content */
.footer-slot-anchor,
.footer-slot-anchor-inner {
  min-height: 1px; /* Ensure they take up at least some space if empty */
}

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

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

  .header-container {
    padding: 0 15px; /* Adjust padding for mobile */
    justify-content: space-between;
    position: relative; /* For logo centering */
  }

  .hamburger-menu {
    display: flex; /* Show hamburger on mobile */
    order: 1;
  }

  .logo {
    order: 2;
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-size: 24px; /* Adjust logo size for mobile */
  }

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

  /* Mobile Nav Buttons (Visible on Mobile) */
  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    min-height: 48px;
    align-items: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px; /* Mobile padding */
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
    justify-content: center; /* Center the buttons within the strip */
  }

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

  /* Main Navigation (Mobile Menu) */
  .main-nav {
    min-height: auto;
    height: auto;
    position: fixed; /* Fixed position for mobile slide-out menu */
    top: var(--header-offset); /* Position below header */
    left: 0;
    width: 70%; /* Slide-out menu width */
    max-width: 300px; /* Max width for larger phones */
    transform: translateX(-100%); /* Hidden by default */
    transition: transform 0.3s ease;
    flex-direction: column; /* Vertical links */
    justify-content: flex-start;
    align-items: flex-start;
    padding: 20px 0;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    background-color: var(--main-nav-bg);
    overflow-y: auto; /* Enable scrolling for long menus */
    height: calc(100vh - var(--header-offset)); /* Fill remaining viewport height */
    display: none; /* Hide by default, JS will change to block/flex */
  }

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

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

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

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

  /* Overlay */
  .overlay.active {
    display: block;
  }

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

  .footer-top-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
  }

  .footer-col {
    text-align: center;
  }
  .footer-col h3 {
    text-align: center;
  }
  .footer-nav {
    text-align: center;
  }
  .footer-logo {
    margin-bottom: 10px;
  }

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

/* Hamburger menu active state (X icon) */
.hamburger-menu.active span:nth-child(1) {
  transform: translateY(10px) rotate(45deg);
}
.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
}
.hamburger-menu.active span:nth-child(3) {
  transform: translateY(-10px) rotate(-45deg);
}

/* Body no-scroll class for mobile menu */
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;
  }
}
