:root {
  --header-offset: 122px;
  --color-primary: #C61F1F;
  --color-accent: #E53030;
  --color-button-gradient-start: #FFB04A;
  --color-button-gradient-end: #D86A14;
  --color-card-bg: #2A1212;
  --color-background: #140C0C;
  --color-text-main: #FFF1E8;
  --color-border: #6A1E1E;
  --color-gold: #F3C54D;
  --color-deep-red: #7E0D0D;
}

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

/* 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.5);
  background-color: var(--color-background); /* 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);
  width: 100%;
  color: var(--color-text-main);
}

.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-left: 30px;
  padding-right: 30px;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--color-gold);
  text-decoration: none;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 25px;
  text-decoration: none;
  color: var(--color-background); /* Changed for contrast */
  font-weight: bold;
  background: linear-gradient(180deg, var(--color-button-gradient-start) 0%, var(--color-button-gradient-end) 100%);
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
  box-sizing: border-box;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.hamburger-menu {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 22px;
  cursor: pointer;
  position: relative;
  z-index: 1001;
}

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

.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--color-primary);
  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;
  gap: 25px;
}

.nav-link {
  color: var(--color-text-main);
  text-decoration: none;
  font-weight: bold;
  padding: 5px 0;
  position: relative;
  transition: color 0.3s ease;
  white-space: nowrap;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-gold);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

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

.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default on desktop */
  min-height: 48px;
  background-color: var(--color-card-bg);
  color: var(--color-text-main);
}

.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 998;
}

.overlay.active {
  display: block;
}

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

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

.footer-col {
  padding: 10px 0;
}

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

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

.footer-heading {
  font-size: 16px;
  color: var(--color-gold);
  margin-bottom: 15px;
  text-transform: uppercase;
}

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

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

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

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

.footer-bottom {
  border-top: 1px solid var(--color-border);
  padding-top: 20px;
  text-align: center;
  max-width: 1200px;
  margin: 0 auto;
  color: var(--color-text-main);
}

.footer-bottom p {
  margin: 0;
}

/* Footer dynamic slot anchors - must be present and visible */
.footer-slot-anchor, .footer-slot-anchor-inner {
  /* Ensure these are not hidden by default */
  min-height: 1px; /* Smallest possible height to be visible for injection */
  display: block;
}

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

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

  .header-container {
    padding: 0;
    justify-content: space-between;
    position: relative; /* For absolute positioning of logo if needed */
  }

  .logo {
    font-size: 20px;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: calc(100% - 70px); /* Account for hamburger menu width */
  }

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

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

  .hamburger-menu {
    display: flex;
    order: -1; /* Move to left */
    margin-right: auto; /* Push logo to center */
  }

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

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

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

  .mobile-nav-buttons {
    display: flex !important;
    min-height: 48px;
    align-items: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
    justify-content: center; /* Center buttons horizontally */
  }

  .mobile-nav-buttons .btn {
    flex: 1;
    min-width: 0;
    max-width: calc(50% - 5px);
    padding: 8px 12px;
    font-size: 13px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    border-radius: 20px;
  }

  .main-nav {
    display: none;
    position: fixed;
    top: var(--header-offset); /* Position below fixed header */
    left: 0;
    width: 280px;
    height: calc(100% - var(--header-offset));
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    background-color: var(--color-card-bg); /* Darker background for mobile menu */
    padding: 20px;
    box-sizing: border-box;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 999;
    overflow-y: auto;
  }

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

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

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

  .nav-link::after {
    display: none;
  }

  .overlay.active {
    display: block;
    z-index: 997;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-col {
    padding: 20px 0;
    border-bottom: 1px solid var(--color-border);
  }

  .footer-col:last-of-type {
    border-bottom: none;
  }

  .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 double padding on first section */
.page-xxx:first-of-type {
  padding-top: 10px; /* Small decorative top padding, not header-offset */
}

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