html, body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--site-bg);
}

:root {
  --primary-color: #C61F1F;
  --secondary-color: #E53030;
  --button-gradient: linear-gradient(180deg, #FFB04A 0%, #D86A14 100%);
  --card-bg: #2A1212;
  --site-bg: #140C0C;
  --text-main: #FFF1E8;
  --border-color: #6A1E1E;
  --gold-color: #F3C54D;
  --deep-red-color: #7E0D0D;
  --header-top-bg: var(--site-bg);
  --main-nav-bg: var(--card-bg);
  --header-offset: 122px; /* 68px (header-top) + 52px (main-nav) + 2px buffer */
}

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

.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: var(--header-top-bg); /* Fallback for transparency */
}

.header-top {
  box-sizing: border-box;
  height: 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--header-top-bg);
  width: 100%;
}

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

.logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--gold-color);
  text-decoration: none;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hamburger-menu {
  display: none; /* Hidden on desktop */
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 25px;
  cursor: pointer;
  padding: 5px;
  z-index: 1001;
}

.hamburger-menu span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--gold-color);
  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);
}

.desktop-nav-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
}

.mobile-nav-buttons {
  box-sizing: border-box;
  display: none; /* Hidden on desktop */
  min-height: 48px;
}

.main-nav {
  box-sizing: border-box;
  height: 52px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--main-nav-bg);
  width: 100%;
}

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

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

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

.btn {
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  border: none;
  font-size: 15px;
  line-height: 1;
}

.btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.btn-register {
  background: var(--button-gradient);
  color: var(--site-bg); /* Dark text for contrast */
}

.btn-login {
  background-color: var(--deep-red-color);
  color: var(--text-main);
}

.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.7);
  z-index: 999;
  transition: opacity 0.3s ease;
  opacity: 0;
}

.mobile-menu-overlay.active {
  display: block;
  opacity: 1;
}

/* Footer Styles */
.site-footer {
  background-color: var(--site-bg);
  color: var(--text-main);
  padding: 40px 0 20px;
}

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

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

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

.footer-description {
  font-size: 14px;
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

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

.footer-nav li a {
  color: var(--text-main);
  text-decoration: none;
  font-size: 14px;
  line-height: 2.2;
  display: block;
  transition: color 0.3s ease;
}

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

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
  text-align: center;
  font-size: 13px;
  color: rgba(255,241,232,0.7);
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 30px;
  padding-right: 30px;
}

.footer-slot-anchor-inner {
  height: 1px;
  width: 1px;
  overflow: hidden;
  display: block;
}

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

  body {
    overflow-x: hidden;
  }

  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }

  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }

  .site-header {
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  }

  .header-top {
    height: 60px;
    padding: 0 15px;
  }

  .header-container {
    padding: 0;
    width: 100%;
    max-width: none;
    position: relative;
    justify-content: space-between;
  }

  .hamburger-menu {
    display: flex;
    order: -1;
    margin-right: 15px;
  }

  .logo {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    max-width: calc(100% - 100px); /* Adjust max-width to prevent overlap */
  }

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

  .mobile-nav-buttons {
    display: flex !important;
    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;
    background-color: var(--main-nav-bg);
  }

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

  .main-nav {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 280px;
    background-color: var(--site-bg);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    display: none; /* Initially hidden */
    padding-top: var(--header-offset);
    box-sizing: border-box;
    overflow-y: auto;
  }

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

  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    height: auto;
    max-width: none;
  }

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

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

  .footer-top-grid {
    grid-template-columns: 1fr;
    padding: 0 15px 30px;
  }

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

  .footer-bottom {
    padding-left: 15px;
    padding-right: 15px;
  }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
