:root {
  --header-offset: 122px; /* Desktop: 68px (header-top) + 52px (main-nav) = 120px, +2px buffer */
  --primary-color: #F2C14E;
  --secondary-color: #FFD36B;
  --button-gradient: linear-gradient(180deg, #FFD86A 0%, #DDA11D 100%);
  --card-bg: #111111;
  --body-bg: #0A0A0A;
  --text-main: #FFF6D6;
  --border-color: #3A2A12;
  --glow-color: #FFD36B;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--body-bg);
  padding-top: var(--header-offset);
  overflow-x: hidden; /* Global overflow-x for body to prevent initial scroll */
}

a {
  color: var(--primary-color);
  text-decoration: none;
}

a:hover {
  color: var(--secondary-color);
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  background-color: var(--body-bg); /* Fallback/base for header */
}

.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--body-bg); /* Darkest background for top bar */
  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 20px; /* Adjusted padding */
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--primary-color);
  white-space: nowrap;
  text-decoration: none;
}

.logo:hover {
  color: var(--secondary-color);
}

.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(--card-bg); /* Card BG for mobile buttons */
  width: 100%;
  align-items: center;
  justify-content: center;
  padding: 0 15px; /* Add padding for mobile buttons */
  gap: 10px;
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 25px;
  background: var(--button-gradient);
  color: #FFFFFF;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}

.btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
  color: #FFFFFF; /* Ensure text color remains white on hover */
}

.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: #1A1A1A; /* Slightly lighter dark grey 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: wrap; /* Allow wrapping if many nav items */
}

.nav-link {
  color: var(--text-main);
  padding: 8px 15px;
  font-weight: bold;
  white-space: nowrap;
  transition: color 0.3s ease, background-color 0.3s ease;
  border-radius: 5px;
}

.nav-link:hover {
  color: var(--primary-color);
  background-color: rgba(255, 255, 255, 0.05);
}

.hamburger-menu {
  display: none; /* Hidden by default on desktop */
  width: 30px;
  height: 24px;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  z-index: 1001; /* Above header-top */
}

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

.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 998; /* Below mobile menu, above content */
}

/* Footer Styles */
.site-footer {
  background-color: var(--card-bg);
  padding: 40px 0 20px;
  color: var(--text-main);
  border-top: 1px solid var(--border-color);
}

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

.footer-col {
  margin-bottom: 20px;
}

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

.footer-logo:hover {
  color: var(--secondary-color);
}

.footer-description {
  font-size: 14px;
  line-height: 1.8;
  color: #CCC;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.footer-heading {
  font-size: 16px;
  color: var(--primary-color);
  margin-bottom: 15px;
}

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

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

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

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

.footer-bottom {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  font-size: 13px;
  color: #AAA;
}

/* Dynamic Slot Anchors - ensure they are not hidden */
.footer-slot-anchor-inner {
  min-height: 1px; /* Ensure visibility for system injection */
  width: 100%;
}

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

  body {
    overflow-x: hidden;
  }

  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }

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

  .header-container {
    padding: 0 15px;
    max-width: none;
    width: 100%;
    justify-content: space-between; /* Keep space-between for hamburger and logo */
    position: relative; /* For absolute logo centering */
  }

  .hamburger-menu {
    display: flex; /* Show hamburger on mobile */
    margin-right: auto; /* Push hamburger to left */
  }

  .hamburger-menu.active .bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
  }

  .hamburger-menu.active .bar:nth-child(2) {
    opacity: 0;
  }

  .hamburger-menu.active .bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
  }

  .logo {
    flex: 1; /* Allow logo to take available space */
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute; /* Absolute positioning to truly center */
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 100px); /* Account for hamburger and potential right-side elements */
    font-size: 20px;
  }

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

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    min-height: 48px;
    background-color: var(--card-bg);
    padding: 8px 15px; /* Vertical padding for buttons */
    justify-content: center;
    flex-wrap: nowrap;
    gap: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); /* Subtle shadow below buttons */
  }

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

  .main-nav {
    display: none; /* Hidden by default on mobile */
    flex-direction: column; /* Vertical navigation */
    position: fixed;
    top: var(--header-offset); /* Position below fixed header and mobile buttons */
    left: 0;
    width: 250px; /* Width of the mobile menu */
    height: calc(100% - var(--header-offset));
    background-color: var(--card-bg); /* Use card background for mobile menu */
    transform: translateX(-100%); /* Off-screen initially */
    transition: transform 0.3s ease;
    padding: 20px 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.4);
    z-index: 999; /* Below overlay */
    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 {
    flex-direction: column; /* Stack nav links vertically */
    align-items: flex-start; /* Align links to the left */
    padding: 0 20px;
    max-width: none;
    width: 100%;
  }

  .nav-link {
    width: 100%;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0;
  }

  .nav-link:last-child {
    border-bottom: none;
  }

  .overlay.active {
    display: block;
  }

  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
    padding: 0 15px;
  }

  .footer-col {
    margin-bottom: 30px;
  }

  .footer-bottom {
    margin-top: 20px;
    padding: 0 15px 20px;
  }
}

/* Ensure no-scroll works */
body.no-scroll {
  overflow: hidden;
}

/* Logo img sizing for cases where logo is an image */
.logo img {
  display: block;
  max-height: 60px; /* Desktop max height */
  height: auto;
  width: auto;
  max-width: 280px; /* Prevent oversized logos */
  object-fit: contain;
}

@media (max-width: 768px) {
  .logo img {
    max-height: 56px; /* Mobile max height */
  }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
