:root {
  --header-offset: 122px;
  --primary-color: #26A9E0;
  --secondary-color: #FFFFFF;
  --login-btn-color: #EA7C07;
  --dark-text-color: #333333;
  --light-text-color: #FFFFFF;
}

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

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

a:hover {
  text-decoration: underline;
}

.container, .header-container, .nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

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

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

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

.btn-login {
  background-color: var(--dark-text-color); /* Black */
  color: var(--light-text-color);
  border: none;
}

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

/* Site Header - Fixed Navigation */
.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(--primary-color); /* Primary color for the overall header */
  box-sizing: border-box;
}

/* Header Top Section */
.header-top {
  min-height: 68px;
  height: 68px; /* Fixed height for desktop */
  display: flex;
  align-items: center;
  background-color: var(--primary-color); /* Primary color for header top */
  color: var(--light-text-color);
  box-sizing: border-box;
  overflow: hidden;
}

.header-top .header-container {
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-header .logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--light-text-color);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex; /* For potential image logo centering on mobile */
  align-items: center;
  height: 100%;
}

.site-header .logo img {
  display: block;
  max-height: 60px; /* Max height for desktop logo */
  height: auto;
  width: auto;
  max-width: 280px;
  object-fit: contain;
}

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

/* Main Navigation Section */
.main-nav {
  min-height: 52px;
  height: 52px; /* Fixed height for desktop */
  display: flex; /* Default to flex for desktop */
  align-items: center;
  background-color: var(--secondary-color); /* White for main nav */
  border-top: 1px solid rgba(0,0,0,0.05);
  box-sizing: border-box;
  overflow: hidden;
}

.main-nav .nav-container {
  height: 100%;
  display: flex;
  justify-content: center; /* Center nav links on desktop */
  align-items: center;
}

.main-nav .nav-link {
  color: var(--dark-text-color);
  padding: 0 15px;
  font-weight: bold;
  height: 100%;
  display: flex;
  align-items: center;
  transition: background-color 0.3s ease;
}

.main-nav .nav-link:hover {
  background-color: rgba(0,0,0,0.05);
  text-decoration: none;
}

/* Hamburger Menu (Desktop - Hidden) */
.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 other header elements */
}

.hamburger-menu span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--light-text-color);
  margin-bottom: 5px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger-menu span:last-child {
  margin-bottom: 0;
}

/* Mobile Nav Buttons (Desktop - Hidden) */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden on desktop */
  min-height: 48px; /* Fixed height for mobile, even if hidden */
}

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

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

.site-footer a:hover {
  color: var(--light-text-color);
  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;
  box-sizing: border-box;
  margin-bottom: 30px;
}

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

.footer-col p {
  line-height: 1.8;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.footer-col .footer-logo {
  font-size: 20px;
  font-weight: bold;
  color: var(--light-text-color);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 15px;
  display: block;
}

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

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

.footer-nav li:last-child {
  margin-bottom: 0;
}

.footer-nav a {
  color: #ccc;
  transition: color 0.3s ease;
}

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

.footer-bottom {
  border-top: 1px solid #444;
  padding-top: 20px;
  margin-top: 20px;
  text-align: center;
  color: #888;
}

/* Dynamic slot anchors */
.footer-slot-anchor-inner, .footer-slot-anchor-outer {
  min-height: 1px; /* Ensure they take up space if empty */
}

/* Overlay for 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.5);
  z-index: 999;
  transition: opacity 0.3s ease;
  opacity: 0;
}

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

/* Mobile styles */
@media (max-width: 768px) {
  :root {
    --header-offset: 110px;
  }

  /* Mobile header top */
  .header-top {
    min-height: 60px !important;
    height: 60px !important;
    padding-left: 15px; /* Add padding for hamburger */
    padding-right: 15px;
  }

  .header-top .header-container {
    padding: 0; /* Remove container padding as header-top now has it */
    width: 100%;
    max-width: none; /* No max-width on mobile */
    justify-content: space-between;
    position: relative; /* For absolute positioning of logo */
  }

  .site-header .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% - 100px); /* Leave space for hamburger and potential right-side element */
  }
  
  .site-header .logo img {
    max-height: 56px !important; /* Max height for mobile logo */
    max-width: 100%; /* Ensure image fits */
  }

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

  /* Hamburger menu visible on mobile */
  .hamburger-menu {
    display: block;
    margin-right: auto; /* Push logo to center, if flex-start on container */
    color: var(--light-text-color);
  }

  .hamburger-menu span {
    background-color: var(--light-text-color);
  }

  /* Hamburger menu active state (X icon) */
  .hamburger-menu.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

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

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

  /* Mobile Nav Buttons Section */
  .mobile-nav-buttons {
    display: flex !important; /* Always visible on mobile */
    min-height: 48px;
    align-items: center;
    justify-content: center; /* Center buttons horizontally */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px; /* Padding for mobile buttons row */
    overflow: hidden; /* Prevent overflow */
    gap: 10px; /* Space between buttons */
    flex-wrap: nowrap; /* Ensure buttons stay on one line */
    background-color: #F8F8F8; /* Light grey background for distinction */
    border-top: 1px solid rgba(0,0,0,0.05);
    border-bottom: 1px solid rgba(0,0,0,0.05);
  }

  .mobile-nav-buttons .btn {
    flex: 1; /* Distribute space equally */
    min-width: 0; /* Allow shrinking */
    max-width: calc(50% - 5px); /* Max width for two buttons with gap */
    box-sizing: border-box;
    padding: 8px 12px; /* Smaller padding */
    font-size: 13px; /* Smaller font size */
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-align: center;
  }

  /* Main Navigation (Mobile - Hidden by default, slides in) */
  .main-nav {
    display: none; /* Hidden by default */
    position: fixed;
    top: var(--header-offset); /* Below header-top and mobile-nav-buttons */
    left: 0;
    width: 80%; /* Menu width */
    max-width: 300px; /* Max menu width */
    height: calc(100vh - var(--header-offset)); /* Full height minus header */
    background-color: var(--secondary-color); /* White background for menu */
    z-index: 1001; /* Above overlay, below hamburger button */
    transform: translateX(-100%); /* Slide out to the left */
    transition: transform 0.3s ease;
    flex-direction: column; /* Vertical links */
    overflow-y: auto; /* Scroll if content is too long */
    align-items: flex-start; /* Align links to the left */
  }

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

  .main-nav .nav-link {
    width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    justify-content: flex-start;
  }

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

  /* Mobile menu active state */
  .main-nav.active {
    display: flex; /* Must set display to show */
    transform: translateX(0); /* Slide in */
  }

  /* Footer mobile */
  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column layout on mobile */
    padding: 0 15px;
  }
  .footer-col {
    margin-bottom: 20px;
  }
  .footer-col:last-child {
    margin-bottom: 0;
  }

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

/* Body no-scroll for mobile menu */
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;
  }
}
/* 内容保护（系统追加，请勿删除） */
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;
}
