:root {
  --primary-color: #26A9E0;
  --secondary-color: #FFFFFF;
  --button-login-color: #EA7C07;
  --text-dark: #333333;
  --text-light: #FFFFFF;
  --header-offset: 110px; /* Desktop: header-top (60px) + main-nav (50px) */
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding-top: var(--header-offset);
  color: var(--text-dark);
  background-color: var(--secondary-color);
  overflow-x: hidden; /* Prevent horizontal scroll on body */
}

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

a:hover {
  text-decoration: underline;
}

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

/* --- Site Header (Fixed Navigation) --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  background-color: var(--secondary-color); /* Fallback for transparency */
}

/* Header Top Section (Logo & Desktop Buttons) */
.header-top {
  background-color: #1A7BA8; /* Darker blue for contrast with main-nav */
  min-height: 60px; /* Ensure minimum height */
  display: flex;
  align-items: center;
  padding: 5px 0; /* Vertical padding */
}

.header-top .header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap; /* Prevent wrapping on desktop */
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--secondary-color); /* White text for dark background */
  padding: 5px 0;
  white-space: nowrap; /* Prevent logo text from wrapping */
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 250px; /* Limit logo width */
  display: block; /* Ensure it's a block for centering on mobile */
}

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

/* Main Navigation (Desktop) */
.main-nav {
  background-color: var(--primary-color); /* Lighter blue for main nav */
  min-height: 50px;
  display: flex; /* Desktop default: flex */
  align-items: center;
  flex-direction: row; /* Desktop default: row */
  position: static; /* Desktop default: static */
  width: 100%;
  transition: transform 0.3s ease-in-out; /* For mobile slide effect */
}

.main-nav .nav-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 25px; /* Spacing between nav links */
  flex-wrap: wrap; /* Allow wrapping if many links */
}

.nav-link {
  color: var(--secondary-color);
  font-weight: bold;
  padding: 10px 0;
  white-space: nowrap;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: #FFD700; /* Gold hover effect */
  text-decoration: none;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
  color: var(--secondary-color); /* White text for buttons */
}

.btn-register {
  background-color: var(--button-login-color); /* Orange for register */
  border: 2px solid var(--button-login-color);
}

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

.btn-login {
  background-color: var(--primary-color); /* Primary blue for login */
  border: 2px solid var(--primary-color);
}

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

/* Hamburger Menu (Mobile Only) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1001;
  position: absolute; /* Position relative to header-top for mobile */
  left: 15px; /* Align with mobile container padding */
  top: 50%;
  transform: translateY(-50%);
}

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

/* Hamburger Menu Active State */
.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);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

/* Mobile Nav Buttons (Always visible on mobile) */
.mobile-nav-buttons {
  display: none; /* Hidden on desktop */
  background-color: var(--secondary-color); /* White background for buttons */
  padding: 10px 15px; /* Small padding for mobile */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
}

/* --- Site Footer --- */
.site-footer {
  background-color: #000000; /* Explicitly allowed black */
  color: var(--secondary-color);
  padding: 40px 0 20px;
  font-size: 14px;
}

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

.footer-col {
  flex: 1;
  min-width: 200px;
  max-width: 300px;
}

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

.footer-description {
  line-height: 1.6;
  color: #CCCCCC;
}

.site-footer h3 {
  font-size: 16px;
  margin-bottom: 15px;
  color: var(--primary-color); /* Primary color for footer headings */
}

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

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

.site-footer .footer-nav a {
  color: #CCCCCC;
  transition: color 0.3s ease;
}

.site-footer .footer-nav a:hover {
  color: var(--primary-color);
  text-decoration: none;
}

.copyright {
  text-align: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #333333;
  color: #CCCCCC;
}

/* --- Responsive Styles (Mobile) --- */
@media (max-width: 768px) {
  .header-container,
  .nav-container,
  .footer-container {
    padding-left: 15px;
    padding-right: 15px;
    max-width: none; /* Ensure full width on mobile */
    width: 100%;
  }

  /* Header Top Mobile */
  .header-top .header-container {
    justify-content: center; /* Center logo by default */
    position: relative; /* For absolute positioning of hamburger */
    min-height: 60px;
  }

  .hamburger-menu {
    display: block; /* Show hamburger on mobile */
  }

  .logo {
    flex: 1 !important; /* Take available space */
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    max-width: calc(100% - 100px); /* Leave space for hamburger and potential right-side elements */
    font-size: 20px; /* Smaller font for logo */
  }

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

  /* Mobile Nav Buttons */
  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    width: 100%; max-width: 100%;
    box-sizing: border-box;
    padding-left: 15px; padding-right: 15px;
    overflow: hidden; /* Prevent overflow */
    gap: 10px;
    flex-wrap: nowrap; /* Prevent buttons from wrapping */
    justify-content: center; /* Center buttons if less than 2 */
  }

  .mobile-nav-buttons .btn {
    flex: 1; min-width: 0;
    max-width: calc(50% - 5px); /* Max width for two buttons with gap */
    box-sizing: border-box;
    padding: 8px 12px; /* Smaller padding */
    font-size: 13px; /* Smaller font size */
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Main Navigation (Mobile - hidden by default, slides in) */
  .main-nav {
    display: none; /* Hidden by default */
    position: fixed;
    top: var(--header-offset); /* Start below the header + mobile buttons */
    left: 0;
    width: 280px; /* Sidebar width */
    height: calc(100% - var(--header-offset)); /* Full height below header */
    background-color: var(--primary-color);
    flex-direction: column; /* Vertical links */
    transform: translateX(-100%); /* Off-screen to the left */
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    overflow-y: auto; /* Scroll if content is long */
  }

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

  .main-nav .nav-container {
    flex-direction: column;
    align-items: flex-start; /* Align links to the left */
    gap: 0; /* Remove gap for vertical list */
    padding: 20px 15px;
  }

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

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

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

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

  .site-footer .footer-nav {
    margin-bottom: 20px;
  }

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

  .site-footer h3 {
    margin-top: 20px;
  }

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