:root {
  --header-offset: 122px; /* Desktop: 68px (header-top) + 52px (main-nav) = 120px. Adding 2px buffer. */
  --primary-color: #E53935;
  --accent-color: #FF5A4F;
  --text-main: #333333;
  --card-bg: #FFFFFF;
  --page-bg: #F5F7FA;
  --border-color: #E0E0E0;
}

body {
  padding-top: var(--header-offset);
  margin: 0;
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--page-bg);
  overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Site Header - Fixed position, always visible */
.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.1);
  box-sizing: border-box;
}

/* Header Top Section (Logo and Desktop Buttons) */
.header-top {
  box-sizing: border-box;
  height: 68px; /* Fixed height for desktop */
  display: flex;
  align-items: center;
  background-color: var(--primary-color); /* Main color for header-top */
  color: #fff;
  overflow: hidden;
  padding: 0 20px; /* Padding for content inside header-top */
}

.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: #fff;
  text-decoration: none;
  display: block; /* Ensure visibility */
  line-height: 1;
}

/* If logo is an image */
.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; /* Display on desktop */
  gap: 12px;
  align-items: center;
}

/* Mobile Nav Buttons - Hidden by default on desktop */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden on desktop by default */
  min-height: 48px; /* Fixed height for mobile nav buttons */
  background-color: var(--accent-color); /* Distinct background color */
  padding: 0 15px; /* Add padding for mobile */
}

/* Main Navigation Section */
.main-nav {
  box-sizing: border-box;
  height: 52px; /* Fixed height for desktop */
  display: flex; /* Display on desktop */
  align-items: center;
  background-color: var(--accent-color); /* Accent color for main-nav, distinct from header-top */
  overflow: hidden;
}

.nav-container {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: row; /* Horizontal layout for desktop */
  justify-content: center;
  align-items: center;
  padding: 0 20px;
  gap: 25px; /* Spacing between nav links */
}

.nav-link {
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  font-size: 16px;
  padding: 8px 0;
  white-space: nowrap;
  transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
  color: rgba(255, 255, 255, 0.8);
}

/* Buttons General Styling */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: bold;
  text-decoration: none;
  color: #fff;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
  white-space: nowrap;
  box-sizing: border-box;
}

.btn-register,
.btn-login {
  background: linear-gradient(180deg, #FF5A4F 0%, #E53935 100%); /* Specific button gradient */
  box-shadow: 0 4px 10px rgba(229, 57, 53, 0.4);
}

.btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* Hamburger Menu (Mobile Only) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 25px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1002; /* Above header-top content */
}

.hamburger-menu span {
  display: block;
  width: 100%;
  height: 3px;
  background: #fff;
  border-radius: 3px;
  transition: all 0.3s ease-in-out;
}

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

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

.mobile-overlay.active {
  display: block;
}

/* Site Footer */
.site-footer {
  background-color: #222; /* Dark background for footer */
  color: #eee;
  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 {
  display: flex;
  flex-direction: column;
}

.footer-logo {
  font-size: 24px;
  font-weight: bold;
  color: #fff;
  text-decoration: none;
  margin-bottom: 15px;
  display: block;
}

.footer-description {
  margin-top: 0;
  line-height: 1.8;
  color: #ccc;
  word-wrap: break-word; /* Ensure description fits */
  overflow-wrap: break-word;
}

.footer-title {
  font-size: 18px;
  color: #fff;
  margin-top: 0;
  margin-bottom: 15px;
}

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

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

.footer-nav a {
  color: #ccc;
  text-decoration: none;
  transition: color 0.3s ease;
}

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

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

.footer-bottom p {
  margin: 0;
}

/* Placeholder for dynamic slots - ensure visibility */
.footer-slot-anchor-inner {
  min-height: 1px; /* Ensure it takes up minimal space if empty */
  margin-top: 10px; /* Basic spacing */
}


/* Responsive Styles */
@media (max-width: 768px) {
  :root {
    --header-offset: 148px; /* 60px (header-top) + 48px (mobile-nav-buttons) + 48px (main-nav when closed) = 156px. Using 148px for a good fit. */
  }

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

  /* Header Top */
  .header-top {
    height: 60px; /* Fixed height for mobile */
    padding: 0 15px; /* Add padding for mobile */
  }

  .header-container {
    padding: 0; /* Remove container padding as header-top has it */
    justify-content: space-between; /* Hamburger left, logo middle, space right */
    position: relative; /* For absolute positioning of logo if needed */
  }

  .logo {
    flex: 1 !important; /* Take available space */
    display: flex !important;
    justify-content: center !important; /* Center logo text */
    align-items: center !important;
    font-size: 24px;
  }

  /* Image logo centering for mobile */
  .logo img {
    max-height: 56px !important; /* Max height for mobile logo */
    max-width: 100%;
    height: auto;
  }

  .hamburger-menu {
    display: flex; /* Display hamburger menu on mobile */
    position: relative; /* Ensure it's clickable */
    z-index: 1002;
  }

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

  /* Mobile Nav Buttons - Display on mobile */
  .mobile-nav-buttons {
    display: flex !important; /* Display on mobile */
    align-items: center;
    justify-content: center; /* Center buttons */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 8px 15px; /* Adjust padding for mobile */
    overflow: hidden; /* Prevent overflow */
    gap: 10px; /* Spacing between buttons */
    flex-wrap: nowrap; /* Keep buttons in one line */
    min-height: 48px; /* Fixed height for mobile nav buttons */
    background-color: var(--accent-color); /* Match main-nav background */
  }

  .mobile-nav-buttons .btn {
    flex: 1; /* Distribute space evenly */
    min-width: 0; /* Allow shrinking */
    max-width: calc(50% - 5px); /* Max width for two buttons with gap */
    padding: 8px 12px; /* Smaller padding for mobile buttons */
    font-size: 13px; /* Smaller font size for mobile buttons */
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word; /* Allow text wrapping */
    overflow-wrap: break-word;
  }

  /* Main Navigation (Mobile Menu) */
  .main-nav {
    display: none; /* Hidden by default on mobile */
    flex-direction: column; /* Vertical layout for mobile */
    position: fixed;
    top: var(--header-offset); /* Position below header */
    left: 0;
    width: 80%; /* Width of the mobile menu */
    max-width: 300px;
    height: calc(100vh - var(--header-offset)); /* Full height below header */
    overflow-y: auto; /* Enable scrolling for long menus */
    background-color: var(--accent-color); /* Same as desktop main-nav */
    transform: translateX(-100%); /* Slide out from left */
    transition: transform 0.3s ease;
    z-index: 1001; /* Above overlay, below hamburger */
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
  }

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

  .nav-container {
    flex-direction: column; /* Vertical links */
    align-items: flex-start; /* Align links to the left */
    padding: 20px;
    gap: 15px; /* Spacing between mobile nav links */
    width: 100%;
    max-width: none; /* Remove max-width for mobile containers */
  }

  .nav-link {
    width: 100%;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 17px;
  }

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

  /* Footer Responsive */
  .footer-top-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
  }

  .footer-col {
    margin-bottom: 20px;
  }

  .footer-bottom {
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Mobile content overflow prevention */
  .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;
  }
}
/* 内容保护（系统追加，请勿删除） */
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;
}
