:root {
  --header-offset: 122px; /* Desktop: 68px (header-top) + 52px (main-nav) = 120px + 2px buffer */
  --color-primary: #C91F17;
  --color-accent: #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 {
  padding-top: var(--header-offset);
  margin: 0;
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--color-text-main);
  background-color: var(--color-background);
  overflow-x: hidden; /* Prevent horizontal scroll */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  scroll-behavior: smooth;
}

a {
  text-decoration: none;
  color: inherit;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
}

.header-top {
  background-color: var(--color-deep-red); /* Darker red */
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  box-sizing: border-box;
  padding: 0 20px; /* Add padding to header-top itself, container will adjust */
}

.header-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%; /* Ensure content fills header-top height */
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--color-gold);
  text-decoration: none;
  display: block;
  white-space: nowrap;
  line-height: 1;
  text-shadow: 0 0 5px rgba(255, 204, 102, 0.5);
}

.logo img {
  display: block;
  max-height: 60px; /* Desktop logo height */
  height: auto;
  width: auto;
  max-width: 280px;
  object-fit: contain;
}

.desktop-nav-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn {
  background: var(--color-button-gradient);
  color: var(--color-deep-red); /* Text color contrasting with gold gradient */
  padding: 10px 20px;
  border-radius: 25px;
  font-weight: bold;
  text-align: center;
  white-space: nowrap;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--color-border);
  text-decoration: none;
  font-size: 15px;
  line-height: 1;
}

.btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), 0 0 10px var(--color-glow);
}

.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default on desktop */
  min-height: 48px;
  background-color: var(--color-accent); /* Distinct background for mobile buttons */
  justify-content: center; /* Center buttons horizontally */
  align-items: center;
  padding: 0 15px;
  overflow: hidden;
}

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

.nav-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  height: 100%; /* Fill main-nav height */
  padding: 0 20px;
  gap: 20px;
}

.nav-link {
  color: var(--color-text-main);
  font-weight: bold;
  padding: 8px 12px;
  white-space: nowrap;
  transition: color 0.3s ease, background-color 0.3s ease;
  border-radius: 5px;
  font-size: 16px;
}

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

.hamburger-menu {
  display: none; /* Hidden by default on desktop */
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 25px;
  cursor: pointer;
  z-index: 1002;
  padding: 5px;
  position: relative;
}

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

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

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

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

.footer-col h3 {
  color: var(--color-gold);
  font-size: 18px;
  margin-bottom: 15px;
  text-shadow: 0 0 5px rgba(255, 204, 102, 0.3);
}

.footer-logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--color-gold);
  margin-bottom: 15px;
  display: inline-block;
  text-shadow: 0 0 5px rgba(255, 204, 102, 0.5);
}

.footer-description {
  margin-top: 0;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.85);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

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

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

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

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

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

.footer-slot-anchor-inner {
  min-height: 1px;
}

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

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

  .header-top {
    min-height: 60px;
    height: 60px;
    padding: 0 15px; /* Smaller padding for mobile */
  }

  .header-container {
    padding: 0; /* Remove container padding, header-top has it */
    justify-content: space-between;
    position: relative; /* For logo absolute positioning fallback */
  }

  /* Mobile logo centering (Method 1: Flexbox) */
  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    position: absolute !important; /* Force absolute to center, as flex:1 might not be enough with hamburger */
    left: 50% !important;
    transform: translateX(-50%) !important;
    max-width: calc(100% - 100px) !important; /* Ensure space for hamburger */
  }
  
  .logo img {
    max-height: 56px !important; /* Mobile logo height */
  }

  .hamburger-menu {
    display: flex;
    position: relative;
    z-index: 2;
    margin-right: auto; /* Push hamburger to left */
  }

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

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

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

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

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    min-height: 48px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap; /* Ensure buttons stay in one row */
    background-color: var(--color-accent);
  }

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

  .main-nav {
    min-height: auto;
    height: auto;
    position: fixed;
    top: var(--header-offset); /* Below header and mobile buttons */
    left: 0;
    width: 80%; /* Sidebar width */
    max-width: 300px;
    height: calc(100% - var(--header-offset)); /* Full height below header */
    flex-direction: column;
    justify-content: flex-start;
    transform: translateX(-100%); /* Hidden off-screen */
    transition: transform 0.3s ease-in-out;
    background-color: var(--color-primary);
    z-index: 1001;
    padding: 20px 0;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.5);
    display: none; /* Hidden by default, shown via JS active class */
  }

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

  .nav-container {
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 0;
    padding: 0 15px;
    width: 100%;
    max-width: none;
  }

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

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

  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column layout */
    text-align: center;
  }

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

  .footer-col:last-child {
    margin-bottom: 0;
  }

  .footer-nav {
    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;
  }
}
