:root {
  --header-offset: 122px;
  --color-primary: #F2C14E;
  --color-secondary: #FFD36B;
  --color-card-bg: #111111;
  --color-background: #0A0A0A;
  --color-text-main: #FFF6D6;
  --color-border: #3A2A12;
  --color-glow: #FFD36B;
  --btn-gradient: linear-gradient(180deg, #FFD86A 0%, #DDA11D 100%);
}

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

/* General Link Styling */
a {
  color: var(--color-primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Site Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  background-color: var(--color-background); /* Overall header background */
}

.header-top {
  box-sizing: border-box;
  height: 68px;
  min-height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--color-card-bg); /* Distinct background for header-top */
  width: 100%;
  padding: 0 20px; /* Padding for small screens, overridden by container on desktop */
}

.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; /* Ensures padding on larger screens */
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--color-primary);
  text-decoration: none;
  display: flex; /* For potential image logo alignment */
  align-items: center;
}

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

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

.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default, shown on mobile */
  min-height: 48px;
  background-color: var(--color-card-bg);
  padding: 0 15px; /* Default padding for mobile buttons */
}

.hamburger-menu {
  display: none; /* Hidden by default, shown on mobile */
  width: 30px;
  height: 24px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  position: relative;
  z-index: 1001;
}

.hamburger-menu .bar {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--color-primary);
  margin: 5px 0;
  transition: 0.3s;
}

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

.main-nav {
  box-sizing: border-box;
  height: 52px;
  min-height: 52px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--color-primary); /* Distinct background for main-nav */
  width: 100%;
  transition: transform 0.3s ease; /* For mobile slide-in/out */
}

.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;
  width: 100%;
}

.nav-link {
  color: var(--color-background);
  text-decoration: none;
  padding: 10px 15px;
  font-weight: bold;
  white-space: nowrap;
  transition: background-color 0.3s ease;
}

.nav-link:hover {
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  text-decoration: none;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  color: var(--color-text-main);
}

.btn-primary {
  background: var(--btn-gradient);
  box-shadow: 0 4px 10px rgba(242, 193, 78, 0.4);
}

.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 15px rgba(242, 193, 78, 0.6);
}

.btn-secondary {
  background-color: var(--color-card-bg);
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
}

.btn-secondary:hover {
  background-color: var(--color-primary);
  color: var(--color-background);
  box-shadow: 0 4px 10px rgba(242, 193, 78, 0.2);
}

/* Overlay for 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: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.overlay.visible {
  display: block;
  opacity: 1;
}

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

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

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

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

.footer-col .footer-description {
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

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

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

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

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

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

.footer-bottom p {
  margin: 0;
}

/* Footer Slot Anchors - ensure they are visible for injection */
.footer-slot-anchor, .footer-slot-anchor-inner {
  min-height: 1px; /* Ensure they take up space if empty */
  visibility: visible;
  opacity: 1;
  display: block;
}

/* Mobile Styles */
@media (max-width: 768px) {
  :root {
    --header-offset: 110px;
  }

  .header-top {
    height: 60px;
    min-height: 60px;
    padding: 0 15px; /* Adjust padding for mobile */
    justify-content: space-between; /* Ensure hamburger is left, logo right */
  }

  .header-container {
    width: 100%;
    max-width: none;
    padding: 0;
    justify-content: space-between;
  }

  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin-left: -30px; /* Offset for hamburger menu */
  }

  .logo img {
    max-height: 56px !important;
  }

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

  .mobile-nav-buttons {
    display: flex !important;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
  }

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

  .hamburger-menu {
    display: block;
    order: -1; /* Place hamburger first */
  }

  .main-nav {
    display: none;
    flex-direction: column;
    position: fixed;
    top: var(--header-offset);
    left: 0;
    width: 75%;
    height: calc(100% - var(--header-offset));
    background-color: var(--color-card-bg); /* Mobile menu background */
    transform: translateX(-100%);
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3);
  }

  .main-nav.active {
    display: flex;
    transform: translateX(0);
  }

  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    width: 100%;
    max-width: none;
    height: auto; /* Allow content to dictate height */
  }

  .nav-link {
    width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-text-main);
  }

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

  .site-footer {
    padding-left: 15px;
    padding-right: 15px;
  }

  .footer-top-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

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

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