:root {
  --header-offset: 122px; /* Desktop: 68px (header-top) + 52px (main-nav) = 120px + 2px buffer */
  --primary-color: #26A9E0; /* Light Blue */
  --secondary-color: #FFFFFF; /* White */
  --login-btn-color: #EA7C07; /* Orange */
  --text-color-dark: #333333;
  --text-color-light: #FFFFFF;
  --header-top-bg: var(--primary-color);
  --main-nav-bg: #1a7bbd; /* A darker shade of primary for contrast */
  --mobile-btn-bg: #e0e0e0; /* Light gray for mobile button bar */
}

body {
  padding-top: var(--header-offset);
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* More modern font */
  color: var(--text-color-dark);
  line-height: 1.6;
  overflow-x: hidden; /* For mobile content overflow */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Base styles for header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); /* Stronger shadow for suspended effect */
  background-color: var(--header-top-bg); /* Default background, overridden by sections */
}

/* Header Top Area (Desktop) */
.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  background-color: var(--header-top-bg);
  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 25px; /* Padding for container edges */
}

/* Logo */
.logo {
  font-size: 28px;
  font-weight: 800; /* Bolder for brand */
  color: var(--text-color-light);
  text-decoration: none;
  display: block;
  flex-shrink: 0; /* Prevent logo from shrinking */
}
.logo img { /* If logo is an image */
  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;
  flex-shrink: 0; /* Prevent buttons from shrinking */
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 25px; /* More rounded buttons */
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
  white-space: nowrap;
  box-sizing: border-box;
  text-align: center;
  cursor: pointer;
  font-size: 15px;
  letter-spacing: 0.5px;
}

.btn-login {
  background-color: var(--login-btn-color);
  color: var(--text-color-light);
  border: none;
}
.btn-login:hover {
  background-color: #d66f07; /* Slightly darker orange */
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn-register {
  background-color: var(--primary-color);
  border: 2px solid var(--secondary-color);
  color: var(--text-color-light);
}
.btn-register:hover {
  background-color: #1e9bd8; /* Slightly darker primary */
  border-color: #d8d8d8;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Hamburger Menu (Desktop hidden) */
.hamburger-menu {
  display: none; /* Hidden by default on desktop */
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 25px;
  cursor: pointer;
  z-index: 1002;
  padding: 5px;
  margin-right: 15px; /* Space from logo on mobile */
  position: relative; /* For z-index in mobile container */
}

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

/* Main Navigation Area (Desktop) */
.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex; /* Desktop default: flex */
  align-items: center;
  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; /* Desktop default: row */
  justify-content: center;
  align-items: center;
  gap: 30px; /* Spacing between nav links */
  padding: 0 25px;
}

.nav-link {
  color: var(--text-color-light);
  text-decoration: none;
  font-weight: 600;
  padding: 5px 0;
  transition: color 0.3s ease, transform 0.2s ease;
  white-space: nowrap;
  position: relative;
}
.nav-link::after { /* Underline effect */
    content: '';
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 0;
    height: 2px;
    background-color: var(--secondary-color);
    transition: width 0.3s ease;
}
.nav-link:hover::after {
    width: 100%;
}
.nav-link:hover {
  color: var(--secondary-color);
  transform: translateY(-1px);
}

/* Mobile Navigation Buttons (Desktop hidden) */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default on desktop */
  min-height: 48px; /* Placeholder height, actual content might make it taller */
  background-color: var(--mobile-btn-bg);
  padding: 10px 25px;
  width: 100%;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); /* Slight shadow */
}

/* Mobile Menu Overlay (Desktop hidden) */
.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.6); /* Darker overlay */
  z-index: 999;
  opacity: 0;
  visibility: hidden; /* Use visibility for smoother transition with display */
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.mobile-menu-overlay.active {
  display: block; /* Explicitly block for interaction */
  opacity: 1;
  visibility: visible;
}

/* Footer Styles */
.site-footer {
  background-color: #222222; /* Darker background for footer */
  color: #cccccc;
  padding: 40px 20px 20px;
  font-size: 14px;
  line-height: 1.8;
}

.footer-top-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr); /* First col wider for logo+desc */
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
  padding-bottom: 30px;
  border-bottom: 1px solid #3a3a3a;
}

.footer-col h3 {
  color: var(--secondary-color);
  font-size: 17px;
  margin-bottom: 18px;
  font-weight: 700;
}

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

.footer-description {
  margin: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  font-size: 13px;
  color: #b0b0b0;
}

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

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

.footer-nav a {
  color: #cccccc;
  text-decoration: none;
  transition: color 0.3s ease;
  font-size: 14px;
}

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

.footer-mid-section,
.footer-slot-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 25px 0;
  border-top: 1px solid #3a3a3a;
  border-bottom: 1px solid #3a3a3a;
  margin-top: 25px;
  margin-bottom: 25px;
}
.footer-mid-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  padding-top: 20px;
  color: #888888;
  font-size: 13px;
}
.footer-bottom p {
  margin: 0;
}

/* Dynamic Slot Anchors (must be visible/renderable) */
.footer-slot-anchor-inner {
  min-height: 1px; /* Ensure renderable, even if empty */
  width: 100%;
}


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

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

  /* Mobile Header Top */
  .site-header {
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
  }
  .header-top {
    min-height: 60px !important;
    height: 60px !important;
    padding: 0 15px; /* Smaller padding for mobile */
  }

  .header-container {
    width: 100%;
    max-width: none; /* No max-width on mobile */
    padding: 0; /* Handled by header-top padding */
    position: relative; /* For absolute positioning of logo */
  }
  
  /* Hamburger Menu (Mobile visible) */
  .hamburger-menu {
    display: flex; /* Visible on mobile */
    position: relative; /* Ensure it stays on top of logo if overlapping */
    z-index: 1002;
    margin-right: 0; /* No margin needed, flex handles spacing */
  }
  .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);
  }

  /* Logo Centering on Mobile (Method 2: Absolute Positioning) */
  .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/buttons */
    height: 100%; /* Ensure it vertically centers within header-top */
  }
  .logo img { /* If logo is an image */
    max-height: 56px !important; /* Match mobile header-top height */
    max-width: 100%;
    height: auto;
  }

  /* Desktop Buttons (Mobile hidden) */
  .desktop-nav-buttons {
    display: none !important;
  }

  /* Mobile Navigation Buttons (Mobile visible, below header-top) */
  .mobile-nav-buttons {
    display: flex !important; /* Visible on mobile */
    min-height: 48px;
    height: auto; /* Allow content to dictate height */
    align-items: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px 15px; /* Smaller padding for mobile */
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap; /* Ensure buttons stay on one line */
    background-color: var(--mobile-btn-bg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  }
  .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; /* Smaller padding */
    font-size: 13px; /* Smaller font size */
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word;
    overflow-wrap: break-word;
    border-radius: 20px; /* Slightly less rounded on mobile */
  }
  .mobile-nav-buttons .btn-login {
    background-color: var(--login-btn-color);
  }
  .mobile-nav-buttons .btn-register {
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color); /* Match background for a solid look */
  }


  /* Main Navigation (Mobile hidden by default, slides in) */
  .main-nav {
    display: none; /* Hidden by default, JS will change to block/flex */
    position: fixed;
    top: var(--header-offset); /* Position below fixed header and mobile buttons */
    left: 0;
    width: 75%; /* Slide-out menu width */
    max-width: 300px; /* Max width for larger phones */
    height: calc(100% - var(--header-offset)); /* Full height below header */
    background-color: #f8f8f8; /* Light background for menu */
    flex-direction: column; /* Vertical menu */
    padding: 20px 0;
    transform: translateX(-100%); /* Slide out to the left */
    transition: transform 0.3s ease;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    z-index: 1001; /* Above overlay */
    overflow-y: auto; /* Allow scrolling for long menus */
    box-sizing: border-box;
  }
  .main-nav.active {
    display: flex; /* Show menu when active */
    transform: translateX(0); /* Slide in */
  }

  .nav-container {
    width: 100%;
    max-width: none; /* No max-width on mobile */
    flex-direction: column; /* Vertical links */
    align-items: flex-start; /* Align links to the left */
    gap: 0; /* No gap for vertical list */
    padding: 0 20px;
  }
  .nav-link {
    width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    color: var(--text-color-dark);
    font-size: 16px;
  }
  .nav-link:last-child {
    border-bottom: none;
  }
  .nav-link::after { /* Remove underline effect on mobile */
    display: none;
  }
  .nav-link:hover {
    color: var(--primary-color);
    transform: none; /* Remove hover transform on mobile */
  }


  /* Mobile Overlay */
  .mobile-menu-overlay.active {
    top: 0;
    height: 100%; /* Cover full viewport */
  }

  /* Footer Mobile */
  .site-footer {
    padding: 30px 15px 15px; /* Adjust padding for mobile */
  }
  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column layout */
    padding-bottom: 15px;
    gap: 15px;
  }
  .footer-col {
    text-align: center;
  }
  .footer-col h3 {
    margin-top: 15px;
    margin-bottom: 10px;
  }
  .footer-logo {
    text-align: center;
    margin-bottom: 10px;
  }
  .footer-description {
    font-size: 12px;
  }
  .footer-nav li {
    margin-bottom: 6px;
  }
  .footer-nav a {
    font-size: 13px;
  }
  .footer-mid-section,
  .footer-slot-bottom {
    padding: 15px 0;
    margin-top: 15px;
    margin-bottom: 15px;
  }
  .footer-mid-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    padding-top: 15px;
    font-size: 12px;
  }

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