:root {
  --header-offset: 122px; /* Desktop: 68px (header-top) + 52px (main-nav) + 2px buffer */
  --primary-color: #C61F1F;
  --accent-color: #E53030;
  --button-gradient: linear-gradient(180deg, #FFB04A 0%, #D86A14 100%);
  --card-bg-color: #2A1212;
  --site-bg-color: #140C0C;
  --text-main-color: #FFF1E8;
  --border-color: #6A1E1E;
  --gold-color: #F3C54D;
  --deep-red-color: #7E0D0D;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: var(--text-main-color);
  background-color: var(--site-bg-color);
  padding-top: var(--header-offset); /* Ensure content doesn't get hidden under fixed header */
}

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

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

.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(--text-main-color);
  text-decoration: none;
  display: flex;
  align-items: center; /* For vertical alignment */
}

.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; /* Always visible on desktop */
  gap: 12px;
  align-items: center;
}

.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default on desktop */
  min-height: 48px; /* Mobile fixed height for this row */
  background-color: var(--card-bg-color); /* Distinct from other header parts */
}

.btn {
  padding: 10px 18px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: bold;
  color: #FFFFFF; /* White text for buttons */
  background: var(--button-gradient);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  white-space: nowrap; /* Prevent text wrap on desktop */
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

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

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

.nav-container {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: row; /* Horizontal on desktop */
  justify-content: center;
  align-items: center;
  padding: 0 20px;
}

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

.nav-link:hover, .nav-link.active {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  color: var(--gold-color);
}

/* Hamburger menu for mobile */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  width: 30px;
  height: 24px;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  z-index: 1001; /* Above logo on mobile */
  padding: 0;
  margin-right: 15px; /* Spacing from logo */
  flex-shrink: 0;
}

.hamburger-menu::before,
.hamburger-menu::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 3px;
  background-color: var(--text-main-color);
  left: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger-menu::before {
  top: 0;
}

.hamburger-menu::after {
  bottom: 0;
}

.hamburger-menu span {
  position: absolute;
  width: 100%;
  height: 3px;
  background-color: var(--text-main-color);
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  transition: opacity 0.3s ease;
}

.hamburger-menu.active::before {
  transform: translateY(10.5px) rotate(45deg);
}

.hamburger-menu.active::after {
  transform: translateY(-10.5px) rotate(-45deg);
}

.hamburger-menu.active span {
  opacity: 0;
}

/* Mobile Navigation Overlay */
.mobile-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; /* Below menu, above content */
  transition: opacity 0.3s ease;
  opacity: 0;
}

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

/* Footer */
.site-footer {
  background-color: var(--site-bg-color);
  padding: 40px 20px 20px;
  border-top: 1px solid var(--border-color);
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

.footer-top-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  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(--text-main-color);
  text-decoration: none;
  margin-bottom: 15px;
}

.footer-description {
  margin: 0;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.6);
  word-wrap: break-word; /* Ensure description wraps */
  overflow-wrap: break-word;
}

.footer-col h3 {
  color: var(--gold-color);
  font-size: 18px;
  margin-bottom: 20px;
  font-weight: 600;
}

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

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

.footer-nav a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

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

.footer-bottom p {
  margin: 0;
}

/* Dynamic slot anchors - ensure they are visible and don't hide content */
.footer-slot-anchor, .footer-slot-anchor-inner {
  min-height: 1px; /* Ensure visibility */
  width: 100%;
}

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

  body {
    padding-top: var(--header-offset);
    overflow-x: hidden; /* Prevent horizontal scroll for body */
  }

  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }

  .header-top {
    height: 60px; /* Mobile fixed height */
  }

  .header-container {
    padding: 0 15px; /* Smaller padding for mobile */
    justify-content: space-between; /* Hamburger left, logo center, space right */
    position: relative; /* For absolute positioning of logo if needed */
  }

  .hamburger-menu {
    display: block; /* Show hamburger on mobile */
    order: -1; /* Place it at the beginning */
    margin-right: 0;
  }

  /* Mobile logo centering (Method 1: Flexbox) */
  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    position: static !important; /* Reset absolute positioning if any */
    transform: none !important; /* Reset transform if any */
  }
  .logo img {
    max-height: 56px !important; /* Mobile max-height */
  }

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

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    min-height: 48px; /* Mobile fixed height */
    align-items: center;
    justify-content: center; /* Center buttons horizontally */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap; /* Ensure buttons stay in one line */
    background-color: var(--card-bg-color); /* Background for mobile button row */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3); /* Subtle shadow for separation */
  }

  .mobile-nav-buttons .btn {
    flex: 1;
    min-width: 0;
    max-width: calc(50% - 5px); /* Max width for two buttons with gap */
    box-sizing: border-box;
    padding: 8px 12px; /* Smaller padding */
    font-size: 13px; /* Smaller font size */
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.3;
  }

  .main-nav {
    display: none; /* Hidden by default, shown by JS */
    flex-direction: column; /* Vertical layout for mobile menu */
    position: fixed; /* Fixed position for mobile menu */
    top: var(--header-offset); /* Position below the header (header-top + mobile-nav-buttons) */
    left: 0;
    width: 280px; /* Width of the mobile menu */
    height: calc(100% - var(--header-offset)); /* Fill remaining height */
    background-color: var(--site-bg-color); /* Dark background for menu */
    transform: translateX(-100%); /* Slide out of view initially */
    transition: transform 0.3s ease-out;
    padding: 20px 0;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.5);
    z-index: 999; /* Below overlay */
    overflow-y: auto; /* Enable scrolling for long menus */
  }

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

  .nav-container {
    flex-direction: column;
    padding: 0;
    height: auto;
  }

  .nav-link {
    width: 100%;
    padding: 12px 20px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

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

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

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

  .footer-bottom {
    margin-top: 20px;
    padding-top: 15px;
  }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
