:root { --header-offset: 122px; }
body {
  padding-top: var(--header-offset);
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333333;
  overflow-x: hidden;
}

/* Header */
.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.1);
  background-color: #FFFFFF; /* Base background for header */
}

.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: #1a8cc7; /* Darker shade of primary for header-top */
  width: 100%;
  color: #FFFFFF;
}

.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 20px; /* Padding for logo and buttons from container edges */
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: #FFFFFF;
  text-decoration: none;
  display: block;
  flex-shrink: 0; /* Prevent shrinking */
}

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

.desktop-nav-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0; /* Prevent shrinking */
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
  border: none;
  box-sizing: border-box;
}

.btn-login {
  background-color: #EA7C07; /* Login color */
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(234, 124, 7, 0.4);
}
.btn-login:hover {
  background-color: #d16e06;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(234, 124, 7, 0.6);
}

.btn-register {
  background-color: #26A9E0; /* Primary color */
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(38, 169, 224, 0.4);
}
.btn-register:hover {
  background-color: #1f8bc2;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(38, 169, 224, 0.6);
}

/* Mobile Nav Buttons - Hidden by default on desktop */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default on desktop */
  min-height: 48px;
  background-color: #f5f5f5; /* Light background for mobile buttons */
  padding: 8px 15px;
  justify-content: center;
  gap: 10px;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex; /* Desktop: visible, row layout */
  align-items: center;
  overflow: hidden;
  background-color: #26A9E0; /* Primary color for main nav */
  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;
  flex-wrap: nowrap; /* Prevent wrapping on desktop */
}

.nav-link {
  color: #FFFFFF;
  text-decoration: none;
  padding: 0 15px;
  font-weight: bold;
  height: 100%;
  display: flex;
  align-items: center;
  transition: background-color 0.3s ease;
  white-space: nowrap; /* Prevent wrapping for nav links */
}

.nav-link:hover, .nav-link.active {
  background-color: rgba(255,255,255,0.1);
}

/* Hamburger Menu (Mobile Only) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  width: 30px;
  height: 24px;
  position: relative;
  cursor: pointer;
  z-index: 1001; /* Above header */
  flex-shrink: 0;
  margin-right: 15px; /* Space from logo */
}
.hamburger-menu span {
  display: block;
  position: absolute;
  height: 3px;
  width: 100%;
  background: #FFFFFF;
  border-radius: 9px;
  opacity: 1;
  left: 0;
  transform: rotate(0deg);
  transition: .25s ease-in-out;
}
.hamburger-menu span:nth-child(1) { top: 0px; }
.hamburger-menu span:nth-child(2) { top: 10px; }
.hamburger-menu span:nth-child(3) { top: 20px; }
.hamburger-menu.active span:nth-child(1) { top: 10px; transform: rotate(135deg); }
.hamburger-menu.active span:nth-child(2) { opacity: 0; left: -60px; }
.hamburger-menu.active span:nth-child(3) { top: 10px; transform: rotate(-135deg); }

/* Overlay (Mobile Only) */
.overlay {
  display: none; /* Hidden on desktop */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.overlay.active {
  display: block;
  opacity: 1;
}

/* Footer */
.site-footer {
  background-color: #333333; /* Dark background for footer */
  color: #FFFFFF;
  padding: 40px 20px 20px;
  font-size: 14px;
}

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

.footer-col {
  box-sizing: border-box;
}

.footer-logo {
  font-size: 24px;
  font-weight: bold;
  color: #FFFFFF;
  text-decoration: none;
  margin-bottom: 15px;
  display: block;
}

.footer-description {
  margin-top: 0;
  line-height: 1.8;
  color: #CCCCCC;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.site-footer h3 {
  color: #FFFFFF;
  font-size: 18px;
  margin-bottom: 15px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 10px;
}

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

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

.footer-nav a {
  color: #CCCCCC;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-nav a:hover {
  color: #26A9E0;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  color: #AAAAAA;
}

.footer-bottom p {
  margin: 0;
}

/* Footer Dynamic Slots */
.footer-slot-anchor, .footer-slot-anchor-inner {
  min-height: 1px;
}
.footer-mid-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 1200px;
  margin: 20px auto;
}

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

  /* Header */
  .header-top {
    min-height: 60px;
    height: 60px;
    padding: 0 15px; /* Adjust padding for mobile */
    justify-content: space-between; /* Hamburger left, Logo center, space right */
  }

  .header-container {
    width: 100%;
    max-width: none;
    padding: 0;
    justify-content: space-between;
  }

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

  .logo img {
    max-height: 56px !important; /* Adjust for mobile header height */
  }

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

  .hamburger-menu {
    display: block; /* Show on mobile */
    order: -1; /* Place it first */
    margin-right: 0; /* No right margin, handled by container space-between */
  }
  .hamburger-menu.active {
    position: fixed; /* Keep hamburger in place when menu is open */
    left: 15px;
    top: 15px; /* Adjust if needed, relative to viewport */
  }

  /* Mobile Nav Buttons */
  .mobile-nav-buttons {
    display: flex !important; /* Show on mobile */
    min-height: 48px;
    height: auto; /* Allow height to adjust if buttons wrap (though nowrap is set) */
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5; /* Light background for mobile buttons */
    padding: 8px 15px;
    gap: 10px;
    flex-wrap: nowrap;
    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); /* 50% minus half of gap */
    padding: 8px 12px;
    font-size: 13px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    height: auto; /* Allow height to adjust with content */
    line-height: 1.2; /* Adjust line height for wrapped text */
  }

  .main-nav {
    display: none; /* Hidden by default on mobile */
    position: fixed;
    top: 0;
    left: 0;
    width: 280px; /* Sidebar width */
    height: 100vh; /* Full viewport height */
    background-color: #2c3e50; /* Dark background for mobile menu */
    flex-direction: column;
    padding-top: var(--header-offset); /* Push content below fixed header */
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
    transform: translateX(-100%); /* Start off-screen */
    transition: transform 0.3s ease-in-out;
    z-index: 1000;
    overflow-y: auto; /* Allow scrolling for long menus */
    box-sizing: border-box;
  }

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

  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 0;
    max-width: none;
    width: 100%;
  }

  .nav-link {
    width: 100%;
    padding: 12px 20px;
    color: #FFFFFF;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    justify-content: flex-start;
  }
  .nav-link:last-child {
    border-bottom: none;
  }

  /* Footer */
  .site-footer {
    padding: 30px 15px 15px;
  }

  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column layout for mobile */
    gap: 20px;
  }
  .footer-col:not(.footer-about) {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
  }
  .footer-col:first-child {
    border-top: none;
    padding-top: 0;
  }

  .footer-mid-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

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

/* No-scroll class for body when mobile 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;
  }
}
