:root {
  --header-offset: 122px;
  --primary-color: #E53935;
  --accent-color: #FF5A4F;
  --card-bg-color: #FFFFFF;
  --background-color: #F5F7FA;
  --text-main-color: #333333;
  --border-color: #E0E0E0;
}

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

/* Shared Container Styles */
.header-container, .nav-container, .footer-top-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}

/* Site Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Header Top Area */
.header-top {
  background-color: var(--primary-color); /* Deep red */
  min-height: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  box-sizing: border-box;
}

.header-top .header-container {
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: #fff;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block; /* Ensure it's visible */
}

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

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

.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: bold;
  color: #fff;
  text-align: center;
  transition: all 0.3s ease;
  white-space: nowrap;
  cursor: pointer;
  border: none;
}

.btn-register, .btn-login {
  background: linear-gradient(180deg, var(--accent-color) 0%, var(--primary-color) 100%);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-register:hover, .btn-login:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* Mobile Nav Buttons (Hidden by default on desktop) */
.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden by default on desktop */
  min-height: 48px;
  background-color: #f0f0f0; /* Light background for contrast */
  padding: 0 20px;
  width: 100%;
}

/* Main Navigation */
.main-nav {
  background-color: var(--card-bg-color); /* White background for contrast */
  min-height: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  overflow: hidden;
  box-sizing: border-box;
}

.main-nav .nav-container {
  height: 100%;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
}

.nav-link {
  color: var(--text-main-color);
  text-decoration: none;
  padding: 0 15px;
  font-weight: 600;
  transition: color 0.3s ease;
  white-space: nowrap;
  height: 100%;
  display: flex;
  align-items: center;
}

.nav-link:hover {
  color: var(--primary-color);
}

/* Hamburger Menu (Hidden by default on desktop) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1002;
}

.hamburger-icon {
  display: block;
  width: 25px;
  height: 3px;
  background-color: #fff;
  position: relative;
  transition: background-color 0.3s ease;
}

.hamburger-icon::before, .hamburger-icon::after {
  content: '';
  display: block;
  width: 25px;
  height: 3px;
  background-color: #fff;
  position: absolute;
  transition: transform 0.3s ease;
}

.hamburger-icon::before {
  top: -8px;
}

.hamburger-icon::after {
  top: 8px;
}

.hamburger-menu.active .hamburger-icon {
  background-color: transparent;
}

.hamburger-menu.active .hamburger-icon::before {
  transform: translateY(8px) rotate(45deg);
}

.hamburger-menu.active .hamburger-icon::after {
  transform: translateY(-8px) rotate(-45deg);
}

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

/* Site Footer */
.site-footer {
  background-color: #333;
  color: #f0f0f0;
  padding: 40px 0 20px;
  font-size: 14px;
}

.footer-top-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  margin-bottom: 30px;
}

.footer-col h3 {
  color: #fff;
  font-size: 18px;
  margin-bottom: 15px;
}

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

.footer-description {
  line-height: 1.8;
  margin-bottom: 15px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

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

.footer-nav li a {
  color: #f0f0f0;
  text-decoration: none;
  padding: 5px 0;
  display: block;
  transition: color 0.3s ease;
}

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

.footer-slot-anchor-inner {
  /* Ensures the slot is visible and doesn't hide injected content */
  min-height: 1px;
  visibility: visible;
  opacity: 1;
  height: auto;
  overflow: visible;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #444;
  color: #ccc;
}

.footer-bottom p {
  margin: 0;
}

/* Responsive Styles */
@media (max-width: 768px) {
  :root {
    --header-offset: 110px;
  }

  /* Mobile Header Top */
  .header-top {
    min-height: 60px;
    height: 60px;
  }

  .header-top .header-container {
    padding-left: 15px;
    padding-right: 15px;
    width: 100%;
    max-width: none;
    justify-content: space-between;
  }

  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-size: 24px;
  }

  .logo img {
    max-height: 56px !important;
    max-width: 100%;
  }

  .desktop-nav-buttons {
    display: none !important;
  }

  .hamburger-menu {
    display: block;
    order: -1; /* Place hamburger to the left */
    margin-right: auto; /* Push logo to center */
  }
  
  /* Mobile Nav Buttons */
  .mobile-nav-buttons {
    display: flex !important;
    min-height: 48px;
    align-items: center;
    justify-content: center; /* Center buttons horizontally */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding-left: 15px;
    padding-right: 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
    background-color: #e0e0e0; /* Different background for mobile button row */
    box-shadow: inset 0 -1px 0 rgba(0,0,0,0.05);
  }

  .mobile-nav-buttons .btn {
    flex: 1;
    min-width: 0;
    max-width: calc(50% - 5px); /* Account for gap */
    box-sizing: border-box;
    padding: 8px 12px;
    font-size: 13px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-wrap;
    border-radius: 20px;
  }

  /* Mobile Main Nav (Hamburger Menu) */
  .main-nav {
    display: none; /* Hidden by default */
    flex-direction: column;
    position: fixed;
    top: var(--header-offset); /* Position below fixed header */
    left: 0;
    width: 80%; /* Sidebar width */
    max-width: 300px;
    height: calc(100% - var(--header-offset));
    overflow-y: auto;
    background-color: #333; /* Dark background for mobile menu */
    transform: translateX(-100%); /* Off-screen by default */
    transition: transform 0.3s ease;
    z-index: 1001;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    padding: 20px 0;
  }

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

  .main-nav .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 0 15px;
    height: auto;
    width: 100%;
    max-width: none;
  }

  .nav-link {
    width: 100%;
    padding: 12px 15px;
    border-bottom: 1px solid #444;
    color: #fff;
    justify-content: flex-start;
  }

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

  .overlay.active {
    display: block;
  }

  /* Footer Responsive */
  .footer-top-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .footer-col {
    padding: 0 15px;
  }

  .footer-col:first-child {
    padding-top: 0;
  }

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