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

html {
  scroll-behavior: smooth;
}

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

/* Header Styles */
.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); /* Fallback, specific colors for header-top and main-nav */
}

/* Header Top */
.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--primary-color); /* Deep blue 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-left: 25px; /* Added padding */
  padding-right: 25px; /* Added padding */
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--secondary-color);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block; /* Ensure it's visible */
}

/* Logo image (if used, currently text-based) */
.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;
}

.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default on desktop */
  min-height: 48px;
  background-color: var(--secondary-color); /* Matches main-nav background */
  padding: 0 25px; /* Matches header-container padding */
  width: 100%;
}

.btn {
  padding: 10px 18px;
  border-radius: 5px;
  font-weight: bold;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  border: none;
  font-size: 15px;
}

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

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

.btn-login {
  background-color: var(--primary-color); /* Primary color for login */
  color: var(--secondary-color);
}

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

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

.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-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 25px;
}

.nav-list li a {
  color: #333333;
  text-decoration: none;
  font-weight: bold;
  font-size: 16px;
  padding: 5px 0;
  transition: color 0.3s ease;
  white-space: nowrap;
}

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

/* Hamburger Menu (Desktop hidden) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
}

.nav-overlay {
  display: none; /* Hidden by default */
}

/* Footer Styles */
.site-footer {
  background-color: #333333;
  color: #cccccc;
  padding: 40px 20px 20px;
  font-size: 14px;
}

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

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

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

.footer-description {
  margin-bottom: 20px;
  line-height: 1.8;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

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

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

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

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

.footer-bottom {
  text-align: center;
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 20px;
  color: #999999;
}

.footer-bottom p {
  margin: 0;
}

/* Footer Slot Anchors - ensure visibility */
.footer-slot-anchor-inner {
  display: block; /* Ensure it's not display: none */
  visibility: visible; /* Ensure it's not visibility: hidden */
  opacity: 1; /* Ensure it's not opacity: 0 */
  height: auto; /* Ensure it's not height: 0 */
  max-height: none; /* Ensure it's not max-height: 0 */
  overflow: visible; /* Ensure it's not overflow: hidden */
}

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

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

  /* Header adjustments for mobile */
  .site-header {
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  }

  .header-top {
    min-height: 60px !important;
    height: 60px !important;
    background-color: var(--primary-color); /* Keep primary color */
  }

  .header-container {
    width: 100%;
    max-width: none; /* Crucial: no max-width on mobile */
    padding-left: 15px;
    padding-right: 15px;
    position: relative; /* For absolute logo positioning */
    justify-content: space-between; /* To push hamburger left and leave space for possible right elements */
  }

  .hamburger-menu {
    display: block; /* Show hamburger on mobile */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0; /* Adjusted padding */
    position: relative;
    z-index: 1001; /* Above logo and buttons */
    width: 30px;
    height: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    flex-shrink: 0; /* Prevent shrinking */
  }

  .hamburger-menu::before,
  .hamburger-menu::after,
  .hamburger-menu span {
    content: '';
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--secondary-color);
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
  }

  .hamburger-menu span {
    width: 100%;
  }

  .hamburger-menu.active::before {
    transform: translateY(11px) rotate(45deg);
  }

  .hamburger-menu.active::after {
    transform: translateY(-11px) rotate(-45deg);
  }

  .hamburger-menu.active span {
    opacity: 0;
  }

  .logo {
    position: absolute !important; /* Force absolute positioning */
    left: 50% !important; /* Center horizontally */
    transform: translateX(-50%) !important; /* Adjust for element's own width */
    display: flex !important; /* Use flex for potential image logo alignment */
    align-items: center !important;
    justify-content: center !important;
    max-width: calc(100% - 100px); /* Leave space for hamburger */
    text-align: center; /* For text logo */
    font-size: 24px;
    z-index: 1; /* Below hamburger */
  }

  .logo img {
    max-height: 56px !important; /* Adjust for mobile header height */
    max-width: 100%;
    height: auto;
  }

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

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    min-height: 48px;
    align-items: center;
    justify-content: center; /* Center buttons horizontally */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding-left: 15px;
    padding-right: 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap; /* Prevent buttons from wrapping */
    background-color: var(--secondary-color); /* White background */
    z-index: 999; /* Below main nav, above content */
    box-shadow: 0 1px 3px rgba(0,0,0,0.08); /* Light shadow */
  }

  .mobile-nav-buttons .btn {
    flex: 1;
    min-width: 0;
    max-width: calc(50% - 5px); /* Ensure two buttons fit 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;
  }

  .main-nav {
    display: none; /* Hidden by default */
    position: fixed;
    top: var(--header-offset); /* Start below fixed header and mobile buttons */
    left: 0;
    width: 100%;
    height: calc(100% - var(--header-offset)); /* Fill remaining viewport height */
    background-color: var(--primary-color); /* Use primary color for mobile menu background */
    flex-direction: column;
    transform: translateX(-100%); /* Start off-screen to the left */
    transition: transform 0.3s ease;
    overflow-y: auto; /* Enable scrolling for long menus */
    z-index: 1001; /* Above header */
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
    padding: 20px 0; /* Padding for menu items */
  }

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

  .nav-list {
    flex-direction: column;
    gap: 15px;
    text-align: center;
    width: 100%;
  }

  .nav-list li a {
    color: var(--secondary-color); /* White text for mobile menu */
    font-size: 18px;
    padding: 10px 20px;
    display: block;
  }

  .nav-list li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--secondary-color);
  }

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

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

  /* Footer adjustments for mobile */
  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column layout for footer on mobile */
    gap: 20px;
    padding-left: 15px;
    padding-right: 15px;
    border-bottom: none; /* Remove border on mobile */
  }

  .footer-col {
    text-align: center;
  }

  .footer-col h3 {
    margin-top: 20px;
  }

  .footer-nav li {
    display: inline-block; /* Inline list for footer links */
    margin: 0 8px 10px;
  }

  .footer-nav li a {
    white-space: nowrap;
  }

  .footer-about .footer-description {
    padding: 0 10px;
  }

  .footer-bottom {
    padding-left: 15px;
    padding-right: 15px;
  }
}

/* No scroll for body when menu is active */
body.no-scroll {
  overflow: hidden;
}

/* Ensure all slot anchors are visible and not hidden by CSS */
.footer-slot-anchor-inner {
  display: block; /* Ensure it's not display: none */
  visibility: visible; /* Ensure it's not visibility: hidden */
  opacity: 1; /* Ensure it's not opacity: 0 */
  height: auto; /* Ensure it's not height: 0 */
  max-height: none; /* Ensure it's not max-height: 0 */
  overflow: visible; /* Ensure it's not 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;
}
