:root {
  --primary-color: #26A9E0;
  --secondary-color: #FFFFFF;
  --login-btn-color: #EA7C07;
  --header-offset: 122px; /* Desktop: header-top (68) + main-nav (52) = 120px, +2px buffer */
}

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 from fixed header */
}

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, specific colors for header-top/main-nav */
}

.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--primary-color); /* Primary color for header top */
  width: 100%;
  color: var(--secondary-color);
}

.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: 24px;
  font-weight: bold;
  color: var(--secondary-color); /* White text on primary background */
  text-decoration: none;
  white-space: nowrap;
  padding: 5px 0; /* Add some vertical padding for text logo */
}

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

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 5px;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none; /* Remove underline */
  color: var(--secondary-color); /* White text on buttons */
}

.btn-register, .btn-login {
  background-color: var(--login-btn-color); /* Orange for login/register */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.btn-register:hover, .btn-login:hover {
  background-color: #D46F00; /* Slightly darker orange on hover */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.hamburger-menu {
  display: none; /* Hidden by default on desktop */
  width: 30px;
  height: 24px;
  position: relative;
  cursor: pointer;
  z-index: 1001; /* Above header */
}

.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-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default on desktop */
  min-height: 48px; /* For mobile, min-height for this bar */
  width: 100%;
  background-color: #F0F8FF; /* A very light blue for this section, distinct from header-top and main-nav */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex; /* Default to flex for desktop */
  align-items: center;
  overflow: hidden;
  background-color: #1E88B5; /* Darker blue for main nav, distinct from header-top */
  width: 100%;
  color: var(--secondary-color);
  transition: transform 0.3s ease; /* For mobile slide-in/out */
}

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

.nav-link {
  color: var(--secondary-color);
  font-size: 15px;
  font-weight: bold;
  padding: 5px 0;
  white-space: nowrap;
  transition: color 0.3s ease;
}

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

/* Footer Styles */
.site-footer {
  background-color: #333; /* Dark background for footer */
  color: #ccc;
  padding: 40px 20px 10px;
  font-size: 14px;
}

.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: 16px;
  margin-bottom: 15px;
  font-weight: bold;
}

.footer-col p {
  line-height: 1.8;
  margin-bottom: 15px;
}

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

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

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

.footer-bottom p {
  margin: 0;
  color: #aaa;
}

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

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

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

  .header-top {
    min-height: 60px;
    height: 60px;
    padding: 0 15px; /* Adjust padding for mobile */
    justify-content: space-between; /* To push hamburger and logo apart */
  }

  .header-container {
    padding: 0; /* Remove container padding as header-top has it */
    justify-content: space-between; /* Keep space-between for hamburger and logo */
    position: relative; /* For absolute positioning of logo if needed */
  }

  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important; /* Center text logo */
    align-items: center !important;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 100px); /* Leave space for hamburger and potential buttons if they were here */
    font-size: 20px; /* Smaller font size for mobile logo */
  }

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

  .hamburger-menu {
    display: block; /* Show hamburger menu */
    position: relative;
    z-index: 1001;
    order: -1; /* Place hamburger menu to the left */
  }

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    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: #F0F8FF; /* Match the light blue */
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  }

  .mobile-nav-buttons .btn {
    flex: 1;
    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 {
    min-height: auto; /* Allow height to adjust for stacked links */
    height: auto;
    flex-direction: column; /* Stack links vertically */
    align-items: flex-start; /* Align links to the left */
    position: fixed; /* Fixed position for mobile menu */
    top: var(--header-offset); /* Below the fixed header and mobile buttons */
    left: 0;
    width: 100%;
    max-width: 300px; /* Max width for the slide-out menu */
    transform: translateX(-100%); /* Hide menu off-screen */
    background-color: #1E88B5; /* Darker blue */
    padding: 20px 0;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    z-index: 999; /* Below hamburger menu, above content */
    display: none; /* Hidden by default, toggled by JS */
  }

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

  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 0 20px;
    width: 100%;
    height: auto;
    max-width: none; /* Remove max-width for mobile nav container */
    gap: 15px; /* Spacing between stacked nav links */
  }

  .nav-link {
    width: 100%;
    padding: 10px 0;
    font-size: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Separator for links */
  }

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

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

  .footer-col:not(:last-child) {
    margin-bottom: 20px; /* Space between stacked columns */
  }
}

/* Overlay for mobile menu */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 998; /* Below menu, above content */
  display: none; /* Hidden by default */
}

.overlay.active {
  display: block;
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
