:root {
  --primary-color: #26A9E0;
  --secondary-color: #FFFFFF;
  --button-login-color: #EA7C07;
  --header-top-bg: #0A3D62; /* Darker blue for header top */
  --main-nav-bg: #26A9E0; /* Primary blue for main nav */
  --footer-bg: #F5F5F5;
  --footer-bottom-bg: #333333;
  --text-color-light: #FFFFFF;
  --text-color-dark: #333333;
  --header-offset: 122px; /* Desktop: 68px (top) + 52px (nav) */
}

html { scroll-behavior: smooth; }

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

body.no-scroll {
  overflow: hidden;
}

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

a:hover {
  text-decoration: underline;
}

/* --- Header Styles --- */
.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(--header-top-bg); /* Default background, will be covered by main-nav if needed */
  box-sizing: border-box;
}

.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--header-top-bg);
  width: 100%;
  padding: 0 20px; /* Add padding to header-top itself to prevent content touching edges */
}

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

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--text-color-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block; /* Ensure it's block for centering on mobile */
  line-height: 1; /* Adjust line height to prevent extra space */
}

.logo:hover {
  text-decoration: none;
  opacity: 0.9;
}

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

.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default on desktop */
  min-height: 48px;
  background-color: var(--main-nav-bg); /* Use main nav color for consistency */
  width: 100%;
  align-items: center;
  justify-content: center;
  padding: 0 15px; /* Adjust padding for mobile */
  gap: 10px;
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 5px;
  font-weight: bold;
  text-align: center;
  transition: background-color 0.3s ease, transform 0.2s ease;
  white-space: nowrap;
  text-decoration: none; /* Remove underline */
  cursor: pointer;
  color: var(--text-color-light); /* Default button text color */
  background-color: var(--primary-color); /* Default button background */
  border: none;
  line-height: 1.2;
}

.btn:hover {
  transform: translateY(-2px);
  text-decoration: none; /* Keep no underline on hover */
}

.btn-register {
  background-color: var(--primary-color); /* Use primary color for register */
}

.btn-login {
  background-color: var(--button-login-color); /* Use specific color for login */
}

.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex; /* Default desktop display */
  align-items: center;
  overflow: hidden;
  background-color: var(--main-nav-bg);
  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;
  gap: 25px; /* Spacing between nav links */
}

.nav-link {
  color: var(--text-color-light);
  font-weight: bold;
  padding: 5px 0;
  position: relative;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: var(--secondary-color);
  text-decoration: none;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background-color: var(--secondary-color);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.nav-link:hover::after {
  transform: scaleX(1);
}

/* Hamburger Menu (Mobile Only) */
.hamburger-menu {
  display: none; /* Hidden by default on desktop */
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 25px;
  cursor: pointer;
  z-index: 1001; /* Above header */
  position: relative; /* For z-index to work */
}

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

.hamburger-menu.active span:nth-child(1) {
  transform: translateY(11px) rotate(45deg);
}

.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
  transform: translateY(-11px) rotate(-45deg);
}

/* Overlay for 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: 998; /* Below menu, above content */
  transition: opacity 0.3s ease;
  opacity: 0;
}

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

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

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

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

.footer-col {
  padding: 10px 0;
}

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

.footer-logo:hover {
  text-decoration: none;
  opacity: 0.9;
}

.footer-description {
  margin: 0;
  line-height: 1.8;
  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: var(--text-color-dark);
  transition: color 0.3s ease;
}

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

.footer-bottom {
  border-top: 1px solid #e0e0e0;
  padding-top: 20px;
  margin-top: 30px;
  text-align: center;
  background-color: var(--footer-bottom-bg); /* Darker background for copyright */
  color: var(--text-color-light); /* Light text for copyright */
  padding: 20px 20px 20px; /* Add padding to copyright section */
  margin-left: -20px; /* Counteract site-footer padding for full width */
  margin-right: -20px; /* Counteract site-footer padding for full width */
  box-sizing: border-box;
}

.footer-bottom p {
  margin: 0;
  max-width: 1200px;
  margin: 0 auto;
}

/* Dynamic Slot Anchors - ensure they are visible and do not hide content */
.footer-slot-anchor-inner {
  min-height: 1px; /* Ensure they take up some space for visibility */
  display: block;
  width: 100%;
  box-sizing: border-box;
}

/* Mobile Specific Styles */
@media (max-width: 768px) {
  :root {
    --header-offset: 110px; /* Mobile: 60px (top) + 48px (mobile buttons) + 48px (nav) = 156px, but padding-top is based on fixed height of header-top + main-nav. Mobile buttons are visually below header-top, not part of padding-top calculation. So 60 + 48 = 108, add buffer to 110px. */
  }

  /* Mobile Header Top */
  .header-top {
    min-height: 60px;
    height: 60px;
    padding: 0 15px; /* Smaller padding for mobile */
  }

  .header-container {
    width: 100%;
    max-width: none; /* No max-width for mobile container */
    justify-content: space-between; /* Hamburger left, Logo center, space right */
    position: relative; /* For absolute logo centering */
  }

  .logo {
    font-size: 24px;
    position: absolute !important; /* Absolute position for centering */
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important; /* Using flex for potential image logo centering */
    align-items: center !important;
    justify-content: center !important;
    max-width: calc(100% - 100px); /* Leave space for hamburger and potential right element */
  }

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

  /* Mobile Nav Buttons */
  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    min-height: 48px;
    height: 48px; /* Fixed height for consistency */
    align-items: center;
    justify-content: center;
    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(--main-nav-bg); /* Use main nav color */
  }

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

  /* Hamburger Menu */
  .hamburger-menu {
    display: flex; /* Show hamburger on mobile */
    order: -1; /* Place it to the left */
    margin-right: auto; /* Push content to center */
  }

  /* Mobile Main Nav (Hamburger Menu Content) */
  .main-nav {
    display: none; /* Hidden by default */
    flex-direction: column;
    position: fixed;
    top: var(--header-offset); /* Position below fixed header */
    left: 0;
    width: 80%; /* Menu width */
    max-width: 300px;
    height: calc(100% - var(--header-offset)); /* Full height below header */
    background-color: var(--header-top-bg); /* Darker background for mobile menu */
    transform: translateX(-100%); /* Slide out to the left */
    transition: transform 0.3s ease;
    padding: 20px 0;
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
    box-sizing: border-box;
    overflow-y: auto; /* Enable scrolling for long menus */
    z-index: 999; /* Below overlay, above content */
  }

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

  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 0 20px;
    gap: 15px;
    height: auto; /* Allow content to dictate height */
    max-width: none; /* No max-width */
  }

  .nav-link {
    width: 100%;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }

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

  .nav-link::after {
    display: none; /* Hide hover effect on mobile */
  }

  /* Mobile Footer */
  .site-footer {
    padding: 30px 15px 15px; /* Adjust padding for mobile */
  }

  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column layout */
    gap: 20px;
    margin-bottom: 20px;
  }
  
  .footer-bottom {
    margin-left: -15px; /* Counteract site-footer padding */
    margin-right: -15px; /* Counteract site-footer padding */
    padding: 15px; /* Adjust padding for mobile */
  }

  /* 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 is already set globally and is sufficient */
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
