:root {
  --header-offset: 120px; /* Desktop: header-top (70px) + main-nav (50px) */
}
@media (max-width: 768px) {
  :root {
    --header-offset: 110px; /* Mobile: header-top (60px) + mobile-nav-buttons (50px) */
  }
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding-top: var(--header-offset); /* Ensure content is not hidden by fixed header */
  background-color: #FFFFFF; /* General page background */
  color: #333333; /* Default text color */
  overflow-x: hidden; /* Prevent horizontal scroll on body */
}

body.no-scroll {
  overflow: hidden;
}

/* Mobile content overflow protection */
@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;
  }
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  display: flex; /* Desktop-first: flex for overall header structure */
  flex-direction: column; /* Stack header-top and main-nav vertically on desktop */
}

.header-top {
  background-color: #000000; /* Primary color */
  width: 100%;
  min-height: 70px; /* Desktop height */
  display: flex;
  align-items: center;
  padding: 10px 0; /* Vertical padding */
}

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

.logo {
  font-size: 28px;
  font-weight: bold;
  color: #FFFFFF;
  text-decoration: none;
  padding: 5px 0;
  white-space: nowrap; /* Prevent logo from wrapping */
}

.desktop-nav-buttons {
  display: flex; /* Show on desktop */
  gap: 12px;
}

.btn {
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  white-space: nowrap;
  transition: background-color 0.3s ease, color 0.3s ease;
  border: 1px solid transparent; /* Default border for consistent sizing */
  cursor: pointer;
}

.btn-login {
  background-color: #FCBC45; /* Login color */
  color: #000000; /* Contrast with login color */
  border-color: #FCBC45;
}
.btn-login:hover {
  background-color: #e0a63a;
  border-color: #e0a63a;
}

.btn-register {
  background-color: #FFFFFF; /* Register color */
  color: #000000; /* Contrast with register color */
  border-color: #FFFFFF;
}
.btn-register:hover {
  background-color: #f0f0f0;
  border-color: #f0f0f0;
}

.main-nav {
  background-color: #1a1a1a; /* Dark grey, contrasts with header-top */
  width: 100%;
  min-height: 50px; /* Desktop height */
  display: flex; /* Desktop-first: show navigation links */
  align-items: center;
  padding: 0; /* No vertical padding, nav-container handles it */
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: row; /* Desktop: horizontal links */
  justify-content: center; /* Center links horizontally */
  align-items: center;
  padding: 10px 20px; /* Vertical and horizontal padding for links */
}

.nav-link {
  color: #FFFFFF;
  text-decoration: none;
  padding: 8px 15px;
  font-size: 16px;
  white-space: nowrap;
  transition: color 0.3s ease, background-color 0.3s ease;
}
.nav-link:hover, .nav-link.active {
  color: #FCBC45; /* Highlight color on hover/active */
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

/* Hamburger menu (hidden on desktop) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1001; /* Above mobile-nav-buttons */
  position: relative; /* For icon animation */
}
.hamburger-icon {
  display: block;
  width: 25px;
  height: 3px;
  background-color: #FFFFFF;
  position: relative;
  transition: background-color 0.3s ease;
}
.hamburger-icon::before,
.hamburger-icon::after {
  content: '';
  display: block;
  width: 25px;
  height: 3px;
  background-color: #FFFFFF;
  position: absolute;
  left: 0;
  transition: transform 0.3s ease, top 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: rotate(45deg); top: 0; }
.hamburger-menu.active .hamburger-icon::after { transform: rotate(-45deg); top: 0; }

/* Mobile navigation buttons (hidden on desktop) */
.mobile-nav-buttons {
  display: none; /* Hidden on desktop */
  justify-content: center;
  gap: 12px;
  padding: 10px 20px;
  background-color: #000000; /* Same as header-top */
  min-height: 50px; /* Mobile height for buttons */
  align-items: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Add shadow to separate from content */
  z-index: 999; /* Below hamburger, above content */
}

/* Mobile menu overlay */
.mobile-menu-overlay {
  display: none; /* Hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 998; /* Below menu, above content */
}
.mobile-menu-overlay.active {
  display: block;
}

/* Mobile styles */
@media (max-width: 768px) {
  .header-top {
    min-height: 60px; /* Mobile header-top height */
    padding: 0 15px; /* Smaller padding for mobile */
  }
  .header-container {
    padding: 0; /* Reset padding, header-top handles it */
    width: 100%;
    max-width: none; /* Important: no max-width on mobile containers */
    justify-content: space-between; /* Hamburger left, Logo center, space right */
    position: relative; /* For logo absolute positioning */
  }
  .logo {
    flex: 1; /* Allows logo to take available space for centering */
    display: flex; /* Using flex for robust centering of text logo */
    justify-content: center;
    align-items: center;
    position: absolute; /* Position absolute for true center */
    left: 50%;
    transform: translateX(-50%);
    width: auto; /* Allow logo to size naturally */
    font-size: 24px; /* Adjust font size for mobile */
  }
  /* Specific rule for image logo centering (though we use text logo here) */
  .logo img {
    display: block !important;
    max-width: 100%;
    height: auto;
    max-height: 40px;
  }

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

  .hamburger-menu {
    display: block; /* Show hamburger on mobile */
    order: -1; /* Place hamburger on the left */
    margin-right: auto; /* Push logo to center */
    position: relative; /* Ensure it's clickable and on top */
  }

  .main-nav {
    display: none; /* Hidden by default on mobile */
    flex-direction: column; /* Vertical links */
    position: fixed;
    top: var(--header-offset); /* Start below the fixed header + buttons */
    left: 0;
    width: 280px; /* Sidebar width */
    height: calc(100% - var(--header-offset)); /* Fill remaining height */
    background-color: #1a1a1a; /* Same as desktop main-nav */
    transform: translateX(-100%); /* Slide out of view initially */
    transition: transform 0.3s ease-out;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3);
    overflow-y: auto; /* Enable scrolling for long menus */
    align-items: flex-start; /* Align menu items to the left */
    padding: 20px 0; /* Vertical padding inside menu */
  }
  .main-nav.active {
    display: flex; /* Show menu when active */
    transform: translateX(0); /* Slide into view */
  }
  .nav-container {
    flex-direction: column; /* Vertical links */
    align-items: flex-start; /* Align links to left */
    padding: 0; /* Reset padding, main-nav handles it */
    width: 100%;
    max-width: none; /* Important: no max-width on mobile containers */
  }
  .nav-link {
    width: 100%;
    padding: 12px 20px; /* Larger clickable area */
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05); /* Separator */
  }
  .nav-link:last-child {
    border-bottom: none;
  }

  .mobile-nav-buttons {
    display: flex; /* Show mobile buttons */
    width: 100%;
    max-width: none; /* Ensure it takes full width */
    position: relative; /* Ensure it's part of the flow below header-top */
  }
}

/* Footer styles */
.site-footer {
  background-color: #000000;
  color: #FFFFFF;
  padding: 40px 20px;
  font-size: 14px;
}

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

.footer-col {
  flex: 1;
  min-width: 250px;
}

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

.footer-about p {
  line-height: 1.6;
  margin: 0;
}

.footer-nav h3 {
  font-size: 18px;
  margin-top: 0;
  margin-bottom: 20px;
  color: #FCBC45; /* Highlight for section titles */
}

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

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

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

.footer-nav a:hover {
  color: #FCBC45;
}

@media (max-width: 768px) {
  .footer-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .footer-col {
    min-width: unset;
    width: 100%;
  }
  .footer-nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 20px; /* Adjust spacing for mobile footer links */
  }
  .footer-nav li {
    margin-bottom: 0;
  }
}
/* 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;
  }
}
