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

html {
  box-sizing: border-box;
  font-size: 16px;
}

*, *::before, *::after {
  box-sizing: inherit;
}

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

/* --- Site Header --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  background-color: var(--bg-color); /* Base background for the whole header */
}

/* Header Top Section (Logo + Desktop Buttons) */
.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px; /* Fixed height for desktop */
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: #1A1A1A; /* Darker background for header-top, contrasting with main-nav */
  width: 100%;
  border-bottom: 1px solid var(--border-color);
}

.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 30px; /* Padding for desktop container */
}

/* Logo */
.logo {
  color: var(--primary-color);
  font-size: 28px;
  font-weight: bold;
  text-decoration: none;
  white-space: nowrap;
  display: flex; /* For potential image logo alignment */
  align-items: center;
  gap: 8px;
}
.logo img {
  display: block;
  max-height: 60px; /* Max height for desktop logo */
  height: auto;
  width: auto;
  max-width: 280px;
  object-fit: contain;
}

/* Desktop Navigation Buttons */
.desktop-nav-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Mobile Navigation 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 */
  background-color: #1A1A1A; /* Same as header-top for consistency */
  width: 100%;
  padding: 0 15px; /* Mobile padding */
  border-bottom: 1px solid var(--border-color);
}

/* Main Navigation (Menu) */
.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px; /* Fixed height for desktop */
  display: flex; /* Default display for desktop */
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: var(--card-bg); /* Lighter background for main-nav */
  width: 100%;
  border-bottom: 1px solid var(--border-color);
}

.nav-container {
  box-sizing: border-box;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: row; /* Desktop horizontal layout */
  justify-content: center;
  align-items: center;
  padding: 0 20px;
  gap: 25px; /* Spacing between nav links */
}

.nav-link {
  color: var(--text-main-color);
  text-decoration: none;
  padding: 8px 0;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.3s ease, transform 0.3s ease;
}

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

/* Hamburger Menu (hidden by default on desktop) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  position: relative;
  z-index: 1001;
  width: 40px;
  height: 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
}

.hamburger-menu span {
  display: block;
  width: 28px;
  height: 3px;
  background-color: var(--text-main-color);
  border-radius: 2px;
  transition: all 0.3s ease;
}

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

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

.hamburger-menu.active span:nth-child(3) {
  transform: translateY(-8px) 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: 998;
  transition: opacity 0.3s ease;
}

.overlay.active {
  display: block;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: bold;
  text-decoration: none;
  color: #333; /* Dark text for light gradient buttons */
  background: var(--button-gradient);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
  border: none;
  cursor: pointer;
}

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

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

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

.footer-col {
  padding: 10px 0;
}

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

.footer-description {
  color: #AAA;
  line-height: 1.8;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.footer-title {
  font-size: 18px;
  color: var(--secondary-color);
  margin-bottom: 20px;
  font-weight: bold;
}

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

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

.footer-nav a {
  color: #AAA;
  text-decoration: none;
  transition: color 0.3s ease;
}

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

.footer-slot-anchor {
  min-height: 1px; /* Ensure it occupies space for injection */
}
.footer-slot-anchor-inner {
  min-height: 1px; /* Ensure it occupies space for injection */
}

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

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

  /* Mobile Header Top */
  .header-top {
    min-height: 60px;
    height: 60px; /* Fixed height for mobile */
    padding: 0 15px; /* Mobile padding for header-top */
    justify-content: flex-start; /* Align items to start for hamburger */
  }

  .header-container {
    padding: 0; /* Remove padding from container, handled by header-top */
    max-width: none; /* Remove max-width for mobile container */
    width: 100%; /* Full width for mobile container */
    justify-content: space-between; /* Space between hamburger, logo, desktop buttons */
  }

  /* Hamburger menu visible on mobile */
  .hamburger-menu {
    display: flex;
    order: -1; /* Place hamburger menu to the far left */
  }

  /* Mobile Logo Centering (Method 1: Flexbox) */
  .logo {
    flex: 1 !important; /* Take available space */
    display: flex !important;
    justify-content: center !important; /* Center the logo horizontally */
    align-items: center !important;
    padding-left: 0; /* No extra padding for logo */
    padding-right: 0; /* No extra padding for logo */
    font-size: 24px;
  }
  .logo img {
    max-height: 56px !important; /* Max height for mobile logo */
  }

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

  /* Show mobile buttons on mobile */
  .mobile-nav-buttons {
    display: flex !important; /* Show on mobile */
    align-items: center;
    justify-content: center; /* Center buttons */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px;
    overflow: hidden; /* Prevent overflow */
    gap: 10px; /* Space between buttons */
    flex-wrap: nowrap; /* Prevent buttons from wrapping */
  }

  .mobile-nav-buttons .btn {
    flex: 1; /* Distribute space evenly */
    min-width: 0; /* Allow shrinking */
    max-width: calc(50% - 5px); /* Max width for two buttons with 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; /* Break long words */
    overflow-wrap: break-word;
  }

  /* Mobile Main Navigation (hidden by default, slides out) */
  .main-nav {
    display: none; /* Hidden by default */
    position: fixed;
    top: var(--header-offset); /* Position below header-top and mobile-nav-buttons */
    left: 0;
    width: 75%; /* Width of the sliding menu */
    max-width: 300px; /* Max width for the menu */
    height: calc(100% - var(--header-offset)); /* Full height below header */
    background-color: var(--card-bg);
    flex-direction: column; /* Vertical layout for menu items */
    align-items: flex-start;
    padding: 20px 0;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.4);
    transform: translateX(-100%); /* Start off-screen */
    transition: transform 0.3s ease;
    overflow-y: auto; /* Scroll if content is too long */
    border-right: 1px solid var(--border-color);
  }

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

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

  .nav-link {
    width: 100%; /* Full width for each link */
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 16px;
  }
  .nav-link:last-child {
    border-bottom: none;
  }

  /* Mobile Footer */
  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column layout for mobile */
    padding: 0 15px;
  }
  .footer-col {
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
  }
  .footer-col:last-child {
    border-bottom: none;
  }
  .footer-bottom {
    padding: 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;
  }
}

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