:root {
  --primary-color: #2F6BFF;
  --secondary-color: #6FA3FF;
  --text-main-color: #1F2D3D;
  --text-black: #000000;
  --card-bg-color: #FFFFFF;
  --background-color: #F4F7FB;
  --border-color: #D6E2FF;
  --glow-color: #A5C4FF;
  --button-gradient: linear-gradient(180deg, #4A8BFF 0%, #2F6BFF 100%);
  --header-top-height-desktop: 68px;
  --main-nav-height-desktop: 52px;
  --header-offset: calc(var(--header-top-height-desktop) + var(--main-nav-height-desktop) + 2px);
  
  --header-top-height-mobile: 60px;
  --main-nav-height-mobile: 48px;
  --mobile-nav-buttons-min-height: 48px;
}

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(--background-color);
  overflow-x: hidden; /* Prevent horizontal scroll from layout issues */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.no-scroll {
  overflow: hidden;
}

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

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* 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: var(--card-bg-color); /* Fallback, specific colors will be applied to header-top and main-nav */
}

.header-top {
  box-sizing: border-box;
  height: var(--header-top-height-desktop);
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--primary-color); /* Darker blue for header top */
  color: #fff;
  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: #fff;
  text-transform: uppercase;
  display: block; /* Ensure logo is visible */
  flex-shrink: 0; /* Prevent logo from shrinking */
}

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

.desktop-nav-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0; /* Prevent buttons from shrinking */
}

/* Mobile nav buttons (hidden by default on desktop) */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden on desktop */
  min-height: var(--mobile-nav-buttons-min-height);
  background-color: var(--background-color); /* Light background for mobile buttons */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.main-nav {
  box-sizing: border-box;
  height: var(--main-nav-height-desktop);
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--secondary-color); /* Lighter blue for main nav */
  width: 100%;
}

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

.nav-link {
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  padding: 5px 0;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: var(--card-bg-color); /* White for hover */
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 25px;
  color: #fff;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  background: var(--button-gradient);
  transition: all 0.3s ease;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  line-height: 1;
}

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

/* Hamburger Menu (Desktop hidden) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 10px;
  position: relative;
  width: 30px;
  height: 30px;
  z-index: 1001; /* Above header */
  box-sizing: content-box;
}

.hamburger-icon {
  display: block;
  width: 25px;
  height: 3px;
  background-color: #fff;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.3s ease;
}

.hamburger-icon::before,
.hamburger-icon::after {
  content: '';
  display: block;
  width: 25px;
  height: 3px;
  background-color: #fff;
  position: absolute;
  transition: all 0.3s ease;
}

.hamburger-icon::before {
  top: -8px;
}

.hamburger-icon::after {
  top: 8px;
}

.hamburger-menu.active .hamburger-icon {
  background-color: transparent;
}

.hamburger-menu.active .hamburger-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.hamburger-menu.active .hamburger-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

/* Overlay for mobile menu */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999; /* Below menu, above content */
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.overlay.active {
  visibility: visible;
  opacity: 1;
}

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

.footer-top-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-cols-wrapper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

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

.footer-logo {
  font-size: 24px;
  font-weight: bold;
  color: #fff;
  text-transform: uppercase;
  display: block;
  margin-bottom: 15px;
}

.footer-description {
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
  word-wrap: break-word; /* Ensure description wraps */
  overflow-wrap: break-word;
}

.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-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
}

/* Footer slot anchors */
.footer-slot-anchor-inner {
  min-height: 1px; /* Ensure it takes up space if empty */
}

/* Responsive adjustments */
@media (max-width: 768px) {
  :root {
    --header-offset: calc(var(--header-top-height-mobile) + var(--mobile-nav-buttons-min-height) + 2px);
  }

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

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

  .site-header {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  }

  .header-top {
    height: var(--header-top-height-mobile);
  }

  .header-container {
    padding: 0 15px;
    justify-content: space-between; /* For hamburger and logo */
  }

  .hamburger-menu {
    display: block; /* Visible on mobile */
    order: -1; /* Place at the beginning */
  }

  .logo {
    flex: 1 !important; /* Allow logo to take space */
    display: flex !important;
    justify-content: center !important; /* Center logo */
    align-items: center !important;
    font-size: 24px; /* Smaller font for mobile logo */
  }
  .logo img {
    max-height: 56px !important; /* Mobile max-height for image logo */
  }

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

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap; /* Prevent buttons from wrapping */
    background-color: var(--background-color); /* Matches body bg */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  }

  .mobile-nav-buttons .btn {
    flex: 1;
    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;
    border-radius: 20px; /* Slightly smaller border radius */
    line-height: 1.2; /* Adjust line height for wrapped text */
  }

  .main-nav {
    height: auto; /* Auto height for expanded menu */
    min-height: var(--main-nav-height-mobile); /* Minimum height for closed state */
    position: fixed;
    top: calc(var(--header-top-height-mobile) + var(--mobile-nav-buttons-min-height)); /* Position below header top and mobile buttons */
    left: 0;
    width: 80%; /* Sidebar width */
    max-width: 300px;
    background-color: var(--primary-color); /* Menu background */
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 20px 0;
    transform: translateX(-100%); /* Hidden by default */
    transition: transform 0.3s ease;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    display: none; /* Hidden by default, toggled by JS */
    z-index: 1000;
    overflow-y: auto;
  }

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

  .nav-container {
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    width: 100%;
    max-width: none; /* No max-width for mobile container */
    padding: 0 15px;
    gap: 15px; /* Spacing between mobile nav links */
  }

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

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

  .site-footer {
    padding: 30px 0 15px;
  }

  .footer-cols-wrapper {
    grid-template-columns: 1fr; /* Single column layout for mobile */
    gap: 30px;
  }

  .footer-col:not(:first-child) {
    margin-top: 20px;
  }

  .footer-bottom {
    padding: 15px 15px 0;
  }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
}
