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

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

/* Header */
.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); /* Base background for the whole fixed header */
}

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

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

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

.hamburger-menu .bar {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--secondary-color);
  margin: 5px auto;
  transition: all 0.3s ease-in-out;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--secondary-color); /* White for contrast on primary background */
  text-decoration: none;
  display: flex; /* For potential image logo alignment */
  align-items: center;
  height: 100%;
}

.logo img {
  display: block;
  max-height: 60px; /* Matches 68px header-top height */
  height: auto;
  width: auto;
  max-width: 280px;
  object-fit: contain;
}

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

.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden on desktop by default */
  min-height: 48px;
  background-color: var(--secondary-color); /* White background for mobile buttons */
  width: 100%;
  padding: 0 15px; /* Default padding for mobile, will be overridden by media query */
}

.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex; /* Desktop default: flex */
  align-items: center;
  overflow: hidden;
  background-color: var(--dark-background); /* Distinct dark background for nav bar */
  width: 100%;
  padding: 0 20px; /* Padding for desktop */
}

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

.nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 25px;
}

.nav-menu li a {
  color: var(--secondary-color); /* White text on dark background */
  text-decoration: none;
  font-weight: bold;
  padding: 10px 0;
  display: block;
  transition: color 0.3s ease;
  white-space: nowrap; /* Prevent wrapping on desktop */
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 5px;
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
  white-space: nowrap; /* Prevent text wrapping on desktop */
  box-sizing: border-box;
}

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

.btn-login:hover {
  background-color: #C26606; /* Darker shade of #EA7C07 */
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

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

.btn-register:hover {
  background-color: var(--primary-color);
  color: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* 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: 999;
  display: none; /* Hidden by default */
  opacity: 0;
  transition: opacity 0.3s ease;
}

.overlay.active {
  display: block;
  opacity: 1;
}

/* Footer */
.site-footer {
  background-color: var(--dark-background);
  color: var(--secondary-color);
  padding: 40px 20px;
  font-size: 14px;
}

.footer-top-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto 30px auto;
}

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

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

.footer-col .footer-description {
  margin-bottom: 15px;
  line-height: 1.8;
  word-wrap: break-word; /* Ensure description wraps */
  overflow-wrap: break-word;
}

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

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

.footer-col .footer-nav li a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

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

.footer-bottom p {
  margin: 0;
}

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

  body {
    padding-top: var(--header-offset);
    overflow-x: hidden;
  }
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }

  .site-header {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15); /* Stronger shadow for mobile */
  }

  .header-top {
    min-height: 60px !important;
    height: 60px !important;
    padding: 0 15px; /* Smaller padding for mobile */
  }

  .header-container {
    width: 100%;
    max-width: none; /* No max-width on mobile */
    justify-content: space-between; /* Hamburger left, logo center, space right */
    position: relative; /* For absolute positioning of logo if needed */
  }

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

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

  .logo {
    flex: 1 !important; /* For centering the logo */
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    /* max-width: calc(100% - 100px); */ /* Account for hamburger menu width, but flex:1 handles it better */
  }

  .logo img {
    max-height: 56px !important; /* Matches 60px header-top height */
  }

  .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;
    justify-content: center; /* Center buttons if only one */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding-left: 15px;
    padding-right: 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap; /* Ensure buttons stay in one line */
    background-color: var(--secondary-color); /* White background for mobile buttons */
    border-bottom: 1px solid rgba(0,0,0,0.05); /* Subtle separator */
  }

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

  .main-nav {
    display: none; /* Hidden by default on mobile */
    position: fixed;
    top: var(--header-offset); /* Position below fixed header and mobile buttons */
    left: 0;
    width: 80%; /* Menu width */
    max-width: 300px; /* Max width for menu */
    height: calc(100% - var(--header-offset)); /* Full height below header */
    background-color: var(--dark-background); /* Menu background */
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    transform: translateX(-100%); /* Off-screen by default */
    transition: transform 0.3s ease;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    overflow-y: auto; /* Enable scrolling for long menus */
    padding: 20px 0;
    box-sizing: border-box;
  }

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

  .nav-container {
    width: 100%;
    max-width: none; /* No max-width on mobile */
    padding: 0;
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-menu {
    flex-direction: column;
    width: 100%;
    gap: 0;
  }

  .nav-menu li {
    width: 100%;
  }

  .nav-menu li a {
    padding: 12px 20px; /* Padding for mobile menu items */
    width: 100%;
    box-sizing: border-box;
    white-space: normal; /* Allow menu item text to wrap */
  }

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

  .footer-col h3 {
    margin-top: 20px;
  }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
}
