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

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

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

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--body-bg);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  min-height: 68px; /* Base height for header-top */
  display: flex;
  align-items: center;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 30px;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 52px; /* Base height for main-nav area */
}

.logo {
  color: var(--primary-color);
  font-size: 2.2em;
  font-weight: bold;
  text-decoration: none;
  flex-shrink: 0;
  padding: 5px 0;
  text-shadow: 0 0 8px var(--glow-color);
  display: block; /* Ensure visibility */
  line-height: 1;
}

.main-nav {
  flex: 1;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 25px;
  padding: 0 20px;
  position: static;
  top: auto;
  left: auto;
  width: auto;
  height: auto;
  background: none;
  overflow: visible;
  transition: none;
  z-index: auto;
}

.nav-link {
  color: var(--text-main);
  text-decoration: none;
  font-weight: bold;
  font-size: 1.05em;
  padding: 8px 12px;
  border-radius: 5px;
  transition: background-color 0.3s ease, color 0.3s ease;
  white-space: nowrap;
}

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

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

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

.btn {
  background: var(--button-gradient);
  color: var(--body-bg);
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1em;
  text-align: center;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  min-width: 80px; /* Ensure buttons have minimum width */
}

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

.hamburger-menu {
  display: none; /* Hidden by default on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1001;
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.hamburger-icon {
  display: block;
  width: 30px;
  height: 3px;
  background-color: var(--text-main);
  margin: 6px 0;
  transition: all 0.3s ease;
}

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

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

.hamburger-menu.active .hamburger-icon:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

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

.footer-slot-anchor {
  width: 100%;
  min-height: 1px; /* Ensure anchor is rendered */
  display: block;
}

.footer-slot-anchor-inner {
  width: 100%;
  min-height: 1px; /* Ensure anchor is rendered */
  display: block;
}

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

.footer-col h3 {
  color: var(--primary-color);
  font-size: 1.2em;
  margin-bottom: 15px;
  text-shadow: 0 0 5px rgba(242, 193, 78, 0.5);
}

.footer-logo {
  color: var(--primary-color);
  font-size: 2em;
  font-weight: bold;
  text-decoration: none;
  display: block;
  margin-bottom: 15px;
  text-shadow: 0 0 8px var(--glow-color);
  line-height: 1;
}

.footer-description {
  font-size: 0.9em;
  line-height: 1.8;
  margin-bottom: 20px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.footer-nav a {
  display: block;
  color: var(--text-main);
  text-decoration: none;
  margin-bottom: 8px;
  font-size: 0.95em;
  transition: color 0.3s ease;
}

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

.footer-bottom {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  font-size: 0.85em;
  color: var(--text-main);
}

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

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

  .header-container {
    width: 100%;
    max-width: none; /* Crucial for mobile full width */
    padding: 8px 15px;
    justify-content: space-between;
    min-height: 48px;
  }

  .hamburger-menu {
    display: block;
  }

  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-size: 1.8em;
    padding: 0;
  }

  .main-nav {
    display: none; /* Hidden by default */
    flex-direction: column;
    position: fixed;
    top: var(--header-offset);
    left: 0;
    width: 250px;
    height: calc(100% - var(--header-offset));
    background-color: var(--card-bg);
    padding: 20px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    transform: translateX(-100%); /* Start off-screen */
    transition: transform 0.3s ease;
    overflow-y: auto;
    align-items: flex-start;
    gap: 10px;
    z-index: 999; /* Ensure menu is above overlay */
  }

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

  .nav-link {
    width: 100%;
    padding: 12px 15px;
    font-size: 1.1em;
  }

  .desktop-nav-buttons {
    display: none !important;
  }

  .mobile-nav-buttons {
    display: flex !important;
    gap: 8px;
    flex-shrink: 0;
  }

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

  .footer-container {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 20px;
  }

  .footer-col {
    text-align: center;
  }

  .footer-col h3 {
    margin-bottom: 10px;
  }

  .footer-logo {
    margin-bottom: 10px;
  }

  .footer-nav a {
    display: inline-block;
    margin: 0 10px 8px 10px;
  }

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

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