:root {
  --primary-color: #26A9E0; /* Light Blue */
  --secondary-color: #FFFFFF; /* White */
  --login-button-color: #EA7C07; /* Orange */
  --dark-background: #000000; /* Black for header-top */
  --header-offset: 122px; /* Desktop: 68px (header-top) + 52px (main-nav) + 2px buffer */
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding-top: var(--header-offset);
  color: #333;
  line-height: 1.6;
  background-color: var(--secondary-color); /* General page background */
}

/* Base Container for consistent width */
.header-container, .nav-container, .footer-top-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}

/* Site Header - Fixed Navigation */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

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

.header-top .header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  position: relative; /* For absolute positioning of logo on mobile */
}

/* Logo Styling */
.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--secondary-color);
  text-decoration: none;
  display: block; /* Ensures it takes up space and can be flex-aligned */
  white-space: nowrap; /* Prevent logo text from wrapping */
}

/* Desktop Navigation Buttons */
.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;
  text-align: center;
  transition: background-color 0.3s ease, transform 0.2s ease;
  white-space: nowrap;
  cursor: pointer;
}

.btn-login {
  background-color: var(--login-button-color); /* Orange */
  color: var(--secondary-color);
}

.btn-register {
  background-color: var(--primary-color); /* Light Blue */
  color: var(--secondary-color);
}

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

/* Main Navigation Section */
.main-nav {
  background-color: var(--primary-color); /* Light blue background for main-nav */
  min-height: 52px;
  height: 52px; /* Fixed height for desktop */
  display: flex; /* Desktop default: flex for horizontal layout */
  align-items: center;
  overflow: hidden;
  box-sizing: border-box;
}

.main-nav .nav-container {
  display: flex;
  justify-content: center; /* Center menu items horizontally */
  align-items: center;
  height: 100%;
  gap: 25px; /* Spacing between menu items */
}

.nav-link {
  color: var(--secondary-color);
  text-decoration: none;
  font-weight: bold;
  padding: 5px 0;
  position: relative;
  transition: color 0.3s ease;
  white-space: nowrap;
}

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

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link:hover {
  color: #f0f0f0; /* Slightly lighter on hover */
}

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

.hamburger-menu span {
  display: block;
  width: 100%;
  height: 2px;
  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: 9px; }
.hamburger-menu span:nth-child(3) { top: 18px; }

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

/* Mobile Navigation Buttons (Hidden on desktop) */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default on desktop, will be flex on mobile */
  min-height: 48px; /* Fixed height for mobile */
  background-color: #1a1a1a; /* Darker background for mobile buttons */
  width: 100%;
  padding: 0 20px; /* Padding for mobile buttons */
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* 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.7);
  z-index: 999;
  transition: opacity 0.3s ease;
  opacity: 0;
}

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

/* Footer Styles */
.site-footer {
  background-color: #333;
  color: #f0f0f0;
  padding: 50px 0 20px;
  font-size: 14px;
}

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

.site-footer h3::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 40px;
  height: 2px;
  background-color: var(--primary-color);
}

.footer-top-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  margin-bottom: 40px;
}

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

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

.footer-description {
  margin-bottom: 20px;
  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: 10px;
}

.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: 20px;
  border-top: 1px solid #444;
  color: #aaa;
}

.footer-bottom p {
  margin: 0;
}

/* Footer dynamic slot anchors */
.footer-slot-anchor-inner {
  min-height: 10px; /* Ensure visibility for injection */
  margin-top: 10px;
}

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

  body {
    padding-top: var(--header-offset);
    overflow-x: hidden; /* Prevent horizontal scroll on body */
  }

  /* Header Top Mobile */
  .header-top {
    min-height: 60px !important;
    height: 60px !important;
    padding-left: 15px; /* Adjust padding for mobile */
    padding-right: 15px;
  }
  
  .header-top .header-container {
    width: 100%; /* Mobile container takes full width */
    max-width: none; /* No max-width on mobile */
    padding: 0; /* Remove container padding as header-top has it */
    justify-content: space-between; /* To push hamburger left, logo center, buttons right */
  }

  /* Hamburger Menu Mobile */
  .hamburger-menu {
    display: block; /* Visible on mobile */
    position: relative; /* Ensure it's part of flex flow */
    flex-shrink: 0; /* Prevent shrinking */
  }

  /* Logo Mobile Centering (Method 2: Absolute positioning for robust centering) */
  .logo {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    max-width: calc(100% - 100px); /* Leave space for hamburger */
    height: 100%; /* Fill height for vertical centering */
  }

  .logo img {
    max-height: 56px !important; /* Adjust max-height for mobile logo */
    max-width: 100%;
    height: auto;
    object-fit: contain;
  }
  
  /* Desktop Buttons Hidden on Mobile */
  .desktop-nav-buttons {
    display: none !important;
  }

  /* Mobile Buttons Visible on Mobile */
  .mobile-nav-buttons {
    display: flex !important; /* Visible on mobile */
    min-height: 48px;
    align-items: center;
    justify-content: center; /* Center buttons if only one, or distribute if two */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding-left: 15px;
    padding-right: 15px;
    overflow: hidden; /* Prevent overflow */
    gap: 10px;
    flex-wrap: nowrap; /* Keep buttons on one line */
  }

  .mobile-nav-buttons .btn {
    flex: 1; /* Distribute space equally for buttons */
    min-width: 0; /* Allow shrinking */
    max-width: calc(50% - 5px); /* Max width for two buttons with 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;
  }

  /* Main Nav Mobile (Hidden by default, fixed overlay) */
  .main-nav {
    display: none; /* Hidden by default on mobile */
    position: fixed;
    top: var(--header-offset); /* Position below fixed header and mobile buttons */
    left: 0;
    width: 80%; /* Menu width */
    max-width: 300px; /* Max width for menu */
    height: calc(100% - var(--header-offset)); /* Fill remaining height */
    background-color: #222; /* Darker background for mobile menu */
    flex-direction: column;
    padding: 20px 0;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3);
    transform: translateX(-100%); /* Start off-screen */
    transition: transform 0.3s ease, display 0.3s ease; /* Smooth transition */
    z-index: 1000; /* Below overlay, but above page content */
    overflow-y: auto; /* Allow scrolling if menu content is long */
  }

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

  .main-nav .nav-container {
    flex-direction: column; /* Stack menu items vertically */
    align-items: flex-start; /* Align items to the left */
    padding: 0 20px;
    gap: 15px; /* Spacing between vertical menu items */
    width: 100%; /* Ensure container takes full width of menu */
    max-width: none; /* No max-width on mobile */
  }

  .main-nav .nav-link {
    color: var(--secondary-color);
    width: 100%; /* Full width for clickable area */
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  .main-nav .nav-link:last-child {
    border-bottom: none;
  }
  .main-nav .nav-link::after {
    display: none; /* Remove underline animation for mobile menu */
  }
  .main-nav .nav-link:hover {
    color: var(--primary-color);
  }

  /* Footer Mobile */
  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 20px;
  }
  .footer-col {
    padding: 0; /* Remove column padding on mobile, use container padding */
  }

  /* Ensure images in page-content are responsive */
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body.no-scroll { overflow: hidden; }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
}
