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

html {
  scroll-behavior: smooth;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding-top: var(--header-offset); /* Important: body padding for fixed header */
  color: var(--text-main-color);
  background-color: var(--site-bg-color);
  overflow-x: hidden; /* Prevent horizontal scroll from initial content */
}

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

a:hover {
  text-decoration: underline;
}

/* Site Header - Fixed Navigation */
.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.2);
  background-color: var(--card-bg-color); /* Fallback, main colors are on sub-elements */
}

/* Header Top Section */
.header-top {
  box-sizing: border-box;
  min-height: 68px; /* Desktop fixed height */
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: #222222; /* Dark background for contrast */
  color: #FFFFFF;
  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 content inside container */
}

/* Logo */
.logo {
  font-size: 28px;
  font-weight: bold;
  color: #FFFFFF;
  text-decoration: none;
  display: block; /* Ensure visibility */
  height: 100%; /* Make logo take full height of header-top */
  display: flex; /* For vertical centering of text logo */
  align-items: center;
  white-space: nowrap; /* Prevent logo text from wrapping */
}

/* Image Logo (if used) */
.logo img {
  display: block;
  max-height: 60px; /* Desktop max height */
  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; /* Mobile fixed height for this bar */
  background-color: var(--site-bg-color); /* Neutral background */
  padding: 10px 20px; /* Add padding for visual separation */
  justify-content: center; /* Center buttons when visible */
  align-items: center;
  width: 100%;
  overflow: hidden; /* Prevent overflow */
}

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

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

.nav-link {
  color: #FFFFFF;
  text-decoration: none;
  padding: 8px 0;
  font-weight: bold;
  font-size: 16px;
  white-space: nowrap;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: var(--secondary-color);
  text-decoration: none;
}

/* Hamburger Menu (hidden by default on desktop) */
.hamburger-menu {
  display: none; /* Hidden by default */
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 25px;
  cursor: pointer;
  z-index: 1001; /* Above header */
}

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

/* Hamburger menu active state (X icon) */
.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);
}

/* Overlay for mobile menu */
.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 999; /* Below menu, above body */
}
.overlay.active {
  display: block;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 5px;
  font-size: 15px;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #FFFFFF; /* White text for all buttons */
  background: linear-gradient(180deg, var(--secondary-color) 0%, var(--primary-color) 100%); /* Button gradient */
  border: none;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  min-width: 80px; /* Ensure minimum width for buttons */
  /* Contrast check: White text on red/orange gradient is usually good */
}

.btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  text-decoration: none;
  color: #FFFFFF;
}

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

.footer-col h3 {
  color: #FFFFFF; /* White for headings */
  font-size: 18px;
  margin-bottom: 15px;
}

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

.footer-description {
  line-height: 1.6;
  word-wrap: break-word; /* Ensure description wraps */
  overflow-wrap: break-word;
  color: #AAAAAA; /* Lighter grey for body text */
}

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

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

.footer-nav a {
  color: #CCCCCC; /* Lighter grey for links */
  text-decoration: none;
  transition: color 0.3s ease;
}

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

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

.footer-bottom {
  border-top: 1px solid #444444;
  padding-top: 20px;
  margin-top: 20px;
  text-align: center;
  color: #AAAAAA;
}

.footer-bottom p {
  margin: 0;
  line-height: 1.5;
}

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

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

  /* Mobile Content Overflow Protection */
  .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 adjustments for mobile */
  .header-top {
    min-height: 60px !important;
    height: 60px !important;
  }

  .header-container {
    width: 100%;
    max-width: none;
    padding: 0 15px;
    position: relative; /* For absolute positioning of logo */
  }

  .hamburger-menu {
    display: flex; /* Show hamburger menu on mobile */
    z-index: 1001;
  }

  /* Mobile Logo Centering (Method 1: Flexbox) */
  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    height: 100%;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 100px); /* Leave space for hamburger */
  }
  .logo img {
    max-height: 56px !important; /* Mobile max height */
  }

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

  /* Mobile Navigation Buttons */
  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    min-height: 48px;
    background-color: var(--site-bg-color);
    padding: 8px 15px;
    gap: 10px;
    flex-wrap: nowrap;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  }

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

  /* Main Navigation (Hamburger Menu Content) */
  .main-nav {
    display: none; /* Hidden by default on mobile */
    position: fixed;
    top: var(--header-offset); /* Position below fixed header and mobile buttons */
    left: 0;
    width: 80%; /* Menu width */
    max-width: 300px;
    height: calc(100% - var(--header-offset)); /* Fill remaining height */
    background-color: #333333; /* Dark background for mobile menu */
    flex-direction: column; /* Vertical layout for menu items */
    padding: 20px 0;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3);
    transform: translateX(-100%); /* Off-screen by default */
    transition: transform 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    height: auto; /* Allow content to dictate height */
  }

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

  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    max-width: none;
    padding: 0 20px;
    gap: 15px;
  }

  .nav-link {
    width: 100%;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    font-size: 16px;
  }
  .nav-link:last-child {
    border-bottom: none;
  }

  .overlay.active {
    display: block;
  }

  /* Footer adjustments for mobile */
  .footer-top-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .footer-col {
    text-align: center;
  }

  .footer-nav li {
    text-align: center;
  }
}

/* Ensure no-scroll class works for body */
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;
}
