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

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

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

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.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(--color-background); /* Default background for header area */
}

.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--color-background); /* Distinct from main-nav */
}

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

.logo {
  display: flex;
  align-items: center;
  font-size: 28px;
  font-weight: bold;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.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 on desktop */
  min-height: 48px; /* Fixed height for mobile buttons area */
  background-color: var(--color-card-bg); /* Distinct background for mobile buttons */
  padding: 0 15px; /* Add padding for mobile buttons */
}

.btn {
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: bold;
  text-align: center;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s ease;
  text-decoration: none; /* Remove underline */
  color: var(--color-text-main); /* Text color for buttons */
}

.btn-primary {
  background: linear-gradient(180deg, var(--color-secondary) 0%, var(--color-deep-orange) 100%);
  border: 1px solid var(--color-border);
  box-shadow: 0 0 10px var(--color-glow);
}

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

.btn-secondary {
  background-color: var(--color-card-bg);
  border: 1px solid var(--color-border);
  box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.btn-secondary:hover {
  background-color: var(--color-background);
  transform: translateY(-2px);
}

.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--color-card-bg); /* Distinct from header-top */
}

.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-list {
  display: flex;
  gap: 25px;
}

.nav-list a {
  padding: 8px 0;
  color: var(--color-text-main);
  font-size: 16px;
  font-weight: 600;
  position: relative;
  transition: color 0.3s ease;
}

.nav-list a:hover {
  color: var(--color-secondary);
}

.nav-list a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-primary);
  transition: width 0.3s ease;
}

.nav-list a:hover::after {
  width: 100%;
}

.hamburger-menu {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  position: relative;
  z-index: 1001;
  width: 40px;
  height: 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  margin-right: 15px; /* Space between hamburger and logo on mobile */
}

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

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

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 999;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

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

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

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

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

.footer-description {
  line-height: 1.6;
  color: var(--color-text-main);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

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

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

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

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
  text-align: center;
  font-size: 13px;
  color: var(--color-text-main);
}

.footer-bottom p {
  margin: 0;
}

.footer-slot-anchor-inner {
  min-height: 1px; /* Ensure anchor is present even if empty */
}

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

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

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

  .header-container {
    padding: 0 15px;
    justify-content: space-between; /* For hamburger and hidden desktop buttons */
  }

  .hamburger-menu {
    display: flex; /* Visible on mobile */
    order: -1; /* Always first */
  }

  .logo {
    flex: 1 !important; /* Take remaining space */
    display: flex !important;
    justify-content: center !important; /* Center logo horizontally */
    align-items: center !important;
    font-size: 24px;
    order: 0; /* Default order */
    position: static !important; /* Reset any desktop positioning that might interfere */
    transform: none !important;
    width: auto !important;
  }
  .logo img {
    display: block !important;
    max-width: 100%;
    height: auto;
    max-height: 56px;
  }

  .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-left: 15px;
    padding-right: 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap; /* Ensure buttons stay in one line */
    z-index: 998; /* Below overlay and main nav */
  }

  .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;
    font-size: 13px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .main-nav {
    min-height: 48px !important;
    height: auto; /* Allow height to adjust for content */
    position: fixed;
    top: var(--header-offset); /* Position below fixed header and mobile buttons */
    left: 0;
    width: 280px; /* Width of the mobile menu */
    height: calc(100% - var(--header-offset)); /* Full height minus header */
    background-color: var(--color-card-bg);
    transform: translateX(-100%); /* Hidden by default */
    transition: transform 0.3s ease;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 20px 0;
    overflow-y: auto; /* Enable scrolling for long menus */
    z-index: 1000;
  }

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

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

  .nav-list {
    flex-direction: column;
    width: 100%;
    gap: 0;
  }

  .nav-list li {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .nav-list a {
    display: block;
    padding: 12px 15px;
    font-size: 16px;
    color: var(--color-text-main);
  }

  .nav-list a::after {
    display: none; /* Hide underline on mobile menu */
  }

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

  .footer-col {
    text-align: center;
  }

  .footer-col h3 {
    text-align: center;
  }

  .footer-nav {
    text-align: center;
  }
  
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: hidden;
  }
}

/* Ensure no-scroll class works for body */
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;
  }
}
/* 内容保护（系统追加，请勿删除） */
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
input, textarea, select, [contenteditable="true"] {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}
