:root {
  --primary-color: #C61F1F;
  --secondary-color: #E53030;
  --button-gradient: linear-gradient(180deg, #FFB04A 0%, #D86A14 100%);
  --card-bg: #2A1212;
  --bg-color: #140C0C;
  --text-main: #FFF1E8;
  --border-color: #6A1E1E;
  --gold-color: #F3C54D;
  --deep-red-color: #7E0D0D;

  /* Desktop: header-top (68px) + main-nav (52px) = 120px. Add 2px for safety. */
  --header-offset: 122px;
}

/* Base Styles */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-color);
  padding-top: var(--header-offset); /* Crucial for fixed header */
  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 5px rgba(0, 0, 0, 0.2);
  background-color: var(--bg-color); /* Fallback background for header */
  box-sizing: border-box; /* Ensure padding/border is included in width */
}

/* Header Top Area */
.header-top {
  box-sizing: border-box;
  min-height: 68px; /* Desktop height */
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--deep-red-color); /* Distinct background 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; /* Padding for content inside container */
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--gold-color); /* Gold color for logo text */
  text-decoration: none;
  display: block; /* Ensure it's treated as a block for flex alignment */
  white-space: nowrap; /* Prevent logo text from wrapping */
}
.logo img {
  display: block;
  max-height: 60px; /* Max height for desktop logo */
  height: auto;
  width: auto;
  max-width: 280px;
  object-fit: contain;
}

/* Desktop Navigation Buttons */
.desktop-nav-buttons {
  display: flex; /* Visible on desktop */
  gap: 12px;
  align-items: center;
}

/* Mobile Navigation Buttons (hidden by default on desktop) */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden on desktop */
  min-height: 48px; /* Mobile height, but hidden on desktop */
  background-color: var(--card-bg); /* Background for mobile buttons when visible */
  width: 100%;
  padding: 0 15px; /* Add padding for mobile buttons */
}

/* Hamburger Menu (hidden by default on desktop) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 24px;
  position: relative;
  z-index: 1002; /* Above other header elements */
}
.hamburger-menu::before,
.hamburger-menu::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 3px;
  background-color: var(--text-main);
  left: 0;
  transition: all 0.3s ease;
}
.hamburger-menu::before { top: 0; }
.hamburger-menu::after { bottom: 0; }
.hamburger-menu.active::before {
  transform: rotate(45deg);
  top: 50%;
  margin-top: -1.5px;
}
.hamburger-menu.active::after {
  transform: rotate(-45deg);
  bottom: 50%;
  margin-bottom: -1.5px;
}
.hamburger-menu.active .middle-bar {
  opacity: 0;
}
.hamburger-menu .middle-bar {
  position: absolute;
  width: 100%;
  height: 3px;
  background-color: var(--text-main);
  left: 0;
  top: 50%;
  margin-top: -1.5px;
  transition: all 0.3s ease;
}

/* Main Navigation Area (Desktop) */
.main-nav {
  box-sizing: border-box;
  min-height: 52px; /* Desktop height */
  height: 52px;
  display: flex; /* Visible on desktop */
  align-items: center;
  overflow: hidden;
  background-color: #1A1A1A; /* Different background for main-nav */
  width: 100%;
  position: static; /* Desktop: normal flow */
}

.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);
  text-decoration: none;
  padding: 10px 15px;
  font-size: 16px;
  white-space: nowrap;
  transition: color 0.3s ease, background-color 0.3s ease;
}
.nav-link:hover {
  color: var(--gold-color);
  background-color: rgba(255, 255, 255, 0.1);
}

/* Buttons */
.btn {
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 5px;
  font-size: 15px;
  font-weight: bold;
  color: var(--text-main);
  background: var(--button-gradient);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  display: none; /* Hidden on desktop */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 999;
  transition: opacity 0.3s ease;
  opacity: 0;
  pointer-events: none; /* Allow clicks through when hidden */
}
.mobile-menu-overlay.active {
  opacity: 1;
  pointer-events: auto; /* Enable clicks when active */
}

/* Footer Styles */
.site-footer {
  background-color: var(--bg-color);
  color: var(--text-main);
  padding: 40px 20px 20px;
  font-size: 14px;
  line-height: 1.6;
  box-sizing: border-box;
  width: 100%;
}

.footer-top-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border-color); /* Add a border for separation */
}

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

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

.footer-description {
  color: var(--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 {
  margin-bottom: 8px;
}

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

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

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

/* Footer slot anchors (invisible, for system injection) */
.footer-slot-anchor, .footer-slot-anchor-inner {
  min-height: 1px; /* Ensure they exist in layout */
}

/* Mobile Styles */
@media (max-width: 768px) {
  /* Mobile: header-top (60px) + mobile-nav-buttons (48px) = 108px. Add 2px for safety. */
  :root {
    --header-offset: 110px;
  }
  body {
    padding-top: var(--header-offset);
    overflow-x: hidden; /* Ensure body overflow is hidden */
  }

  /* Prevent content images from overflowing */
  .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 1px 3px rgba(0, 0, 0, 0.2); /* Lighter shadow for mobile */
  }

  /* Header Top Area (Mobile) */
  .header-top {
    min-height: 60px !important; /* Mobile height */
    height: 60px !important;
  }

  .header-container {
    padding: 0 15px; /* Smaller padding for mobile */
    width: 100%;
    max-width: none; /* No max-width on mobile */
    justify-content: space-between; /* Hamburger left, Logo center, space right */
    position: relative; /* For absolute logo positioning if needed */
  }

  /* Hamburger Menu (visible on mobile) */
  .hamburger-menu {
    display: block; /* Visible on mobile */
    order: -1; /* Place at the beginning */
    width: 24px; /* Smaller hamburger */
    height: 20px;
    margin-right: auto; /* Push logo to center */
  }

  /* Logo Centering for Mobile */
  .logo {
    flex: 1 !important; /* Take available space */
    display: flex !important;
    justify-content: center !important; /* Center horizontally */
    align-items: center !important; /* Center vertically */
    padding-left: 0; /* Reset padding from desktop */
    padding-right: 0;
    font-size: 24px; /* Slightly smaller logo text */
  }
  .logo img {
    max-height: 56px !important; /* Max height for mobile logo */
  }

  /* Desktop Navigation Buttons (hidden on mobile) */
  .desktop-nav-buttons {
    display: none !important;
  }

  /* Mobile Navigation Buttons (visible on mobile) */
  .mobile-nav-buttons {
    display: flex !important; /* Visible on mobile */
    min-height: 48px;
    align-items: center;
    width: 100%;
    max-width: 100%; /* Ensure it takes full width */
    box-sizing: border-box;
    padding: 0 15px; /* Padding for mobile buttons */
    overflow: hidden; /* Prevent buttons from overflowing */
    gap: 10px; /* Space between buttons */
    flex-wrap: nowrap; /* Keep buttons on one line */
    background-color: var(--card-bg); /* Background for mobile buttons */
  }
  .mobile-nav-buttons .btn {
    flex: 1; /* Distribute space evenly */
    min-width: 0; /* Allow shrinking */
    max-width: calc(50% - 5px); /* Max width for two buttons with 10px gap */
    box-sizing: border-box;
    padding: 8px 12px; /* Smaller padding */
    font-size: 13px; /* Smaller font size */
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word; /* Ensure word wrapping */
    overflow-wrap: break-word;
  }

  /* Main Navigation Area (Mobile - hidden by default) */
  .main-nav {
    display: none; /* Hidden by default on mobile */
    position: fixed; /* Fixed position for mobile menu */
    top: var(--header-offset); /* Position below fixed header and mobile buttons */
    left: 0;
    width: 280px; /* Width of the mobile menu drawer */
    height: calc(100% - var(--header-offset)); /* Full height below header */
    background-color: var(--card-bg); /* Background for mobile menu */
    flex-direction: column; /* Vertical layout */
    padding: 20px 0;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3);
    transform: translateX(-100%); /* Slide out to the left */
    transition: transform 0.3s ease;
    z-index: 1001; /* Above overlay, below hamburger */
    overflow-y: auto; /* Allow scrolling for long menus */
  }
  .main-nav.active {
    display: flex; /* Show menu when active */
    transform: translateX(0); /* Slide in */
  }

  .nav-container {
    flex-direction: column; /* Vertical links */
    padding: 0;
    width: 100%;
    max-width: none; /* No max-width on mobile */
    justify-content: flex-start; /* Align links to top */
    align-items: flex-start; /* Align links to left */
  }

  .nav-link {
    width: 100%;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05); /* Subtle separator */
  }
  .nav-link:last-child {
    border-bottom: none;
  }

  /* Mobile Menu Overlay (visible when menu is active) */
  .mobile-menu-overlay {
    top: 0; /* Overlay covers entire screen */
    height: 100%;
    width: 100%;
  }

  /* Footer (Mobile) */
  .site-footer {
    padding: 30px 15px 15px; /* Smaller padding for mobile footer */
  }

  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column layout for mobile */
    gap: 30px;
  }

  .footer-col {
    text-align: center; /* Center footer content on mobile */
  }
  .footer-col:first-child {
    text-align: left;
  }
  .footer-col:first-child .footer-logo,
  .footer-col:first-child .footer-description {
    text-align: left;
  }

  .footer-bottom {
    padding-top: 15px;
  }
}

/* Ensure no-scroll class works for body */
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;
  }
}
