:root {
  --primary-color: #007BFF; /* Deep Blue */
  --secondary-color: #FFC107; /* Gold */
  --text-dark: #333;
  --text-light: #fff;
  --header-offset: 100px; /* Desktop: header-top (60px) + main-nav (40px) */
}

@media (max-width: 768px) {
  :root {
    --header-offset: 100px; /* Mobile: header-top (60px) + mobile-nav-buttons-wrapper (40px) */
  }
}

/* Base styles for header and footer */
.site-header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  background-color: #fff; /* Neutral background for the entire fixed header */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  display: flex; /* Use flex to stack header-top and main-nav */
  flex-direction: column;
}

.header-top {
  background-color: var(--primary-color); /* Deep blue for top bar */
  color: var(--text-light);
  padding: 15px 0; /* Vertically center content */
  min-height: 60px; /* Ensure minimum height */
  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; /* Padding for desktop, not mobile */
}

.logo {
  font-size: 1.8em;
  font-weight: bold;
  color: var(--secondary-color); /* Gold for logo text */
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 5px 0; /* Ensure some vertical padding for click area */
  display: block; /* Ensure it takes up space */
}

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

.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease, transform 0.2s ease;
  white-space: nowrap; /* Prevent button text from wrapping */
  color: var(--text-dark); /* Default text color for buttons */
}

.btn.login-btn {
  background-color: var(--secondary-color); /* Gold for Login */
  color: var(--text-dark);
}

.btn.login-btn:hover {
  background-color: #e6b000; /* Darken on hover */
  transform: translateY(-2px);
}

.btn.register-btn {
  background-color: var(--primary-color); /* Deep blue for Register */
  color: var(--text-light);
  border: 1px solid var(--secondary-color); /* Gold border */
}

.btn.register-btn:hover {
  background-color: #0069d9; /* Darken on hover */
  transform: translateY(-2px);
}

.main-nav {
  background-color: #f8f9fa; /* Light background for navigation, contrasting with header-top */
  padding: 10px 0;
  min-height: 40px; /* Ensure minimum height */
  display: flex; /* Show on desktop */
  justify-content: center;
  align-items: center;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 25px; /* Spacing between menu items */
  padding: 0 20px; /* Padding for desktop */
}

.nav-link {
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 0;
  position: relative;
  transition: color 0.3s ease;
  white-space: nowrap; /* Prevent menu items from wrapping */
}

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

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* Mobile specific elements (hidden by default on desktop) */
.mobile-nav-toggle {
  display: none; /* Hidden on desktop */
  cursor: pointer;
  width: 30px;
  height: 20px;
  position: relative;
  z-index: 1001; /* Above logo and buttons */
}

.mobile-nav-toggle .bar {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--text-light);
  border-radius: 2px;
  position: absolute;
  left: 0;
  transition: all 0.3s ease;
}

.mobile-nav-toggle .bar:nth-child(1) { top: 0; }
.mobile-nav-toggle .bar:nth-child(2) { top: 8px; }
.mobile-nav-toggle .bar:nth-child(3) { top: 16px; }

.mobile-nav-toggle.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.mobile-nav-toggle.active .bar:nth-child(2) { opacity: 0; }
.mobile-nav-toggle.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.mobile-nav-buttons-wrapper {
  display: none; /* Hidden on desktop */
  background-color: var(--primary-color); /* Same as header-top for continuity */
  padding: 10px 0;
  min-height: 40px; /* Ensure minimum height */
  border-top: 1px solid rgba(255,255,255,0.1); /* Separator */
}

.mobile-buttons-container {
  max-width: none; /* Must be 100% on mobile */
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 0 15px; /* Mobile padding */
}

.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.5);
  z-index: 999; /* Below nav, above content */
  cursor: pointer;
}

/* Footer styles */
.site-footer {
  background-color: #333; /* Dark background for footer */
  color: #f4f4f4;
  padding: 40px 0 20px;
  font-size: 0.9em;
}

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

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

.footer-logo {
  font-size: 1.5em;
  font-weight: bold;
  color: var(--secondary-color); /* Gold for footer logo */
  text-decoration: none;
  text-transform: uppercase;
  margin-bottom: 15px;
  display: block;
}

.footer-about p {
  line-height: 1.6;
  color: #ccc;
}

.footer-section h3 {
  color: var(--secondary-color); /* Gold for footer headings */
  margin-bottom: 15px;
  font-size: 1.2em;
}

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

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

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

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

.footer-contact p {
  margin-bottom: 8px;
  color: #ccc;
}

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

/* Mobile specific styles */
@media (max-width: 768px) {
  /* Mobile content overflow rules */
  .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 {
    flex-direction: column; /* Stack header-top and mobile buttons */
  }

  .header-top {
    padding: 15px 0; /* Maintain vertical padding */
  }

  .header-container {
    padding: 0 15px; /* Smaller padding for mobile */
    flex-wrap: nowrap; /* Prevent wrapping in header-top */
  }

  .mobile-nav-toggle {
    display: block; /* Show hamburger menu */
    order: 1; /* Place at the beginning */
  }

  .logo {
    order: 2; /* Place logo after hamburger */
    flex: 1; /* Allow logo to take available space */
    text-align: center; /* Center the text logo */
    font-size: 1.6em; /* Slightly smaller logo */
    padding: 0; /* Remove extra padding for better centering */
    color: var(--secondary-color); /* Ensure gold color */
  }

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

  .mobile-nav-buttons-wrapper {
    display: block; /* Show mobile buttons wrapper */
  }

  .main-nav {
    display: none; /* Hidden by default on mobile */
    position: fixed;
    top: var(--header-offset); /* Position below the fixed header (header-top + mobile-nav-buttons-wrapper) */
    left: 0;
    width: 280px; /* Width of the mobile menu */
    height: calc(100% - var(--header-offset)); /* Take full height below header */
    background-color: #333; /* Dark background for mobile menu */
    flex-direction: column;
    padding: 20px 0;
    transform: translateX(-100%); /* Start off-screen */
    transition: transform 0.3s ease;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    overflow-y: auto; /* Allow scrolling for long menus */
    align-items: flex-start; /* Align menu items to the left */
  }

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

  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    padding: 0 20px;
    width: 100%;
    max-width: none; /* Must be 100% on mobile */
  }

  .nav-link {
    color: var(--text-light); /* Light text for dark mobile menu */
    width: 100%;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  .nav-link:last-child {
    border-bottom: none;
  }

  .nav-link:hover {
    color: var(--secondary-color);
  }
  .nav-link::after { /* Remove hover underline for mobile */
    display: none;
  }

  .mobile-menu-overlay.active {
    display: block; /* Show overlay when menu is active */
  }

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

  .footer-section {
    min-width: unset;
    width: 100%;
    margin-bottom: 20px;
  }

  .footer-nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 20px; /* Space out links in a grid-like fashion */
  }
  .footer-nav li {
    margin-bottom: 0; /* Reset margin for inline display */
  }
}

/* Helper class for body overflow */
body.no-scroll {
  overflow: 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;
  }
}
