/* General Reset & Base */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--background-color);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
}

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

/* Color Variables */
:root {
  --primary-color: #C91F17;
  --secondary-color: #E53935;
  --button-gradient: linear-gradient(180deg, #FFD86A 0%, #E6B800 100%);
  --card-bg: #D32F2F;
  --background-color: #B71C1C;
  --text-main: #FFF5E1;
  --border-color: #F2B544;
  --glow-color: #FFCC66;
  --gold-color: #F4D34D;
  --deep-red: #7A0E0E;

  /* Header Offset - Desktop */
  --header-offset: 122px; 
}

body {
  padding-top: var(--header-offset);
}

/* Site Header - Fixed & Suspended */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  background-color: transparent; /* Background set by header-top and main-nav */
}

/* Header Top Section */
.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--deep-red); /* Distinct from main-nav */
  width: 100%;
  padding: 0 20px; /* Added padding to header-top itself to ensure hamburger is visible on mobile */
}

.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-left and padding-right are now on header-top */
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  height: 100%;
}

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

/* Desktop Navigation Buttons */
.desktop-nav-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Mobile Navigation Buttons (hidden on desktop) */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default, shown on mobile */
  min-height: 48px;
  background-color: var(--secondary-color); /* Different color for mobile button row */
  width: 100%;
  padding: 0 15px; /* Consistent mobile padding */
}

/* Main Navigation Section */
.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex; /* Desktop default: flex */
  align-items: center;
  overflow: hidden;
  background-color: var(--background-color); /* Distinct from header-top */
  width: 100%;
}

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

.nav-item {
  color: var(--text-main);
  padding: 10px 15px;
  font-size: 16px;
  font-weight: bold;
  white-space: nowrap;
  transition: color 0.3s ease, background-color 0.3s ease;
  border-radius: 5px;
}

.nav-item:hover,
.nav-item.active {
  color: var(--gold-color);
  background-color: rgba(255, 255, 255, 0.1);
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border-radius: 25px;
  font-weight: bold;
  font-size: 15px;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  background: var(--button-gradient);
  color: var(--deep-red); /* Text color on gold button */
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none; /* No underline */
}

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

/* Hamburger Menu */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  width: 30px;
  height: 24px;
  position: relative;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  z-index: 1001; /* Above logo and buttons on mobile */
  margin-right: 15px; /* Space between hamburger and logo */
}

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

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

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

/* Overlay for Mobile Menu */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 998; /* Below menu, above content */
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.overlay.active {
  visibility: visible;
  opacity: 1;
}

/* Site Footer */
.site-footer {
  background-color: var(--background-color);
  padding: 40px 20px 20px;
  color: var(--text-main);
  font-size: 14px;
  box-sizing: border-box;
}

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

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

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

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

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

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

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

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

.footer-bottom p {
  margin: 0;
}

/* Footer Slot Anchors - ensure they don't hide content */
.footer-slot-anchor-inner {
  min-height: 1px; /* Ensure visibility */
  overflow: visible;
}

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

  body {
    overflow-x: hidden; /* Prevent body horizontal scroll */
  }

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

  .header-container {
    width: 100%;
    max-width: none; /* Remove max-width for mobile */
    padding: 0; /* Remove padding from container, now on header-top */
    justify-content: space-between; /* To push hamburger left, logo center (via flex:1 on logo) */
  }

  .hamburger-menu {
    display: block; /* Show hamburger on mobile */
    margin-right: 0; /* No extra margin, padding on header-top handles it */
  }

  .logo {
    flex: 1 !important; /* Allow logo to take available space */
    display: flex !important;
    justify-content: center !important; /* Center logo */
    align-items: center !important;
    height: 100%;
  }

  .logo img {
    max-height: 56px !important; /* Smaller logo on mobile */
  }

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

  /* Mobile Navigation Buttons */
  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    min-height: 48px;
    height: 48px; /* Fixed height for mobile button row */
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%; /* Ensure it doesn't overflow */
    box-sizing: border-box;
    padding: 0 15px;
    overflow: hidden; /* Prevent button overflow */
    gap: 10px;
    flex-wrap: nowrap;
  }

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

  /* Main Navigation (Mobile) */
  .main-nav {
    min-height: unset; /* Allow height to adjust for content */
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto; /* Scrollable if content is long */
    position: fixed; /* Fixed position for mobile menu */
    top: 0;
    left: 0;
    width: 280px;
    background-color: var(--background-color);
    flex-direction: column; /* Vertical layout */
    justify-content: flex-start; /* Align items to top */
    align-items: flex-start;
    padding-top: calc(var(--header-offset) + 20px); /* Space for fixed header + buttons */
    transform: translateX(-100%); /* Hidden by default */
    transition: transform 0.3s ease;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3);
    display: none; /* Hidden by default, JS will change to flex/block when active */
  }

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

  .nav-container {
    width: 100%;
    max-width: none; /* Remove max-width */
    padding: 0 15px; /* Adjust padding */
    flex-direction: column; /* Vertical links */
    align-items: flex-start;
    height: auto; /* Adjust height based on content */
  }

  .nav-item {
    width: 100%;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .nav-item:last-child {
    border-bottom: none;
  }

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

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

  /* Mobile Content Overflow Protection */
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
}

/* Ensure no double padding-top for content areas */
.page-xxx:not(body) {
  padding-top: 10px; /* Small decorative top padding for page content sections */
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
}
