:root {
  --header-offset: 122px; /* Desktop: 68px (header-top) + 52px (main-nav) */
  --primary-color: #C91F17;
  --secondary-color: #E53935;
  --deep-red: #7A0E0E;
  --background-color: #B71C1C;
  --card-bg-color: #D32F2F;
  --text-main-color: #FFF5E1;
  --button-gradient: linear-gradient(180deg, #FFD86A 0%, #E6B800 100%);
  --border-color: #F2B544;
  --glow-color: #FFCC66;
  --gold-color: #F4D34D;
}

/* Base styles */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: var(--text-main-color);
  background-color: var(--background-color);
  padding-top: var(--header-offset); /* Fixed header offset */
  overflow-x: hidden; /* Prevent horizontal scroll for body */
}

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

.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(--deep-red); /* Fallback, specific sections will override */
  box-sizing: border-box;
}

.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex; /* Make header-top a flex container */
  align-items: center;
  overflow: hidden;
  background-color: var(--deep-red); /* Darker red */
  width: 100%;
  padding: 0 20px; /* Default desktop padding */
  position: relative; /* For mobile logo absolute positioning */
}

.header-container {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto; /* Center the container within header-top */
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--gold-color); /* Gold for logo text */
  text-transform: uppercase;
  display: block;
  height: 100%; /* Occupy full height of header-top */
  display: flex;
  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;
}

.btn {
  padding: 10px 20px;
  border-radius: 25px;
  background: var(--button-gradient);
  color: #000000; /* Text color for gold buttons */
  font-weight: bold;
  white-space: nowrap;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  cursor: pointer;
}

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

.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex; /* Desktop default: visible, horizontal */
  align-items: center;
  overflow: hidden;
  background-color: var(--primary-color); /* Primary red, distinct from header-top */
  width: 100%;
}

.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 {
  padding: 0 15px;
  color: var(--text-main-color);
  font-weight: bold;
  font-size: 16px;
  line-height: 52px; /* Match main-nav height for vertical centering */
  transition: color 0.2s ease, background-color 0.2s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--gold-color);
  background-color: rgba(255, 255, 255, 0.1);
}

/* Mobile specific elements (hidden by default on desktop) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  width: 30px;
  height: 24px;
  position: relative;
  cursor: pointer;
  z-index: 1001; /* Above header */
  flex-direction: column;
  justify-content: space-between;
}

.hamburger-menu span {
  display: block;
  height: 3px;
  width: 100%;
  background: var(--gold-color);
  border-radius: 3px;
  transition: all 0.3s ease-in-out;
}

.hamburger-menu.active span:nth-child(1) {
  transform: translateY(10.5px) rotate(45deg);
}
.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
}
.hamburger-menu.active span:nth-child(3) {
  transform: translateY(-10.5px) rotate(-45deg);
}

.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden on desktop, shown on mobile */
  min-height: 48px;
  background-color: var(--secondary-color); /* A different red for this strip */
  width: 100%;
  padding: 0 20px;
  justify-content: center; /* Center buttons horizontally */
  align-items: center;
}

.overlay {
  display: none; /* Hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 999;
}

.overlay.active {
  display: block;
}

/* Footer styles */
.site-footer {
  background-color: var(--background-color); /* Deep red */
  padding: 40px 20px 20px;
  color: var(--text-main-color);
  font-size: 14px;
  box-sizing: border-box;
}

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

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

.footer-logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--gold-color);
  text-transform: uppercase;
  margin-bottom: 15px;
  display: block;
}

.footer-description {
  line-height: 1.6;
  margin-bottom: 15px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.footer-title {
  font-size: 18px;
  color: var(--gold-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-color);
  transition: color 0.2s ease;
}

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

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

/* Dynamic slot anchor visibility */
.footer-slot-anchor-inner {
  min-height: 1px;
}

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

  /* Body padding update for mobile */
  body {
    padding-top: var(--header-offset);
    overflow-x: hidden;
  }
  
  /* 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;
  }

  .site-header {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  }

  .header-top {
    min-height: 60px !important;
    height: 60px !important;
    padding: 0 15px; /* Adjust padding for mobile */
    justify-content: space-between; /* Push hamburger to left, create space for logo */
  }

  .header-container {
    width: 100%;
    max-width: none; /* No max-width on mobile */
    height: 100%; /* Ensure logo takes up height */
    margin: 0; /* No auto margin needed, let header-top handle distribution */
    justify-content: center; /* Center logo if it's the only visible item */
    padding: 0; /* No padding needed here, header-top has it */
  }

  .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 */
    flex: none !important; /* Remove flex:1 to let absolute positioning take over */
  }

  .logo img {
    max-height: 56px !important; /* Adjusted for mobile header height */
    max-width: 100%;
  }

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

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons on mobile */
    min-height: 48px;
    height: auto; /* Allow height to adjust if text wraps */
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 8px 15px; /* Adjusted padding for mobile buttons */
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
    background-color: var(--secondary-color); /* Consistent background */
  }

  .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 to wrap */
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-align: center;
  }

  .hamburger-menu {
    display: flex; /* Show hamburger menu on mobile */
    order: -1; /* Place it at the beginning of the flex items in header-top */
  }

  .main-nav {
    display: none; /* Hidden by default on mobile */
    flex-direction: column; /* Vertical layout for mobile menu */
    position: fixed;
    top: var(--header-offset); /* Below fixed header */
    left: 0;
    width: 80%; /* Menu width */
    max-width: 300px; /* Max width for larger phones */
    height: calc(100% - var(--header-offset)); /* Fill remaining height */
    background-color: var(--primary-color); /* Primary red */
    transform: translateX(-100%); /* Off-screen by default */
    transition: transform 0.3s ease-in-out;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3);
    overflow-y: auto; /* Enable scrolling for long menus */
    z-index: 1001; /* Above main content, below overlay */
    padding: 20px 0;
    box-sizing: border-box;
  }

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

  .nav-container {
    flex-direction: column;
    padding: 0;
    max-width: none; /* No max-width on mobile */
    width: 100%;
  }

  .nav-link {
    width: 100%;
    padding: 12px 20px;
    text-align: left;
    line-height: normal; /* Reset line-height */
    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: 10px;
  }

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

  .footer-col:not(.footer-about) .footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px 10px;
  }

  .footer-col:not(.footer-about) .footer-nav li {
    margin-bottom: 0;
  }

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

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

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

  .footer-bottom {
    padding-left: 15px;
    padding-right: 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;
  }
}
/* 内容保护（系统追加，请勿删除） */
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
input, textarea, select, [contenteditable="true"] {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}
