:root {
  --header-offset: 122px; /* Desktop: header-top (68px) + main-nav (52px) */
  --primary-color: #E53935;
  --accent-color: #FF5A4F;
  --card-bg: #FFFFFF;
  --page-bg: #F5F7FA;
  --text-main: #333333;
  --border-color: #E0E0E0;
}

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

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

/* --- Header Styles --- */
.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.1);
  background-color: var(--card-bg); /* Use card-bg as base for header, then specific sections */
}

.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: #A31E1B; /* Darker red from primary color 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 logo and buttons */
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: #FFFFFF; /* White for contrast */
  display: block;
  flex-shrink: 0;
}

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

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

.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden on desktop */
  min-height: 48px; /* Placeholder height, overridden on mobile */
  background-color: #E53935; /* Use primary color for mobile button bar */
  width: 100%;
  padding: 0 15px; /* Default padding, adjusted on mobile */
}

.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex; /* Visible on desktop */
  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: #FFFFFF;
  padding: 10px 15px;
  font-size: 15px;
  font-weight: 600;
  transition: background-color 0.3s ease;
  white-space: nowrap;
}

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

.hamburger-menu {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 24px;
  position: relative;
  z-index: 1001; /* Above logo on mobile */
  flex-shrink: 0;
}

.hamburger-menu .bar {
  display: block;
  width: 100%;
  height: 3px;
  background-color: #FFFFFF;
  border-radius: 2px;
  position: absolute;
  left: 0;
  transition: all 0.3s ease;
}

.hamburger-menu .bar:nth-child(1) { top: 0; }
.hamburger-menu .bar:nth-child(2) { top: 50%; transform: translateY(-50%); }
.hamburger-menu .bar:nth-child(3) { bottom: 0; }

.hamburger-menu.active .bar:nth-child(1) { top: 50%; transform: translateY(-50%) rotate(45deg); }
.hamburger-menu.active .bar:nth-child(2) { opacity: 0; }
.hamburger-menu.active .bar:nth-child(3) { bottom: 50%; transform: translateY(50%) rotate(-45deg); }

.overlay {
  display: none; /* Hidden on desktop */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  transition: opacity 0.3s ease;
  opacity: 0;
}

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

/* Button styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 25px; /* Rounded buttons */
  font-size: 16px;
  font-weight: bold;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  color: #FFFFFF;
  background: linear-gradient(180deg, var(--accent-color) 0%, var(--primary-color) 100%);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

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

/* --- Footer Styles --- */
.site-footer {
  background-color: #222222; /* Dark background for footer */
  color: #CCCCCC;
  padding: 40px 20px 20px;
  font-size: 14px;
}

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

.footer-col h3 {
  color: #FFFFFF;
  font-size: 18px;
  margin-bottom: 15px;
}

.footer-logo {
  font-size: 24px;
  font-weight: bold;
  color: #FFFFFF;
  margin-bottom: 15px;
  display: block;
}

.footer-description {
  line-height: 1.6;
  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: #CCCCCC;
  transition: color 0.3s ease;
}

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

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  color: #999999;
}

.footer-bottom a {
  pointer-events: none;
  cursor: default;
  text-decoration: none;
  color: inherit;
}

/* Dynamic slot anchor visibility */
.footer-slot-anchor, .footer-slot-anchor-inner {
  display: block;
  min-height: 1px; /* Ensure they take up at least 1px to be visible for injection */
}

/* Ensure no conflicts with body padding-top on other elements */
.page-xxx, .__hero-section, .__video-section, .__title-section {
  padding-top: 10px; /* Small decorative top padding, not header-offset */
}

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

  body {
    padding-top: var(--header-offset);
    overflow-x: hidden;
  }

  /* Header adjustments */
  .header-top {
    min-height: 60px !important;
    height: 60px !important;
  }

  .header-container {
    padding: 0 15px;
    width: 100%;
    max-width: none; /* Crucial for mobile container width */
    justify-content: flex-start; /* Adjust for hamburger menu */
  }

  .hamburger-menu {
    display: block; /* Visible on mobile */
    margin-right: 15px; /* Space between hamburger and logo */
  }

  .logo {
    flex: 1 !important; /* Take remaining space for centering */
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-size: 20px;
  }

  .logo img {
    max-height: 56px !important; /* Max height for mobile logo */
  }

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

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    min-height: 48px;
    height: auto; /* Allow content to dictate height */
    align-items: center;
    justify-content: center; /* Center buttons if only one, or for flex distribution */
    gap: 10px;
    flex-wrap: nowrap; /* Prevent buttons from wrapping */
    padding: 8px 15px; /* Adjusted padding for mobile button bar */
    background-color: #E53935; /* Same as main nav for consistency */
  }

  .mobile-nav-buttons .btn {
    flex: 1;
    min-width: 0; /* Allow shrinking */
    max-width: calc(50% - 5px); /* For two buttons with 10px gap */
    padding: 8px 12px; /* Smaller padding for mobile buttons */
    font-size: 13px; /* Smaller font for mobile buttons */
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    border-radius: 20px; /* Slightly less rounded */
    box-shadow: none; /* Remove shadow for mobile for cleaner look */
  }

  .main-nav {
    min-height: auto; /* Allow menu content to dictate height */
    height: 100vh; /* Full viewport height when active */
    width: 280px; /* Fixed width for slide-out menu */
    position: fixed;
    top: var(--header-offset); /* Position below fixed header */
    left: 0;
    transform: translateX(-100%); /* Hidden by default */
    transition: transform 0.3s ease;
    flex-direction: column; /* Vertical menu items */
    align-items: flex-start;
    justify-content: flex-start;
    padding-top: 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    display: none; /* Hidden by default, JS will change to flex/block */
    overflow-y: auto; /* Enable scrolling for long menus */
  }

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

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

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

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

  /* Footer adjustments */
  .site-footer {
    padding: 30px 15px 15px;
  }

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

  .footer-col h3 {
    margin-bottom: 10px;
  }

  .footer-logo {
    font-size: 20px;
  }

  /* Mobile 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;
  }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
