html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: #333333; /* Text Main */
  background-color: #F5F7FA; /* Background */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden; /* Prevent horizontal scroll */
}
a {
  text-decoration: none;
  color: inherit;
}
ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Header Offset - MUST BE HERE */
:root { --header-offset: 122px; } /* 68px (header-top) + 52px (main-nav) + 2px buffer */
body { padding-top: var(--header-offset); }

/* Site Header - Fixed & Suspended */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Header Top Bar */
.header-top {
  box-sizing: border-box;
  min-height: 68px; /* Desktop fixed height */
  height: 68px; /* Desktop fixed height */
  display: flex;
  align-items: center;
  background-color: #B71C1C; /* Darker Red, different from main-nav */
  color: #FFFFFF;
  padding: 0 40px; /* Desktop padding */
}

.header-top .logo {
  font-size: 28px;
  font-weight: bold;
  color: #FFFFFF;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
  line-height: 1; /* Ensure single line height */
}
/* If logo is an image, style img tag inside .logo */
.header-top .logo img {
  display: block;
  max-height: 60px; /* Desktop image max height */
  height: auto;
  width: auto;
  max-width: 280px;
  object-fit: contain;
}

/* Header Desktop Content (for desktop layout of buttons) */
.header-desktop-content {
  display: flex; /* Visible on desktop */
  flex-grow: 1; /* Occupy available space */
  justify-content: flex-end; /* Push buttons to the right */
  align-items: center;
}

/* Hamburger Menu - Hidden on Desktop */
.hamburger-menu {
  display: none; /* Hidden by default on desktop */
  cursor: pointer;
  width: 30px;
  height: 20px;
  position: relative;
  z-index: 1001; /* Above header-top content */
  margin-right: 20px; /* Space between hamburger and logo on mobile */
}
.hamburger-menu span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: #FFFFFF;
  position: absolute;
  left: 0;
  transition: all 0.3s ease;
}
.hamburger-menu span:nth-child(1) { top: 0; }
.hamburger-menu span:nth-child(2) { top: 8px; }
.hamburger-menu span:nth-child(3) { top: 16px; }
.hamburger-menu.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger-menu.active span:nth-child(2) { opacity: 0; }
.hamburger-menu.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }


/* Desktop Nav Buttons */
.desktop-nav-buttons {
  display: flex; /* Visible on desktop */
  gap: 12px;
  align-items: center;
}
.desktop-nav-buttons .btn {
  padding: 10px 20px;
  border-radius: 5px;
  font-size: 15px;
  font-weight: bold;
  text-decoration: none;
  color: #FFFFFF;
  background: linear-gradient(180deg, #FF5A4F 0%, #E53935 100%); /* Button gradient */
  white-space: nowrap;
  transition: opacity 0.3s ease;
}
.desktop-nav-buttons .btn:hover {
  opacity: 0.9;
}

/* Mobile Nav Buttons - Hidden on Desktop */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default on desktop */
  min-height: 48px; /* Mobile fixed height */
  background-color: #E53935; /* Primary Red */
  width: 100%;
  padding: 0 15px; /* Mobile container padding */
  align-items: center;
  justify-content: center;
}

/* Main Navigation Bar */
.main-nav {
  box-sizing: border-box;
  min-height: 52px; /* Desktop fixed height */
  height: 52px; /* Desktop fixed height */
  display: flex; /* Visible on desktop */
  align-items: center;
  background-color: #E53935; /* Primary Red, different from header-top */
  width: 100%;
  overflow: hidden; /* For transition */
}
.main-nav .nav-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: center; /* Center menu items */
  align-items: center;
  height: 100%;
  padding: 0 20px; /* Container padding */
}
.main-nav .nav-link {
  display: flex;
  align-items: center;
  padding: 0 15px;
  height: 100%;
  color: #FFFFFF;
  font-size: 16px;
  font-weight: bold;
  white-space: nowrap;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.main-nav .nav-link:hover,
.main-nav .nav-link.active {
  background-color: rgba(255, 255, 255, 0.1);
  color: #FF5A4F; /* Secondary color for active/hover */
}

/* Mobile Nav Overlay */
.mobile-nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 998; /* Below menu, above content */
  display: none; /* Hidden by default */
}
.mobile-nav-overlay.active {
  display: block;
}

/* Footer Styles */
.site-footer {
  background-color: #333333; /* Dark background */
  color: #F5F7FA; /* Light text */
  padding: 40px 20px 20px;
  font-size: 14px;
}
.site-footer a {
  color: #FF5A4F; /* Secondary color for links */
  transition: color 0.3s ease;
}
.site-footer a:hover {
  color: #E53935; /* Primary color on hover */
}

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

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

.footer-col .footer-logo {
  font-size: 24px;
  font-weight: bold;
  color: #FFFFFF;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
  margin-bottom: 15px;
}

.footer-col .footer-description {
  margin-bottom: 15px;
  word-wrap: break-word; /* Ensure description wraps */
  overflow-wrap: break-word;
}

.footer-col .footer-nav li {
  margin-bottom: 8px;
}
.footer-col .footer-nav li:last-child {
  margin-bottom: 0;
}

/* Footer Dynamic Slots Visibility */
.footer-slot-anchor-inner {
  /* Anchor containers must be visible for content injection */
  display: block;
  min-height: 1px; /* Ensure they take up minimal space if empty */
  width: 100%;
  box-sizing: border-box;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}
.footer-bottom p {
  margin: 0;
}

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

  /* Header Top Bar - Mobile */
  .header-top {
    min-height: 60px !important; /* Mobile fixed height */
    height: 60px !important; /* Mobile fixed height */
    padding: 0 15px; /* Mobile padding */
    justify-content: space-between; /* Hamburger left, logo center, space right */
  }

  /* Hamburger Menu - Visible on Mobile */
  .hamburger-menu {
    display: block; /* Visible on mobile */
    order: -1; /* Place on the left */
  }
  
  /* Logo - Centered on Mobile */
  .header-top .logo {
    flex: 1 !important; /* Occupy remaining space */
    display: flex !important; /* Use flex to center */
    justify-content: center !important; /* Center the logo horizontally */
    align-items: center !important; /* Center the logo vertically */
    height: 100%;
    margin: 0; /* Reset any default margins */
  }
  .header-top .logo img {
    max-height: 56px !important; /* Mobile image max height */
  }

  /* Header Desktop Content - Hidden on Mobile */
  .header-desktop-content {
    display: none;
  }

  /* Mobile Nav Buttons - Visible on Mobile */
  .mobile-nav-buttons {
    display: flex !important; /* Visible on mobile */
    min-height: 48px;
    align-items: center;
    width: 100%; max-width: 100%;
    box-sizing: border-box;
    padding-left: 15px; padding-right: 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap; /* Ensure buttons stay on one line */
    background-color: #E53935; /* Primary Red */
  }
  .mobile-nav-buttons .btn {
    flex: 1; min-width: 0;
    max-width: calc(50% - 5px); /* Account for gap */
    box-sizing: border-box;
    padding: 8px 12px;
    font-size: 13px;
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Main Navigation Bar - Hidden by default on Mobile, fixed position */
  .main-nav {
    display: none; /* Hidden by default */
    position: fixed;
    top: var(--header-offset); /* Below header-top and mobile-nav-buttons */
    left: 0;
    width: 80%; /* Sidebar width */
    max-width: 300px;
    height: calc(100% - var(--header-offset)); /* Fill remaining height */
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    background-color: #E53935; /* Primary Red */
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    transform: translateX(-100%); /* Start off-screen */
    transition: transform 0.3s ease;
    z-index: 1001; /* Above overlay */
    overflow-y: auto; /* Enable scrolling for long menus */
  }
  .main-nav.active {
    display: flex; /* Show when active */
    transform: translateX(0); /* Slide in */
  }
  .main-nav .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 0;
    max-width: none; /* Remove max-width constraint */
  }
  .main-nav .nav-link {
    width: 100%;
    padding: 12px 20px;
    justify-content: flex-start;
  }

  /* Mobile Nav Overlay - Active state */
  .mobile-nav-overlay.active {
    display: block;
  }

  /* Footer - Mobile Layout */
  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column */
  }
  .footer-col {
    text-align: center;
  }
  .footer-col .footer-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  /* Prevent content overflow */
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: hidden;
  }
}

/* Body no-scroll class for mobile menu */
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;
  }
}
/* 内容保护（系统追加，请勿删除） */
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
input, textarea, select, [contenteditable="true"] {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}
