:root {
  --primary-color: #000000;
  --secondary-color: #FFFFFF;
  --login-btn-bg: #FCBC45;
  --register-btn-bg: #FFFFFF;
  --header-offset: 120px; /* Desktop: header-top (70px) + main-nav (50px) */
}

@media (max-width: 768px) {
  :root {
    --header-offset: 130px; /* Mobile: header-top (70px) + mobile-buttons-area (60px) */
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: var(--secondary-color); /* Background color: #FFFFFF */
  padding-top: var(--header-offset); /* Ensure content is not hidden by fixed header */
  overflow-x: hidden; /* Prevent horizontal scroll on body */
}

body.no-scroll {
  overflow: hidden;
}

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

.header-top {
  background-color: var(--primary-color); /* Header-top background: #000000 */
  min-height: 70px;
  display: flex;
  align-items: center;
}

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

.logo {
  color: var(--secondary-color);
  text-decoration: none;
  font-size: 2em;
  font-weight: bold;
  padding: 10px 0;
  display: block; /* Ensure logo is always visible */
}

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

.btn {
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  text-align: center;
  transition: background-color 0.3s ease;
  white-space: nowrap;
  font-size: 0.9em;
}

.btn-login {
  background-color: var(--login-btn-bg); /* Login button background: #FCBC45 */
  color: var(--primary-color);
  border: 1px solid var(--login-btn-bg);
}

.btn-login:hover {
  background-color: #e0a73b;
  border-color: #e0a73b;
}

.btn-register {
  background-color: var(--register-btn-bg); /* Register button background: #FFFFFF */
  color: var(--primary-color);
  border: 1px solid var(--register-btn-bg);
}

.btn-register:hover {
  background-color: #f0f0f0;
  border-color: #f0f0f0;
}

.main-nav {
  background-color: var(--secondary-color); /* Main-nav background: #FFFFFF */
  min-height: 50px;
  display: flex;
  align-items: center;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 20px;
  flex-wrap: wrap; /* Allow nav items to wrap on smaller desktop screens */
}

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

.nav-link:hover {
  color: var(--login-btn-bg);
  background-color: #f0f0f0;
}

.hamburger-menu {
  display: none; /* Hidden on desktop */
  font-size: 2em;
  background: none;
  border: none;
  color: var(--secondary-color);
  cursor: pointer;
  padding: 5px 10px;
  z-index: 1001;
}

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

.mobile-menu-overlay {
  display: none; /* Hidden by default */
}

/* Footer Styles */
.site-footer {
  background-color: var(--primary-color);
  color: var(--secondary-color);
  padding: 40px 20px 20px;
  font-size: 0.9em;
}

.site-footer h3 {
  color: var(--login-btn-bg);
  margin-bottom: 15px;
  font-size: 1.2em;
}

.site-footer p {
  margin-bottom: 10px;
}

.site-footer ul {
  list-style: none;
}

.site-footer ul li a {
  color: var(--secondary-color);
  text-decoration: none;
  margin-bottom: 8px;
  display: block;
  transition: color 0.3s ease;
}

.site-footer ul li a:hover {
  color: var(--login-btn-bg);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 30px;
  padding-bottom: 30px;
}

.footer-section {
  flex: 1;
  min-width: 200px;
}

.footer-bottom {
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  margin-top: 20px;
  color: rgba(255, 255, 255, 0.7);
}

/* Mobile Styles */
@media (max-width: 768px) {
  .header-container {
    padding: 0 15px;
  }

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

  .logo img {
    display: block !important;
    max-width: 100%;
    height: auto;
    max-height: 40px;
  }

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

  .hamburger-menu {
    display: block;
    order: -1; /* Place hamburger menu to the far left */
  }

  .main-nav {
    display: none; /* Hidden by default on mobile */
    flex-direction: column;
    position: fixed;
    top: var(--header-offset); /* Start below the fixed header (header-top + mobile-buttons-area) */
    left: 0;
    width: 80%;
    max-width: 300px; /* Limit mobile menu width */
    height: calc(100vh - var(--header-offset)); /* Take full viewport height minus header offset */
    background-color: var(--primary-color);
    padding: 20px 0;
    transform: translateX(-100%); /* Off-screen by default */
    transition: transform 0.3s ease-in-out;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    z-index: 999;
  }

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

  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 0 15px;
    max-width: none; /* Important: remove max-width for mobile containers */
    width: 100%;
  }

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

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

  .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--login-btn-bg);
  }

  .mobile-buttons-area {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 10px 15px;
    background-color: var(--primary-color); /* Match header-top background */
    min-height: 60px; /* Ensure it takes up space */
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 999;
  }

  .mobile-buttons-area .btn {
    flex: 1;
    max-width: 150px;
  }

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

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

  .hamburger-menu.active::before {
    content: '\2716'; /* X icon */
  }

  .footer-container {
    flex-direction: column;
    gap: 20px;
    padding: 0 15px 20px;
  }

  .footer-section {
    min-width: unset;
  }

  /* Mobile content overflow protection */
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: hidden;
  }
}

/* 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;
  }
}
