/* Global Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #1F2D3D; /* Text Main */
  background-color: #F4F7FB; /* Background */
  padding-top: var(--header-offset); /* Important: Body padding for fixed header */
  overflow-x: hidden; /* For mobile content overflow protection */
}

a {
  text-decoration: none;
  color: #2F6BFF; /* Primary */
}

a:hover {
  text-decoration: underline;
}

ul {
  list-style: none;
}

/* Header Offset Variables */
:root {
  --header-offset: 122px; /* Desktop: 68px (header-top) + 52px (main-nav) + buffer */
}

/* Site Header - Fixed & Global */
.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); /* Suspended effect */
  background-color: #2F6BFF; /* Primary color for header base */
}

/* Header Top Section */
.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: #2F6BFF; /* Primary color */
}

.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 */
.logo, .footer-logo {
  font-size: 28px;
  font-weight: bold;
  color: #FFFFFF;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block; /* Ensure it takes up space */
  line-height: 1;
}

.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; /* Visible on desktop */
  gap: 12px;
  align-items: center;
}

/* Buttons General Styling */
.btn {
  padding: 10px 20px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: bold;
  font-size: 15px;
  white-space: nowrap;
  cursor: pointer;
  text-align: center;
  transition: all 0.3s ease;
  color: #FFFFFF; /* Text on button */
  background: linear-gradient(180deg, #4A8BFF 0%, #2F6BFF 100%); /* Button Gradient */
  border: 1px solid #2F6BFF;
  box-shadow: 0 4px 10px rgba(47, 107, 255, 0.3); /* Glow */
}

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

/* Mobile Navigation Buttons - Hidden by default on desktop */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden on desktop */
  min-height: 48px; /* Mobile height */
  background-color: #2F6BFF; /* Primary color */
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* Main Navigation */
.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex; /* Desktop default: visible, horizontal */
  align-items: center;
  overflow: hidden;
  background-color: #6FA3FF; /* Secondary color, distinct from header-top */
  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;
  gap: 25px; /* Spacing between menu items */
}

.main-nav .nav-link {
  color: #FFFFFF; /* Text on nav */
  font-size: 16px;
  font-weight: bold;
  padding: 5px 0;
  white-space: nowrap;
  transition: color 0.3s ease;
}

.main-nav .nav-link:hover {
  color: #D6E2FF; /* Lighter hover color */
  text-decoration: none;
}

/* Hamburger Menu (Mobile Only) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  width: 30px;
  height: 24px;
  position: relative;
  cursor: pointer;
  z-index: 1002; /* Above header */
  flex-direction: column;
  justify-content: space-between;
  padding: 5px 0;
}

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

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

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  display: none; /* Hidden by default */
}

.mobile-menu-overlay.active {
  display: block; /* Visible when active */
}

/* Footer Styling */
.site-footer {
  background-color: #1F2D3D; /* Text Main for footer background */
  color: #FFFFFF;
  padding: 40px 0 20px;
  font-size: 14px;
  line-height: 1.8;
}

.site-footer a {
  color: #6FA3FF; /* Secondary for links */
}

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

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

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

.footer-col.footer-about {
  grid-column: span 1; /* Default span for 4 cols */
}

.footer-logo {
  font-size: 24px;
  margin-bottom: 15px;
  display: inline-block;
}

.footer-description {
  margin-bottom: 15px;
  color: rgba(255,255,255,0.8);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

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

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

.footer-nav a {
  display: block;
  white-space: nowrap; /* Prevent breaking on desktop */
}

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

.footer-bottom p {
  margin: 0;
}

.footer-slot-anchor-inner {
  min-height: 1px; /* Ensure slot exists in layout */
}

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

  body {
    overflow-x: hidden;
  }

  /* Header Top Section for Mobile */
  .header-top {
    min-height: 60px !important;
    height: 60px !important;
    padding: 0 15px; /* Adjust padding for mobile */
    justify-content: space-between; /* Hamburger left, logo center, space right */
  }

  .header-container {
    width: 100%;
    max-width: none; /* Remove max-width on mobile */
    padding: 0; /* Handled by header-top padding */
    position: relative; /* For absolute logo centering */
  }

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

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

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

  /* Show Mobile Buttons */
  .mobile-nav-buttons {
    display: flex !important; /* Visible on mobile */
    min-height: 48px;
    align-items: center;
    width: 100%; max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px; /* Mobile padding */
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap; /* Ensure buttons stay in one row */
    justify-content: center;
    background-color: #2F6BFF; /* Primary color */
  }

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

  /* Hamburger Menu Visible on Mobile */
  .hamburger-menu {
    display: flex; /* Visible on mobile */
    order: -1; /* Place it to the left */
    margin-right: auto; /* Push logo to center */
  }

  /* Main Navigation (Mobile - Hidden by default, slides in) */
  .main-nav {
    display: none; /* Hidden by default */
    position: fixed;
    top: var(--header-offset); /* Below the fixed header */
    left: 0;
    width: 75%; /* Slide-in width */
    max-width: 300px; /* Max width for mobile menu */
    height: calc(100% - var(--header-offset)); /* Full height below header */
    background-color: #1F2D3D; /* Darker background for mobile menu */
    flex-direction: column;
    padding: 20px 0;
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
    transform: translateX(-100%); /* Start off-screen */
    transition: transform 0.3s ease;
    z-index: 1001; /* Above overlay, below hamburger */
    overflow-y: auto; /* Enable scrolling for long menus */
  }

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

  .main-nav .nav-container {
    flex-direction: column;
    align-items: flex-start; /* Align menu items to the left */
    padding: 0 20px;
    gap: 15px;
    width: 100%;
    max-width: none; /* Remove max-width */
    height: auto;
  }

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

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

  /* Footer Mobile */
  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
    padding: 0 15px;
  }

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

  .footer-col.footer-about {
    grid-column: span 1;
  }

  .footer-title {
    text-align: center; /* Center footer titles */
    margin-bottom: 10px;
  }

  .footer-nav {
    text-align: center; /* Center footer links */
  }

  .footer-nav a {
    white-space: normal; /* Allow footer links to wrap */
  }

  .footer-bottom {
    padding-left: 15px;
    padding-right: 15px;
  }

  /* 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;
  }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
}
