:root {
  --primary-color: #26A9E0;
  --accent-color: #FFFFFF;
  --login-button-color: #EA7C07;
  --text-color-dark: #333333;
  --text-color-light: #FFFFFF;
  --header-top-bg: #1a7bb0; /* Darker blue */
  --main-nav-bg: #3aaae7; /* Lighter blue */
  --mobile-buttons-bg: #f0f0f0; /* Light gray for distinction */
  --footer-bg: #222222; /* Dark background for footer */
  --header-offset: 122px; /* Desktop: 68px (header-top) + 52px (main-nav) */
}

html {
  scroll-behavior: smooth;
}

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

/* Base link styles for better contrast */
a {
  color: var(--primary-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  white-space: nowrap;
  box-sizing: border-box;
}

.btn-login {
  background-color: var(--login-button-color);
  color: var(--accent-color);
  border: none;
}

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

.btn-register {
  background-color: var(--primary-color);
  color: var(--accent-color);
  border: none;
}

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

/* 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);
  background-color: var(--header-top-bg); /* Default background, will be overridden by header-top */
}

.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%;
  color: var(--text-color-light);
}

.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-left: 20px;
  padding-right: 20px;
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--accent-color);
  text-decoration: none;
  white-space: nowrap;
  display: block; /* Ensure it's block for proper alignment */
}

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

.desktop-nav-buttons {
  display: flex;
  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(--mobile-buttons-bg); /* Distinct background for mobile buttons */
  width: 100%;
  padding: 0 20px; /* Add padding for alignment */
}

.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex; /* Displayed by default on desktop */
  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(--accent-color);
  font-size: 15px;
  font-weight: bold;
  padding: 5px 0;
  position: relative;
  text-decoration: none;
  white-space: nowrap;
}

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

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

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

/* Hamburger Menu (Desktop - Hidden) */
.hamburger-menu {
  display: none;
  width: 30px;
  height: 24px;
  position: relative;
  cursor: pointer;
  z-index: 1001; /* Above header */
}

.hamburger-menu span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--accent-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: 50%; transform: translateY(-50%); }
.hamburger-menu span:nth-child(3) { bottom: 0; }

/* Overlay (Hidden by default) */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.overlay.active {
  visibility: visible;
  opacity: 1;
}

/* Site Footer */
.site-footer {
  background-color: var(--footer-bg);
  color: rgba(255, 255, 255, 0.7);
  padding: 40px 20px 20px;
  font-size: 14px;
  line-height: 1.8;
  width: 100%;
  box-sizing: border-box;
}

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

.site-footer a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
}

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

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

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

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

.footer-description {
  margin-top: 10px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

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

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

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  margin-top: 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
}

.footer-bottom p {
  margin: 0;
}

/* Footer slot anchors - ensure they are visible for content injection */
.footer-slot-anchor, .footer-slot-anchor-inner {
  min-height: 1px;
  min-width: 1px;
}
.footer-slot-anchor-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 20px auto;
}
.footer-slot-anchor-grid .footer-slot-anchor-inner {
    min-height: 1px;
    min-width: 1px;
}


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

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

  /* Header adjustments */
  .site-header {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  }

  .header-top {
    min-height: 60px !important;
    height: 60px !important;
  }

  .header-container {
    width: 100%;
    max-width: none; /* No max-width on mobile */
    padding-left: 15px;
    padding-right: 15px;
    position: relative; /* For logo centering */
  }

  .hamburger-menu {
    display: block;
    position: relative;
    z-index: 1001;
  }

  .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 Logo Centering */
  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: calc(100% - 80px); /* Leave space for hamburger and potential right element */
    max-width: none;
  }

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

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

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    min-height: 48px;
    align-items: center;
    justify-content: center; /* Center buttons if less than 2 */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding-left: 15px;
    padding-right: 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
    background-color: var(--mobile-buttons-bg);
  }

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

  .main-nav {
    display: none; /* Hidden by default, toggled by JS */
    position: fixed;
    top: var(--header-offset); /* Position below fixed header */
    left: 0;
    width: 80%; /* Sidebar width */
    max-width: 300px; /* Max width for sidebar */
    height: calc(100% - var(--header-offset)); /* Fill remaining height */
    background-color: var(--main-nav-bg);
    flex-direction: column;
    padding: 20px 0;
    transform: translateX(-100%); /* Slide out of view */
    transition: transform 0.3s ease;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    align-items: flex-start; /* Align menu items to the left */
    overflow-y: auto; /* Enable scrolling for long menus */
  }

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

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

  .nav-link {
    width: 100%;
    padding: 10px 0;
    font-size: 16px;
    color: var(--accent-color);
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  .nav-link:last-child {
      border-bottom: none;
  }
  .nav-link::after {
      background-color: var(--accent-color);
  }

  /* Footer adjustments */
  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 30px;
  }
  .footer-slot-anchor-grid {
      grid-template-columns: 1fr;
  }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
