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

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding-top: var(--header-offset);
  color: var(--text-main-color);
  background-color: var(--site-bg-color);
  line-height: 1.6;
  overflow-x: hidden; /* Prevent body overflow on mobile */
}

a {
  text-decoration: none;
  color: var(--primary-color);
}

a:hover {
  color: var(--secondary-color);
}

.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-color); /* Overall header background, sections will override */
}

.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--primary-color); /* Distinct background for top bar */
  width: 100%;
  padding: 0 20px; /* Default padding for desktop */
}

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

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--card-bg-color); /* White text for logo on primary background */
  text-transform: uppercase;
  display: block;
}

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

.desktop-nav-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn {
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: bold;
  text-decoration: none;
  white-space: nowrap;
  text-align: center;
  box-sizing: border-box;
  transition: all 0.3s ease;
  color: var(--card-bg-color); /* White text on buttons */
  background: linear-gradient(180deg, #FF5A4F 0%, #E53935 100%); /* Button gradient */
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

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

/* Mobile nav buttons - hidden by default, shown on mobile */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default on desktop */
  min-height: 48px;
  background-color: var(--site-bg-color); /* Light background for mobile buttons */
  padding: 10px 20px;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex; /* Desktop: show main nav */
  align-items: center;
  overflow: hidden;
  background-color: var(--card-bg-color); /* Distinct background for main nav */
  width: 100%;
  border-top: 1px solid var(--border-color); /* Separator */
}

.nav-container {
  box-sizing: border-box;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: row; /* Desktop: horizontal menu */
  justify-content: center;
  align-items: center;
  padding: 0 20px;
}

.nav-link {
  padding: 10px 15px;
  color: var(--text-main-color);
  font-weight: bold;
  white-space: nowrap;
  transition: color 0.3s ease, background-color 0.3s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary-color);
  background-color: var(--site-bg-color);
  border-radius: 4px;
}

.hamburger-menu {
  display: none; /* Hidden by default on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1001;
  position: relative;
}

.hamburger-menu span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--card-bg-color); /* White lines on primary background */
  margin: 5px 0;
  transition: all 0.3s ease;
}

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

/* Footer styles */
.site-footer {
  background-color: var(--primary-color);
  color: var(--card-bg-color);
  padding: 40px 20px 20px;
  font-size: 14px;
  line-height: 1.8;
}

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

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

.footer-logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--card-bg-color);
  text-transform: uppercase;
  margin-bottom: 15px;
  display: block;
}

.footer-description {
  color: rgba(255, 255, 255, 0.8);
  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: rgba(255, 255, 255, 0.8);
  transition: color 0.3s ease;
}

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

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

.footer-slot-anchor-inner {
  min-height: 1px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  max-width: 1200px;
  margin: 0 auto;
}

.footer-bottom p {
  margin: 0;
}

/* Mobile specific styles */
@media (max-width: 768px) {
  :root {
    --header-offset: 110px; /* Mobile: 60px (header-top) + 48px (mobile-nav-buttons) + 48px (main-nav) = 156px. Re-evaluating: header-top (60) + main-nav (48) = 108px + 2px buffer = 110px. mobile-nav-buttons is below header-top, above main-nav, so it adds to the offset. If main-nav is fixed, then mobile-nav-buttons adds to the body padding-top. If it's *between* header-top and main-nav (when main-nav is hidden), then the offset is just header-top + mobile-nav-buttons. Let's assume mobile-nav-buttons is part of the fixed header's height when visible. So, header-top(60) + mobile-nav-buttons(48) + main-nav(0 when hidden) = 108px. When main-nav is open, it slides over content. So 110px is correct for body padding-top. */
  }

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

  body.no-scroll {
    overflow: hidden;
  }

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

  .header-top {
    min-height: 60px !important;
    height: 60px !important;
    padding: 0 15px; /* Smaller padding for mobile */
    justify-content: space-between; /* Hamburger left, logo middle (flex-1 for logo), empty space right */
  }

  .header-container {
    width: 100%;
    max-width: none; /* No max-width on mobile */
    padding: 0; /* Handled by header-top padding */
    position: relative; /* For absolute positioning of logo if needed */
  }

  .logo {
    flex: 1 !important; /* Take available space */
    display: flex !important;
    justify-content: center !important; /* Center logo */
    align-items: center !important;
    font-size: 24px;
  }

  .logo img {
    max-height: 56px !important; /* Matches mobile header-top height */
  }

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

  .hamburger-menu {
    display: block; /* Show hamburger on mobile */
    order: -1; /* Place hamburger first (left) */
    margin-right: auto; /* Push logo to center */
    padding: 5px; /* Adjust padding for better touch target */
  }

  .header-top .header-container::after {
    content: '';
    width: 45px; /* Approximate width of hamburger menu to balance logo */
    height: 1px;
    display: block;
  }

  /* Mobile nav buttons - always visible on mobile */
  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    min-height: 48px;
    align-items: center;
    justify-content: center; /* Center buttons if only one */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding-left: 15px;
    padding-right: 15px;
    overflow: hidden; /* Prevent overflow */
    gap: 10px; /* Space between buttons */
    flex-wrap: nowrap; /* Prevent buttons from wrapping */
    background-color: var(--site-bg-color);
  }

  .mobile-nav-buttons .btn {
    flex: 1; /* Distribute space equally */
    min-width: 0; /* Allow shrinking */
    max-width: calc(50% - 5px); /* Max width for two buttons with gap */
    padding: 8px 12px; /* Smaller padding */
    font-size: 13px; /* Smaller font size */
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .main-nav {
    display: none; /* Hide main nav by default on mobile, controlled by JS */
    position: fixed;
    top: var(--header-offset); /* Position below fixed header and mobile buttons */
    left: 0;
    width: 280px; /* Mobile menu width */
    height: calc(100% - var(--header-offset)); /* Fill remaining height */
    background-color: var(--card-bg-color);
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    flex-direction: column; /* Vertical menu */
    transform: translateX(-100%); /* Hide off-screen */
    transition: transform 0.3s ease;
    z-index: 999; /* Below hamburger, above content */
    align-items: flex-start; /* Align menu items to left */
    overflow-y: auto; /* Allow scrolling for long menus */
    padding: 20px 0;
  }

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

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

  .nav-link {
    width: 100%;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    box-sizing: border-box;
  }

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

  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
  }

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

  .footer-mid-slots {
    grid-template-columns: 1fr; /* Single column on mobile */
  }
}

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

.overlay.active {
  display: block;
  opacity: 1;
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
}
