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

/* Base styles */
body {
  font-family: 'Arial', sans-serif;
  margin: 0;
  padding-top: var(--header-offset);
  background-color: var(--bg-color);
  color: var(--text-main-color);
  line-height: 1.6;
  overflow-x: hidden; /* Mobile content overflow protection */
}

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

a:hover {
  text-decoration: underline;
}

/* Site Header */
.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.5);
  background-color: var(--bg-color); /* Fallback, specific sections will override */
  box-sizing: border-box;
}

/* Header Top Section */
.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  background-color: var(--card-bg-color); /* Different 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; /* Padding for logo and buttons */
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--primary-color);
  text-transform: uppercase;
  display: block; /* Ensure logo is visible */
  height: 100%; /* Occupy full height of header-top */
  display: flex; /* For vertical centering if text/img */
  align-items: center;
}

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

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

.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default on desktop */
  min-height: 48px; /* Mobile button bar height */
  background-color: var(--bg-color); /* Same as body bg or card bg */
  padding: 0 15px; /* Added for consistency */
}

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

.hamburger-menu span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--primary-color);
  position: absolute;
  left: 0;
  transition: all 0.3s ease;
}

.hamburger-menu span:nth-child(1) { top: 0; }
.hamburger-menu span:nth-child(2) { top: 10px; }
.hamburger-menu span:nth-child(3) { top: 20px; }

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

/* Main Navigation */
.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex; /* Desktop default: visible, horizontal */
  align-items: center;
  background-color: var(--primary-color); /* Different 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;
  justify-content: center; /* Center menu items */
  align-items: center;
  padding: 0 20px;
  gap: 20px; /* Space between nav links */
}

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

.nav-link:hover {
  color: var(--glow-color);
  text-decoration: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: bold;
  color: var(--text-main-color);
  background: linear-gradient(180deg, var(--secondary-color) 0%, var(--deep-orange-color) 100%);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover {
  opacity: 0.9;
  box-shadow: 0 0 10px var(--glow-color);
  text-decoration: none;
}

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

/* 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;
  padding-bottom: 30px;
}

.footer-col {
  display: flex;
  flex-direction: column;
}

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

.footer-description {
  margin-bottom: 15px;
  color: #bbb;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

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

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

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

.footer-nav a {
  color: #bbb;
  transition: color 0.3s ease;
}

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

.footer-bottom {
  text-align: center;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
  margin-top: 20px;
  color: #aaa;
}

.footer-bottom p {
  margin: 0;
}

/* Dynamic Slot Anchors - ensure they are visible for injection */
.footer-slot-anchor-inner {
  min-height: 1px; /* Ensure element exists and can be targeted, but takes minimal space */
}
/* Ensure the fourth column for dynamic injection is present */
.footer-dynamic-col {
  min-height: 1px;
}


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

  body {
    padding-top: var(--header-offset);
  }
  
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: hidden;
  }

  /* Header Top Section Mobile */
  .header-top {
    min-height: 60px;
    height: 60px;
  }

  .header-container {
    padding: 0 15px; /* Smaller padding for mobile */
    max-width: none; /* No max-width on mobile */
    width: 100%; /* Full width */
    justify-content: space-between; /* Hamburger left, Logo center, space right */
  }

  .logo {
    flex: 1 !important; /* For centering with hamburger */
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-size: 24px;
  }

  .logo img {
    max-height: 56px !important; /* Max height for mobile logo */
    max-width: 100%;
  }

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

  .hamburger-menu {
    display: block; /* Show hamburger on mobile */
    order: -1; /* Place hamburger to the left */
    margin-right: auto; /* Push logo to center */
    flex-shrink: 0;
  }
  
  /* Mobile Nav Buttons */
  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    min-height: 48px;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding-left: 15px;
    padding-right: 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap; /* Prevent buttons from wrapping */
    background-color: var(--bg-color); /* Match body background */
  }

  .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 for mobile buttons */
    font-size: 13px; /* Smaller font size */
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Main Navigation Mobile */
  .main-nav {
    display: none; /* Hidden by default, shown with .active */
    position: fixed;
    top: var(--header-offset); /* Position below fixed header and mobile buttons */
    left: 0;
    width: 70%; /* Slide in from left */
    height: calc(100% - var(--header-offset)); /* Fill remaining height */
    background-color: var(--card-bg-color);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    transform: translateX(-100%); /* Start off-screen */
    transition: transform 0.3s ease;
    flex-direction: column; /* Vertical menu */
    align-items: flex-start;
    padding: 20px 0;
    overflow-y: auto; /* Scrollable if many items */
    z-index: 1001; /* Above overlay */
  }

  .main-nav.active {
    display: flex; /* Crucial: change display to show */
    transform: translateX(0); /* Slide into view */
  }

  .nav-container {
    flex-direction: column; /* Vertical links */
    align-items: flex-start;
    padding: 0 20px;
    gap: 15px;
    width: 100%;
    max-width: none; /* No max-width on mobile */
    height: auto; /* Auto height for content */
  }

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

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

  /* Overlay Mobile */
  .overlay.active {
    display: block; /* Show overlay when menu is active */
  }

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

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

  .footer-col h3 {
    margin-top: 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;
  }
}
