/* General Reset & Body */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-color);
  line-height: 1.6;
  padding-top: var(--header-offset); /* Important for fixed header */
  overflow-x: hidden; /* Prevent horizontal scroll on desktop */
}

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

/* Color Variables */
:root {
  --primary-color: #E53935; /* Red */
  --secondary-color: #FF5A4F; /* Orange-Red */
  --text-main: #333333;
  --bg-color: #F5F7FA;
  --card-bg: #FFFFFF;
  --border-color: #E0E0E0;
  --btn-gradient: linear-gradient(180deg, #FF5A4F 0%, #E53935 100%);
  
  /* Header Offset - Desktop */
  --header-offset: 122px; 
}

/* Site Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  background-color: transparent; /* Base, actual colors on header-top/main-nav */
}

/* Header Top */
.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: #C62828; /* Darker Red */
  width: 100%;
  color: #FFFFFF;
}

.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 30px; /* Adjusted padding */
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: #FFFFFF;
  text-decoration: none;
  display: block; /* Ensure visibility */
  line-height: 1;
}

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

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

/* Mobile Navigation Buttons - Hidden by default on desktop */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default */
  min-height: 48px;
  background-color: var(--bg-color); /* Light grey */
  width: 100%;
  padding: 0 15px;
}

/* Hamburger Menu - Hidden by default on desktop */
.hamburger-menu {
  display: none;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 25px;
  z-index: 1001;
  padding: 5px; /* Add padding to make it easier to click */
  box-sizing: content-box;
}

.hamburger-menu span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: #FFFFFF;
  border-radius: 2px;
  transition: all 0.3s ease-in-out;
}

/* Main Navigation */
.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex; /* Desktop default: flex */
  align-items: center;
  overflow: hidden;
  background-color: var(--card-bg); /* White */
  width: 100%;
}

.nav-container {
  box-sizing: border-box;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: row; /* Desktop default: row */
  justify-content: center;
  align-items: center;
  padding: 0 20px;
  flex-wrap: nowrap; /* Prevent wrapping on desktop */
}

.nav-link {
  color: var(--text-main);
  padding: 10px 15px;
  font-weight: 500;
  transition: color 0.3s ease, background-color 0.3s ease;
  white-space: nowrap; /* Prevent wrapping for nav links */
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 5px;
  background: var(--btn-gradient);
  color: #FFFFFF;
  font-weight: bold;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

.btn:hover {
  opacity: 0.9;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

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

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

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

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

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

.footer-description {
  margin: 0;
  line-height: 1.8;
  color: #CCCCCC;
  word-wrap: break-word; /* Ensure description wraps */
  overflow-wrap: break-word;
}

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

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

.footer-nav a {
  color: #E0E0E0;
  text-decoration: none;
  transition: color 0.3s ease;
}

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

.footer-legal {
  max-width: 1200px;
  margin: 30px auto 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
}

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

.footer-bottom p {
  margin: 0;
}

/* Dynamic Slot Anchors - ensure they are visible and do not hide content */
.footer-slot-anchor-inner {
  min-height: 1px; /* Ensure they take up space if empty */
  margin-top: 10px; /* Provide some spacing */
}

/* Mobile Responsive */
@media (max-width: 768px) {
  /* Header Offset - Mobile */
  :root {
    --header-offset: 110px;
  }
  
  body {
    padding-top: var(--header-offset);
  }

  /* 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;
  }

  /* Header Top */
  .header-top {
    min-height: 60px !important;
    height: 60px !important;
    padding: 0 15px; /* Adjust padding for mobile */
  }

  .header-container {
    width: 100%;
    max-width: none; /* No max-width on mobile */
    padding: 0; /* Handled by header-top padding */
    justify-content: space-between; /* Hamburger left, Logo center */
    position: relative; /* For absolute positioning of logo if needed */
  }
  
  /* Mobile Logo Centering (Method 1: Flexbox) */
  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    order: 2; /* Puts logo in center */
    position: static !important; /* Reset any absolute positioning */
    transform: none !important; /* Reset any transform */
    max-width: calc(100% - 100px); /* Leave space for hamburger and potential right element */
  }

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

  /* Hamburger Menu */
  .hamburger-menu {
    display: flex;
    order: 1; /* Puts hamburger on left */
    margin-right: auto; /* Push logo to center */
    background-color: transparent; /* Ensure no background interferes */
  }

  .hamburger-menu span {
    background-color: #FFFFFF;
  }

  /* Hamburger Active State */
  .hamburger-menu.active span:nth-child(1) {
    transform: translateY(11px) rotate(45deg);
  }
  .hamburger-menu.active span:nth-child(2) {
    opacity: 0;
  }
  .hamburger-menu.active span:nth-child(3) {
    transform: translateY(-11px) rotate(-45deg);
  }

  /* Desktop Nav Buttons - Hidden on mobile */
  .desktop-nav-buttons {
    display: none !important;
    order: 3; /* Keep order for consistency */
  }

  /* Mobile Nav Buttons - 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;
    gap: 10px;
    flex-wrap: nowrap;
    background-color: var(--bg-color); /* Match body background */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); /* Subtle shadow below buttons */
  }

  .mobile-nav-buttons .btn {
    flex: 1;
    min-width: 0;
    max-width: calc(50% - 5px); /* 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 Navigation - Mobile (hidden by default, fixed position) */
  .main-nav {
    display: none; /* Hidden by default */
    flex-direction: column; /* Vertical layout */
    position: fixed;
    top: var(--header-offset); /* Starts below the header */
    left: 0;
    width: 80%; /* Menu width */
    max-width: 300px;
    height: calc(100% - var(--header-offset)); /* Full height below header */
    background-color: var(--card-bg); /* White background for menu */
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    transform: translateX(-100%); /* Off-screen to the left */
    transition: transform 0.3s ease-in-out;
    overflow-y: auto; /* Scrollable if menu content is long */
    align-items: flex-start; /* Align menu items to the left */
    padding: 20px 0;
    box-sizing: border-box;
  }

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

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

  .nav-link {
    width: 100%;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    color: var(--text-main);
  }

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

  /* Overlay for mobile menu */
  .menu-overlay {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999; /* Below menu, above page content */
    cursor: pointer;
  }

  .menu-overlay.active {
    display: block;
  }

  /* Footer Mobile */
  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 20px;
  }
  .footer-col {
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }
  .footer-col:last-child {
    border-bottom: none;
  }
  .footer-legal {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
  }
  .footer-bottom {
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
  }
}

/* Ensure contrast */
.header-top .logo, .header-top .hamburger-menu span {
  color: #FFFFFF;
}
.header-top .btn { /* Buttons in header-top for desktop */
  color: #FFFFFF; /* Ensure button text is white */
}
.mobile-nav-buttons .btn {
  color: #FFFFFF; /* Ensure button text is white */
}
.main-nav .nav-link {
  color: var(--text-main); /* Ensure contrast with white background */
}
.main-nav .nav-link:hover, .main-nav .nav-link.active {
  color: var(--primary-color); /* Ensure contrast with light grey background */
}
.site-footer h3 {
  color: #FFFFFF;
}
.site-footer a {
  color: #E0E0E0;
}
.site-footer a:hover {
  color: var(--secondary-color);
}
.site-footer p {
  color: #CCCCCC;
}

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