:root {
  --primary-color: #F2C14E;
  --secondary-color: #FFD36B;
  --button-gradient: linear-gradient(180deg, #FFD86A 0%, #DDA11D 100%);
  --card-bg: #111111;
  --site-bg: #0A0A0A;
  --text-main: #FFF6D6;
  --border-color: #3A2A12;
  --glow-color: #FFD36B;

  /* Header offset calculation: desktop (68px header-top + 52px main-nav) = 120px */
  --header-offset: 122px; /* Adding a small buffer */
}

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

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); /* Suspended effect */
  background-color: var(--card-bg); /* Default background, will be overridden by header-top/main-nav */
}

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

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

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--secondary-color);
  text-decoration: none;
  display: block; /* Ensure logo is visible on desktop */
  text-shadow: 0 0 5px var(--glow-color);
  white-space: nowrap;
}

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

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

.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden on desktop by default */
  min-height: 48px; /* Mobile fixed height */
  background-color: var(--card-bg); /* Consistent with header-top */
  padding: 0 15px; /* Mobile padding */
}

.main-nav {
  box-sizing: border-box;
  min-height: 52px; /* Desktop fixed height */
  height: 52px;
  display: flex; /* Visible on desktop */
  align-items: center;
  overflow: hidden;
  width: 100%;
  background-color: var(--primary-color); /* Distinct from header-top */
}

.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;
}

.nav-link {
  color: #0A0A0A; /* Dark text for primary background */
  text-decoration: none;
  padding: 10px 15px;
  font-weight: bold;
  transition: color 0.3s ease, background-color 0.3s ease;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  background-color: rgba(0, 0, 0, 0.1);
  color: #FFF;
  border-radius: 4px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  color: #333; /* Default text color for bright buttons */
  background: var(--button-gradient);
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 15px var(--glow-color);
}

/* Hamburger Menu (hidden on desktop) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  width: 30px;
  height: 24px;
  position: relative;
  cursor: pointer;
  z-index: 1001; /* Above header */
  padding: 5px; /* Increase clickable area */
  box-sizing: content-box;
}

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

.hamburger-menu span:nth-child(1) { top: 0; }
.hamburger-menu span:nth-child(2) { top: 10px; }
.hamburger-menu span:nth-child(3) { top: 20px; }

.hamburger-menu.active span:nth-child(1) {
  transform: translateY(10px) rotate(45deg);
}
.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
}
.hamburger-menu.active span:nth-child(3) {
  transform: translateY(-10px) 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 */
.site-footer {
  background-color: var(--card-bg);
  color: var(--text-main);
  padding: 40px 20px 20px;
  font-size: 14px;
  line-height: 1.6;
}

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

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

.footer-logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--secondary-color);
  text-decoration: none;
  margin-bottom: 15px;
  display: block;
  text-shadow: 0 0 5px var(--glow-color);
}

.footer-description {
  margin-bottom: 15px;
  color: #BBB;
  word-wrap: break-word; /* Ensure description wraps */
  overflow-wrap: break-word;
}

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

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

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

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

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

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

.footer-bottom p {
  margin: 0;
}

/* Dynamic slot anchors - must be empty containers */
.footer-slot-anchor-inner {
  min-height: 10px; /* Ensure they take up some space for visibility in dev tools */
  margin-top: 10px;
}

/* Media Queries for Mobile */
@media (max-width: 768px) {
  :root {
    /* Mobile header-top (60) + main-nav (48) = 108px + buffer */
    --header-offset: 110px;
  }

  body {
    padding-top: var(--header-offset);
    overflow-x: hidden; /* Ensure no horizontal scroll on mobile */
  }

  /* Header mobile styles */
  .header-top {
    min-height: 60px !important; /* Mobile fixed height */
    height: 60px !important;
    padding: 0 15px; /* Mobile padding */
  }

  .header-container {
    width: 100%;
    max-width: none; /* No max-width on mobile */
    padding: 0; /* Handled by header-top */
    justify-content: space-between;
    position: relative; /* For absolute logo centering */
  }

  .hamburger-menu {
    display: block; /* Visible on mobile */
    position: relative; /* Ensure it's above other elements */
    z-index: 1001;
    margin-right: auto; /* Push logo to center, buttons to right */
  }

  /* LOGO Centering Method 2 (more robust for text logo with side elements) */
  .logo {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    max-width: calc(100% - 100px); /* Leave space for hamburger and buttons */
  }

  .logo img {
    max-height: 56px !important; /* Mobile max height */
  }
  
  .desktop-nav-buttons {
    display: none !important; /* Hidden on mobile */
  }

  .mobile-nav-buttons {
    display: flex !important; /* Visible on mobile */
    min-height: 48px;
    align-items: center;
    justify-content: center; /* Center buttons if only one, or use space-between for two */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px; /* Mobile padding for buttons */
    overflow: hidden; /* Prevent button overflow */
    gap: 10px; /* Gap between buttons */
    flex-wrap: nowrap; /* Ensure buttons stay on one line */
  }

  .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;
    font-size: 13px;
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .main-nav {
    min-height: 48px !important; /* Mobile fixed height */
    height: calc(100% - var(--header-offset)); /* Fill remaining height */
    position: fixed; /* Fixed position for mobile menu */
    top: var(--header-offset); /* Position below fixed header */
    left: 0;
    width: 280px; /* Sidebar width */
    background-color: var(--card-bg); /* Menu background */
    transform: translateX(-100%); /* Hidden by default */
    transition: transform 0.3s ease-in-out;
    flex-direction: column; /* Vertical layout */
    align-items: flex-start;
    padding: 20px 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    overflow-y: auto; /* Enable scrolling for long menus */
    display: none; /* Crucial: hidden by default */
  }

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

  .nav-container {
    width: 100%;
    max-width: none; /* No max-width on mobile */
    flex-direction: column; /* Vertical links */
    align-items: flex-start;
    padding: 0 15px;
  }

  .nav-link {
    width: 100%;
    padding: 12px 15px;
    color: var(--text-main); /* Text color for dark menu background */
    border-bottom: 1px solid var(--border-color);
  }

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

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

  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 30px;
    margin-bottom: 20px;
  }

  .footer-col {
    align-items: flex-start;
  }

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

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

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