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

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

a {
  text-decoration: none;
  color: var(--primary-color);
}

/* 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(--secondary-color); /* Fallback, actual background set on header-top/main-nav */
  box-sizing: border-box;
  overflow-x: hidden; /* Prevent header content from overflowing */
}

/* Header Top Area */
.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: #333333; /* Dark grey for contrast */
  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 content inside container */
}

/* Logo */
.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--secondary-color); /* White text for dark background */
  text-decoration: none;
  display: block; /* Ensure it's a block for flex alignment */
  line-height: 1; /* Adjust line height for better vertical alignment */
}

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

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

/* Mobile Navigation Buttons (hidden by default on desktop) */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default on desktop */
  min-height: 48px; /* Fixed height for mobile */
  background-color: var(--secondary-color); /* White background for mobile buttons */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05); /* Subtle shadow */
}

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

.nav-link {
  color: var(--secondary-color); /* White text */
  padding: 10px 15px;
  font-size: 16px;
  font-weight: bold;
  transition: background-color 0.3s ease;
  white-space: nowrap; /* Prevent menu items from wrapping */
}

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

/* Buttons */
.btn {
  padding: 10px 18px;
  border-radius: 5px;
  font-weight: bold;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  text-decoration: none; /* Remove underline */
  white-space: nowrap; /* Prevent button text from wrapping on desktop */
}

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

.btn-register:hover {
  background-color: #1a8cc2; /* Slightly darker primary */
  transform: translateY(-1px);
}

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

.btn-login:hover {
  background-color: #c76706; /* Slightly darker login color */
  transform: translateY(-1px);
}

/* Hamburger Menu (hidden on desktop) */
.hamburger-menu {
  display: none; /* Hidden by default on desktop */
  width: 30px;
  height: 24px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  position: relative;
  z-index: 1002; /* Above logo on mobile */
}

.hamburger-menu span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--secondary-color); /* White lines for dark header */
  border-radius: 2px;
  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); }

/* 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.5);
  z-index: 999; /* Below mobile menu, above main content */
  transition: opacity 0.3s ease;
  opacity: 0;
}

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

/* Footer */
.site-footer {
  background-color: #222222; /* Dark background for footer */
  color: #cccccc;
  padding: 40px 20px 20px;
  font-size: 14px;
  box-sizing: border-box;
}

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

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

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

.footer-description {
  margin-bottom: 20px;
  line-height: 1.8;
  color: #aaaaaa;
  word-wrap: break-word; /* Ensure description wraps */
  overflow-wrap: break-word;
}

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

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

.footer-nav a {
  color: #aaaaaa;
  transition: color 0.3s ease;
}

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

.footer-mid-slots {
  max-width: 1200px;
  margin: 0 auto 30px;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #444444;
  color: #999999;
}

.footer-bottom p {
  margin: 0;
}

/* Footer Dynamic Slot Anchors */
.footer-slot-anchor-inner {
  min-height: 1px; /* Ensure visibility for injection */
}

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

  body {
    padding-top: var(--header-offset);
    overflow-x: hidden;
  }

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

  /* Header adjustments */
  .site-header {
    box-sizing: border-box;
  }

  .header-top {
    min-height: 60px !important;
    height: 60px !important;
    display: flex; /* Make header-top a flex container */
    justify-content: flex-start; /* Align hamburger to left */
    align-items: center;
    padding: 0 15px; /* Padding for the entire header-top bar */
    position: relative; /* For absolutely positioned logo */
  }

  .header-container {
    width: 100%;
    max-width: none;
    padding: 0;
    height: 100%;
    display: contents; /* Allow children to flow directly into header-top's flex context */
  }

  /* Hamburger Menu visible on mobile */
  .hamburger-menu {
    display: block;
    position: relative;
    z-index: 1002;
    margin-right: auto; /* Push any other flex items to the right if they exist */
  }
  
  /* Mobile Logo Centering (Method 2: Absolute Positioning) */
  .logo {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important; /* For vertical centering if logo is an image */
    align-items: center !important;
    justify-content: center !important;
    max-width: calc(100% - 100px); /* Allow space for hamburger and potential right-side elements */
    font-size: 24px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 1; /* Below hamburger */
  }

  .logo img {
    max-height: 56px !important; /* Adjust max-height for mobile */
    max-width: 100%;
    height: auto;
  }

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

  /* Mobile Navigation Buttons visible on mobile */
  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    min-height: 48px;
    align-items: center;
    justify-content: center; /* Center buttons */
    width: 100%; max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap; /* Ensure buttons stay in one line */
    background-color: var(--secondary-color); /* White background for mobile buttons */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05); /* Subtle shadow */
  }

  .mobile-nav-buttons .btn {
    flex: 1; min-width: 0;
    max-width: calc(50% - 5px); /* Two buttons with 10px gap */
    box-sizing: border-box;
    padding: 8px 12px;
    font-size: 13px;
    white-space: normal; /* Allow text to wrap if necessary */
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Main Navigation (Mobile Menu) */
  .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; /* Width of the mobile menu */
    height: auto; /* Let content define height for initial display */
    max-height: calc(100% - var(--header-offset)); /* Constrain max height */
    background-color: #333333; /* Dark background for mobile menu */
    flex-direction: column;
    padding: 20px 0;
    box-sizing: border-box;
    transform: translateX(-100%); /* Slide out from left */
    transition: transform 0.3s ease;
    z-index: 1001; /* Above overlay, below hamburger */
    overflow-y: auto; /* Enable scrolling for long menus */
  }

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

  .nav-container {
    flex-direction: column;
    padding: 0 15px;
    height: auto;
    max-width: none;
    align-items: flex-start; /* Align menu items to the left */
  }

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

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

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

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

  .footer-col h3 {
    margin-top: 0;
  }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
}
