/* Base styles */
html {
  box-sizing: border-box;
}
*, *::before, *::after {
  box-sizing: inherit;
}
body {
  margin: 0;
  font-family: 'Arial', sans-serif; /* Placeholder, can be refined */
  line-height: 1.6;
  color: #FFF5E1; /* Text Main */
  background-color: #B71C1C; /* Background */
  overflow-x: hidden; /* Prevent horizontal scroll on mobile */
  padding-top: var(--header-offset); /* Handled by JS, ensures content doesn't get hidden */
}

/* Header Offset - No marquee */
:root {
  --header-offset: 122px; /* 68px (header-top) + 52px (main-nav) + 2px buffer */
}

/* Site Header - Fixed position, desktop-first */
.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);
  background-color: #7A0E0E; /* Deep Red */
}

/* Header Top Section */
.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: #7A0E0E; /* Deep Red */
}

.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 */
.logo {
  font-size: 28px;
  font-weight: bold;
  color: #F4D34D; /* Gold */
  text-decoration: none;
  display: block;
  white-space: nowrap; /* Prevent logo text from wrapping */
}
.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 by default on desktop) */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default on desktop */
  min-height: 48px; /* Placeholder height, overridden by mobile media query */
}

/* Main Navigation */
.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: #C91F17; /* Main Red */
}

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

.nav-link {
  color: #FFF5E1; /* Text Main */
  text-decoration: none;
  padding: 0 15px;
  font-weight: 500;
  font-size: 15px;
  transition: color 0.3s ease;
  white-space: nowrap;
}
.nav-link:hover {
  color: #FFD86A; /* Lighter gold for hover */
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: bold;
  color: #7A0E0E; /* Deep Red for contrast */
  background: linear-gradient(180deg, #FFD86A 0%, #E6B800 100%); /* Button gradient */
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  font-size: 15px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.4);
}

/* Hamburger Menu (hidden on desktop) */
.hamburger-menu {
  display: none; /* Hidden by default on desktop */
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 25px;
  cursor: pointer;
  padding: 5px 0;
  z-index: 1002; /* Above mobile menu */
}
.hamburger-menu span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: #FFF5E1; /* Text Main */
  border-radius: 3px;
  transition: all 0.3s ease;
}
.hamburger-menu.active span:nth-child(1) {
  transform: translateY(11px) rotate(45deg);
}
.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
}
.hamburger-menu.active span:nth-child(3) {
  transform: translateY(-11px) rotate(-45deg);
}

/* Overlay (hidden by default) */
.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  z-index: 999;
}
.overlay.active {
  display: block;
}

/* Footer Styles */
.site-footer {
  background-color: #B71C1C; /* Background */
  color: #FFF5E1; /* Text Main */
  padding: 40px 20px 20px;
  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 {
  font-size: 18px;
  color: #F4D34D; /* Gold */
  margin-bottom: 15px;
}

.footer-col .footer-logo {
  font-size: 28px;
  font-weight: bold;
  color: #F4D34D; /* Gold */
  text-decoration: none;
  display: block;
  margin-bottom: 15px;
}

.footer-col .footer-description {
  line-height: 1.8;
  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: #FFF5E1; /* Text Main */
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-nav a:hover {
  color: #FFD86A; /* Lighter gold for hover */
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  color: #FFF5E1; /* Text Main */
}

.footer-bottom p {
  margin: 0;
}

/* Dynamic Slot Anchor Styles (must be visible) */
.footer-slot-anchor, .footer-slot-anchor-inner {
  min-height: 1px; /* Ensure it takes up space, even if empty */
  width: 100%;
  box-sizing: border-box;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  /* Header Offset for mobile */
  :root {
    --header-offset: 110px; /* 60px (header-top) + 48px (main-nav) + 2px buffer */
  }
  body {
    overflow-x: hidden; /* Ensure body also prevents horizontal scroll */
  }

  /* Header Top Mobile Adjustments */
  .header-top {
    min-height: 60px !important;
    height: 60px !important;
  }
  .header-container {
    padding: 0 15px;
    max-width: none;
    position: relative; /* For absolute positioning of logo */
  }

  /* Hamburger Menu (visible on mobile) */
  .hamburger-menu {
    display: flex;
    position: relative;
    z-index: 2;
  }

  /* Mobile Logo Centering (Method 2: Absolute Positioning for robustness) */
  .logo {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    max-width: calc(100% - 100px); /* Adjust based on hamburger width */
    height: 100%;
    white-space: nowrap;
  }
  .logo img {
    max-height: 56px !important; /* Adjust for mobile header height */
  }

  /* Hide desktop buttons, show mobile buttons */
  .desktop-nav-buttons {
    display: none !important;
  }
  .mobile-nav-buttons {
    display: flex !important; /* Visible on mobile */
    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 on one line */
    justify-content: center; /* Center buttons horizontally */
    background-color: #C91F17; /* Main Red, matching main nav */
  }
  .mobile-nav-buttons .btn {
    flex: 1; /* Distribute space equally */
    min-width: 0; /* Allow shrinking */
    max-width: calc(50% - 5px); /* Max width for two buttons with 10px gap */
    box-sizing: border-box;
    padding: 8px 12px;
    font-size: 13px;
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Main Navigation Mobile (hidden by default, revealed by JS) */
  .main-nav {
    min-height: 48px !important;
    height: 48px !important;
    display: none; /* Hidden by default */
    position: fixed;
    top: var(--header-offset); /* Position below header */
    left: 0;
    width: 80%; /* Sidebar width */
    max-width: 300px; /* Max width for sidebar */
    height: calc(100% - var(--header-offset)); /* Fill remaining height */
    background-color: #C91F17; /* Main Red */
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    transform: translateX(-100%); /* Start off-screen */
    transition: transform 0.3s ease;
    overflow-y: auto; /* Enable scrolling for long menus */
    z-index: 1001; /* Above overlay */
    padding: 20px 0; /* Padding for menu items */
  }
  .main-nav.active {
    display: flex; /* Display when active */
    transform: translateX(0); /* Slide into view */
  }
  .nav-container {
    flex-direction: column; /* Stack links vertically */
    align-items: flex-start;
    padding: 0;
    width: 100%;
    max-width: none;
  }
  .nav-link {
    padding: 12px 20px;
    width: 100%;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  .nav-link:last-child {
    border-bottom: none;
  }

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

  /* Footer Mobile Adjustments */
  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column layout */
    gap: 30px;
  }
  .footer-col {
    text-align: center;
  }
  .footer-col .footer-logo, .footer-col h3 {
    text-align: center;
  }
  .footer-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
}
