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

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

/* 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(--secondary-color); /* Fallback, specific colors for header-top/main-nav below */
  box-sizing: border-box;
}

.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: #1a8cc4; /* Darker shade of primary 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: 0 30px; /* Padding for logo and buttons */
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--secondary-color);
  text-decoration: none;
  white-space: nowrap;
  padding: 0; /* Remove default padding if any */
}

.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; /* Placeholder for mobile */
  background-color: #209ad7; /* Slightly lighter than header-top */
  width: 100%;
  padding: 0 15px; /* Adjust padding for mobile buttons */
  justify-content: center; /* Center buttons horizontally */
  align-items: center;
  overflow: hidden; /* Prevent button overflow */
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  color: var(--secondary-color);
  font-weight: bold;
  text-align: center;
  transition: background-color 0.3s ease, transform 0.2s ease;
  white-space: nowrap; /* Prevent wrapping on desktop */
  box-sizing: border-box;
}

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

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

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

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

.hamburger-menu {
  display: none; /* Hidden by default on desktop */
  width: 30px;
  height: 24px;
  position: relative;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  z-index: 1001;
}

.hamburger-menu span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--secondary-color);
  position: absolute;
  left: 0;
  transition: all 0.3s ease;
}

.hamburger-menu span:nth-child(1) { top: 0; }
.hamburger-menu span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.hamburger-menu span:nth-child(3) { bottom: 0; }

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

.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex; /* Display as flex on desktop */
  align-items: center;
  overflow: hidden;
  background-color: var(--primary-color); /* Primary color for main nav */
  width: 100%;
  transition: transform 0.3s ease; /* Smooth transition for mobile menu */
}

.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;
  width: 100%;
}

.nav-link {
  color: var(--secondary-color);
  text-decoration: none;
  padding: 0 15px;
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.3s ease, background-color 0.3s ease;
  height: 100%;
  display: flex;
  align-items: center;
}

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

.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; /* Dark background for footer */
  color: #ccc;
  padding: 40px 0 20px;
  font-size: 14px;
}

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

.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;
  display: block;
  margin-bottom: 15px;
}

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

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

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

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

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

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

.footer-bottom p {
  margin: 0;
}

/* Dynamic slot anchor inner - must be visible */
.footer-slot-anchor-inner {
  min-height: 1px; /* Ensure it takes up minimal space and is not hidden */
}


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

  /* Body overflow-x handling for mobile */
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: hidden;
  }

  .site-header {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  }

  .header-top {
    min-height: 60px !important;
    height: 60px !important;
    position: relative; /* For absolute logo positioning */
  }

  .header-container {
    width: 100%;
    max-width: none; /* Remove max-width on mobile */
    padding: 0 15px; /* Smaller padding for mobile */
    justify-content: space-between; /* Hamburger left, logo centered, space right */
  }

  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-size: 24px; /* Smaller font size for mobile logo */
    position: absolute; /* Absolute positioning for centering */
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 100px); /* Leave space for hamburger */
    height: 100%; /* Take full height for vertical centering */
  }

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

  .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 */
    background-color: #209ad7; /* Same as desktop for consistency */
    padding: 8px 15px;
    gap: 10px;
    flex-wrap: nowrap; /* Prevent buttons from wrapping */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    z-index: 990; /* Below hamburger menu */
  }

  .mobile-nav-buttons .btn {
    flex: 1;
    min-width: 0;
    max-width: calc(50% - 5px); /* Max width for two buttons with gap */
    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; /* Allow text to break words */
    overflow-wrap: break-word;
  }

  .hamburger-menu {
    display: block; /* Show hamburger menu on mobile */
    position: relative; /* Ensure it stays in flow for flexbox */
    z-index: 1001; /* Above logo and overlay */
  }

  .main-nav {
    display: none; /* Hidden by default on mobile */
    flex-direction: column; /* Vertical layout for mobile menu items */
    position: fixed; /* Fixed position for mobile menu */
    top: var(--header-offset); /* Start below header */
    left: 0;
    width: 280px; /* Width of the mobile menu */
    height: calc(100vh - var(--header-offset)); /* Full height below header */
    background-color: #26A9E0; /* Primary color for mobile menu */
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    transform: translateX(-100%); /* Initially off-screen to the left */
    transition: transform 0.3s ease;
    overflow-y: auto; /* Enable scrolling for long menus */
    z-index: 1000; /* Below hamburger, above overlay */
  }

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

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

  .nav-link {
    padding: 12px 20px;
    width: 100%;
    box-sizing: border-box;
    justify-content: flex-start;
  }

  .overlay.active {
    display: block; /* Show overlay when menu is active */
  }

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

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

  .footer-bottom {
    padding: 20px 15px;
    margin-top: 20px;
  }
}

/* Ensure sufficient color contrast */
.btn-login, .btn-register {
  color: var(--secondary-color); /* White text on colored buttons */
}
.btn-login:hover, .btn-register:hover {
  color: var(--secondary-color);
}
.logo {
  color: var(--secondary-color); /* White text on dark header-top */
}
.nav-link {
  color: var(--secondary-color); /* White text on primary main-nav */
}
.footer-col h3 {
  color: var(--secondary-color); /* White text for footer headings */
}
.footer-logo {
  color: var(--secondary-color); /* White text for footer logo */
}
.footer-nav a {
  color: #ccc; /* Light gray text for footer links */
}
.footer-nav a:hover {
  color: var(--primary-color); /* Primary color on hover for contrast */
}
.footer-description, .footer-bottom p {
  color: #ccc; /* Light gray text for footer descriptions and copyright */
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
