:root {
  --header-offset: 122px; /* Desktop: 68px (header-top) + 52px (main-nav) + 2px buffer */
  --primary-color: #C61F1F;
  --secondary-color: #E53030;
  --button-gradient: linear-gradient(180deg, #FFB04A 0%, #D86A14 100%);
  --card-bg: #2A1212;
  --background-color: #140C0C;
  --text-main-color: #FFF1E8;
  --border-color: #6A1E1E;
  --gold-color: #F3C54D;
  --deep-red-color: #7E0D0D;
}

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

/* Site Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  background-color: var(--background-color); /* Base background for header, individual sections will override */
}

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

.logo {
  color: var(--text-main-color);
  text-decoration: none;
  font-weight: bold;
  font-size: 24px;
  white-space: nowrap;
  display: block; /* Ensure logo is visible */
}

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

.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default on desktop */
  min-height: 48px;
}

.main-nav {
  box-sizing: border-box;
  height: 52px;
  min-height: 52px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--primary-color); /* Primary color for main nav */
  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 {
  color: var(--text-main-color);
  text-decoration: none;
  padding: 10px 15px;
  white-space: nowrap;
  font-size: 16px;
  transition: background-color 0.3s ease;
}

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

.btn {
  background: var(--button-gradient);
  color: var(--text-main-color);
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  white-space: nowrap;
  transition: opacity 0.3s ease;
  border: none;
  cursor: pointer;
  display: inline-block;
  text-align: center;
}

.btn:hover {
  opacity: 0.9;
}

.hamburger-menu {
  display: none; /* Hidden by default on desktop */
  cursor: pointer;
  padding: 10px;
  position: relative;
  z-index: 1002;
}

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

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: none;
  transition: opacity 0.3s ease;
  opacity: 0;
}

.overlay.active {
  display: block;
  opacity: 1;
}

/* Footer */
.site-footer {
  background-color: var(--background-color);
  padding: 40px 20px 20px;
  color: var(--text-main-color);
  border-top: 1px solid var(--border-color);
}

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

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

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

.footer-description {
  font-size: 14px;
  line-height: 1.8;
  color: rgba(255, 241, 232, 0.8);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.footer-heading {
  font-size: 18px;
  margin-bottom: 15px;
  color: var(--gold-color);
}

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

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

.footer-nav a {
  color: rgba(255, 241, 232, 0.8);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s ease;
}

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

.footer-dynamic-col {
  /* This column is intentionally left empty for dynamic content injection */
}

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

.footer-bottom p {
  margin: 0;
}

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

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

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

  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-size: 20px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    height: 100%;
    max-width: calc(100% - 100px); /* Account for hamburger menu and potential right-side elements */
  }

  .logo img {
    max-height: 56px !important;
  }

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

  .mobile-nav-buttons {
    display: flex !important;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 5px 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
    background-color: var(--deep-red-color); /* Same as header-top for consistency */
  }

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

  .main-nav {
    height: calc(100vh - var(--header-offset)); /* Full height minus header */
    min-height: unset;
    position: fixed;
    top: var(--header-offset);
    left: 0;
    width: 80%; /* Adjust width as needed */
    max-width: 300px; /* Max width for mobile menu */
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    transform: translateX(-100%); /* Hidden by default */
    transition: transform 0.3s ease;
    background-color: var(--card-bg); /* Use card background for mobile menu */
    z-index: 1001;
    overflow-y: auto;
    padding-top: 20px;
  }

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

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

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

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

  .hamburger-menu {
    display: block; /* Show hamburger menu on mobile */
    position: relative;
    z-index: 1002;
    margin-right: auto; /* Push logo to center */
  }

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

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

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

  .footer-top-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

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

  .footer-nav {
    padding-left: 0;
  }

  .footer-nav li {
    display: inline-block;
    margin: 0 10px 10px 0;
  }
  .footer-nav a {
    white-space: nowrap;
  }

  /* Mobile content overflow prevention */
  .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 body overflow-x is hidden on desktop too */
body {
  overflow-x: 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;
  }
}
