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

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

body.no-scroll {
  overflow: hidden;
}

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

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

.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(--text-color-light); /* White for logo text on blue background */
  text-decoration: none;
  display: flex; /* Ensure it's a flex container for consistent sizing */
  align-items: center;
  height: 100%; /* Take full height of header-top */
}

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

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

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

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

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

.btn-register {
  background-color: var(--secondary-color); /* White for register */
  color: var(--primary-color); /* Primary blue text */
  border: 1px solid var(--primary-color);
}

.btn-register:hover {
  background-color: #f0f0f0;
  transform: translateY(-1px);
}

/* Mobile nav buttons - hidden by default */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden on desktop */
  min-height: 48px; /* Minimum height for mobile button row */
  background-color: var(--primary-color); /* Same as header-top for consistency */
  width: 100%;
  padding: 0 15px; /* Adjust padding for mobile */
  align-items: center;
  justify-content: center; /* Center buttons horizontally */
  gap: 10px;
}

.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex; /* Desktop: visible, flex row */
  align-items: center;
  overflow: hidden;
  background-color: var(--secondary-color); /* White for main nav */
  width: 100%;
  border-top: 1px solid rgba(0,0,0,0.05); /* Subtle separator */
}

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

.nav-link {
  color: var(--text-color-dark); /* Dark text for links on white background */
  text-decoration: none;
  padding: 0 15px;
  font-size: 15px;
  font-weight: 500;
  transition: color 0.3s ease;
  height: 100%;
  display: flex;
  align-items: center;
  white-space: nowrap; /* Prevent menu items from wrapping */
}

.nav-link:hover {
  color: var(--primary-color); /* Blue on hover */
}

.hamburger-menu {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 24px;
  position: relative;
  z-index: 1002; /* Above logo if it's abs positioned */
}

.hamburger-menu .bar {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--text-color-light); /* White bars */
  border-radius: 2px;
  position: absolute;
  left: 0;
  transition: all 0.3s ease;
}

.hamburger-menu .bar:nth-child(1) { top: 0; }
.hamburger-menu .bar:nth-child(2) { top: 10px; }
.hamburger-menu .bar:nth-child(3) { top: 20px; }

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

/* Mobile overlay */
.mobile-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: 999; /* Below menu, above content */
  transition: opacity 0.3s ease;
  opacity: 0;
}

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

/* Footer styles */
.site-footer {
  background-color: #f5f5f5; /* Light gray background for footer */
  padding: 40px 20px 20px;
  color: var(--text-color-dark);
  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 {
  padding: 0;
}

.footer-col:first-child {
  padding-right: 20px; /* Add some space for description */
}

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

.footer-description {
  margin: 0;
  line-height: 1.8;
  word-wrap: break-word;
  overflow-wrap: break-word;
  color: #555;
}

.footer-title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 15px;
  color: var(--text-color-dark);
}

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

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

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

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

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

.footer-slot-anchor-inner {
  min-height: 10px; /* Ensure visibility for system injection */
  margin-top: 15px; /* Provide some spacing */
}

.footer-bottom {
  text-align: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  color: #777;
}

.footer-bottom p {
  margin: 0;
}

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

  /* Mobile body 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 !important;
    height: 60px !important;
    padding: 0 15px; /* Smaller padding for mobile */
  }

  .header-container {
    width: 100%;
    max-width: none; /* No max-width for container on mobile */
    position: relative; /* For absolute logo centering */
    justify-content: flex-start; /* Ensure hamburger is at start */
  }

  .logo {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    max-width: calc(100% - 80px); /* Leave space for hamburger */
  }
  
  .logo img {
    max-height: 56px !important; /* Mobile logo height */
  }

  .hamburger-menu {
    display: block; /* Show hamburger on mobile */
    margin-right: auto; /* Push logo to center */
    padding: 10px; /* Make it easier to tap */
    position: relative;
    z-index: 1002;
  }

  .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;
    height: auto; /* Allow height to adjust if text wraps */
    padding: 8px 15px; /* Adjust padding for mobile buttons */
    justify-content: center;
    flex-wrap: nowrap; /* Ensure buttons stay in one line */
  }

  .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; /* Smaller padding for mobile buttons */
    font-size: 13px; /* Smaller font size for mobile buttons */
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .main-nav {
    min-height: auto; /* Height will be determined by content */
    height: auto;
    display: none; /* Hidden by default on mobile */
    flex-direction: column; /* Vertical menu on mobile */
    position: fixed;
    top: var(--header-offset); /* Start below fixed header */
    left: 0;
    width: 80%; /* Menu takes 80% width */
    max-width: 300px; /* Max width for menu */
    height: calc(100% - var(--header-offset)); /* Full height below header */
    overflow-y: auto; /* Scroll if menu content is long */
    background-color: var(--secondary-color); /* White menu background */
    transform: translateX(-100%); /* Slide out to the left */
    transition: transform 0.3s ease;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    border-top: none; /* Remove top border */
  }

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

  .nav-container {
    width: 100%;
    max-width: none; /* No max-width for container on mobile */
    flex-direction: column;
    align-items: flex-start; /* Align menu items to left */
    padding: 20px 15px; /* Adjust padding for mobile menu */
  }

  .nav-link {
    width: 100%;
    padding: 10px 0;
    border-bottom: 1px solid #eee; /* Separator for menu items */
    justify-content: flex-start;
    font-size: 16px;
  }

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

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

  .footer-mid-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
  }

  .footer-col {
    padding-right: 0; /* Remove right padding for mobile columns */
    margin-bottom: 20px; /* Add space between columns */
  }

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