:root {
  --primary-color: #FF8C1A;
  --secondary-color: #FFA53A;
  --card-bg-color: #17191F;
  --background-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 */
}

body {
  font-family: 'Arial', sans-serif;
  margin: 0;
  padding-top: var(--header-offset);
  background-color: var(--background-color);
  color: var(--text-main-color);
  overflow-x: hidden; /* Prevent horizontal scroll */
  min-height: 100vh; /* Ensure footer is at bottom */
  display: flex;
  flex-direction: column;
}

main {
  flex: 1; /* Push footer to bottom */
}

/* Site Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  background-color: var(--deep-orange-color); /* Distinct from main-nav */
  display: flex;
  align-items: center;
  overflow: hidden;
  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;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--text-main-color);
  text-decoration: none;
  display: flex; /* For potential image logo centering in mobile */
  align-items: center;
  justify-content: flex-start;
}

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

.desktop-nav-buttons {
  display: flex;
  gap: 10px;
}

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

.btn:hover {
  opacity: 0.9;
}

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

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

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

.mobile-nav-buttons {
  display: none; /* Hidden by default on desktop, shown in mobile media query */
}

.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  background-color: var(--card-bg-color); /* Distinct from header-top */
  display: flex; /* Desktop default: flex for horizontal menu */
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 100%;
  position: static; /* Desktop default: normal flow */
  flex-direction: row; /* Desktop default: horizontal */
}

.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: 20px;
  padding: 0 20px;
}

.nav-link {
  color: var(--text-main-color);
  text-decoration: none;
  padding: 10px 15px;
  transition: color 0.3s ease, background-color 0.3s ease;
  white-space: nowrap;
  font-size: 15px;
}

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

/* Site Footer */
.site-footer {
  background-color: var(--card-bg-color);
  padding: 40px 20px 20px;
  color: var(--text-main-color);
  font-size: 14px;
  line-height: 1.6;
  margin-top: auto; /* Push footer to bottom */
}

.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: 20px;
  font-weight: bold;
  color: var(--text-main-color);
  text-decoration: none;
  display: block;
  margin-bottom: 10px;
}

.footer-description {
  font-size: 14px;
  line-height: 1.6;
  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-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

.footer-dynamic-col .footer-slot-anchor-inner {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-items: flex-start;
  gap: 5px;
}

.footer-dynamic-row {
  max-width: 1200px;
  margin: 20px auto;
}

.footer-dynamic-row .footer-slot-anchor-inner {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}

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

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

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

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

  .header-top {
    min-height: 60px !important;
    height: 60px !important;
    position: relative; /* For absolute positioning of hamburger */
  }

  .header-container {
    padding: 0 15px;
    width: 100%;
    max-width: none;
    justify-content: center; /* Center logo by default */
  }

  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin-left: 0; /* Reset desktop margin */
  }

  .logo img {
    max-height: 56px !important;
    max-width: 100%;
    height: auto;
    display: block !important;
  }

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

  .hamburger-menu {
    display: flex;
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
  }

  .mobile-nav-buttons {
    display: flex !important;
    min-height: 48px;
    height: auto; /* Allow height to adjust if text wraps */
    align-items: center;
    justify-content: 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-color); /* Distinct background for mobile buttons */
  }

  .mobile-nav-buttons .btn {
    flex: 1;
    min-width: 0;
    max-width: calc(50% - 5px); /* 50% 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;
    text-align: center;
  }

  .main-nav {
    min-height: 48px !important;
    height: calc(100% - var(--header-offset)); /* Fill remaining height */
    display: none; /* Hidden by default */
    flex-direction: column; /* Vertical menu */
    position: fixed;
    top: var(--header-offset);
    left: 0;
    width: 80%; /* Sidebar width */
    max-width: 300px;
    background-color: var(--background-color);
    transform: translateX(-100%); /* Slide out of view */
    transition: transform 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
  }

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

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

  .nav-link {
    width: 100%;
    text-align: left;
    padding: 12px 15px;
    font-size: 16px;
  }

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

  .footer-top-grid {
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 20px;
  }

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