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

body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: var(--text-main-color);
  background-color: var(--background-color);
  padding-top: var(--header-offset); /* Ensure content is not hidden by fixed header */
  overflow-x: hidden; /* Prevent horizontal scroll on body */
}

body.no-scroll {
  overflow: hidden;
}

/* Base styles for links and buttons */
a {
  text-decoration: none;
  color: var(--primary-color);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--accent-color) 0%, var(--primary-color) 100%);
  color: var(--card-bg-color); /* White text on button */
  font-weight: bold;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
  border: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn:hover {
  background: linear-gradient(180deg, var(--primary-color) 0%, var(--accent-color) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* Site Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  background-color: var(--card-bg-color); /* White background for header */
}

.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--primary-color); /* Main color for top bar */
  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: 28px;
  font-weight: bold;
  color: var(--card-bg-color); /* White logo text on primary background */
  text-decoration: none;
  display: block; /* Ensure logo is visible */
  height: 100%;
  display: flex; /* For vertical centering of text/img */
  align-items: center;
}

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

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

.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Mobile buttons hidden by default on desktop */
  min-height: 48px;
  background-color: var(--background-color); /* Light background for mobile buttons */
  width: 100%;
}

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

.hamburger-icon {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--card-bg-color); /* White hamburger icon */
  margin-bottom: 5px;
  transition: all 0.3s ease;
}

.hamburger-icon:last-child {
  margin-bottom: 0;
}

/* Hamburger menu active state */
.hamburger-menu.active .hamburger-icon:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger-menu.active .hamburger-icon:nth-child(2) {
  opacity: 0;
}

.hamburger-menu.active .hamburger-icon:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex; /* Desktop nav visible */
  align-items: center;
  overflow: hidden;
  background-color: var(--accent-color); /* Accent color for main nav */
  width: 100%;
  transition: transform 0.3s ease; /* For mobile menu animation */
}

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

.nav-link {
  color: var(--card-bg-color); /* White nav links */
  padding: 10px 15px;
  font-size: 16px;
  font-weight: bold;
  white-space: nowrap;
  transition: background-color 0.3s ease;
}

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

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

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

/* Site Footer */
.site-footer {
  background-color: var(--text-main-color); /* Dark background for footer */
  color: var(--card-bg-color); /* White text for footer */
  padding: 40px 20px 20px;
  font-size: 14px;
}

.site-footer a {
  color: var(--accent-color); /* Accent color for footer links */
}

.site-footer a:hover {
  text-decoration: underline;
}

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

.footer-col {
  display: flex;
  flex-direction: column;
}

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

.footer-description {
  line-height: 1.6;
  margin-bottom: 15px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.footer-heading {
  font-size: 18px;
  margin-bottom: 15px;
  color: var(--card-bg-color);
}

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

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

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

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

/* Footer slot anchors - ensure they are visible */
.footer-slot-anchor-inner {
  min-height: 1px; /* Ensure visibility for injection */
  margin-top: 10px; /* Small buffer */
}

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

  body {
    padding-top: var(--header-offset);
    overflow-x: hidden; /* Ensure body prevents horizontal scroll */
  }

  .header-top {
    min-height: 60px;
    height: 60px;
    padding: 0 15px; /* Apply padding directly to header-top */
  }

  .header-container {
    position: relative; /* For absolute positioning of logo */
    height: 100%;
    width: 100%;
    max-width: none; /* No max-width on mobile container */
    padding: 0; /* Remove container padding as header-top has it */
    display: flex; /* Still flex for hamburger and desktop buttons (hidden) */
    justify-content: space-between;
    align-items: center;
  }
  
  .hamburger-menu {
    display: block; /* Show hamburger on mobile */
    position: relative; /* Ensure it stays in flow for z-index */
    z-index: 2; /* Above logo if overlapping */
  }

  /* Specific CSS for image LOGO centering on mobile - Method 2 (forced centering) */
  .logo {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    max-width: calc(100% - 100px); /* Leave space for hamburger on left, and implied space on right */
    z-index: 1; /* Below hamburger */
  }

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

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

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    min-height: 48px;
    align-items: center;
    justify-content: center; /* Center buttons horizontally */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px; /* Padding for the button row */
    overflow: hidden; /* Prevent overflow */
    gap: 10px;
    flex-wrap: nowrap; /* Ensure buttons stay in one line */
    background-color: var(--background-color); /* Light background for mobile buttons */
  }

  .mobile-nav-buttons .btn {
    flex: 1;
    min-width: 0;
    max-width: calc(50% - 5px); /* Max width for two buttons with 10px gap */
    box-sizing: border-box;
    padding: 8px 12px;
    font-size: 13px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .main-nav {
    display: none; /* Hidden by default on mobile */
    position: fixed;
    top: var(--header-offset); /* Position below fixed header */
    left: 0;
    width: 80%; /* Sidebar width */
    max-width: 300px;
    height: calc(100% - var(--header-offset)); /* Full height below header */
    flex-direction: column; /* Vertical links */
    justify-content: flex-start;
    align-items: flex-start;
    padding: 20px 0;
    transform: translateX(-100%); /* Start off-screen */
    background-color: var(--accent-color); /* Same as desktop nav */
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    z-index: 1001; /* Above overlay */
    overflow-y: auto; /* Scrollable if many links */
  }

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

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

  .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; /* Single column on mobile */
  }

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

  .footer-col:last-child {
    margin-bottom: 0;
  }
  
  /* Mobile content 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;
  }
}
