:root {
  --primary-color: #C61F1F;
  --secondary-color: #E53030;
  --header-top-bg: #7E0D0D;
  --main-nav-bg: #C61F1F;
  --mobile-nav-buttons-bg: #2A1212;
  --text-main-color: #FFF1E8;
  --card-bg-color: #2A1212;
  --site-bg-color: #140C0C;
  --border-color: #6A1E1E;
  --gold-color: #F3C54D;
  --deep-red-color: #7E0D0D;
  --button-gradient: linear-gradient(180deg, #FFB04A 0%, #D86A14 100%);

  --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(--site-bg-color);
  color: var(--text-main-color);
  line-height: 1.6;
  overflow-x: hidden; /* Prevent horizontal scroll on desktop too */
}

body.no-scroll {
  overflow: hidden;
}

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

a:hover {
  text-decoration: underline;
}

/* --- Header Styles --- */
.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.3);
  background-color: var(--header-top-bg); /* Fallback, specific sections have their own */
  box-sizing: border-box;
}

.header-top {
  box-sizing: border-box;
  min-height: 68px;
  height: 68px; /* Fixed height for desktop */
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--header-top-bg);
  width: 100%;
  padding: 0 20px; /* Add padding to header-top itself */
}

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

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--gold-color);
  text-transform: uppercase;
  display: block; /* Ensure logo is always visible */
  height: 100%;
  display: flex; /* For vertical centering of text/img */
  align-items: center;
  white-space: nowrap;
}

.logo img {
  display: block;
  max-height: 60px; /* Max height for desktop logo */
  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 by default on desktop */
  min-height: 48px;
  background-color: var(--mobile-nav-buttons-bg);
  width: 100%;
  padding: 0 15px; /* Adjust padding for mobile */
}

.main-nav {
  box-sizing: border-box;
  min-height: 52px;
  height: 52px; /* Fixed height for desktop */
  display: flex; /* Displayed by default on desktop */
  align-items: center;
  overflow: hidden;
  background-color: var(--main-nav-bg);
  width: 100%;
  padding: 0 20px; /* Add padding to main-nav itself */
}

.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;
  width: 100%;
}

.nav-link {
  color: var(--text-main-color);
  font-weight: 600;
  padding: 8px 15px;
  transition: color 0.3s ease, background-color 0.3s ease;
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: var(--gold-color);
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  text-decoration: none;
}

.btn {
  padding: 10px 20px;
  border-radius: 25px;
  font-weight: bold;
  color: var(--text-main-color); /* Per Text Main color */
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
  text-align: center;
  box-sizing: border-box;
}

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

.btn-login {
  background: var(--button-gradient);
}

.btn-register {
  background: var(--deep-red-color);
}

/* Hamburger Menu (Mobile) */
.hamburger-menu {
  display: none; /* Hidden by default on desktop */
  width: 30px;
  height: 24px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  position: absolute; /* Position relative to header-top for mobile */
  left: 15px; /* Adjust for mobile padding */
  z-index: 1002; /* Above mobile menu */
}

.hamburger-menu span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--text-main-color);
  margin-bottom: 5px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger-menu span:last-child {
  margin-bottom: 0;
}

.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 {
  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; /* Below menu, above content */
}

/* --- Footer Styles --- */
.site-footer {
  background-color: var(--card-bg-color);
  color: var(--text-main-color);
  padding: 40px 20px 20px;
  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;
  white-space: nowrap;
}

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

.footer-description {
  color: var(--text-main-color);
  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: var(--text-main-color);
  transition: color 0.3s ease;
  white-space: nowrap; /* Prevent breaking link text */
}

.footer-nav a:hover {
  color: var(--gold-color);
  text-decoration: underline;
}

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

.footer-bottom p {
  margin: 0;
  color: var(--text-main-color);
}

/* Dynamic slot anchors - ensure they are visible */
.footer-slot-anchor-inner {
  min-height: 1px; /* Ensure visibility for injection */
}

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

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

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

  .header-top {
    min-height: 60px;
    height: 60px; /* Fixed height for mobile */
    padding: 0 15px; /* Adjust padding for mobile */
    position: relative; /* For absolute positioning of logo */
  }

  .header-container {
    padding: 0; /* Remove container padding as header-top has it */
    justify-content: center; /* Center logo for text, for image handled by .logo flex */
  }

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

  /* Mobile image logo centering (Method 1: Flexbox) */
  .logo {
    flex: 1 !important; /* Take available space */
    display: flex !important;
    justify-content: center !important; /* Center content */
    align-items: center !important;
    padding: 0 40px; /* Add padding to prevent overlap with hamburger */
  }
  .logo img {
    max-height: 56px !important; /* Max height for mobile logo */
    max-width: 100%;
    height: auto;
  }

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

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons on mobile */
    min-height: 48px;
    height: auto; /* Allow height to adjust if text wraps */
    align-items: center;
    justify-content: center; /* Center buttons horizontally */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap; /* Ensure buttons stay in one line */
    background-color: var(--mobile-nav-buttons-bg);
  }

  .mobile-nav-buttons .btn {
    flex: 1;
    min-width: 0;
    max-width: calc(50% - 5px); /* Account for gap: 10px */
    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: auto;
    height: auto; /* Allow height to adjust for menu items */
    position: fixed; /* Fixed position for mobile menu drawer */
    top: var(--header-offset); /* Position below the combined header-top and mobile-nav-buttons */
    left: 0;
    width: 280px; /* Width of the mobile menu drawer */
    height: 100vh; /* Full viewport height */
    max-height: calc(100vh - var(--header-offset)); /* Adjust max-height to not go beyond screen */
    transform: translateX(-100%); /* Hidden by default */
    transition: transform 0.3s ease;
    background-color: var(--main-nav-bg);
    flex-direction: column; /* Vertical layout for menu items */
    align-items: flex-start; /* Align menu items to the left */
    justify-content: flex-start;
    padding: 20px 0; /* Adjust padding for mobile menu */
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3);
    overflow-y: auto; /* Allow scrolling for long menus */
    z-index: 1001; /* Ensure menu is above overlay but below hamburger */
    display: none; /* Hidden by default, JS will change to flex */
  }

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

  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0; /* Remove gap for vertical menu */
    width: 100%;
    max-width: none; /* Remove max-width for mobile */
    padding: 0;
  }

  .nav-link {
    width: 100%;
    padding: 12px 20px; /* Larger tap area */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

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

  .overlay.active {
    display: block; /* Show overlay when active */
  }

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

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

  /* Ensure content images in page-content are responsive */
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  /* body overflow-x: hidden is already set globally and re-declared here for emphasis as per prompt */
  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;
  }
}
