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

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

body.no-scroll {
  overflow: hidden;
}

/* Base styles for containers */
.header-container, .nav-container, .footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/* Site 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.1);
  background-color: var(--primary-color); /* Fallback, specific sections will override */
}

.site-header a {
  text-decoration: none;
  color: var(--text-light);
}

/* Header Top */
.header-top {
  background-color: var(--primary-color);
  min-height: 68px;
  height: 68px; /* Fixed height for desktop */
  display: flex;
  align-items: center;
  overflow: hidden;
  box-sizing: border-box;
}

.header-top .header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  padding: 0 20px; /* Ensure padding for logo and buttons */
}

.site-header .logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--text-light);
  white-space: nowrap;
}

.site-header .logo img {
  display: block;
  max-height: 60px; /* Matches header-top height */
  height: auto;
  width: auto;
  max-width: 280px;
  object-fit: contain;
}

/* Desktop Navigation Buttons */
.desktop-nav-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: bold;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.3s ease, transform 0.2s ease;
  color: var(--text-light);
  border: none;
  cursor: pointer;
}

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

.btn-register {
  background-color: var(--primary-color);
  border: 1px solid var(--text-light);
}

.btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

/* Mobile Navigation Buttons (hidden on desktop by default) */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden on desktop */
  min-height: 48px; /* Fixed height for mobile */
  background-color: rgba(0, 0, 0, 0.05); /* Subtle background */
  width: 100%;
  align-items: center;
  justify-content: center;
  padding: 0 15px; /* Adjust padding for mobile */
}

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

.main-nav .nav-container {
  height: 100%;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: 0 20px;
}

.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 25px;
}

.main-nav li a {
  color: var(--text-dark); /* Dark text for white background */
  font-weight: bold;
  font-size: 15px;
  padding: 5px 0;
  position: relative;
}

.main-nav li a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

.main-nav li a:hover::after,
.main-nav li a.active::after {
  width: 100%;
}

/* Hamburger Menu (hidden on desktop) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  width: 30px;
  height: 24px;
  position: relative;
  cursor: pointer;
  z-index: 1001; /* Above header */
}

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

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

/* Overlay (hidden on desktop) */
.overlay {
  display: none; /* Hidden on desktop */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 998; /* Below menu, above content */
  transition: opacity 0.3s ease;
  opacity: 0;
}

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

/* Site Footer */
.site-footer {
  background-color: #1A2B3A; /* Dark blue for footer */
  color: var(--text-light);
  padding: 40px 0 20px;
  font-size: 14px;
}

.site-footer h3 {
  color: var(--primary-color); /* Light blue headings */
  font-size: 16px;
  margin-bottom: 15px;
}

.site-footer a {
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

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

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

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

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

.footer-description {
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.8);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.footer-bottom {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
}

/* Dynamic slot anchors - ensure they don't hide content */
.footer-slot-anchor, .footer-slot-anchor-inner {
  min-height: 1px; /* Ensure they take up space if needed */
  display: block;
}

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

  /* Mobile Overflow Prevention */
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: hidden;
  }

  .header-top {
    min-height: 60px;
    height: 60px; /* Fixed height for mobile */
  }

  .header-top .header-container {
    padding: 0 15px; /* Smaller padding for mobile */
    position: relative; /* For logo centering */
    justify-content: space-between; /* Hamburger left, logo middle, desktop buttons hidden */
  }

  .site-header .logo {
    flex: 1 !important; /* Method 1 for image logo centering */
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-size: 20px; /* Smaller font for mobile logo */
  }

  .site-header .logo img {
    max-height: 56px !important; /* Matches mobile header-top height */
    max-width: 100%;
  }

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

  .hamburger-menu {
    display: block; /* Show hamburger menu on mobile */
    order: -1; /* Place it at the beginning */
  }

  .main-nav {
    display: none; /* Hidden by default for mobile menu */
    position: fixed;
    top: var(--header-offset); /* Position below fixed header */
    left: 0;
    width: 280px; /* Mobile menu width */
    height: calc(100% - var(--header-offset)); /* Fill remaining height */
    background-color: var(--secondary-color); /* White background for mobile menu */
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
    transform: translateX(-100%); /* Slide out from left */
    transition: transform 0.3s ease, display 0.3s ease; /* Include display in transition */
    z-index: 999; /* Below overlay */
    overflow-y: auto; /* Allow scrolling for long menus */
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
  }

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

  .main-nav ul {
    flex-direction: column;
    gap: 15px;
    width: 100%;
  }

  .main-nav li a {
    color: var(--text-dark); /* Dark text for mobile menu */
    font-size: 16px;
    display: block;
    padding: 10px 0;
  }

  .main-nav li a::after {
    display: none; /* Remove underline animation for mobile */
  }
  .main-nav li a:hover {
    color: var(--primary-color);
  }

  .overlay {
    z-index: 997; /* Below mobile nav */
  }
  .overlay.active {
    display: block;
  }

  /* Mobile Navigation Buttons */
  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    justify-content: center;
    align-items: center;
    min-height: 48px;
    background-color: rgba(0, 0, 0, 0.05); /* Subtle background */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
  }

  .mobile-nav-buttons .btn {
    flex: 1;
    min-width: 0;
    max-width: calc(50% - 5px); /* Account for gap */
    box-sizing: border-box;
    padding: 8px 12px;
    font-size: 13px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-align: center;
  }

  .footer-grid-container {
    grid-template-columns: 1fr; /* Single column for mobile */
    gap: 20px;
    padding: 0 15px;
  }

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

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

  .footer-bottom .footer-container {
    padding: 0 15px;
  }

  .header-container, .nav-container, .footer-container {
    width: 100%;
    max-width: none;
  }
}

/* Ensure no double padding-top on content sections */
.page-xxx, .__hero-section, .__video-section, .__title-section {
  padding-top: 10px; /* Decorative top margin, not header offset */
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
}
