/* General Reset & Body */
body {
  margin: 0;
  font-family: 'Arial', sans-serif;
  color: #FFF1E8;
  background-color: #140C0C;
  line-height: 1.6;
  overflow-x: hidden; /* Prevent horizontal scroll on body */
  padding-top: var(--header-offset); /* Fixed header offset */
}

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

/* WCAG AA contrast for text on dark background */
a,
.nav-link,
.footer-nav a,
.logo,
.footer-logo,
h1, h2, h3, h4, h5, h6,
p,
li {
  color: #FFF1E8; /* Text Main */
}

/* Site Header - Fixed Navigation */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
}

/* Header Top Area */
.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: #7E0D0D; /* Deep Red */
  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,
.footer-logo {
  font-size: 24px;
  font-weight: bold;
  text-decoration: none;
  color: #F3C54D; /* Gold */
  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 Navigation Buttons */
.desktop-nav-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Mobile Navigation Buttons (hidden by default) */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default, shown on mobile */
  min-height: 48px;
  background-color: #C61F1F; /* Main Color */
  width: 100%;
  padding: 8px 20px;
}

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

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

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

/* Main Navigation */
.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: #C61F1F; /* Main Color */
  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 {
  text-decoration: none;
  color: #FFF1E8; /* Text Main */
  padding: 10px 15px;
  white-space: nowrap;
  transition: color 0.3s ease, background-color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
  color: #F3C54D; /* Gold */
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 25px;
  text-decoration: none;
  color: #FFF1E8; /* Text Main */
  font-weight: bold;
  background: linear-gradient(180deg, #FFB04A 0%, #D86A14 100%);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  text-align: center;
}

.btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Footer */
.site-footer {
  background-color: #140C0C; /* Background */
  padding: 40px 20px 20px;
  color: #FFF1E8; /* Text Main */
  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;
  border-bottom: 1px solid #6A1E1E; /* Border */
  padding-bottom: 30px;
}

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

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

.footer-logo {
  display: block;
  margin-bottom: 15px;
  font-size: 20px;
  color: #F3C54D; /* Gold */
}

.footer-description {
  line-height: 1.8;
  color: #FFF1E8;
  word-wrap: break-word; /* Ensure description text wraps */
  overflow-wrap: break-word;
}

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

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

.footer-nav a {
  color: #FFF1E8; /* Text Main */
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-nav a:hover {
  color: #F3C54D; /* Gold */
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #6A1E1E; /* Border */
  color: #FFF1E8;
}

.footer-bottom p {
  margin: 0;
}

/* Footer Slot Anchors - ensure they are visible */
.footer-slot-anchor-inner {
  min-height: 1px; /* Ensure slot is not completely collapsed */
}

/* Mobile Overlay */
.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 999;
}

.mobile-overlay.active {
  display: block;
}

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

  /* Mobile Body 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 4px rgba(0, 0, 0, 0.2);
  }

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

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

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

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

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

  .hamburger-menu {
    display: flex;
    position: absolute;
    left: 15px; /* Align with header-top padding */
    top: 50%;
    transform: translateY(-50%);
  }

  .mobile-nav-buttons {
    display: flex !important; /* Show on mobile */
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 8px 15px; /* Adjust padding for mobile */
    gap: 10px;
    flex-wrap: nowrap;
    overflow: hidden;
  }

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

  .main-nav {
    display: none; /* Hidden by default, shown by JS */
    flex-direction: column;
    position: fixed;
    top: var(--header-offset); /* Position below fixed header + mobile buttons */
    left: 0;
    width: 70%; /* Adjust width as needed */
    height: calc(100% - var(--header-offset)); /* Adjust height */
    background-color: #2A1212; /* Card BG */
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    z-index: 1001;
    box-shadow: 4px 0 8px rgba(0, 0, 0, 0.2);
  }

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

  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 15px;
    width: 100%;
    max-width: none;
    height: auto; /* Allow content to dictate height */
  }

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

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

  .footer-top-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-bottom: 20px;
  }

  .footer-col {
    text-align: center;
  }

  .footer-col h3,
  .footer-logo {
    text-align: center;
  }

  .footer-nav {
    display: flex;
    flex-direction: column;
    align-items: 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;
  }
}
