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

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding-top: var(--header-offset);
  background-color: var(--background-color);
  color: var(--text-main-color);
  overflow-x: hidden; /* For mobile content overflow */
}

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

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

/* Header Styles */
.site-header {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: var(--card-bg); /* Using card-bg as a dark background for header */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  min-height: 60px; /* Base min-height, actual height will adapt */
  display: flex;
  align-items: center;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 15px 30px; /* Desktop padding */
  display: flex;
  align-items: center;
  width: 100%;
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 1px;
  flex-shrink: 0;
  display: block; /* Ensure logo is visible */
}

.hamburger-menu {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-main-color);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  z-index: 1001; /* Above mobile menu */
  flex-shrink: 0;
}

.main-nav {
  flex: 1;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 30px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.main-nav .nav-link {
  font-size: 16px;
  font-weight: bold;
  padding: 5px 0;
  position: relative;
  transition: color 0.3s ease;
  white-space: nowrap; /* Prevent menu items from wrapping */
}

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

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

/* Buttons */
.btn {
  background: var(--btn-gradient);
  color: #000; /* Text color for buttons to contrast with gradient */
  padding: 10px 20px;
  border-radius: 25px;
  font-weight: bold;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(242, 193, 78, 0.4); /* Glow effect for buttons */
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(242, 193, 78, 0.6);
  color: #000; /* Ensure text color remains black on hover */
}

.desktop-nav-buttons {
  display: flex; /* Visible on desktop */
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

.mobile-nav-buttons {
  display: none !important; /* Hidden on desktop, important to override other rules */
}

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

.footer-top-row, .footer-mid-row, .footer-mid-row-grid, .footer-bottom-slot {
  margin-bottom: 20px; /* Spacing for dynamic slots */
}

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

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

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

.footer-description {
  line-height: 1.6;
  margin-bottom: 15px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-nav .footer-link {
  color: var(--text-main-color);
  transition: color 0.3s ease;
}

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

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

/* Ensure anchor containers are visible for injected content */
.footer-slot-anchor-inner {
  min-height: 10px; /* Small height to ensure visibility if empty */
  width: 100%;
}

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

  .header-container {
    width: 100%;
    max-width: none; /* Crucial: remove max-width for mobile container */
    padding: 10px 15px; /* Mobile padding */
    justify-content: space-between; /* Space out hamburger, logo, buttons */
    position: relative; /* For absolute positioning of logo if needed */
  }

  .hamburger-menu {
    display: block; /* Visible on mobile */
    order: 1; /* Position left */
  }

  .logo {
    order: 2; /* Position center */
    flex: 1 !important; /* Take remaining space */
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-size: 24px;
  }
  .logo img {
    display: block !important;
    max-width: 100%;
    height: auto;
    max-height: 40px; /* Adjust as needed */
  }

  .mobile-nav-buttons {
    display: flex !important; /* Visible on mobile */
    order: 3; /* Position right */
    gap: 8px;
    flex-shrink: 0;
  }

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

  .main-nav {
    display: none; /* Hidden by default on mobile, revealed by JS */
    position: fixed;
    top: var(--header-offset);
    left: 0;
    width: 80%; /* Drawer width */
    max-width: 300px;
    height: calc(100% - var(--header-offset)); /* Fill remaining viewport height */
    background-color: var(--card-bg);
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    transform: translateX(-100%); /* Start off-screen */
    transition: transform 0.3s ease;
    z-index: 999;
    overflow-y: auto; /* Enable scrolling for long menus */
    gap: 15px; /* Gap between menu items */
  }

  .main-nav.active {
    display: flex; /* Crucial: change display to flex when active */
    transform: translateX(0); /* Slide in */
  }

  .main-nav .nav-link {
    font-size: 18px;
    width: 100%;
    padding: 10px 0;
  }

  .main-nav .nav-link::after {
    bottom: 0; /* Adjust underline position for mobile */
  }

  .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.5);
    z-index: 998;
    transition: opacity 0.3s ease;
    opacity: 0;
  }

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

  /* Footer mobile styles */
  .footer-columns {
    grid-template-columns: 1fr; /* Single column layout */
    padding-bottom: 20px;
  }
  
  .footer-col {
    text-align: center; /* Center content in single column */
  }

  .footer-col h3 {
    margin-top: 20px;
  }

  .footer-logo {
    margin-left: auto;
    margin-right: auto;
  }
  
  /* Mobile content overflow prevention */
  .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 for body when 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;
  }
}
