:root {
  --bg-color: #0D0E12;
  --card-bg-color: #17191F;
  --text-main-color: #FFF3E6;
  --primary-color: #FF8C1A;
  --secondary-color: #FFA53A;
  --button-gradient: linear-gradient(180deg, #FFA53A 0%, #D96800 100%);
  --border-color: #A84F0C;
  --glow-color: #FFB04D;
  --deep-orange-color: #D96800;

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

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding-top: var(--header-offset); /* Crucial for fixed header */
  background-color: var(--bg-color);
  color: var(--text-main-color);
  line-height: 1.6;
  overflow-x: hidden; /* For general mobile overflow protection */
}

/* Site Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
}

/* Header Top */
.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  background-color: var(--bg-color); /* Distinct from main-nav */
  width: 100%;
  overflow: hidden;
}

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

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--primary-color);
  text-decoration: none;
  line-height: 1;
  display: block; /* Ensure it's visible */
}

.logo img {
  display: block;
  max-height: 60px;
  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 on desktop by default) */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default for desktop */
  min-height: 48px; /* Placeholder height */
  background-color: var(--card-bg-color); /* Distinct color */
  width: 100%;
  overflow: hidden;
}

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

.hamburger-menu span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--text-main-color);
  margin-bottom: 5px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger-menu span:last-child {
  margin-bottom: 0;
}

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

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

.nav-link {
  color: var(--text-main-color);
  text-decoration: none;
  font-size: 16px;
  font-weight: bold;
  padding: 5px 0;
  transition: color 0.3s ease;
  white-space: nowrap; /* Prevent wrapping on desktop */
}

.nav-link:hover, .nav-link.active {
  color: var(--glow-color);
}

/* Buttons */
.btn {
  background: var(--button-gradient);
  color: var(--text-main-color);
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 90px;
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 15px var(--glow-color);
}

/* 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;
  transition: opacity 0.3s ease;
  opacity: 0;
}

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

/* Footer */
.site-footer {
  background-color: var(--card-bg-color);
  padding: 40px 20px 20px;
  color: var(--text-main-color);
  font-size: 14px;
  box-sizing: border-box;
}

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

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

.footer-col .footer-logo {
  font-size: 32px;
  font-weight: bold;
  color: var(--primary-color);
  text-decoration: none;
  margin-bottom: 15px;
  display: block;
}

.footer-col .footer-description {
  margin-bottom: 15px;
  color: var(--text-main-color);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

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

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

.footer-nav a {
  color: var(--text-main-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

.footer-mid-slots {
  display: flex; /* or grid, depending on desired layout */
  flex-wrap: wrap;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto 20px;
}

.footer-slot-anchor-inner {
  /* This container is for dynamic injection, keep it empty */
  width: 100%; /* Ensure slots take up full width for proper injection */
  min-height: 1px; /* Ensure slot is rendered */
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  max-width: 1200px;
  margin: 0 auto;
  border-top: 1px solid var(--border-color);
}

.footer-bottom p {
  margin: 0;
  color: var(--text-main-color);
}

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

  /* Header Top */
  .header-top {
    min-height: 60px !important;
    height: 60px !important;
    padding: 0 15px; /* Adjust padding for mobile */
  }

  .header-container {
    width: 100%;
    max-width: none; /* No max-width on mobile */
    padding: 0; /* Handled by header-top padding */
    justify-content: space-between; /* Hamburger left, logo center, empty space right */
  }

  /* Hamburger Menu */
  .hamburger-menu {
    display: block; /* Show hamburger on mobile */
    order: 1; /* Position left */
    margin-right: auto; /* Push logo to center */
    z-index: 1001;
  }

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

  /* Logo Centering (Mobile) */
  .logo {
    order: 2; /* Position center */
    flex: 1 !important; /* Take up available space for centering */
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin-left: auto; /* Push logo to center, relative to hamburger */
    margin-right: auto; /* Balance margins for centering */
  }

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

  /* Desktop Nav Buttons (hide on mobile) */
  .desktop-nav-buttons {
    display: none !important;
  }

  /* Mobile Nav Buttons (show on mobile) */
  .mobile-nav-buttons {
    display: flex !important; /* Show on mobile */
    min-height: 48px;
    align-items: center;
    justify-content: center; /* Center buttons horizontally */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px; /* Match header-top padding */
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap; /* Ensure buttons stay in one row */
    background-color: var(--card-bg-color); /* Apply background color */
  }

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

  /* Main Navigation (mobile menu) */
  .main-nav {
    display: none; /* Hidden by default */
    flex-direction: column; /* Vertical layout */
    position: fixed;
    top: var(--header-offset); /* Below the fixed header + mobile buttons */
    left: 0;
    width: 280px; /* Width of the side menu */
    height: calc(100% - var(--header-offset)); /* Full height below header */
    background-color: var(--card-bg-color); /* Menu background */
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.3);
    transform: translateX(-100%); /* Slide out of view */
    transition: transform 0.3s ease;
    z-index: 1000; /* Below overlay */
    overflow-y: auto; /* Scrollable if many links */
    min-height: auto !important; /* Override fixed height */
    height: auto !important; /* Override fixed height */
  }

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

  .nav-container {
    flex-direction: column; /* Vertical links */
    align-items: flex-start; /* Align links to the left */
    padding: 20px 15px; /* Padding inside the menu */
    gap: 15px; /* Spacing between links */
    width: 100%;
    max-width: none; /* No max-width on mobile */
    height: auto;
  }

  .nav-link {
    width: 100%;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    white-space: normal; /* Allow wrapping */
  }

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

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

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

  .footer-col h3 {
    margin-bottom: 10px;
  }

  .footer-col .footer-logo {
    font-size: 28px;
    margin-bottom: 10px;
  }

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

  .footer-bottom {
    padding-top: 15px;
  }

  /* Mobile overflow protection for content */
  .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.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;
}
