:root {
  --header-offset: 122px; /* Desktop: 68px (header-top) + 52px (main-nav) + 2px buffer */
  --primary-color: #26A9E0;
  --secondary-color: #FFFFFF;
  --login-button-color: #EA7C07;
  --dark-background: #1a1a1a; /* Dark grey/black for contrast */
  --medium-dark-background: #333333; /* Slightly lighter dark grey */
  --text-color: #FFFFFF;
  --link-color: #FFFFFF;
  --active-link-color: var(--login-button-color);
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #333333;
  padding-top: var(--header-offset);
  overflow-x: hidden; /* Prevent horizontal scroll on desktop */
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Base styles for anchors, buttons for better consistency */
a {
  text-decoration: none;
  color: inherit;
}

/* 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.2);
  background-color: var(--dark-background); /* Fallback, overridden by sections */
}

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

.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 for logo */
  text-decoration: none;
  line-height: 1;
  display: flex;
  align-items: center;
  flex-shrink: 0; /* Prevent logo from shrinking */
}

.logo img {
  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;
  flex-shrink: 0; /* Prevent buttons from shrinking */
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
  color: var(--secondary-color); /* White text for buttons */
  border: none;
  box-sizing: border-box;
  text-align: center; /* Ensure text is centered in button */
}

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

.btn-login:hover {
  background-color: #D46F00; /* Darker version of #EA7C07 */
}

.btn-register {
  background-color: var(--primary-color);
}

.btn-register:hover {
  background-color: #1D8CB9; /* Darker version of #26A9E0 */
}

.hamburger-menu {
  display: none; /* Hidden on desktop */
  width: 30px;
  height: 24px;
  position: relative;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0;
  z-index: 1001;
  margin-left: auto; /* Push to right on desktop if present */
  flex-shrink: 0;
}

.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 on desktop, will be overridden by media query */
  min-height: 48px; /* Placeholder for mobile */
}

.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex; /* Display flex for desktop */
  align-items: center;
  overflow: hidden;
  background-color: var(--primary-color); /* Primary color for main-nav */
  width: 100%;
}

.nav-container {
  box-sizing: border-box;
  width: 100%;
  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(--link-color);
  text-decoration: none;
  padding: 10px 15px;
  font-size: 16px;
  white-space: nowrap;
  transition: color 0.3s ease, background-color 0.3s ease;
  display: block; /* Ensure it takes full width in mobile menu */
}

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

.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 998;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

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

.site-footer a {
  color: var(--link-color);
  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;
  padding: 0 20px 40px;
}

.footer-col h3 {
  font-size: 16px;
  margin-top: 0;
  margin-bottom: 15px;
  color: var(--secondary-color);
}

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

.footer-description {
  line-height: 1.6;
  color: #cccccc;
  overflow-wrap: break-word;
}

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

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

.footer-legal-section {
  background-color: var(--medium-dark-background);
  padding: 15px 0;
}

.footer-legal-section .footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-legal-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
}

.footer-legal-nav li a {
  white-space: nowrap; /* Prevent wrapping for short links */
}

.footer-bottom {
  background-color: #000000;
  padding: 15px 0;
  text-align: center;
}

.footer-bottom .footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.copyright {
  margin: 0;
  color: #aaaaaa;
}

.footer-slot-anchor-inner {
  /* This is intentionally left empty for content injection */
}


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

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

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

  .header-container {
    padding: 0; /* Remove padding as hamburger and logo will handle spacing */
    justify-content: space-between;
    position: relative; /* Needed for absolute positioning of logo */
  }

  .logo {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto; /* Allow logo to size itself */
    max-width: calc(100% - 80px); /* Ensure space for hamburger width */
    font-size: 20px; /* Smaller font size for mobile */
    text-align: center; /* For text logos */
  }

  .logo img {
    max-height: 56px !important;
  }

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

  .hamburger-menu {
    display: block; /* Show hamburger on mobile */
    position: relative; /* Keep it in flow */
    z-index: 1002; /* Higher than overlay */
    margin-left: 0; /* Reset margin */
  }

  .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; /* Padding for mobile buttons */
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
    background-color: var(--dark-background); /* Consistent background with header-top */
  }

  .mobile-nav-buttons .btn {
    flex: 1;
    min-width: 0;
    max-width: calc(50% - 5px); /* 50% width minus half of gap */
    padding: 8px 12px;
    font-size: 13px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-align: center;
  }

  .main-nav {
    display: none; /* Hidden by default on mobile */
    flex-direction: column;
    position: fixed;
    top: var(--header-offset); /* Start below fixed header and mobile buttons */
    left: 0;
    width: 250px; /* Width of the mobile menu */
    height: calc(100% - var(--header-offset)); /* Full height below header */
    background-color: var(--primary-color);
    transform: translateX(-100%); /* Slide out of view */
    transition: transform 0.3s ease;
    z-index: 999;
    padding: 20px 0;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    overflow-y: auto; /* Enable scrolling for long menus */
  }

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

  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 0 15px;
    height: auto; /* Allow height to adjust to content */
  }

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

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

  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
    padding: 0 15px 30px;
  }

  .footer-legal-section .footer-container {
    padding: 0 15px;
  }

  .footer-legal-nav {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .footer-bottom .footer-container {
    padding: 0 15px;
  }
}

/* No-scroll class for body */
.no-scroll {
  overflow: 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;
  }
}
