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

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  background-color: #0D0E12; /* Background */
  color: #FFF3E6; /* Text Main */
  padding-top: var(--header-offset); /* Must be here */
  overflow-x: hidden; /* For mobile overflow protection */
}

a {
  color: #FFA53A; /* Auxiliary color for general links */
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

/* Site Header - Fixed Navigation */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  background-color: var(--main-bg); /* Use main-bg for overall header */
}

/* Header Top Section */
.header-top {
  min-height: 68px; /* Desktop fixed height */
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--card-bg); /* Card BG for header-top */
  width: 100%;
}

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

/* Logo */
.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--primary-color); /* Primary color for logo text */
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block; /* Ensure it's block for alignment */
}

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

/* Mobile Navigation Buttons - Hidden by default on desktop */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden on desktop */
  min-height: 48px; /* Mobile fixed height for placeholder */
  background-color: var(--card-bg); /* Same as header-top */
  width: 100%;
  padding: 0 15px; /* Mobile padding */
}

/* Main Navigation */
.main-nav {
  min-height: 52px; /* Desktop fixed height */
  height: 52px;
  display: flex; /* Default desktop display */
  align-items: center;
  overflow: hidden;
  background-color: var(--main-bg); /* Main BG for main-nav */
  width: 100%;
}

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

.nav-link {
  color: var(--text-main); /* Text Main for nav links */
  padding: 10px 15px;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease, background-color 0.3s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--secondary-color); /* Auxiliary on hover */
  background-color: rgba(255, 255, 255, 0.05);
  text-decoration: none;
}

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

.hamburger-menu::before,
.hamburger-menu::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 3px;
  background-color: var(--text-main); /* Text Main */
  left: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger-menu::before {
  top: 0;
}

.hamburger-menu::after {
  bottom: 0;
}

.hamburger-menu.active::before {
  transform: translateY(10.5px) rotate(45deg);
}

.hamburger-menu.active::after {
  transform: translateY(-10.5px) rotate(-45deg);
}

.hamburger-menu.active {
  background-color: transparent;
}

/* Button Styles */
.btn {
  background: linear-gradient(180deg, var(--secondary-color) 0%, var(--deep-orange) 100%); /* Button gradient */
  color: var(--text-main); /* Text Main */
  padding: 10px 20px;
  border-radius: 25px;
  font-weight: bold;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
  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); /* Glow on hover */
  text-decoration: none;
}

/* Overlay for mobile menu */
.overlay {
  display: none; /* Hidden by default */
  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;
}

.overlay.active {
  display: block;
}

/* Footer Styles */
.site-footer {
  background-color: var(--main-bg); /* Main BG */
  color: var(--text-main); /* Text Main */
  padding: 40px 20px 20px;
  border-top: 1px solid var(--border-color); /* Border color */
  font-size: 14px;
  line-height: 1.8;
  width: 100%;
}

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

.footer-col {
  padding: 0;
}

.footer-col-title {
  font-size: 18px;
  color: var(--primary-color); /* Primary color for titles */
  margin-bottom: 15px;
  text-transform: uppercase;
}

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

.footer-description {
  color: rgba(255, 243, 230, 0.8); /* Slightly muted text main */
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.footer-nav {
  list-style: none;
}

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

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

.footer-nav a:hover {
  color: var(--secondary-color); /* Auxiliary on hover */
  text-decoration: underline;
}

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

.footer-bottom p {
    margin: 0;
}

/* Footer Slot Anchors - Must remain visible */
.footer-slot-anchor-inner {
    min-height: 1px; /* Ensure visibility for injection */
    display: block;
}

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

  /* Header Top Mobile */
  .header-top {
    min-height: 60px !important;
    height: 60px !important;
    padding: 0 15px; /* Mobile padding */
    position: relative; /* For absolute logo positioning */
  }

  .header-container {
    padding: 0; /* Container padding handled by header-top */
    max-width: none; /* No max-width on mobile */
    justify-content: space-between; /* Hamburger left, logo center, space right */
    position: relative; /* For logo centering */
  }

  .hamburger-menu {
    display: block; /* Show hamburger on mobile */
    order: 0; /* Leftmost */
    margin-right: 15px; /* Space between hamburger and logo */
  }

  .logo {
    flex: 1 !important; /* Take remaining space */
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-size: 24px; /* Smaller logo text */
    order: 1; /* Center */
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 100px); /* Leave space for hamburger and potential right-side element */
  }

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

  /* Show mobile buttons on mobile */
  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    min-height: 48px; /* Fixed height */
    align-items: center;
    justify-content: center; /* Center buttons */
    width: 100%;
    max-width: 100%; /* Ensure full width */
    box-sizing: border-box;
    padding: 0 15px; /* Mobile padding */
    overflow: hidden; /* Prevent overflow */
    gap: 10px; /* Space between buttons */
    flex-wrap: nowrap; /* Ensure buttons stay on one line */
  }

  .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 wrap */
    word-wrap: break-word; /* For long text */
    overflow-wrap: break-word;
  }

  /* Main Nav Mobile Menu */
  .main-nav {
    display: none; /* Hidden by default on mobile */
    position: fixed;
    top: var(--header-offset); /* Below header and mobile buttons */
    left: 0;
    width: 100%;
    height: calc(100% - var(--header-offset)); /* Full height below header */
    background-color: var(--main-bg); /* Main BG */
    flex-direction: column; /* Vertical menu */
    transform: translateX(-100%); /* Slide out from left */
    transition: transform 0.3s ease-out;
    z-index: 1001; /* Above overlay, below hamburger */
    overflow-y: auto; /* Scrollable if content is long */
    align-items: flex-start; /* Align links to the left */
    padding: 20px 0; /* Padding inside the menu */
  }

  .nav-container {
    flex-direction: column; /* Vertical links */
    align-items: flex-start; /* Align links to the left */
    padding: 0 15px; /* Mobile padding */
    max-width: none; /* No max-width on mobile */
    height: auto; /* Auto height for content */
  }

  .nav-link {
    width: 100%; /* Full width links */
    padding: 12px 15px; /* Larger tap area */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Separator */
  }

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

  /* Active state for mobile menu */
  .main-nav.active {
    display: flex; /* Show menu */
    transform: translateX(0); /* Slide in */
  }

  /* Mobile Overlay */
  .overlay.active {
    display: block;
  }

  /* Mobile Footer */
  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 20px;
  }
  .footer-col-title {
    margin-top: 15px; /* Add some spacing */
  }

  /* Mobile Overflow Protection (from prompt) */
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: hidden;
  }
}

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