:root {
  --primary-color: #26A9E0; /* 浅蓝色 */
  --secondary-color: #FFFFFF; /* 白色 */
  --login-button-color: #EA7C07; /* 登录按钮橙色 */
  --text-color-dark: #000000; /* 黑色 */
  --header-top-bg: #222222; /* 深灰色背景，与主色调形成对比 */
  --main-nav-bg: #333333; /* 稍浅的深灰色，与顶部区域不同 */
  --mobile-nav-bg: #333333; /* 移动菜单背景 */
  --header-offset: 122px; /* Desktop: 68px (header-top) + 52px (main-nav) = 120px + 2px buffer */
}

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

/* 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); /* Suspended effect */
  background-color: var(--header-top-bg); /* Fallback background, main colors set on children */
}

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

.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(--primary-color); /* Primary color for logo text */
  text-decoration: none;
  display: flex;
  align-items: center;
  height: 100%;
}

.logo img {
  display: block;
  max-height: 60px; /* Fixed 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;
}

.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default on desktop */
  min-height: 48px;
  width: 100%;
  background-color: var(--header-top-bg); /* Same as header-top for consistency */
  padding: 0 15px; /* Mobile padding */
  z-index: 999; /* Below hamburger menu */
}

.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px; /* Fixed height for desktop */
  display: flex; /* Visible by default on desktop */
  align-items: center;
  overflow: hidden;
  background-color: var(--main-nav-bg); /* Different background than header-top */
  width: 100%;
  color: var(--secondary-color);
}

.nav-container {
  box-sizing: border-box;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: row; /* Horizontal on desktop */
  justify-content: center;
  align-items: center;
  padding: 0 20px;
}

.nav-link {
  color: var(--secondary-color);
  text-decoration: none;
  padding: 8px 15px;
  font-weight: bold;
  transition: color 0.3s ease, background-color 0.3s ease;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color); /* Highlight color on hover/active */
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 6px;
  font-weight: bold;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
  color: var(--text-color-dark); /* Changed to black text for WCAG AA contrast */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn-login {
  background-color: var(--login-button-color); /* Specific color for login */
  border: 1px solid var(--login-button-color);
}

.btn-login:hover {
  background-color: #D46F06; /* Darken on hover */
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

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

.btn-register:hover {
  background-color: #2299C9; /* Darken on hover */
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

/* Hamburger Menu (Mobile) */
.hamburger-menu {
  display: none; /* Hidden by default on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1001;
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hamburger-icon {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--secondary-color);
  position: relative;
  transition: background-color 0.3s ease;
}

.hamburger-icon::before,
.hamburger-icon::after {
  content: '';
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--secondary-color);
  position: absolute;
  left: 0;
  transition: transform 0.3s ease, top 0.3s ease, background-color 0.3s ease;
}

.hamburger-icon::before {
  top: -8px;
}

.hamburger-icon::after {
  top: 8px;
}

.hamburger-menu.active .hamburger-icon {
  background-color: transparent; /* Middle bar disappears */
}

.hamburger-menu.active .hamburger-icon::before {
  transform: rotate(45deg);
  top: 0;
}

.hamburger-menu.active .hamburger-icon::after {
  transform: rotate(-45deg);
  top: 0;
}

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

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

/* Footer */
.site-footer {
  background-color: var(--header-top-bg); /* Dark background for footer */
  color: #CCCCCC;
  padding: 40px 20px 20px;
  font-size: 14px;
}

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

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

.site-footer .footer-description {
  color: #AAAAAA;
  line-height: 1.8;
  word-wrap: break-word; /* Ensure description wraps */
  overflow-wrap: break-word;
}

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

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

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

.footer-col ul li a {
  color: #AAAAAA;
  text-decoration: none;
  transition: color 0.3s ease;
}

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

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

.footer-bottom p {
  margin: 0;
}

/* Dynamic slot anchors - must be visible */
.footer-slot-anchor-inner {
  min-height: 1px; /* Ensure visibility for injection */
  margin-top: 10px; /* Some spacing */
}

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

  /* Header Top */
  .header-top {
    min-height: 60px !important;
    height: 60px !important; /* Fixed height for mobile */
    position: relative; /* For logo centering */
  }

  .header-container {
    width: 100%;
    max-width: none; /* No max-width on mobile */
    padding: 0 15px; /* Smaller padding for mobile */
    justify-content: space-between; /* Space between hamburger and logo */
  }

  .logo {
    flex: 1 !important; /* Take available space */
    display: flex !important;
    justify-content: center !important; /* Center logo */
    align-items: center !important;
    position: absolute; /* Absolute positioning for better centering */
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 100px); /* Account for hamburger width */
  }

  .logo img {
    max-height: 56px !important; /* Fixed max-height for mobile logo */
  }

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

  .hamburger-menu {
    display: flex; /* Show hamburger on mobile */
    position: relative;
    z-index: 1001; /* Above logo for clickability */
  }

  /* Mobile Nav Buttons (always visible below header-top) */
  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    min-height: 48px; /* Fixed height for mobile button bar */
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%; /* Ensure it doesn't overflow */
    box-sizing: border-box;
    padding: 0 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap; /* Prevent buttons from wrapping */
    background-color: var(--header-top-bg); /* Match header-top background */
  }

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

  /* Main Nav (Mobile - hidden by default, slides in) */
  .main-nav {
    display: none; /* Hidden by default */
    position: fixed;
    top: var(--header-offset); /* Start below the fixed header + mobile buttons */
    left: 0;
    width: 280px; /* Width of the mobile menu */
    height: calc(100% - var(--header-offset)); /* Full height below header */
    flex-direction: column; /* Vertical menu */
    justify-content: flex-start;
    align-items: flex-start;
    background-color: var(--mobile-nav-bg);
    transform: translateX(-100%); /* Off-screen by default */
    transition: transform 0.3s ease;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3);
    z-index: 1000; /* Below overlay, above body */
    overflow-y: auto; /* Scrollable if many items */
    padding-top: 10px; /* Internal padding */
    min-height: 48px !important; /* Fixed height for mobile main-nav bar */
    height: calc(100% - var(--header-offset)) !important; /* Full height below header */
  }

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

  .nav-container {
    width: 100%;
    max-width: none; /* No max-width on mobile */
    flex-direction: column; /* Vertical menu items */
    align-items: flex-start;
    padding: 0;
  }

  .nav-link {
    width: 100%;
    padding: 12px 20px; /* Larger clickable area */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

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

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

  .site-footer h3 {
    text-align: left;
  }

  .site-footer .footer-logo,
  .site-footer .footer-description {
    text-align: left;
  }

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