:root {
  --primary-color: #26A9E0; /* Light blue */
  --secondary-color: #FFFFFF; /* White */
  --login-button-color: #EA7C07; /* Orange */
  --dark-blue-bg: #003366; /* Darker blue for header-top */
  --header-offset: 122px; /* Desktop: 68px (header-top) + 52px (main-nav) + 2px */
}

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

/* Header Styles */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  background-color: var(--dark-blue-bg); /* Use dark blue for fixed header background */
  box-sizing: border-box;
}

.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--dark-blue-bg); /* Dark blue background for header-top */
  color: var(--secondary-color);
  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: 28px;
  font-weight: bold;
  color: var(--secondary-color);
  text-decoration: none;
  padding: 0;
  display: block;
}

.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; /* For mobile layout */
  background-color: var(--secondary-color); /* White background for mobile buttons */
  padding: 0 15px; /* Adjust padding for mobile */
}

.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;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  box-sizing: border-box;
}

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

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

.btn-register {
  background-color: var(--primary-color); /* Light blue */
  color: var(--secondary-color);
}

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

.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex; /* Desktop default */
  align-items: center;
  overflow: hidden;
  background-color: var(--primary-color); /* Light blue background 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;
  width: 100%;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 25px; /* Space between nav items */
}

.nav-list li a {
  color: var(--secondary-color);
  text-decoration: none;
  font-weight: bold;
  font-size: 15px;
  padding: 5px 0;
  transition: color 0.3s ease;
}

.nav-list li a:hover {
  color: #e0e0e0;
}

.hamburger-menu {
  display: none; /* Hidden on desktop */
  width: 30px;
  height: 24px;
  position: relative; /* Positioned relative to header-top flex container */
  cursor: pointer;
  z-index: 1001;
  flex-direction: column;
  justify-content: space-between;
  margin-right: 20px; /* Space from logo on mobile */
}

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

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

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

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

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

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

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

.footer-description {
  margin-bottom: 15px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

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

.footer-nav li a {
  color: #f4f4f4;
  text-decoration: none;
  display: block;
  padding: 5px 0;
  transition: color 0.3s ease;
}

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

/* Dynamic slot anchors - must be visible */
.footer-slot-anchor-inner, .footer-slot-anchor {
  min-height: 1px; /* Ensure visibility for injection */
  display: block;
}

.footer-bottom {
  max-width: 1200px;
  margin: 30px auto 0;
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #444;
  padding: 20px 20px 0; /* Add padding for mobile */
}

.footer-bottom p {
  margin: 0;
  color: #ccc;
}

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

  body {
    padding-top: var(--header-offset);
    overflow-x: hidden; /* Ensure no horizontal scroll on body */
  }

  .site-header {
    background-color: var(--dark-blue-bg); /* Ensure fixed header has background on mobile */
  }

  .header-top {
    min-height: 60px;
    height: 60px;
    padding: 0 15px;
    justify-content: space-between;
    position: relative; /* For absolute positioning of logo */
  }

  .header-container {
    width: 100%;
    max-width: none; /* Remove max-width on mobile */
    padding: 0;
    justify-content: flex-start;
  }

  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    position: absolute !important; /* Absolute position for centering */
    left: 50% !important;
    transform: translateX(-50%) !important;
    max-width: calc(100% - 100px); /* Account for hamburger menu and potential right-side element */
  }

  .logo img {
    max-height: 56px !important; /* Mobile logo height */
    max-width: 100%;
  }

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

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    min-height: 48px;
    height: auto; /* Allow height to adjust if text wraps */
    align-items: center;
    justify-content: center; /* Center buttons */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 8px 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
    background-color: var(--secondary-color); /* White background */
    box-shadow: 0 1px 3px rgba(0,0,0,0.08); /* Slight shadow */
  }

  .mobile-nav-buttons .btn {
    flex: 1;
    min-width: 0;
    max-width: calc(50% - 5px); /* Max width for two buttons with 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 */
    position: fixed;
    top: var(--header-offset); /* Position below header and mobile buttons */
    left: 0;
    width: 280px; /* Sidebar width */
    height: calc(100% - var(--header-offset)); /* Fill remaining height */
    background-color: #333; /* Dark background for mobile menu */
    flex-direction: column;
    padding: 20px 0;
    transform: translateX(-100%); /* Slide out from left */
    transition: transform 0.3s ease-in-out;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    overflow-y: auto; /* Enable scroll for long menus */
    z-index: 1001; /* Above overlay */
  }

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

  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 0 20px;
    width: 100%;
    max-width: none; /* Remove max-width on mobile */
    height: auto; /* Allow height to expand */
  }

  .nav-list {
    flex-direction: column;
    width: 100%;
    gap: 0; /* No gap for vertical list */
  }

  .nav-list li {
    width: 100%;
    border-bottom: 1px solid #444; /* Separator for menu items */
  }

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

  .nav-list li a {
    color: var(--secondary-color);
    padding: 12px 0;
    display: block;
    font-size: 16px;
  }

  .hamburger-menu {
    display: flex; /* Show hamburger menu on mobile */
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    z-index: 1002; /* Above logo for clickability */
  }
  
  .overlay.active {
    display: block; /* Show overlay when menu is active */
  }

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

  .footer-col {
    text-align: left; /* Align text left in single column */
    margin-bottom: 20px;
  }
  .footer-col:last-child {
    margin-bottom: 0;
  }

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