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

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-main-color);
  background-color: var(--bg-color);
  padding-top: var(--header-offset);
  overflow-x: hidden; /* Prevent horizontal scroll on body */
  line-height: 1.5;
}

/* 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);
  box-sizing: border-box;
}

.header-top {
  background-color: var(--deep-orange-color); /* Deep Orange for header-top */
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  box-sizing: border-box;
}

.header-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  height: 100%;
  box-sizing: border-box;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--text-main-color);
  text-decoration: none;
  display: block; /* Ensures logo is always visible */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px; /* Limit logo width */
}

.logo img {
  display: block;
  max-height: 60px; /* Matches header-top height */
  height: auto;
  width: auto;
  max-width: 100%; /* Ensures image fits */
  object-fit: contain;
}

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

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

.btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.main-nav {
  background-color: var(--primary-color); /* Primary color for main-nav */
  min-height: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  overflow: hidden;
  box-sizing: border-box;
}

.nav-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 20px;
  height: 100%;
  box-sizing: border-box;
}

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

.nav-link:hover, .nav-link.active {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-main-color);
}

.hamburger-menu {
  display: none; /* Hidden on desktop */
  width: 30px;
  height: 24px;
  position: relative;
  cursor: pointer;
  z-index: 1001;
  margin-left: auto; /* Push to the right in desktop flex, effectively hidden */
}

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

.hamburger-menu .bar:nth-child(1) { top: 0; }
.hamburger-menu .bar:nth-child(2) { top: 50%; transform: translateY(-50%); }
.hamburger-menu .bar:nth-child(3) { bottom: 0; }

.hamburger-menu.active .bar:nth-child(1) { top: 50%; transform: translateY(-50%) rotate(45deg); }
.hamburger-menu.active .bar:nth-child(2) { opacity: 0; }
.hamburger-menu.active .bar:nth-child(3) { bottom: 50%; transform: translateY(50%) rotate(-45deg); }

.mobile-nav-buttons {
  display: none; /* Hidden on desktop, shown on mobile */
}

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

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

/* Footer */
.site-footer {
  background-color: var(--card-bg-color); /* Card BG for footer */
  padding: 40px 20px 20px;
  color: var(--text-main-color);
  text-align: left;
  box-sizing: border-box;
  font-size: 14px;
}

.site-footer h3 {
  color: var(--text-main-color);
  margin-bottom: 15px;
  font-size: 18px;
  font-weight: bold;
}

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

.footer-col {
  padding-right: 15px;
}

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

.footer-description {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 243, 230, 0.8);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

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

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

.footer-nav a {
  color: rgba(255, 243, 230, 0.8);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s ease;
}

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

.footer-slot-anchor-inner {
  margin-top: 20px;
}

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

.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;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 243, 230, 0.1);
  max-width: 1200px;
  margin: 0 auto;
  font-size: 13px;
  color: rgba(255, 243, 230, 0.6);
}

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

  /* Shared mobile overflow protection */
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: hidden;
  }

  .site-header {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3); /* Stronger shadow for mobile fixed header */
  }

  .header-top {
    min-height: 60px;
    height: 60px;
    padding-left: 15px; /* Add padding for hamburger menu */
    padding-right: 15px; /* Add padding for right edge */
  }

  .header-container {
    width: 100%;
    max-width: none; /* No max-width for mobile container */
    padding: 0; /* Reset padding, as header-top has it */
    justify-content: space-between; /* Align hamburger left, logo center */
    position: relative; /* For absolute logo centering */
  }

  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    position: static !important; /* Reset absolute positioning if any */
    transform: none !important; /* Reset transform if any */
    max-width: calc(100% - 100px); /* Adjust max-width to leave space for hamburger */
    font-size: 22px;
  }
  .logo img {
    max-height: 56px !important; /* Matches mobile header-top height */
  }

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

  .hamburger-menu {
    display: block; /* Show hamburger menu on mobile */
    position: absolute;
    left: 15px; /* Position to the left */
    top: 50%;
    transform: translateY(-50%);
  }

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    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; /* Ensure buttons stay in one line */
    background-color: var(--primary-color); /* Use primary color for mobile buttons bar */
  }

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

  .main-nav {
    display: none; /* Hidden by default on mobile */
    position: fixed;
    top: var(--header-offset); /* Position below fixed header */
    left: 0;
    width: 80%; /* Menu width */
    height: calc(100% - var(--header-offset)); /* Full height below header */
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    box-sizing: border-box;
    transform: translateX(-100%); /* Off-screen to the left */
    transition: transform 0.3s ease;
    z-index: 1001; /* Above overlay */
    overflow-y: auto; /* Enable scrolling for long menus */
    background-color: var(--primary-color); /* Keep primary color for menu */
  }

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

  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 0; /* Reset padding for mobile nav container */
    height: auto; /* Allow height to adjust */
    width: 100%;
    max-width: none; /* No max-width for mobile container */
  }

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

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

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

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

  .footer-col {
    padding-right: 0;
  }

  .footer-logo {
    font-size: 24px;
    text-align: center;
  }

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

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

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

  .footer-dynamic-col .footer-slot-anchor-inner {
    justify-content: center; /* Center items in dynamic col */
  }

  .footer-dynamic-row .footer-slot-anchor-inner {
    justify-content: center; /* Center items in dynamic rows */
  }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
