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

body {
  margin: 0;
  font-family: 'Arial', sans-serif;
  color: var(--text-main-color);
  background-color: var(--bg-color);
  padding-top: var(--header-offset);
  overflow-x: hidden; /* For mobile image overflow */
}

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

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

.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--deep-orange); /* Distinct from main-nav */
  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;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--text-main-color);
  display: block;
  flex-shrink: 0;
}

.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;
  flex-shrink: 0;
}

.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default on desktop */
  min-height: 48px; /* Required min-height */
  background-color: var(--card-bg); /* A different background for this row */
  width: 100%;
  padding: 0 15px; /* Added padding for mobile buttons */
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  background: linear-gradient(180deg, var(--secondary-color) 0%, var(--deep-orange) 100%);
  color: var(--text-main-color);
  transition: background-color 0.3s ease, transform 0.3s ease;
  border: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.hamburger-menu {
  display: none; /* Hidden by default on desktop */
  width: 30px;
  height: 24px;
  position: relative;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
  z-index: 1001;
  flex-shrink: 0;
}

.hamburger-menu .bar {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--text-main-color);
  transition: all 0.3s ease-in-out;
}

.hamburger-menu.active .bar:nth-child(1) {
  transform: translateY(10px) rotate(45deg);
}

.hamburger-menu.active .bar:nth-child(2) {
  opacity: 0;
}

.hamburger-menu.active .bar:nth-child(3) {
  transform: translateY(-10px) rotate(-45deg);
}

.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--primary-color); /* Distinct from header-top */
  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;
}

.nav-link {
  display: block;
  padding: 0 15px;
  line-height: 52px; /* Match main-nav height for vertical alignment */
  color: var(--text-main-color);
  font-weight: bold;
  transition: color 0.3s ease, background-color 0.3s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--glow-color);
  background-color: rgba(255, 255, 255, 0.1);
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 998;
  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-color);
  font-size: 14px;
}

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

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

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

.footer-description {
  line-height: 1.6;
  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);
  transition: color 0.3s ease;
}

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

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

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

.footer-bottom-nav .footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px 25px;
}

.footer-bottom-nav .footer-nav li {
  margin-bottom: 0;
}

.footer-bottom {
  max-width: 1200px;
  margin: 20px auto 0;
  padding: 0 20px;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 243, 230, 0.7); /* Slightly desaturated for copyright */
}

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

  /* Image 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;
  }

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

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

  .header-container {
    width: 100%;
    max-width: none; /* Remove max-width for mobile */
    padding: 0 15px;
    justify-content: space-between;
    position: relative; /* For logo absolute positioning */
  }

  .logo {
    position: absolute !important; /* Force absolute positioning for centering */
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    max-width: calc(100% - 100px); /* Ensure it doesn't overlap hamburger */
    flex-grow: 0; /* Reset flex-grow for absolute positioning */
  }

  .logo img {
    max-height: 56px !important; /* Match mobile header-top height */
  }

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

  .hamburger-menu {
    display: flex; /* Show hamburger menu on mobile */
    position: relative; /* Ensure it's above logo */
    z-index: 1002;
  }

  /* Add an empty pseudo-element to balance the hamburger menu on the right for justify-content: space-between */
  .header-container::after {
    content: '';
    display: block;
    width: 30px; /* Same width as hamburger */
    flex-shrink: 0;
  }

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons on mobile */
    min-height: 48px;
    height: auto; /* Allow height to adjust for wrapping text */
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 8px 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap; /* Ensure buttons stay in one line initially */
  }

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

  .main-nav {
    display: none; /* Hidden by default on mobile */
    position: fixed;
    top: var(--header-offset); /* Position below header */
    left: 0;
    width: 80%; /* Sidebar width */
    height: calc(100vh - var(--header-offset)); /* Full height below header */
    background-color: var(--card-bg); /* Sidebar background */
    flex-direction: column;
    padding: 20px 0;
    transform: translateX(-100%); /* Slide out from left */
    transition: transform 0.3s ease-in-out;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    z-index: 1001; /* Above overlay */
    overflow-y: auto; /* Enable scrolling for long menus */
    min-height: 0; /* Override fixed height */
    height: auto; /* Override fixed height */
  }

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

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

  .nav-link {
    width: 100%;
    padding: 12px 0;
    line-height: normal; /* Reset line-height */
    border-bottom: 1px solid rgba(255, 243, 230, 0.1);
  }

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

  .overlay.active {
    visibility: visible;
    opacity: 1;
    z-index: 999; /* Below menu, above content */
  }

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

  .footer-bottom-nav .footer-nav {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .footer-bottom-nav .footer-nav li {
    width: 100%;
    text-align: center;
  }

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