:root {
  --header-offset: 122px; /* Desktop: header-top (68px) + main-nav (52px) + 2px buffer */
}

body {
  padding-top: var(--header-offset);
  margin: 0;
  font-family: 'Arial', sans-serif;
  color: #FFF5E1; /* Text Main */
  background-color: #B71C1C; /* Background */
  line-height: 1.6;
}

/* Base styles for the site header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  background-color: transparent; /* Background handled by header-top and main-nav */
}

/* Header Top Bar - Desktop default */
.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: #C91F17; /* Primary Color */
  width: 100%;
  padding: 0 20px; /* Default padding for smaller desktop screens if container is not full width */
}

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

/* Logo styles */
.logo {
  font-size: 28px;
  font-weight: bold;
  color: #F4D34D; /* Gold */
  text-decoration: none;
  display: flex; /* For potential image logo alignment */
  align-items: center;
  height: 100%;
}
.logo img {
  display: block;
  max-height: 60px; /* Desktop max height */
  height: auto;
  width: auto;
  max-width: 280px;
  object-fit: contain;
}

/* Desktop Navigation Buttons */
.desktop-nav-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Mobile Navigation Buttons (hidden by default on desktop) */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden on desktop */
  min-height: 48px; /* Mobile height */
  background-color: #E53935; /* Auxiliary Color */
  width: 100%;
  padding: 0 15px; /* Mobile padding */
}

/* Main Navigation Bar - Desktop default */
.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex; /* Desktop default: visible */
  align-items: center;
  overflow: hidden;
  background-color: #E53935; /* Auxiliary Color, different from header-top */
  width: 100%;
  padding: 0 20px; /* Default padding */
}

.nav-container {
  box-sizing: border-box;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: row; /* Desktop: horizontal */
  justify-content: center;
  align-items: center;
  gap: 25px; /* Spacing between nav links */
}

.nav-link {
  color: #FFF5E1; /* Text Main */
  text-decoration: none;
  font-weight: bold;
  padding: 5px 0;
  transition: color 0.3s ease;
  white-space: nowrap; /* Prevent wrapping on desktop */
}

.nav-link:hover,
.nav-link.active {
  color: #FFCC66; /* Glow */
}

/* Hamburger Menu - Hidden by default on desktop */
.hamburger-menu {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 22px;
  cursor: pointer;
  z-index: 1001; /* Above header */
  position: relative; /* For z-index to work */
}

.hamburger-menu span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: #FFF5E1; /* Text Main */
  transition: all 0.3s ease-in-out;
}

/* Button styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: bold;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid #F2B544; /* Border */
  background: linear-gradient(180deg, #FFD86A 0%, #E6B800 100%); /* Button color */
  color: #7A0E0E; /* Deep Red for button text */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.btn:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4), 0 0 15px #FFCC66; /* Glow on hover */
}

/* Overlay for mobile menu */
.overlay {
  display: none; /* Hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 999; /* Below menu, above content */
}

/* Footer styles */
.site-footer {
  background-color: #7A0E0E; /* Deep Red */
  color: #FFF5E1; /* Text Main */
  padding: 40px 20px 20px;
  font-size: 14px;
}

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

.footer-col h3 {
  color: #F4D34D; /* Gold */\  font-size: 18px;
  margin-bottom: 15px;
}

.footer-col .footer-logo {
  font-size: 24px;
  font-weight: bold;
  color: #F4D34D; /* Gold */
  text-decoration: none;
  display: block;
  margin-bottom: 15px;
}

.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: #FFF5E1; /* Text Main */
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-nav a:hover {
  color: #FFCC66; /* Glow */
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #D32F2F; /* Card BG */
  max-width: 1200px;
  margin: 0 auto;
}

/* Footer Slot Anchors - ensure they are visible for injection */
.footer-slot-anchor-inner {
  min-height: 1px; /* Ensure visibility for system injection */
  margin-top: 5px; /* Provide some minimal spacing */
}

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

  /* Header Top Bar - Mobile */
  .header-top {
    min-height: 60px !important;
    height: 60px !important;
    padding: 0 15px; /* Mobile padding */
    justify-content: space-between; /* To push hamburger and logo apart */
  }

  .header-container {
    width: 100%;
    max-width: none; /* No max-width on mobile */
    padding: 0; /* Remove container padding as header-top has it */
    position: relative; /* For absolute positioning of logo */
    justify-content: space-between; /* To align hamburger and empty space */
  }

  /* Hamburger Menu - Mobile */
  .hamburger-menu {
    display: flex;
    order: -1; /* Place it at the beginning */
    margin-right: auto; /* Push logo to center */
  }

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

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

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

  /* Logo styles - Mobile Centering Method 1 */
  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 100px); /* Ensure logo doesn't overlap hamburger/buttons */
  }
  .logo img {
    max-height: 56px !important; /* Mobile max height */
  }

  /* Desktop Navigation Buttons - Hidden on mobile */
  .desktop-nav-buttons {
    display: none !important;
  }

  /* Mobile Navigation Buttons - Visible on mobile */
  .mobile-nav-buttons {
    display: flex !important;
    align-items: center;
    justify-content: center; /* Center buttons horizontally */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px 15px; /* Mobile padding */
    overflow: hidden; /* Prevent overflow */
    gap: 10px;
    flex-wrap: nowrap; /* Keep buttons in one line */
    background-color: #E53935; /* Auxiliary Color */
  }

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

  /* Main Navigation Bar - Mobile */
  .main-nav {
    display: none; /* Hidden by default on mobile */
    position: fixed; /* Fixed position for sidebar menu */
    top: var(--header-offset); /* Below the fixed header */
    left: 0;
    width: 280px; /* Sidebar width */
    height: calc(100% - var(--header-offset)); /* Full height below header */
    background-color: #D32F2F; /* Card BG, a darker red for menu */
    flex-direction: column; /* Vertical menu */
    align-items: flex-start;
    padding: 20px;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.3);
    transform: translateX(-100%); /* Off-screen by default */
    transition: transform 0.3s ease;
    overflow-y: auto; /* Enable scrolling for long menus */
  }

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

  .nav-container {
    flex-direction: column; /* Vertical links */
    align-items: flex-start;
    gap: 15px; /* Spacing between mobile nav links */
    width: 100%;
    max-width: none; /* No max-width on mobile */
    padding: 0; /* No container padding */
  }

  .nav-link {
    width: 100%;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  .nav-link:last-child {
    border-bottom: none;
  }

  .overlay.active {
    display: block; /* Show overlay when menu is active */
  }

  /* Footer - Mobile */
  .site-footer {
    padding: 30px 15px 15px;
  }
  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 25px;
    margin-bottom: 25px;
  }
  .footer-col h3 {
    margin-bottom: 10px;
  }
  .footer-bottom {
    padding-top: 15px;
  }

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

/* Ensure no-scroll class works for body */
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;
  }
}
/* 内容保护（系统追加，请勿删除） */
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;
}
