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

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

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  background-color: var(--site-bg); /* Fallback, actual colors defined in sub-elements */
}

.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--deep-orange); /* Darker color for top bar */
  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; /* Padding for logo and buttons */
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--text-main);
  text-decoration: none;
  display: block; /* Ensure logo is visible by default */
  white-space: nowrap; /* Prevent logo text from wrapping */
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px; /* Limit logo width */
}
.logo img { /* If logo is an image */
  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;
}

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

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

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

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

.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--primary-color); /* Lighter color for main nav */
  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 {
  color: var(--text-main);
  text-decoration: none;
  padding: 10px 15px;
  font-weight: bold;
  white-space: nowrap;
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

.overlay {
  display: none; /* Hidden on desktop */
  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;
}

/* Mobile nav buttons - hidden on desktop */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default on desktop */
  min-height: 48px;
  align-items: center;
  justify-content: center;
  width: 100%;
  background-color: var(--site-bg); /* Background for mobile buttons */
  padding: 8px 15px;
  gap: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Footer */
.site-footer {
  background-color: var(--card-bg); /* Card BG color */
  color: var(--text-main);
  padding: 40px 20px 20px;
  font-size: 14px;
  line-height: 1.6;
  border-top: 1px solid var(--border-color);
}

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

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

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

.footer-description {
  color: var(--text-main);
  margin-bottom: 15px;
  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);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.footer-bottom p {
  margin: 0;
}

/* Dynamic slot anchor styles */
.footer-slot-anchor-top,
.footer-slot-anchor-mid,
.footer-slot-anchor-mid-grid,
.footer-slot-anchor-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 0; /* Minimal padding for spacing */
}
.footer-slot-anchor-inner {
  min-height: 10px; /* Ensure anchor div is visible for inspection */
}

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

  body {
    overflow-x: hidden;
  }

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

  .header-top {
    min-height: 60px;
    height: 60px;
    background-color: var(--deep-orange); /* Consistent color */
  }

  .header-container {
    padding: 0 15px; /* Smaller padding for mobile */
    justify-content: space-between; /* Adjusted for hamburger */
  }

  .logo {
    flex: 1 !important; /* Take remaining space */
    display: flex !important; /* Use flex to center the logo */
    justify-content: center !important; /* Center horizontally */
    align-items: center !important; /* Center vertically */
    max-width: calc(100% - 100px); /* Adjust max-width for logo to leave space for hamburger */
    font-size: 20px; /* Smaller font size for mobile */
  }
  .logo img {
    max-height: 56px !important; /* Smaller max-height for mobile */
    max-width: 100%;
  }

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

  .hamburger-menu {
    display: flex;
    margin-left: 0;
    margin-right: 15px; /* Adjust margin to push hamburger to left */
    order: -1; /* Place hamburger first */
  }
  .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(-11px) rotate(-45deg); }

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    width: 100%; max-width: 100%; /* Full width */
    box-sizing: border-box;
    padding: 8px 15px; /* Smaller padding */
    overflow: hidden; /* Prevent horizontal overflow */
    flex-wrap: nowrap; /* Prevent buttons from wrapping */
    justify-content: center; /* Center buttons if less than 2 */
    background-color: var(--site-bg);
  }
  .mobile-nav-buttons .btn {
    flex: 1;
    min-width: 0;
    max-width: calc(50% - 5px); /* Max width for two buttons with 10px 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; /* Break long words */
    overflow-wrap: break-word;
  }

  .main-nav {
    min-height: 48px;
    height: 48px;
    position: fixed;
    top: 108px; /* Position below header-top (60px) and mobile-nav-buttons (48px) */
    left: 0;
    width: 75%; /* Slide-in menu width */
    height: calc(100vh - 108px); /* Full viewport height minus header elements */
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    background-color: var(--card-bg);
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    padding-top: 20px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    z-index: 999;
    display: none; /* Hidden by default, will be block/flex when active */
    overflow-y: auto;
  }

  .main-nav.active {
    transform: translateX(0);
    display: flex;
  }

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

  .nav-link {
    width: 100%;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
  }
  .nav-link:last-child {
    border-bottom: none;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .footer-col {
    text-align: center;
  }
  .footer-col h3 {
    text-align: center;
  }
  .footer-nav {
    text-align: center;
  }

  /* Mobile content overflow fix */
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  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;
  }
}
