:root {
  --primary-color: #26A9E0; /* Light Blue */
  --secondary-color: #FFFFFF; /* White */
  --btn-login-color: #EA7C07; /* Orange */
  --dark-grey: #333333; /* For header-top background */
  --text-color-dark: #333333;
  --text-color-light: #FFFFFF;

  /* Desktop Header Offset Calculation: header-top (min-height 70px) + main-nav (min-height 50px) = 120px */
  --header-offset: 120px;
}

@media (max-width: 768px) {
  /* Mobile Header Offset Calculation: header-top (min-height 60px) + mobile-nav-buttons (min-height 50px) = 110px */
  :root {
    --header-offset: 110px;
  }
}

/* Base styles */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color-dark);
  padding-top: var(--header-offset); /* Ensure content is not hidden by fixed header */
  overflow-x: hidden; /* Prevent horizontal scroll on mobile */
}

body.no-scroll {
  overflow: hidden;
}

a {
  text-decoration: none;
  color: var(--primary-color);
}

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

/* Shared Container styles */
.header-container, .nav-container, .footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px; /* Desktop padding */
  box-sizing: border-box;
}

/* Site Header */
.site-header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  background-color: var(--secondary-color); /* Fallback, specific colors for header-top and main-nav */
}

/* Header Top Section */
.header-top {
  background-color: var(--dark-grey); /* Distinct from main-nav */
  min-height: 70px; /* Desktop height */
  display: flex;
  align-items: center;
}

.header-top .header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%; /* Ensure it takes full width within max-width */
}

/* Logo */
.logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--secondary-color); /* White text on dark grey background */
  padding: 5px 0; /* Vertical padding */
  display: block; /* Ensure it's not inline for better control */
}

/* Desktop Navigation Buttons */
.desktop-nav-buttons {
  display: flex;
  gap: 10px;
}

.btn {
  display: inline-block;
  padding: 10px 15px;
  border-radius: 5px;
  background-color: var(--btn-login-color); /* Orange */
  color: var(--secondary-color); /* White */
  font-weight: bold;
  text-align: center;
  transition: background-color 0.3s ease;
  white-space: nowrap; /* Prevent text wrapping on desktop */
  text-decoration: none; /* Remove underline for buttons */
}

.btn:hover {
  background-color: #d66c06; /* Slightly darker orange on hover */
}

/* Main Navigation */
.main-nav {
  background-color: var(--primary-color); /* Distinct from header-top */
  min-height: 50px; /* Desktop height */
  display: flex; /* Desktop default: flex */
  align-items: center;
}

.main-nav .nav-container {
  display: flex;
  justify-content: center; /* Center menu items on desktop */
  flex-wrap: wrap; /* Allow wrapping if too many items */
  gap: 20px;
  width: 100%; /* Ensure it takes full width within max-width */
}

.nav-link {
  color: var(--secondary-color); /* White text on primary blue background */
  font-weight: bold;
  padding: 5px 0;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: rgba(255, 255, 255, 0.7);
}

/* Hamburger Menu (Hidden on Desktop) */
.hamburger-menu {
  display: none; /* Hidden by default on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  position: relative;
  z-index: 1001; /* Above logo on mobile */
}

.hamburger-menu span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--secondary-color); /* White lines */
  margin: 5px 0;
  transition: all 0.3s ease;
}

/* Mobile Nav Buttons (Hidden on Desktop) */
.mobile-nav-buttons {
  display: none; /* Hidden by default on desktop */
}

/* Mobile Menu Overlay (Hidden on Desktop) */
.mobile-menu-overlay {
  display: none; /* Hidden by default on desktop */
}

/* Footer */
.site-footer {
  background-color: var(--dark-grey); /* Dark background for footer */
  color: var(--secondary-color); /* White text */
  padding: 40px 0;
  text-align: center;
}

.site-footer .footer-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
}

.footer-column {
  flex: 1;
  min-width: 200px;
  text-align: left;
}

.footer-logo {
  font-size: 20px;
  font-weight: bold;
  color: var(--secondary-color);
  margin-bottom: 15px;
  display: block;
}

.site-footer h3 {
  color: var(--primary-color);
  margin-bottom: 15px;
  font-size: 18px;
}

.site-footer p {
  font-size: 14px;
  margin-top: 15px;
}

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

.footer-nav a {
  color: var(--secondary-color);
  font-size: 14px;
  transition: color 0.3s ease;
}

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


/* --- Mobile Styles --- */
@media (max-width: 768px) {
  /* Prevent content overflow */
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: hidden;
  }

  /* Shared Container mobile overrides */
  .header-container, .nav-container, .footer-container {
    max-width: none; /* Remove max-width on mobile */
    width: 100%; /* Ensure full width */
    padding: 0 15px; /* Adjust padding for mobile */
  }

  /* Header Top Mobile Layout */
  .header-top {
    min-height: 60px; /* Mobile height */
  }

  .header-top .header-container {
    justify-content: space-between; /* Space between hamburger and logo */
    position: relative; /* For logo centering */
  }

  /* Hamburger Menu (Visible on Mobile) */
  .hamburger-menu {
    display: block;
    order: 1; /* Left side */
  }

  /* Logo Mobile Centering (text logo) */
  .logo {
    order: 2; /* Center */
    flex: 1; /* Take available space to help center */
    text-align: center; /* Center text logo */
    font-size: 20px;
    padding: 0; /* Remove vertical padding for cleaner look */
    line-height: 1; /* Adjust line-height for better centering */
    display: flex !important; /* Use flex for centering */
    justify-content: center !important;
    align-items: center !important;
  }

  /* Desktop Nav Buttons (Hidden on Mobile) */
  .desktop-nav-buttons {
    display: none;
  }

  /* Mobile Nav Buttons (Visible on Mobile) */
  .mobile-nav-buttons {
    display: flex !important; /* Force display on mobile */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px 15px; /* Padding for the button container */
    overflow: hidden; /* Prevent buttons from overflowing */
    gap: 10px;
    flex-wrap: nowrap; /* Ensure buttons stay in one row */
    background-color: var(--dark-grey); /* Match header-top background */
  }

  .mobile-nav-buttons .btn {
    flex: 1; /* Distribute space evenly */
    min-width: 0; /* Allow shrinking */
    max-width: calc(50% - 5px); /* Max width for two buttons with 10px gap */
    padding: 8px 12px; /* Smaller padding for mobile buttons */
    font-size: 13px; /* Smaller font size for mobile buttons */
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word; /* Ensure long words break */
    overflow-wrap: break-word; /* Standard property for word breaking */
  }

  /* Main Navigation (Mobile Menu) */
  .main-nav {
    display: none; /* Hidden by default on mobile */
    position: fixed;
    top: var(--header-offset); /* Position below fixed header and mobile buttons */
    left: 0;
    width: 280px; /* Width of the mobile menu */
    height: calc(100vh - var(--header-offset)); /* Full height below header */
    background-color: var(--primary-color);
    flex-direction: column; /* Vertical layout for menu items */
    padding: 20px;
    box-sizing: border-box;
    transform: translateX(-100%); /* Slide out of view initially */
    transition: transform 0.3s ease;
    z-index: 999; /* Below hamburger menu, above overlay */
    overflow-y: auto; /* Enable scrolling for long menus */
  }

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

  .main-nav .nav-container {
    flex-direction: column; /* Stack links vertically */
    align-items: flex-start; /* Align links to the left */
    gap: 15px;
    padding: 0; /* Remove container padding as nav has padding */
    width: auto; /* Let content determine width */
  }

  .nav-link {
    width: 100%; /* Full width links */
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2); /* Separator */
  }
  .nav-link:last-child {
      border-bottom: none;
  }

  /* Hamburger Menu Animation */
  .hamburger-menu.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .hamburger-menu.active span:nth-child(2) {
    opacity: 0;
  }
  .hamburger-menu.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  /* 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.5); /* Semi-transparent black */
    z-index: 998; /* Below menu, above page content */
  }

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

  /* Footer Mobile Layout */
  .site-footer .footer-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 15px;
  }

  .footer-column {
    width: 100%;
    min-width: unset;
    margin-bottom: 30px;
    text-align: center;
  }
  .footer-column:last-child {
    margin-bottom: 0;
  }
  .site-footer h3 {
    margin-top: 0;
  }
  .footer-nav {
    padding-left: 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;
  }
}
