:root {
  --header-offset: 122px; /* Desktop: 68px (header-top) + 52px (main-nav) = 120px, +2 for buffer */
  --primary-color: #26A9E0;
  --secondary-color: #FFFFFF;
  --login-btn-color: #EA7C07;
  --text-color-dark: #333333;
  --text-color-light: #FFFFFF;
  --footer-bg-color: #1a1a1a; /* Dark background for footer */
  --header-top-bg: var(--primary-color); /* Primary color for header top */
  --main-nav-bg: #000000; /* Black for main nav for strong contrast */
  --mobile-nav-buttons-bg: #222222; /* Darker background for mobile buttons */
}

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

.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(--secondary-color); /* Fallback, specific sections have their own bg */
  box-sizing: border-box;
}

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

.header-container {
  width: 100%;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  box-sizing: border-box;
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--text-color-light);
  text-decoration: none;
  display: block; /* Ensure logo is visible */
  white-space: nowrap; /* Prevent logo text from wrapping */
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px; /* Limit logo width */
}

.logo img {
  display: block;
  max-height: 60px;
  height: auto;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.desktop-nav-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease, transform 0.2s ease;
  white-space: nowrap;
  cursor: pointer;
  color: var(--text-color-light); /* Default button text color */
  border: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  background-color: var(--primary-color); /* Default button background */
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

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

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

.main-nav {
  background-color: var(--main-nav-bg);
  min-height: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
  position: static; /* Desktop: normal flow */
}

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

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

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.hamburger-menu {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1001;
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  margin-left: -10px; /* Adjust to align with container padding */
}

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

/* Mobile nav buttons (hidden on desktop) */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden on desktop, will be flex on mobile */
  min-height: 48px; /* Minimum height for mobile buttons area */
  background-color: var(--mobile-nav-buttons-bg); /* Darker background for mobile buttons */
  width: 100%;
  max-width: 100%;
  padding: 0 15px; /* Default padding, will be overridden for flex gap */
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 998;
  display: none; /* Hidden by default */
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

/* Footer styles */
.site-footer {
  background-color: var(--footer-bg-color);
  color: #cccccc;
  padding: 40px 20px 20px;
  font-size: 14px;
  box-sizing: border-box;
}

.site-footer a {
  color: #cccccc;
  text-decoration: none;
}

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

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

.footer-col h3 {
  color: var(--secondary-color);
  font-size: 16px;
  margin-bottom: 15px;
  white-space: nowrap; /* Prevent title from wrapping */
  overflow: hidden;
  text-overflow: ellipsis;
}

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

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

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

.footer-description {
  line-height: 1.5;
  margin-bottom: 15px;
  word-wrap: break-word; /* Ensure description wraps */
  overflow-wrap: break-word;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #999999;
}

/* Dynamic slot anchor inner container */
.footer-slot-anchor-inner {
  /* This container is for system injection, keep it empty and visible */
  min-height: 1px; /* Ensure it takes up minimal space */
}

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

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

  .site-header {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Ensure shadow is present on mobile */
  }

  .header-top {
    min-height: 60px !important;
    height: 60px !important;
  }

  .header-container {
    padding: 0 15px;
    max-width: none; /* Remove max-width on mobile */
    width: 100%;
    position: relative; /* For absolute logo centering if needed */
  }

  .logo {
    flex: 1 !important; /* Method 1 for image logo centering */
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-size: 24px;
    max-width: none; /* Remove max-width for mobile text logo */
  }

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

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

  .hamburger-menu {
    display: flex; /* Show hamburger menu on mobile */
    position: absolute; /* Position hamburger menu */
    left: 15px; /* Align with container padding */
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0; /* Reset margin */
  }

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

  .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: 0 15px;
    overflow: hidden;
    gap: 10px; /* Gap between buttons */
    flex-wrap: nowrap; /* Prevent buttons from wrapping */
    background-color: var(--mobile-nav-buttons-bg);
  }

  .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 10px gap */
    box-sizing: border-box;
    padding: 8px 12px; /* Smaller padding for mobile buttons */
    font-size: 13px; /* Smaller font size for mobile buttons */
    white-space: normal; /* Allow text to wrap */
    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; /* Fixed position for mobile menu */
    top: var(--header-offset); /* Position below header */
    left: 0;
    width: 250px; /* Width of the mobile menu */
    height: calc(100% - var(--header-offset)); /* Full height below header */
    background-color: var(--main-nav-bg); /* Use main nav background */
    overflow-y: auto;
    transform: translateX(-100%); /* Start off-screen */
    transition: transform 0.3s ease;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3);
    z-index: 999; /* Below overlay */
    min-height: auto !important; /* Allow height to be determined by content */
    height: auto !important;
  }

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

  .nav-container {
    flex-direction: column;
    padding: 20px 0; /* Adjust padding for vertical menu */
    max-width: none; /* Remove max-width on mobile */
    width: 100%;
    height: auto; /* Allow height to adjust to content */
    align-items: flex-start; /* Align menu items to the left */
  }

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

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

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

  .footer-col {
    margin-bottom: 20px;
  }

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