/* General resets and body padding */
body {
  margin: 0;
  font-family: 'Arial', sans-serif;
  color: var(--text-main-color);
  background-color: var(--background-color);
  line-height: 1.6;
  padding-top: var(--header-offset); /* Important: only here */
  overflow-x: hidden; /* For mobile overflow protection */
}

:root {
  --primary-color: #C91F17;
  --secondary-color: #E53935;
  --card-bg: #D32F2F;
  --background-color: #B71C1C;
  --text-main-color: #FFF5E1;
  --border-color: #F2B544;
  --glow-color: #FFCC66;
  --gold-color: #F4D34D;
  --deep-red-color: #7A0E0E;

  /* Header offset calculation (Desktop: 68px + 52px = 120px, +2px buffer) */
  --header-offset: 122px; 
}

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

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Site Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  background-color: var(--deep-red-color); /* Fallback, specific sections will override */
  box-sizing: border-box;
}

.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--deep-red-color);
  width: 100%;
}

.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 25px; /* Adjust padding as needed */
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--text-main-color);
  text-transform: uppercase;
  display: block; /* Ensure it's not inline for flex alignment */
  flex-shrink: 0; /* Prevent shrinking on desktop */
}

.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;
  flex-shrink: 0; /* Prevent shrinking on desktop */
}

.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default on desktop */
  min-height: 48px;
  width: 100%;
  background-color: var(--secondary-color); /* A distinct color for this row */
  padding: 0 15px; /* Match mobile container padding */
  align-items: center; /* Vertically center buttons if row has height */
  justify-content: center; /* Center buttons horizontally */
  gap: 10px;
}

.btn {
  padding: 10px 18px;
  border-radius: 25px;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s ease;
  color: #000000; /* Dark text for contrast on yellow gradient */
  border: none; /* No border for buttons */
}

.btn-primary {
  background: linear-gradient(180deg, var(--gold-color) 0%, var(--glow-color) 100%);
  box-shadow: 0 0 8px var(--glow-color);
}

.btn-secondary {
  background: linear-gradient(180deg, #FFD86A 0%, #E6B800 100%);
  box-shadow: 0 0 8px var(--glow-color);
}

.btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--glow-color);
}

.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex; /* Desktop default: flex */
  align-items: center;
  overflow: hidden;
  background-color: var(--secondary-color);
  width: 100%;
}

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

.nav-link {
  color: var(--text-main-color);
  padding: 10px 15px;
  font-weight: bold;
  text-transform: uppercase;
  transition: color 0.3s ease, background-color 0.3s ease;
  border-radius: 5px;
}

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

/* Hamburger menu (hidden on desktop) */
.hamburger-menu {
  display: none; /* Hidden by default on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  position: relative;
  z-index: 1001; /* Above other header elements */
}

.hamburger-menu .bar {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--text-main-color);
  margin: 5px auto;
  transition: all 0.3s ease;
}

/* Overlay (hidden on desktop) */
.overlay {
  display: none; /* Hidden by default on desktop */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 998; /* Below mobile menu, above content */
  transition: opacity 0.3s ease;
  opacity: 0;
}

.overlay.active {
  opacity: 1;
}

/* Site Footer */
.site-footer {
  background-color: var(--background-color);
  padding: 40px 0 20px;
  color: var(--text-main-color);
  text-align: center;
  box-sizing: border-box;
}

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

.footer-col h3 {
  color: var(--gold-color);
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 18px;
}

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

.footer-description {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-main-color);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

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

.footer-nav a {
  color: var(--text-main-color);
  font-size: 14px;
  transition: color 0.3s ease;
}

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

.footer-bottom {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
}

.footer-slot-anchor-inner {
  /* Ensure anchors are visible for content injection */
  min-height: 1px;
  width: 100%; /* Ensure it takes up space */
  box-sizing: border-box;
}

body.no-scroll {
  overflow: hidden;
}

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

  /* 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 8px rgba(0, 0, 0, 0.2);
  }

  .header-top {
    min-height: 60px !important;
    height: 60px !important;
  }

  .header-container {
    width: 100%;
    max-width: none;
    padding: 0 15px;
    justify-content: space-between;
    position: relative; /* Essential for absolute positioning of logo */
  }

  /* Method 2 for logo centering on mobile (absolute positioning) */
  .logo {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important; /* Keep flex for potential image/text alignment within logo */
    align-items: center !important;
    justify-content: center !important;
    max-width: calc(100% - 100px); /* Leave space for hamburger */
    z-index: 1; /* Below hamburger menu */
  }

  .logo img {
    max-height: 56px !important; /* Adjust for mobile header height */
  }

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

  .hamburger-menu {
    display: block;
    order: -1; /* Push to the left */
    z-index: 1002; /* Above logo */
    flex-shrink: 0;
  }

  /* Hamburger menu active state */
  .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);
  }

  .mobile-nav-buttons {
    display: flex !important;
    min-height: 48px;
    width: 100%; max-width: 100%; /* Ensure it takes full width */
    box-sizing: border-box;
    padding: 0 15px;
    overflow: hidden; /* Prevent overflow */
    gap: 10px;
    flex-wrap: nowrap; /* Ensure buttons stay in one row */
    justify-content: center; /* Center the buttons */
    background-color: var(--secondary-color); /* Match main-nav color */
  }

  .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 */
    padding: 8px 12px; /* Smaller padding */
    font-size: 13px; /* Smaller font size */
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word; /* Break long words */
    overflow-wrap: break-word; /* Ensure wrapping */
  }

  .main-nav {
    display: none; /* Hidden by default on mobile, shown by JS */
    position: fixed; /* Fixed position for off-canvas menu */
    top: var(--header-offset); /* Start below fixed header and mobile buttons */
    left: 0;
    width: 80%; /* Adjust width as needed for off-canvas */
    max-width: 300px; /* Max width for the menu */
    height: calc(100% - var(--header-offset)); /* Fill remaining viewport height */
    background-color: var(--card-bg); /* Use a distinct background */
    flex-direction: column; /* Vertical menu items */
    padding: 20px 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    transform: translateX(-100%); /* Start off-screen */
    transition: transform 0.3s ease;
    z-index: 1001; /* Above 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 15px;
    align-items: flex-start;
    height: auto;
    max-width: none;
    width: 100%;
  }

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

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

  .overlay {
    display: block; /* Always display on mobile, control opacity with active class */
  }

  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column layout for mobile */
    padding: 0 15px;
    text-align: center;
  }

  .footer-col {
    margin-bottom: 30px;
  }

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

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

  .footer-description {
    text-align: center;
  }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
}
