:root {
  --primary-color: #26A9E0;
  --secondary-color: #FFFFFF;
  --login-button-color: #EA7C07;
  --background-color: #FFFFFF;
  --text-color-dark: #000000;
  --header-offset: 122px; /* Desktop: 68px (header-top) + 52px (main-nav) + 2px buffer */
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding-top: var(--header-offset);
  line-height: 1.6;
  color: #333;
  background-color: var(--background-color);
  overflow-x: hidden; /* Prevent horizontal scroll */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.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); /* Default background, specific sections will override */
}

.header-top {
  box-sizing: border-box;
  height: 68px; /* Desktop fixed height */
  display: flex;
  align-items: center;
  background-color: var(--primary-color); /* Top section background */
  color: var(--secondary-color);
  overflow: hidden;
}

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

.logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--secondary-color);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block; /* Ensure logo is visible */
}

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

/* Mobile Nav Buttons (hidden on desktop by default) */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden on desktop */
  min-height: 48px; /* Mobile fixed height */
  background-color: #F0F0F0; /* A neutral background for mobile buttons */
  padding: 0 15px; /* Default padding for mobile */
}

.btn {
  padding: 10px 18px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 14px;
  line-height: 1;
}

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

.btn-register:hover {
  background-color: #1a8cc4; /* Darken primary color */
}

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

.btn-login:hover {
  background-color: #c46806; /* Darken login button color */
}

.main-nav {
  box-sizing: border-box;
  height: 52px; /* Desktop fixed height */
  display: flex; /* Desktop default: visible and horizontal */
  align-items: center;
  background-color: #000000; /* Main nav background (contrasting with header-top) */
  overflow: hidden;
}

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

.nav-link {
  color: var(--secondary-color);
  text-decoration: none;
  padding: 0 15px;
  height: 100%;
  display: flex;
  align-items: center;
  font-size: 15px;
  white-space: nowrap;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--primary-color);
}

/* Hamburger menu for mobile */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 25px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

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

.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-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  backdrop-filter: blur(2px);
}

/* Footer styles */
.site-footer {
  background-color: #222;
  color: #fff;
  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 40px;
}

.footer-col h3 {
  color: var(--primary-color);
  font-size: 18px;
  margin-bottom: 20px;
  font-weight: bold;
}

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

.footer-description {
  line-height: 1.8;
  margin-bottom: 20px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  color: #ccc;
}

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

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

.footer-nav a {
  color: #ccc;
  text-decoration: none;
  transition: color 0.3s ease;
}

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

.footer-bottom {
  text-align: center;
  border-top: 1px solid #444;
  padding-top: 20px;
  max-width: 1200px;
  margin: 0 auto;
  color: #ccc;
}

.footer-bottom p {
  margin: 0;
}

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

  .header-top {
    height: 60px; /* Mobile fixed height */
    padding: 0 15px; /* Adjust padding for mobile */
    justify-content: space-between; /* Space between hamburger and logo */
  }

  .header-container {
    padding: 0;
    max-width: none; /* Remove max-width on mobile */
    width: 100%; /* Take full width on mobile */
  }

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

  .logo {
    flex: 1 !important; /* Allow logo to take available space */
    display: flex !important;
    justify-content: center !important; /* Center logo horizontally */
    align-items: center !important;
    font-size: 20px;
    max-width: calc(100% - 60px); /* Account for hamburger width (30px + some margin on both sides) */
  }

  .desktop-nav-buttons {
    display: none !important; /* Hide desktop buttons 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;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap; /* Ensure buttons stay in one line */
    justify-content: center; /* Center buttons if less than 2 */
    background-color: #F0F0F0; /* Background for mobile buttons */
  }

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

  .main-nav {
    height: 100vh; /* Full viewport height */
    width: 70%; /* Menu width */
    max-width: 300px; /* Max menu width */
    position: fixed; /* Fixed position for slide-out menu */
    top: 0; /* Align to top */
    left: 0;
    transform: translateX(-100%); /* Hidden by default */
    transition: transform 0.3s ease-in-out;
    flex-direction: column; /* Vertical menu items */
    justify-content: flex-start; /* Align items to top */
    padding-top: 60px; /* Space for fixed header-top */
    background-color: #000000; /* Ensure menu has background */
    display: none; /* Hidden by default */
    z-index: 1001; /* Above overlay */
  }

  .main-nav.active {
    transform: translateX(0); /* Show menu */
    display: flex; /* Ensure display is not none */
  }

  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 15px;
    max-width: none; /* Remove max-width on mobile */
    width: 100%; /* Take full width on mobile */
  }

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

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

  .mobile-overlay.active {
    display: block;
  }

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

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

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

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

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