:root {
  --primary-color: #000000;
  --secondary-color: #FFFFFF;
  --login-btn-bg: #FCBC45;
  --register-btn-bg: var(--primary-color); /* Using primary color for register button background */
  --register-btn-text: var(--secondary-color); /* White text as specified */
  --header-top-bg: var(--primary-color);
  --main-nav-bg: var(--secondary-color);
  --text-color-dark: #333333; /* For text on light backgrounds */
  --text-color-light: #FFFFFF; /* For text on dark backgrounds */

  /* Desktop header offset calculation:
     header-top (padding 15px top/bottom = approx 60px visible height with default font-size)
     main-nav (padding 10px top/bottom = approx 50px visible height with default font-size)
     Total: 60px + 50px = 110px.
  */
  --header-offset: 110px;
}

@media (max-width: 768px) {
  :root {
    /* Mobile header offset calculation:
       header-top (padding 15px top/bottom = approx 60px visible height)
       mobile-buttons-area (padding 10px top/bottom = approx 60px visible height)
       Total: 60px + 60px = 120px.
    */
    --header-offset: 120px;
  }
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  padding-top: var(--header-offset); /* Ensure content is not hidden by fixed header */
  overflow-x: hidden; /* Prevent horizontal scrolling on mobile */
  background-color: var(--secondary-color); /* General page background */
}

/* --- General Button Styles --- */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
  white-space: nowrap;
  border: none;
  text-align: center;
}

.btn-login {
  background-color: var(--login-btn-bg);
  color: var(--primary-color); /* Black text on gold background */
}

.btn-login:hover {
  background-color: #e6a73d; /* Slightly darker gold */
  transform: translateY(-2px);
}

.btn-register {
  background-color: var(--register-btn-bg); /* Primary color (black) */
  color: var(--register-btn-text); /* Secondary color (white) */
  border: 1px solid var(--secondary-color); /* Add white border for distinction */
}

.btn-register:hover {
  background-color: #333333; /* Slightly lighter black */
  transform: translateY(-2px);
}

/* --- Header Styles (Desktop First) --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  min-height: var(--header-offset); /* Ensure header has enough height */
}

.header-top {
  background-color: var(--header-top-bg); /* Primary color */
  color: var(--text-color-light); /* White text */
  padding: 15px 0;
  position: relative;
  z-index: 1001; 
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--text-color-light); /* White text for logo on dark background */
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 1px;
  display: block; /* Ensure logo is visible */
}

.desktop-nav-buttons {
  display: flex;
  gap: 10px;
}

.hamburger-menu {
  display: none; /* Hidden on desktop */
  cursor: pointer;
  width: 30px;
  height: 20px;
  position: relative;
  transform: rotate(0deg);
  transition: .5s ease-in-out;
  z-index: 1002; 
  background: transparent; /* Ensure no background interferes */
  border: none;
  padding: 0;
}

.hamburger-menu span {
  display: block;
  position: absolute;
  height: 3px;
  width: 100%;
  background: var(--text-color-light); /* White lines */
  border-radius: 9px;
  opacity: 1;
  left: 0;
  transform: rotate(0deg);
  transition: .25s ease-in-out;
}

.hamburger-menu span:nth-child(1) {
  top: 0px;
}

.hamburger-menu span:nth-child(2) {
  top: 8px;
}

.hamburger-menu span:nth-child(3) {
  top: 16px;
}

.hamburger-menu.active span:nth-child(1) {
  top: 8px;
  transform: rotate(135deg);
}

.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
  left: -60px;
}

.hamburger-menu.active span:nth-child(3) {
  top: 8px;
  transform: rotate(-135deg);
}

.mobile-buttons-area {
  display: none; /* Hidden on desktop */
}

.main-nav {
  background-color: var(--main-nav-bg); /* Secondary color (white) */
  padding: 10px 0;
  width: 100%;
  display: flex; /* Desktop default: flex */
  flex-direction: row; /* Desktop default: row */
  justify-content: center;
  align-items: center;
  border-top: 1px solid #e0e0e0; /* Subtle separator */
}

.main-nav .nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap; /* Allow wrapping on smaller screens */
  gap: 20px; /* Spacing between nav links */
}

.main-nav .nav-link {
  color: var(--text-color-dark); /* Dark text on light background */
  text-decoration: none;
  font-weight: 500;
  padding: 5px 0;
  transition: color 0.3s ease;
  white-space: nowrap;
}

.main-nav .nav-link:hover {
  color: var(--login-btn-bg); /* Gold on hover */
}

.mobile-menu-overlay {
  display: none; /* Hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  transition: opacity 0.3s ease;
  opacity: 0;
}

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

/* --- Footer Styles --- */
.site-footer {
  background-color: var(--primary-color); /* Primary color (black) */
  color: var(--text-color-light); /* White text */
  padding: 40px 20px 20px;
  text-align: center;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  text-align: left;
  gap: 30px;
}

.footer-col {
  flex: 1;
  min-width: 200px;
  margin-bottom: 20px;
}

.footer-col h3 {
  font-size: 18px;
  margin-bottom: 15px;
  color: var(--login-btn-bg); /* Gold for headings */
}

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

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

.footer-nav a {
  color: var(--text-color-light); /* White text */
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s ease;
}

.footer-nav a:hover {
  color: var(--login-btn-bg); /* Gold on hover */
}

.copyright {
  margin-top: 40px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

/* --- Mobile Specific Styles --- */
@media (max-width: 768px) {
  /* Mobile 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;
  }

  .header-container {
    padding: 0 15px;
    width: 100%;
    max-width: none; /* Override max-width for mobile */
    justify-content: space-between;
  }

  .logo {
    flex: 1;
    text-align: center;
    font-size: 20px;
    order: 2; /* Logo in the middle */
    padding-left: 15px; /* Adjust for hamburger menu */
    padding-right: 15px; /* Adjust for spacing */
    display: block; /* Ensure logo is visible on mobile */
  }

  .desktop-nav-buttons {
    display: none; /* Hide desktop buttons */
  }

  .hamburger-menu {
    display: block; /* Show hamburger menu */
    order: 1; /* Hamburger on the left */
    margin-right: auto; /* Push logo to center if no right element */
  }

  .mobile-buttons-area {
    display: flex; /* Show mobile buttons area */
    justify-content: center;
    gap: 10px;
    background-color: var(--header-top-bg); /* Same background as header-top for continuity */
    padding: 10px 15px;
    width: 100%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 1000; /* Below header-top but above main content */
  }

  .main-nav {
    display: none; /* Hidden by default on mobile */
    position: fixed;
    top: 0;
    left: 0;
    width: 80%; /* Sidebar width */
    max-width: 300px; /* Limit sidebar width on larger mobile devices */
    height: 100vh;
    background-color: var(--main-nav-bg); /* White background for mobile menu */
    flex-direction: column;
    padding: 20px 0;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    transform: translateX(-100%); /* Slide out from left */
    transition: transform 0.3s ease-in-out;
    z-index: 9999; /* Ensure it's on top of everything */
    overflow-y: auto; /* Enable scrolling for long menus */
    border-top: none; /* Remove desktop border */
  }

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

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

  .main-nav .nav-link {
    width: 100%;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
  }

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

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

  .footer-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer-col {
    width: 100%;
    min-width: unset;
  }

  .footer-col h3 {
    margin-top: 20px;
  }
}
/* Payment Methods 图标容器样式 */
.payment-icons {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-items: flex-start;
  gap: 5px;
}

.payment-icons img,
.payment-icon {
  max-height: 50px;
  height: auto;
  width: auto;
  display: block;
}

/* Game Providers 图标容器样式 */
.game-providers-icons {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}

.game-providers-icons img,
.game-provider-icon {
  max-height: 50px;
  height: auto;
  width: auto;
  display: block;
}

/* Social Media 图标容器样式 */
.social-media-icons {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}

.social-media-icons img,
.social-media-icon {
  max-height: 50px;
  height: auto;
  width: auto;
  display: block;
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
