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

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

/* Header Styles */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: var(--body-bg);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--card-bg); /* Distinct from main-nav */
  width: 100%;
  padding: 0 20px; /* Padding for desktop container */
}

.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;
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--primary-color);
  text-decoration: none;
  display: block;
  padding: 0;
  margin: 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;
}

.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default on desktop */
  min-height: 48px;
}

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

.btn:hover {
  box-shadow: 0 0 10px var(--glow-color);
  transform: translateY(-2px);
}

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

.hamburger-menu .bar {
  width: 100%;
  height: 4px;
  background-color: var(--text-main);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.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(--body-bg); /* Distinct from header-top */
  width: 100%;
  padding: 0 20px; /* Padding for desktop container */
}

.main-nav .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;
  gap: 25px;
}

.main-nav .nav-link {
  color: var(--text-main);
  text-decoration: none;
  font-size: 16px;
  padding: 5px 0;
  transition: color 0.3s ease, border-bottom 0.3s ease;
  white-space: nowrap;
}

.main-nav .nav-link:hover,
.main-nav .nav-link.active {
  color: var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
}

/* Footer Styles */
.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: 20px;
  max-width: 1200px;
  margin: 0 auto 30px;
}

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

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

.footer-description {
  margin-bottom: 15px;
  color: var(--text-main);
  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 var(--border-color);
  color: var(--text-main);
  max-width: 1200px;
  margin: 0 auto;
}

.footer-bottom p {
  margin: 0;
}

.footer-slot-anchor-inner {
  min-height: 10px; /* Ensure visibility for content injection */
}

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

.overlay.visible {
  display: block;
}

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

  .header-top {
    min-height: 60px !important;
    height: 60px !important;
    padding: 0 15px;
  }

  .header-container {
    width: 100%;
    max-width: none;
    padding: 0;
    justify-content: space-between;
  }

  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-size: 24px;
  }

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

  .desktop-nav-buttons {
    display: none !important;
  }

  .hamburger-menu {
    display: flex;
    margin-right: auto; /* Push logo to center */
    order: -1; /* Place hamburger on the left */
  }

  .mobile-nav-buttons {
    display: flex !important;
    min-height: 48px;
    align-items: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    justify-content: center;
  }

  .mobile-nav-buttons .btn {
    flex: 1;
    min-width: 0;
    max-width: calc(50% - 5px); /* 50% width minus half of the gap */
    box-sizing: border-box;
    padding: 8px 12px;
    font-size: 13px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .main-nav {
    position: fixed;
    top: var(--header-offset); /* Align with the bottom of the header content */
    left: 0;
    width: 80%; /* Sidebar width */
    height: calc(100% - var(--header-offset));
    background-color: var(--body-bg);
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    transform: translateX(-100%); /* Hidden by default */
    transition: transform 0.3s ease;
    overflow-y: auto;
    display: none; /* Ensure it's hidden when not active */
    z-index: 1001; /* Above overlay */
  }

  .main-nav.active {
    transform: translateX(0); /* Show menu */
    display: flex; /* Make it visible */
  }

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

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

  .site-footer {
    padding: 30px 15px 15px;
  }

  .footer-top-grid {
    grid-template-columns: 1fr;
  }

  .footer-col {
    margin-bottom: 20px;
  }

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

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