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

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding-top: var(--header-offset);
  background-color: var(--color-background);
  color: var(--color-text-main);
  overflow-x: hidden; /* Prevent body overflow on desktop */
}

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

.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--color-deep-red); /* Distinct color for top bar */
  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 30px; /* Adjusted padding */
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--color-text-main);
  text-decoration: none;
  display: flex;
  align-items: center; /* For potential image logo */
  height: 100%;
}

.logo img {
  display: block;
  max-height: 60px; /* Matches header-top height */
  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 on desktop */
  min-height: 48px;
  background-color: var(--color-primary); /* Same as main-nav for consistency */
  width: 100%;
  padding: 0 15px;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 25px;
  background: var(--color-button-gradient);
  color: var(--color-deep-red); /* Dark text for light gold button */
  text-decoration: none;
  font-weight: bold;
  font-size: 15px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

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

.hamburger-menu {
  display: none; /* Hidden by default on desktop */
  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-text-main);
  margin-bottom: 5px;
  transition: all 0.3s ease;
}

.hamburger-menu .bar:last-child {
  margin-bottom: 0;
}

/* Main Navigation */
.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex; /* Desktop default: flex */
  align-items: center;
  overflow: hidden;
  background-color: var(--color-primary); /* Distinct color for navigation bar */
  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;
  width: 100%;
}

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

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

/* 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.5);
  z-index: 999;
  transition: opacity 0.3s ease;
  opacity: 0;
}

.overlay.active {
  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;
  line-height: 1.6;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

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

.footer-col-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 15px;
  color: var(--color-gold);
}

.footer-about .footer-logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--color-text-main);
  text-decoration: none;
  margin-bottom: 15px;
  display: block;
}

.footer-description {
  color: var(--color-text-main);
  margin-bottom: 15px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

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

.footer-nav li a {
  color: var(--color-text-main);
  text-decoration: none;
  padding: 5px 0;
  display: block;
  transition: color 0.3s ease;
}

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

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
}

.footer-bottom p {
  margin: 0;
}

.footer-slot-anchor-inner {
  min-height: 1px; /* Ensure slot is visible for inspection */
}

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

  body {
    overflow-x: hidden;
  }

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

  .header-top {
    min-height: 60px;
    height: 60px;
    justify-content: space-between; /* To push hamburger and logo apart */
  }

  .header-container {
    padding: 0 15px;
    max-width: none;
    position: relative; /* For absolute logo centering */
    width: 100%;
  }

  .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); /* Account for hamburger width */
  }

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

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

  .mobile-nav-buttons {
    display: flex !important; /* Show on mobile */
    min-height: 48px;
    height: auto; /* Allow content to dictate height if buttons wrap */
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px 15px; /* Adjust padding for mobile */
    overflow: hidden; /* Prevent button overflow */
    gap: 10px;
    flex-wrap: nowrap; /* Ensure buttons stay in one row */
  }

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

  .hamburger-menu {
    display: block;
    order: -1; /* Place to the left */
  }

  .main-nav {
    display: none; /* Hidden by default on mobile */
    position: fixed;
    top: var(--header-offset); /* Position below fixed header and mobile buttons */
    left: 0;
    width: 280px; /* Width of the mobile menu */
    height: calc(100% - var(--header-offset)); /* Fill remaining height */
    flex-direction: column; /* Vertical menu */
    background-color: var(--color-background); /* Darker background for menu */
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    transform: translateX(-100%); /* Slide out of view initially */
    transition: transform 0.3s ease;
    overflow-y: auto;
  }

  .main-nav.active {
    display: flex; /* Must be flex to show */
    transform: translateX(0); /* Slide into view */
  }

  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 0;
    max-width: none;
  }

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

  .overlay {
    z-index: 998; /* Below hamburger, above menu */
  }

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

  .footer-grid-container {
    grid-template-columns: 1fr; /* Single column layout for mobile */
  }
  .footer-col {
    text-align: center;
  }
  .footer-nav li a {
    display: inline-block; /* For better mobile spacing */
    margin: 0 5px;
  }
  .footer-about .footer-logo {
    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;
  }
}
