/* Shared CSS */
:root {
  --header-offset: 122px; /* Desktop: 68px (header-top) + 52px (main-nav) + 2px = 122px */
  --primary-color: #2F6BFF;
  --auxiliary-color: #6FA3FF;
  --button-gradient: linear-gradient(180deg, #4A8BFF 0%, #2F6BFF 100%);
  --card-bg: #FFFFFF;
  --page-bg: #F4F7FB;
  --text-main: #1F2D3D;
  --text-black: #000000;
  --border-color: #D6E2FF;
  --glow-color: #A5C4FF;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  padding-top: var(--header-offset);
  overflow-x: hidden; /* Prevent horizontal scroll on mobile */
  background-color: var(--page-bg);
  color: var(--text-main);
  direction: ltr;
}

/* Header Styles */
.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);
}

.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px; /* Fixed height for desktop */
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--primary-color); /* Primary color for header top */
  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 {
  text-decoration: none;
  color: #FFFFFF; /* White for contrast */
  font-weight: bold;
  font-size: 24px;
  display: flex; /* For potential image logo alignment */
  align-items: center;
  height: 100%;
}

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

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

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

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

.btn-primary {
  background: var(--button-gradient);
}

.btn-secondary {
  background: var(--button-gradient); /* Use the same gradient for consistency, or a slight variation */
}

.hamburger-menu {
  display: none; /* Hidden on desktop */
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 25px;
  cursor: pointer;
  padding: 5px;
  z-index: 1001;
}

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

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

.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default on desktop */
  min-height: 48px; /* Fixed height for mobile button bar */
  width: 100%;
  background-color: var(--page-bg); /* Background color for mobile button bar */
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  z-index: 999; /* Below main nav but above content */
}

.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px; /* Fixed height for desktop */
  display: flex; /* Display flex for desktop */
  align-items: center;
  overflow: hidden;
  background-color: var(--auxiliary-color); /* Auxiliary color for main nav */
  width: 100%;
}

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

.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 25px; /* Spacing between menu items */
}

.main-nav ul li a {
  text-decoration: none;
  color: var(--text-black); /* Dark text for contrast with auxiliary color */
  font-weight: bold;
  padding: 10px 0;
  display: block;
  transition: color 0.3s ease;
  white-space: nowrap; /* Prevent menu items from wrapping */
}

.main-nav ul li a:hover {
  color: var(--primary-color);
}

/* Overlay for mobile 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: 998; /* Below hamburger and mobile menu */
  transition: opacity 0.3s ease;
  opacity: 0;
}

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

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

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

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

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

.footer-description {
  margin-bottom: 15px;
  line-height: 1.6;
  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 li a {
  text-decoration: none;
  color: var(--auxiliary-color); /* Auxiliary color for footer links */
  transition: color 0.3s ease;
}

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

.footer-slot-anchor-inner {
  /* This div is intended for dynamic content injection, keep it empty and visible */
  min-height: 1px; /* Ensure it takes up minimal space */
}

.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: rgba(255, 255, 255, 0.7);
}

.footer-bottom p {
  margin: 0;
}

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

  body {
    padding-top: var(--header-offset);
    overflow-x: hidden; /* Ensure body prevents horizontal scroll */
  }
  
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }

  /* Header adjustments for mobile */
  .header-top {
    min-height: 60px;
    height: 60px; /* Fixed height for mobile */
    padding: 0 15px; /* Smaller padding */
  }

  .header-container {
    padding: 0; /* Remove padding from container as header-top now has it */
    justify-content: space-between; /* To push hamburger left and logo center */
    align-items: center;
    position: relative; /* For absolute positioning of logo */
  }

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

  .logo img {
    max-height: 56px !important; /* Max height for mobile logo */
    max-width: 100%;
  }

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

  .hamburger-menu {
    display: flex; /* Show hamburger menu on mobile */
    position: relative;
    z-index: 1001; /* Ensure it's above other elements */
  }
  
  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    min-height: 48px; /* Fixed height for mobile button bar */
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px; /* Padding for the button bar */
    overflow: hidden;
    gap: 10px; /* Gap between buttons */
    flex-wrap: nowrap; /* Prevent buttons from wrapping */
  }

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

  .main-nav {
    min-height: auto; /* Allow height to adapt */
    height: auto;
    position: fixed; /* Fixed position for off-screen menu */
    top: var(--header-offset); /* Below header and mobile buttons */
    left: 0;
    width: 80%; /* Menu width */
    max-width: 300px; /* Max width for menu */
    height: calc(100vh - var(--header-offset)); /* Full height minus header */
    flex-direction: column; /* Vertical menu */
    justify-content: flex-start;
    align-items: flex-start;
    padding: 20px 0;
    transform: translateX(-100%); /* Start off-screen */
    transition: transform 0.3s ease-in-out;
    background-color: var(--auxiliary-color); /* Same as desktop main nav */
    z-index: 1000; /* Above overlay */
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
    display: none; /* Hidden by default for display property */
  }

  .main-nav.active {
    transform: translateX(0); /* Slide into view */
    display: flex; /* Make it visible */
  }

  .main-nav .nav-container {
    flex-direction: column;
    width: 100%;
    max-width: none; /* Remove max-width for mobile */
    padding: 0;
    height: auto;
    overflow-y: auto; /* Enable scrolling for long menus */
  }

  .main-nav ul {
    flex-direction: column;
    width: 100%;
    gap: 0; /* Remove gap for vertical menu */
  }

  .main-nav ul li {
    width: 100%;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  }

  .main-nav ul li:last-child {
    border-bottom: none;
  }

  .main-nav ul li a {
    padding: 15px 20px;
    width: 100%;
    box-sizing: border-box;
    white-space: normal; /* Allow menu text to wrap */
  }

  /* Footer adjustments for mobile */
  .site-footer {
    padding: 30px 15px 15px;
  }

  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column layout */
    margin-bottom: 20px;
  }

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

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

/* Ensure body scroll is controlled when menu is open */
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;
}
