:root {
  --primary-color: #26A9E0; /* Light Blue */
  --secondary-color: #FFFFFF; /* White */
  --login-button-color: #EA7C07; /* Orange */
  --dark-header-bg: #1A202C; /* Dark Blue/Grey for header-top */
  --text-color-dark: #333333;
  --text-color-light: #FFFFFF;
  --header-offset: 122px; /* Desktop: 68px (header-top) + 52px (main-nav) + 2px buffer */
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-color-dark);
  padding-top: var(--header-offset); /* Fixed header spacing */
  overflow-x: hidden; /* Prevent horizontal scroll on body */
}

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

.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/base for entire header */
}

.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px; /* Desktop fixed height */
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--dark-header-bg); /* Darker background for top bar */
  width: 100%;
  padding: 0 20px; /* Padding for header-top */
}

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

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--secondary-color); /* White text on dark header-top */
  padding: 0;
  display: flex;
  align-items: center;
  text-decoration: none;
}

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

.hamburger-menu {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1001; /* Above header */
}

.hamburger-menu .bar {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--secondary-color); /* White bars on dark header-top */
  margin: 5px 0;
  transition: 0.4s;
}

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

.btn {
  padding: 10px 18px;
  border-radius: 5px;
  font-weight: bold;
  text-align: center;
  transition: background-color 0.3s ease, transform 0.2s ease;
  white-space: nowrap;
  text-decoration: none; /* Remove underline */
  color: var(--text-color-light); /* Default button text color */
  cursor: pointer;
  border: none;
}

.btn-login {
  background-color: var(--login-button-color); /* Orange */
  color: var(--text-color-light);
}

.btn-login:hover {
  background-color: #CC6D06; /* Darker orange */
  transform: translateY(-1px);
}

.btn-register {
  background-color: var(--primary-color); /* Light Blue */
  color: var(--text-color-light);
}

.btn-register:hover {
  background-color: #2197CA; /* Darker primary blue */
  transform: translateY(-1px);
}

.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden on desktop, shown on mobile */
  min-height: 48px; /* Mobile button bar fixed height */
  background-color: var(--dark-header-bg); /* Same as header-top */
  padding: 8px 15px; /* Padding for mobile button bar */
  width: 100%;
  justify-content: center;
  align-items: center;
  gap: 10px;
  overflow: hidden; /* Prevent horizontal scroll */
}

.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px; /* Desktop fixed height */
  display: flex; /* Desktop default: visible, horizontal */
  flex-direction: row;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background-color: var(--primary-color); /* Primary color for main nav */
  width: 100%;
  position: static; /* Desktop default */
}

.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;
  gap: 25px; /* Spacing between nav links */
}

.nav-link {
  color: var(--secondary-color); /* White text on primary background */
  font-weight: bold;
  padding: 8px 0;
  transition: color 0.3s ease;
  white-space: nowrap;
  text-decoration: none;
}

.nav-link:hover {
  color: #E0E0E0; /* Slightly lighter white on hover */
}

.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.7);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Footer styles */
.site-footer {
  background-color: var(--dark-header-bg); /* Dark background for footer */
  color: #BBBBBB; /* Lighter text for footer */
  padding: 40px 20px 20px;
}

.site-footer a {
  color: var(--primary-color); /* Primary color for footer links */
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.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); /* White headings */
  font-size: 18px;
  margin-bottom: 15px;
}

.footer-logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--primary-color); /* Primary color for footer logo */
  margin-bottom: 15px;
  display: block;
}

.footer-description {
  font-size: 14px;
  line-height: 1.8;
  color: #BBBBBB;
  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 {
  font-size: 14px;
  color: #BBBBBB; /* Lighter text for footer nav links */
  transition: color 0.3s ease;
}

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

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  text-align: center;
  font-size: 13px;
  color: #999999;
  max-width: 1200px;
  margin: 0 auto;
}

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

  .header-top {
    min-height: 60px !important;
    height: 60px !important; /* Mobile fixed height */
    padding: 0 15px;
    justify-content: space-between; /* To push hamburger and logo apart */
  }

  .header-container {
    width: 100%;
    max-width: none; /* No max-width on mobile */
    padding: 0; /* Remove container padding as header-top has it */
    position: relative; /* For absolute logo centering */
  }

  .hamburger-menu {
    display: block; /* Show hamburger on mobile */
    position: relative;
    z-index: 1001; /* Ensure it's above other elements */
  }

  .hamburger-menu.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .hamburger-menu.active .bar:nth-child(2) {
    opacity: 0;
  }

  .hamburger-menu.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  /* Mobile Logo Centering (Method 1: Flexbox) */
  .header-top .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    position: absolute; /* To allow hamburger to be far left */
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 100px); /* Leave space for hamburger */
    z-index: 1; /* Below hamburger */
  }

  .logo img {
    max-height: 56px !important; /* Mobile max height for image logo */
    max-width: 100%;
  }

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

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons on mobile */
    min-height: 48px;
    padding: 8px 15px; /* Reduced padding for mobile */
    flex-wrap: nowrap; /* Prevent buttons from wrapping */
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
  }

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

  .main-nav {
    min-height: auto; /* Allow height to adjust for content */
    height: auto;
    display: none; /* Hidden by default on mobile */
    flex-direction: column; /* Vertical layout for mobile menu */
    position: fixed;
    top: var(--header-offset); /* Below fixed header */
    left: 0;
    width: 75%; /* Slide-out menu width */
    max-width: 300px;
    height: calc(100% - var(--header-offset)); /* Fill remaining viewport height */
    background-color: var(--primary-color);
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3);
    transform: translateX(-100%); /* Slide out from left */
    transition: transform 0.3s ease;
    overflow-y: auto; /* Scroll if menu content is long */
    z-index: 1000;
  }

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

  .nav-container {
    flex-direction: column;
    padding: 20px 15px;
    gap: 15px; /* Spacing between mobile nav links */
    max-width: none; /* No max-width on mobile */
    width: 100%;
    height: auto; /* Allow height to adjust */
    align-items: flex-start; /* Align links to the left */
  }

  .nav-link {
    width: 100%;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  .nav-link:last-child {
      border-bottom: none;
  }

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

  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 25px;
  }

  .footer-col h3 {
    margin-top: 0;
  }

  .footer-bottom {
    padding-top: 15px;
  }

  /* Mobile content 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;
  }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
}
