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

html {
  scroll-behavior: smooth;
}

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

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

/* Shared Container Styles */
.header-container,
.nav-container,
.footer-top-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
  height: 100%;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  background: var(--button-gradient);
  color: var(--color-background); /* Dark text for light button */
  border: none;
  transition: all 0.3s ease;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(255, 211, 107, 0.4);
}

.btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 211, 107, 0.6);
}

/* Header Styles */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  background-color: var(--color-background); /* Overall header background */
}

.header-top {
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  background-color: var(--color-card-bg); /* Distinct background for header-top */
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.header-top .header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block; /* Ensure it's a block element for layout */
}

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

/* Mobile Nav Buttons - Hidden by default on desktop */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden on desktop */
  min-height: 48px; /* Fixed height for mobile, even if hidden on desktop */
  background-color: var(--color-card-bg); /* Consistent with overall header */
  width: 100%;
  align-items: center;
  justify-content: center;
  padding: 0 15px; /* Add padding for consistency */
}

.main-nav {
  min-height: 52px;
  height: 52px;
  display: flex; /* Desktop: visible and flex */
  align-items: center;
  background-color: var(--color-background); /* Distinct background for main-nav */
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.main-nav .nav-container {
  display: flex;
  justify-content: center; /* Center nav links on desktop */
  align-items: center;
  gap: 25px;
}

.nav-link {
  color: var(--color-text-main);
  font-size: 16px;
  font-weight: 500;
  padding: 5px 0;
  position: relative;
  transition: color 0.3s ease;
}

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

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

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

/* Hamburger Menu - Hidden by default on desktop */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 25px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001; /* Above header */
}

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

/* Mobile Menu Overlay */
.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 header */
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
  display: block;
  opacity: 1;
}

/* Footer Styles */
.site-footer {
  background-color: var(--color-background);
  color: var(--color-text-main);
  padding: 40px 0 20px;
  font-size: 14px;
}

.footer-top-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--color-border);
}

.footer-col {
  display: flex;
  flex-direction: column;
}

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

.footer-description {
  line-height: 1.6;
  color: #a0a0a0;
  word-wrap: break-word; /* Ensure long text wraps */
  overflow-wrap: break-word;
}

.footer-heading {
  font-size: 18px;
  color: var(--color-primary);
  margin-bottom: 15px;
  text-transform: uppercase;
}

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

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

.footer-nav a {
  color: #a0a0a0;
  transition: color 0.3s ease;
}

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

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  color: #a0a0a0;
}

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

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

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

  .header-top .header-container {
    padding-left: 15px;
    padding-right: 15px;
    width: 100%;
    max-width: none; /* Remove max-width for mobile container */
    position: relative; /* Needed for absolute positioning of hamburger and logo */
    justify-content: space-between; /* To push hamburger and desktop-nav-buttons to ends */
  }

  .hamburger-menu {
    display: flex; /* Show hamburger on mobile */
    position: absolute; /* Position absolutely */
    left: 15px; /* Aligned with container padding */
    top: 50%;
    transform: translateY(-50%);
    width: 25px; /* Adjust size for better fit */
    height: 20px;
  }

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

  .logo {
    /* Existing absolute positioning for centering */
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    max-width: calc(100% - 80px); /* Ensure it doesn't overlap hamburger/buttons */
    font-size: 24px;
  }
  
  .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;
    gap: 10px;
    flex-wrap: nowrap; /* Ensure buttons stay in one line */
    padding: 8px 15px; /* Adjust padding for mobile */
    background-color: var(--color-card-bg); /* Use card-bg for mobile button strip */
  }

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

  .main-nav {
    min-height: auto; /* Allow height to adjust for content */
    height: calc(100vh - var(--header-offset)); /* Fill remaining viewport height */
    overflow-y: auto; /* Allow scrolling if menu is long */
    position: fixed;
    top: var(--header-offset); /* Position below fixed header and mobile buttons */
    left: 0;
    width: 100%;
    max-width: 300px; /* Sidebar width */
    transform: translateX(-100%); /* Hidden by default */
    transition: transform 0.3s ease;
    background-color: var(--color-card-bg); /* Menu background */
    flex-direction: column; /* Vertical menu */
    align-items: flex-start;
    padding: 20px 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    z-index: 1001; /* Above header */
    display: none; /* Initially hidden, JS will toggle display:flex/block */
  }

  .main-nav.active {
    transform: translateX(0); /* Show menu */
    display: flex; /* Make it visible */
  }

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

  .nav-link {
    width: 100%;
    padding: 12px 15px;
    border-bottom: 1px solid var(--color-border);
    font-size: 17px;
  }

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

  .nav-link::after {
    display: none; /* Hide underline effect on mobile menu */
  }

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

  .footer-col:not(:last-child) {
    margin-bottom: 20px; /* Add spacing between columns */
  }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
