:root {
  --header-offset: 122px; /* 68px (header-top) + 52px (main-nav) + 2px buffer */
  --primary-color: #26A9E0;
  --auxiliary-color: #FFFFFF;
  --login-button-color: #EA7C07;
  --text-color: #333333; /* Default text color for contrast */
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding-top: var(--header-offset); /* Fixed header offset */
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--auxiliary-color);
}

/* Base styles for anchors */
a {
  text-decoration: none;
  color: var(--primary-color);
}
a:hover {
  text-decoration: underline;
}

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

/* Header Top Section (Desktop default) */
.header-top {
  background-color: var(--primary-color); /* Distinct from main-nav */
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

.header-container {
  width: 100%;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px; /* Padding for logo and buttons */
  box-sizing: border-box;
}

/* Logo */
.site-header .logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--auxiliary-color); /* White text for logo on primary background */
  text-decoration: none;
  display: block; /* Ensure it's not inline-block by default for flex */
}

/* Hamburger Menu (Hidden on Desktop) */
.hamburger-menu {
  display: none; /* Hidden by default on desktop */
  cursor: pointer;
  width: 30px;
  height: 20px;
  position: relative;
  z-index: 1001; /* Above header */
}
.hamburger-menu span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: var(--auxiliary-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: 8px; }
.hamburger-menu span:nth-child(3) { top: 16px; }

/* Hamburger Active State */
.hamburger-menu.active span:nth-child(1) { transform: rotate(45deg); top: 8px; }
.hamburger-menu.active span:nth-child(2) { opacity: 0; }
.hamburger-menu.active span:nth-child(3) { transform: rotate(-45deg); top: 8px; }

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

/* Mobile Navigation Buttons (Hidden on Desktop) */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default on desktop */
  min-height: 48px; /* Placeholder height */
  background-color: #F0F0F0; /* A light background for this section */
  padding: 0 20px;
}

/* Main Navigation (Desktop default) */
.main-nav {
  background-color: var(--auxiliary-color); /* Distinct from header-top */
  min-height: 52px;
  height: 52px;
  display: flex; /* Visible on desktop */
  align-items: center;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
  position: static; /* Default for desktop */
  flex-direction: row; /* Default for desktop */
}

.nav-container {
  width: 100%;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: row;
  justify-content: center; /* Center nav links on desktop */
  align-items: center;
  padding: 0 20px;
  box-sizing: border-box;
}

.main-nav .nav-link {
  color: var(--text-color); /* Dark text on white background */
  padding: 10px 15px;
  font-weight: bold;
  transition: color 0.3s ease, background-color 0.3s ease;
  white-space: nowrap;
}

.main-nav .nav-link:hover {
  color: var(--primary-color);
  background-color: #f5f5f5; /* Light hover background */
  text-decoration: none;
}

/* Buttons */
.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;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.btn-login {
  background-color: var(--login-button-color); /* Orange */
  color: var(--auxiliary-color); /* White text */
}
.btn-login:hover {
  background-color: #d16b05; /* Darker orange */
  transform: translateY(-1px);
}

.btn-register {
  background-color: var(--primary-color); /* Light blue */
  color: var(--auxiliary-color); /* White text */
}
.btn-register:hover {
  background-color: #1f8ec4; /* Darker blue */
  transform: translateY(-1px);
}

/* Overlay for Mobile Menu */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: none; /* Hidden by default */
}
.overlay.active {
  display: block;
}

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

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

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

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

.footer-col .footer-description {
  font-size: 14px;
  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: #cccccc;
  font-size: 14px;
  transition: color 0.3s ease;
}

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

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

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

/* Dynamic Slot Anchors - ensure they are visible for injection */
.footer-slot-anchor-inner {
    min-height: 1px; /* Ensure they take up space */
}

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

  /* Header Top Section */
  .header-top {
    min-height: 60px !important;
    height: 60px !important;
  }
  .header-container {
    padding: 0 15px; /* Smaller padding for mobile */
    max-width: none; /* No max-width for mobile container */
    width: 100%;
    justify-content: space-between; /* Hamburger left, Logo center, space right */
    position: relative; /* For absolute positioning of logo */
  }

  /* Logo Centering for Mobile */
  .site-header .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 100px); /* Account for hamburger and potential right-side element */
    height: 100%; /* Ensure logo takes full height of header-top */
  }
  .site-header .logo img {
    max-height: 56px !important;
    max-width: 100%;
    height: auto;
  }

  /* Hamburger Menu (Visible on Mobile) */
  .hamburger-menu {
    display: block; /* Visible on mobile */
    order: -1; /* Place it at the beginning */
    margin-right: auto; /* Push logo to center */
    z-index: 1001; /* Ensure it's above the logo for clickability */
  }

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

  /* Mobile Navigation Buttons (Visible on Mobile) */
  .mobile-nav-buttons {
    display: flex !important; /* Visible on mobile */
    min-height: 48px;
    align-items: center;
    justify-content: center; /* Center buttons horizontally */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px; /* Padding for mobile buttons */
    overflow: hidden; /* Prevent overflow */
    gap: 10px;
    flex-wrap: nowrap; /* Keep buttons on a single line */
    background-color: #f5f5f5; /* Light background for mobile buttons bar */
    box-shadow: inset 0 -1px 0 rgba(0,0,0,0.05); /* Separator from main nav */
  }
  .mobile-nav-buttons .btn {
    flex: 1; /* Distribute space equally */
    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 */
    font-size: 13px; /* Smaller font size */
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-align: center;
  }

  /* Main Navigation (Hidden by default on Mobile) */
  .main-nav {
    display: none; /* Hidden by default */
    position: fixed; /* Fixed position for slide-in menu */
    top: var(--header-offset); /* Below fixed header */
    left: 0;
    width: 80%; /* Menu width */
    max-width: 300px; /* Max width for menu */
    height: calc(100% - var(--header-offset)); /* Full height below header */
    background-color: #333333; /* Dark background for mobile menu */
    flex-direction: column; /* Vertical links */
    justify-content: flex-start;
    align-items: flex-start;
    padding: 20px 0;
    box-sizing: border-box;
    transform: translateX(-100%); /* Off-screen by default */
    transition: transform 0.3s ease;
    z-index: 1000; /* Below overlay, same as header, but slides over */
  }
  .main-nav.active {
    display: flex; /* Show when active */
    transform: translateX(0); /* Slide into view */
  }

  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 0 15px;
    max-width: none; /* No max-width for mobile nav container */
    width: 100%;
  }

  .main-nav .nav-link {
    color: var(--auxiliary-color); /* White text on dark menu background */
    width: 100%;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  .main-nav .nav-link:last-child {
    border-bottom: none;
  }
  .main-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--primary-color);
  }

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

  /* Footer Mobile */
  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column for mobile */
    text-align: center;
  }
  .footer-mid-grid {
    grid-template-columns: 1fr; /* Single column for mobile */
  }
  .footer-col {
    text-align: center; /* Center content in columns */
  }
  .footer-col .footer-logo {
    text-align: center;
  }
  .footer-nav {
    text-align: center;
  }
}

/* No scroll for body when menu is open */
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;
}
