:root {
  --primary-color: #FF8C1A;
  --secondary-color: #FFA53A;
  --card-bg: #17191F;
  --body-bg: #0D0E12;
  --text-main: #FFF3E6;
  --border-color: #A84F0C;
  --glow-color: #FFB04D;
  --deep-orange: #D96800;
  --header-offset: 122px; /* Desktop: 68px (header-top) + 52px (main-nav) */
}

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

body.no-scroll {
  overflow: hidden;
}

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

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header-top {
  background-color: var(--deep-orange); /* Darker orange from custom colors */
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

.header-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  height: 100%;
  box-sizing: border-box;
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block; /* Ensure logo is visible */
  line-height: 1; /* Align text logo better */
}

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

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 25px;
  background: linear-gradient(180deg, var(--secondary-color) 0%, var(--deep-orange) 100%);
  color: #fff;
  font-weight: bold;
  font-size: 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  text-decoration: none; /* Remove underline */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  white-space: nowrap; /* Prevent button text from wrapping on desktop */
}

.btn:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default on desktop */
  min-height: 48px; /* Fixed height for mobile */
  background-color: var(--body-bg); /* Use a neutral background for mobile buttons */
  width: 100%;
  overflow-x: hidden;
  padding: 0 15px; /* Adjust padding for mobile */
}

.main-nav {
  background-color: var(--secondary-color); /* Lighter orange from custom colors */
  min-height: 52px;
  height: 52px;
  display: flex; /* Desktop default is flex */
  align-items: center;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

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

.nav-link {
  display: block;
  padding: 10px 15px;
  color: var(--text-main);
  font-weight: bold;
  transition: background-color 0.3s ease;
  white-space: nowrap;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
}

/* Hamburger menu for mobile */
.hamburger-menu {
  display: none; /* Hidden by default on desktop */
  width: 30px;
  height: 24px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  position: relative;
  z-index: 1002; /* Above other header elements */
}

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

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

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

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 998; /* Below hamburger and menu */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

/* Footer styles */
.site-footer {
  background-color: var(--card-bg);
  padding: 40px 0 20px;
  color: var(--text-main);
  font-size: 14px;
  text-align: center;
}

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

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

.footer-col p {
  line-height: 1.8;
  word-wrap: break-word; /* Ensure description wraps */
  overflow-wrap: break-word;
}

.footer-logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--text-main);
  text-transform: uppercase;
  margin-bottom: 15px;
  display: inline-block;
}

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

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

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

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

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-main);
  text-align: center;
}

.footer-bottom p {
  margin: 0;
}

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

  /* Shared mobile overflow protection */
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }

  .site-header {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%; /* Prevent overflow */
    overflow-x: hidden; /* Prevent horizontal scroll */
  }

  .header-top {
    min-height: 60px !important;
    height: 60px !important;
    padding: 0 15px;
  }

  .header-container {
    width: 100%;
    max-width: none; /* Important: remove max-width on mobile */
    padding: 0; /* Handled by header-top padding */
    justify-content: space-between; /* Hamburger left, logo center, space right */
    position: relative; /* For absolute positioning of logo if needed */
  }

  .hamburger-menu {
    display: block; /* Show hamburger on mobile */
    position: absolute; /* Position relative to header-container */
    left: 0;
    top: 50%;
    transform: translateY(-50%);
  }

  .logo {
    flex: 1 !important; /* Take remaining space */
    display: flex !important;
    justify-content: center !important; /* Center logo horizontally */
    align-items: center !important;
    font-size: 24px;
    position: static; /* Reset position for flex centering */
    transform: none; /* Reset transform for flex centering */
    max-width: calc(100% - 60px); /* Account for hamburger menu width */
    margin-left: 30px; /* Offset for hamburger menu */
  }

  .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; /* Center buttons horizontally */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px;
    overflow-x: hidden;
    gap: 10px;
    flex-wrap: nowrap; /* Ensure buttons stay in one line */
    background-color: var(--body-bg); /* Match body background or a neutral 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;
    font-size: 13px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .main-nav {
    display: none; /* Hidden by default on mobile */
    flex-direction: column; /* Vertical navigation */
    position: fixed;
    top: var(--header-offset); /* Position below header and mobile buttons */
    left: 0;
    width: 80%; /* Menu width */
    max-width: 300px; /* Max width for menu */
    height: calc(100% - var(--header-offset));
    background-color: var(--card-bg); /* Menu background */
    transform: translateX(-100%); /* Off-screen by default */
    transition: transform 0.3s ease;
    padding: 20px 0;
    box-sizing: border-box;
    overflow-y: auto; /* Enable scrolling for long menus */
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    z-index: 999; /* Above overlay */
  }

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

  .nav-container {
    flex-direction: column; /* Stack links vertically */
    align-items: flex-start; /* Align links to the left */
    padding: 0 20px;
    width: 100%;
    max-width: none; /* Remove max-width on mobile */
    height: auto; /* Allow height to adjust */
  }

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

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

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

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

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

  .footer-bottom {
    padding: 20px 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;
  }
}
