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

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding-top: var(--header-offset);
  background-color: var(--color-background);
  color: var(--color-text-main);
  line-height: 1.6;
  overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Base styles for all elements to ensure proper box model */
*, *::before, *::after {
  box-sizing: border-box;
}

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

a:hover {
  text-decoration: underline;
}

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

.btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(47, 107, 255, 0.4);
  text-decoration: none;
}

/* Header */
.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);
  background-color: var(--color-card-bg); /* Use white for header background */
}

.header-top {
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--color-primary); /* Distinct color for header-top */
  width: 100%;
  color: #FFFFFF;
}

.header-container {
  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 {
  font-size: 28px;
  font-weight: bold;
  color: #FFFFFF;
  text-decoration: none;
  display: flex; /* For potential image logo alignment */
  align-items: center;
  height: 100%;
}

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

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

/* Hamburger menu (hidden by default on desktop) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 24px;
  position: relative;
  z-index: 1002; /* Above logo if needed */
}

.hamburger-menu span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: #FFFFFF; /* Hamburger icon color */
  border-radius: 2px;
  position: absolute;
  left: 0;
  transition: all 0.3s ease;
}

.hamburger-menu span:nth-child(1) { top: 0; }
.hamburger-menu span:nth-child(2) { top: 10px; }
.hamburger-menu span:nth-child(3) { top: 20px; }

.hamburger-menu.active span:nth-child(1) {
  transform: translateY(10px) rotate(45deg);
}
.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
}
.hamburger-menu.active span:nth-child(3) {
  transform: translateY(-10px) rotate(-45deg);
}

.main-nav {
  min-height: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: var(--color-card-bg); /* Different color for main-nav */
  width: 100%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

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

.nav-link {
  color: var(--color-text-main);
  padding: 0 15px;
  font-size: 15px;
  font-weight: 500;
  height: 100%;
  display: flex;
  align-items: center;
  transition: color 0.3s ease;
  white-space: nowrap;
}

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

/* Mobile-specific buttons (hidden by default on desktop) */
.mobile-nav-buttons {
  display: none; /* Hidden on desktop */
  min-height: 48px; /* Fixed height for mobile button bar */
  background-color: var(--color-background); /* A light background for mobile buttons */
  width: 100%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Overlay for mobile menu */
.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0,0,0,0.5);
  z-index: 999;
  transition: opacity 0.3s ease;
  opacity: 0;
}

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

/* Footer */
.site-footer {
  background-color: var(--color-primary);
  color: #FFFFFF;
  padding: 40px 0 20px;
  font-size: 14px;
}

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

.footer-col {
  padding-bottom: 20px; /* For spacing between columns on smaller screens before stacking */
}

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

.footer-description {
  margin-top: 10px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.8);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.footer-title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 15px;
  color: #FFFFFF;
}

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

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

.footer-nav a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-nav a:hover {
  color: #FFFFFF;
  text-decoration: underline;
}

.footer-bottom {
  text-align: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.7);
}

.footer-bottom p {
  margin: 0;
}

/* Anchor slots must remain visible */
.footer-slot-anchor-inner {
  min-height: 1px; /* Ensure it takes up space if empty */
}

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

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

  .header-top {
    min-height: 60px;
    height: 60px;
  }

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

  /* Image/Text Logo Centering (Method 2: Absolute Positioning) */
  .logo {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important; /* Keep flex for potential image within */
    align-items: center !important;
    justify-content: center !important;
    max-width: calc(100% - 100px); /* Ensure space for hamburger on left */
    height: 100%; /* Occupy full height of header-top for centering */
  }
  .logo img {
    display: block !important;
    max-width: 100%;
    height: auto;
    max-height: 56px !important; /* Smaller logo for mobile */
    object-fit: contain;
  }

  .hamburger-menu {
    display: block; /* Show hamburger menu on mobile */
    position: relative; /* Keep it in flow */
    z-index: 1002; /* Ensure it's above the absolutely positioned logo */
    margin-right: auto; /* Pushes other content away if not using absolute for logo */
  }

  .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;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px; /* Padding for mobile buttons */
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
    background-color: var(--color-background); /* A light background for mobile buttons */
  }

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

  .main-nav {
    display: none; /* Hidden by default, shown via JS */
    position: fixed;
    top: var(--header-offset); /* Start below header and mobile buttons */
    left: 0;
    width: 80%; /* Menu width */
    max-width: 300px; /* Optional max width for menu */
    height: calc(100vh - var(--header-offset));
    background-color: var(--color-card-bg); /* Menu background */
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    transform: translateX(-100%); /* Off-screen initially */
    transition: transform 0.3s ease;
    z-index: 1001;
    overflow-y: auto;
  }

  .main-nav.active {
    display: flex; /* Must set display for it to show */
    transform: translateX(0); /* Slide into view */
  }

  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 0; /* No horizontal padding for menu items */
    width: 100%;
    max-width: none;
  }

  .nav-link {
    width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    justify-content: flex-start;
    color: var(--color-text-main);
  }

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

  /* Footer mobile layout */
  .footer-top-grid {
    grid-template-columns: 1fr; /* Stack columns */
    padding: 0 15px;
  }

  .footer-col {
    padding-bottom: 30px; /* More space between stacked columns */
  }

  .footer-col:last-of-type {
    padding-bottom: 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;
}
