:root {
  --primary-color: #F2C14E;
  --accent-color: #FFD36B;
  --card-bg-color: #111111;
  --background-color: #0A0A0A;
  --text-main-color: #FFF6D6;
  --border-color: #3A2A12;
  --glow-color: #FFD36B;
  --header-offset: 122px; /* Desktop: 68px (header-top) + 52px (main-nav) + 2px buffer */
}

body {
  margin: 0;
  padding-top: var(--header-offset);
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-main-color);
  background-color: var(--background-color);
  overflow-x: hidden; /* Prevent horizontal scroll from initial content */
}

/* Header styles */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  background-color: var(--card-bg-color); /* Fallback, actual colors defined per section */
  box-sizing: border-box;
}

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

.logo {
  display: block;
  color: var(--primary-color);
  font-size: 28px;
  font-weight: bold;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px; /* Prevent long logo text from pushing elements */
}

.desktop-nav-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
}

.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden on desktop */
  min-height: 48px; 
  background-color: var(--card-bg-color); /* Same as header-top for consistency */
  padding: 0 20px; /* Consistent padding */
  width: 100%;
}

.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--border-color); /* Main nav background, different from header-top */
  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: 20px; /* Spacing between nav links */
}

.nav-link {
  color: var(--text-main-color);
  text-decoration: none;
  font-size: 16px;
  padding: 5px 0;
  transition: color 0.3s ease;
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent-color);
}

/* Button styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 25px;
  text-decoration: none;
  color: #FFFFFF; /* White text for contrast on gradient button */
  font-weight: bold;
  font-size: 15px;
  background: linear-gradient(180deg, #FFD86A 0%, #DDA11D 100%);
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Hamburger menu styles (hidden on desktop) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 24px;
  position: relative;
  z-index: 1001; /* Above other header elements */
  margin-right: 15px; /* Space between hamburger and logo */
}

.hamburger-icon {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--text-main-color);
  border-radius: 2px;
  position: absolute;
  left: 0;
  transition: all 0.3s ease;
}

.hamburger-icon:nth-child(1) { top: 0; }
.hamburger-icon:nth-child(2) { top: 50%; transform: translateY(-50%); }
.hamburger-icon:nth-child(3) { bottom: 0; }

.hamburger-menu.active .hamburger-icon:nth-child(1) {
  transform: translateY(10.5px) rotate(45deg);
}
.hamburger-menu.active .hamburger-icon:nth-child(2) {
  opacity: 0;
}
.hamburger-menu.active .hamburger-icon:nth-child(3) {
  transform: translateY(-10.5px) rotate(-45deg);
}

/* Overlay for 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.7);
  z-index: 999; /* Below menu, above content */
  transition: opacity 0.3s ease;
  opacity: 0;
}

.overlay.active {
  display: block;
  opacity: 1;
}

/* Footer styles */
.site-footer {
  background-color: var(--background-color);
  padding: 40px 20px 20px;
  color: var(--text-main-color);
  font-size: 14px;
  box-sizing: border-box;
  width: 100%;
}

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

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

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

.footer-description {
  margin-bottom: 15px;
  color: var(--text-main-color);
  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: var(--text-main-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  max-width: 1200px;
  margin: 0 auto;
  color: var(--text-main-color);
}

.footer-slot-anchor {
  display: none; /* Hidden, only for system injection */
}
.footer-slot-anchor-inner {
  min-height: 1px; /* Ensure it takes up minimal space if empty */
}

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

  /* Header adjustments for mobile */
  .header-top {
    min-height: 60px !important;
    height: 60px !important;
    padding-left: 15px; /* Adjust padding for mobile */
    padding-right: 15px; /* Adjust padding for mobile */
  }
  
  .header-container {
    width: 100%;
    max-width: none; /* No max-width on mobile */
    padding-left: 0; /* Handled by header-top padding */
    padding-right: 0; /* Handled by header-top padding */
    justify-content: space-between; /* To push hamburger and logo apart */
    position: relative; /* For logo absolute centering */
  }

  .hamburger-menu {
    display: block; /* Show hamburger on mobile */
    margin-left: 0; /* No left margin */
    order: 0; /* Place it first */
  }

  .logo {
    flex: 1 !important; /* Allow logo to take remaining space */
    display: flex !important;
    justify-content: center !important; /* Center logo */
    align-items: center !important;
    font-size: 24px; /* Smaller font size for mobile logo */
    order: 1; /* Place it after hamburger, before desktop buttons */
  }
  
  .desktop-nav-buttons {
    display: none !important; /* Hide desktop buttons on mobile */
  }

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons on mobile */
    min-height: 48px;
    align-items: center;
    justify-content: center; /* Center buttons if only one, or use space-around/between */
    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(--card-bg-color); /* Same as header-top */
  }

  .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 for mobile menu */
    position: fixed;
    top: var(--header-offset); /* Position below fixed header */
    left: 0;
    width: 80%; /* Sidebar width */
    height: calc(100vh - var(--header-offset)); /* Full height below header */
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    transform: translateX(-100%); /* Slide out of view */
    transition: transform 0.3s ease;
    background-color: var(--background-color); /* Menu background */
    z-index: 1001; /* Above overlay and header */
    overflow-y: auto; /* Enable scrolling for long menus */
    box-sizing: border-box;
  }

  .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; /* Padding handled by main-nav */
    gap: 15px; /* Spacing between nav links in column */
  }

  .nav-link {
    width: 100%;
    padding: 10px 0;
    font-size: 18px; /* Larger font for mobile menu items */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Separator */
  }
  .nav-link:last-child {
    border-bottom: none;
  }

  /* Overlay active state for mobile */
  .overlay.active {
    display: block;
    opacity: 1;
  }

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

  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column layout for mobile */
    gap: 30px;
  }
  
  /* Mobile content overflow fix */
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: hidden;
  }
}

/* Ensure no-scroll class works */
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;
  }
}
