:root {
  --header-offset: 122px; /* Desktop: 68px (header-top) + 52px (main-nav) = 120px + 2px buffer */
  --primary-color: #FF8C1A;
  --secondary-color: #FFA53A;
  --button-gradient: linear-gradient(180deg, #FFA53A 0%, #D96800 100%);
  --card-bg: #17191F;
  --background-color: #0D0E12;
  --text-main: #FFF3E6;
  --border-color: #A84F0C;
  --glow-color: #FFB04D;
  --deep-orange: #D96800;
}

html {
  scroll-behavior: smooth;
}

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

/* Base styles for links */
a {
  text-decoration: none;
  color: var(--text-main);
}

/* Site Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); /* Suspended effect */
  background-color: var(--background-color); /* Fallback, specific sections will override */
}

.header-top {
  box-sizing: border-box;
  min-height: 68px; /* Desktop height */
  height: 68px; /* Desktop height */
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--card-bg); /* Different 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; /* Logo left, buttons right */
  align-items: center;
  padding: 0 30px; /* Inner padding for desktop */
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block; /* Ensure visibility */
}

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

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

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

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

/* Hamburger menu active state */
.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);
}

/* Desktop Navigation Buttons */
.desktop-nav-buttons {
  display: flex; /* Visible on desktop */
  gap: 12px;
  align-items: center;
}

/* Mobile Navigation Buttons (hidden on desktop) */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default on desktop */
  min-height: 48px; /* Mobile height placeholder */
  width: 100%;
  background-color: var(--deep-orange); /* Distinct color */
}

/* Main Navigation */
.main-nav {
  box-sizing: border-box;
  min-height: 52px; /* Desktop height */
  height: 52px; /* Desktop height */
  display: flex; /* Visible on desktop */
  align-items: center;
  overflow: hidden;
  background-color: var(--background-color); /* Different from header-top */
  width: 100%;
  transition: transform 0.3s ease; /* For mobile menu slide */
}

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

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

.nav-link:hover, .nav-link.active {
  color: var(--primary-color);
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

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

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

/* Overlay for mobile menu */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 999;
  display: none; /* Hidden by default */
  transition: opacity 0.3s ease;
  opacity: 0;
}

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

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

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

.footer-col {
  padding: 10px 0;
}

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

.footer-description {
  margin: 0;
  line-height: 1.8;
  word-wrap: break-word; /* Ensure long text wraps */
  overflow-wrap: break-word;
}

.footer-heading {
  font-size: 18px;
  color: var(--primary-color);
  margin-bottom: 20px;
  position: relative;
}

.footer-heading::after {
  content: '';
  display: block;
  width: 40px;
  height: 2px;
  background-color: var(--border-color);
  margin-top: 8px;
}

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

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

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

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

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

.footer-bottom p {
  margin: 0;
}

/* Dynamic slot anchors - ensure they are visible */
.footer-slot-anchor-inner {
  min-height: 10px; /* Ensure visibility for debugging/placement */
  /* No display:none, visibility:hidden, opacity:0, height:0, max-height:0, overflow:hidden */
}


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

  body {
    padding-top: var(--header-offset);
    overflow-x: hidden; /* Prevent horizontal scroll */
  }

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

  /* Header adjustments for mobile */
  .site-header {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  }

  .header-top {
    min-height: 60px !important; /* Mobile height */
    height: 60px !important; /* Mobile height */
    position: relative; /* For logo centering */
  }

  .header-container {
    padding: 0 15px; /* Smaller padding for mobile */
    justify-content: space-between; /* Hamburger left, logo middle, desktop buttons hidden */
    position: relative; /* For logo absolute centering */
  }

  .hamburger-menu {
    display: block; /* Show hamburger on mobile */
    order: 0; /* Leftmost */
  }

  .logo {
    order: 1; /* Center */
    position: absolute; /* Absolute positioning for centering */
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    max-width: calc(100% - 100px); /* Leave space for hamburger */
    text-align: center; /* For text logo */
  }

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

  .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; /* Padding for mobile buttons container */
    overflow: hidden; /* Prevent overflow */
    gap: 10px; /* Space between buttons */
    flex-wrap: nowrap; /* Ensure buttons stay in one line */
    background-color: var(--deep-orange); /* Same color as desktop .mobile-nav-buttons */
  }

  .mobile-nav-buttons .btn {
    flex: 1; /* Distribute space evenly */
    min-width: 0; /* Allow shrinking */
    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; /* Allow text wrapping */
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .main-nav {
    display: none; /* Hidden by default on mobile */
    position: fixed; /* Fixed position for mobile menu */
    top: var(--header-offset); /* Below the header-top and mobile-nav-buttons */
    left: 0;
    width: 280px; /* Width of the mobile menu */
    height: calc(100vh - var(--header-offset)); /* Fill remaining viewport height */
    background-color: var(--card-bg); /* Menu background */
    flex-direction: column; /* Vertical layout */
    justify-content: flex-start;
    align-items: flex-start;
    padding: 20px 0;
    transform: translateX(-100%); /* Start off-screen */
    z-index: 1000; /* Below overlay */
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    overflow-y: auto; /* Enable scrolling for long menus */
  }

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

  .nav-container {
    flex-direction: column;
    padding: 0;
    width: 100%;
    max-width: none;
    align-items: flex-start;
  }

  .nav-link {
    width: 100%;
    padding: 12px 20px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 16px;
  }

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

  .overlay {
    z-index: 998; /* Below mobile menu, above content */
  }

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

  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 20px;
    margin-bottom: 20px;
  }

  .footer-heading {
    margin-top: 15px;
    margin-bottom: 15px;
    font-size: 16px;
  }

  .footer-heading::after {
    width: 30px;
  }

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

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

/* No-scroll class for body when menu is open */
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;
  }
}
