:root {
  --primary-color: #26A9E0;
  --secondary-color: #FFFFFF;
  --login-btn-color: #EA7C07;
  --dark-background: #333333; /* Dark grey for header-top */
  --text-dark: #000000;
  --text-light: #FFFFFF;
  --header-offset: 120px; /* Desktop: header-top (70px) + main-nav (50px) */
}
@media (max-width: 768px) {
  :root {
    --header-offset: 130px; /* Mobile: header-top (70px) + mobile-nav-buttons (60px) */
  }
}

html {
  box-sizing: border-box;
}
*,
*::before,
*::after {
  box-sizing: inherit;
}
body {
  margin: 0;
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  padding-top: var(--header-offset); /* Ensure content is not covered by fixed header */
  overflow-x: hidden; /* Prevent horizontal scroll on body */
}
a {
  text-decoration: none;
  color: inherit;
}
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;
}

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

/* Header Top */
.header-top {
  background-color: var(--dark-background); /* Dark grey */
  color: var(--text-light);
  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%;
  padding: 0 30px; /* Ensure logo and buttons don't touch edges */
}
.site-header .logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--secondary-color); /* White logo on dark background */
  padding: 10px 0; /* Vertical padding for logo */
  white-space: nowrap;
}
.site-header .logo:hover {
  color: var(--primary-color);
}

/* Desktop Nav Buttons */
.desktop-nav-buttons {
  display: flex;
  gap: 15px;
}
.desktop-nav-buttons .btn {
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: bold;
  transition: background-color 0.3s ease, transform 0.2s ease;
  white-space: nowrap;
  text-decoration: none; /* Remove underline */
  color: var(--text-light); /* White text on buttons */
  border: none;
  cursor: pointer;
}
.desktop-nav-buttons .btn-register {
  background-color: var(--primary-color); /* Light blue */
}
.desktop-nav-buttons .btn-register:hover {
  background-color: #1a8cc4; /* Slightly darker blue */
  transform: translateY(-2px);
}
.desktop-nav-buttons .btn-login {
  background-color: var(--login-btn-color); /* Orange */
}
.desktop-nav-buttons .btn-login:hover {
  background-color: #c46200; /* Slightly darker orange */
  transform: translateY(-2px);
}

/* Main Navigation (Desktop) */
.main-nav {
  background-color: var(--primary-color); /* Light blue */
  min-height: 50px; /* Desktop height */
  display: flex; /* Desktop default: flex */
  align-items: center;
}
.main-nav .nav-container {
  display: flex;
  justify-content: center; /* Center nav items */
  align-items: center;
  width: 100%;
  padding: 0 20px;
}
.main-nav .nav-link {
  color: var(--text-light); /* White text for nav links */
  padding: 15px 20px;
  font-weight: bold;
  transition: background-color 0.3s ease, color 0.3s ease;
  white-space: nowrap;
}
.main-nav .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

/* Hamburger Menu (Hidden on Desktop) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  width: 30px;
  height: 20px;
  position: relative;
  cursor: pointer;
  z-index: 1001;
}
.hamburger-menu span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--text-light);
  border-radius: 2px;
  position: absolute;
  left: 0;
  transition: all 0.3s ease;
}
.hamburger-menu span:nth-child(1) { top: 0; }
.hamburger-menu span:nth-child(2) { top: 8px; }
.hamburger-menu span:nth-child(3) { top: 16px; }

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

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

/* Footer */
.site-footer {
  background-color: var(--dark-background); /* Dark grey */
  color: var(--text-light);
  padding: 40px 0 20px;
  font-size: 14px;
}
.site-footer .footer-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 30px;
  padding: 0 20px;
}
.site-footer .footer-col {
  flex: 1;
  min-width: 250px;
}
.site-footer h3, .site-footer h4 {
  color: var(--secondary-color);
  margin-top: 0;
  margin-bottom: 15px;
}
.site-footer .footer-logo {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 20px;
}
.site-footer p {
  line-height: 1.8;
}
.site-footer ul {
  padding: 0;
  list-style: none;
}
.site-footer ul li {
  margin-bottom: 10px;
}
.site-footer ul li a {
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.3s ease;
}
.site-footer ul li a:hover {
  color: var(--primary-color);
}
.site-footer .footer-bottom {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
}

/* Responsive adjustments for Mobile */
@media (max-width: 768px) {
  /* Body content 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;
  }

  /* Header Top Mobile */
  .header-top .header-container {
    padding: 0 15px; /* Smaller padding for mobile */
    justify-content: space-between;
  }
  .hamburger-menu {
    display: block; /* Show hamburger on mobile */
    order: 1;
    width: 30px; /* Explicit width for hamburger */
  }
  .site-header .logo {
    order: 2;
    flex-grow: 1; /* Allow logo to take available space */
    text-align: center; /* Center text logo */
    font-size: 20px;
    padding: 10px 0;
  }
  .header-balance-right {
    display: block;
    order: 3;
    width: 30px; /* Same width as hamburger for balancing */
  }
  .desktop-nav-buttons {
    display: none; /* Hide desktop buttons on mobile */
  }

  /* Hamburger Menu Active State */
  .hamburger-menu.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
  .hamburger-menu.active span:nth-child(2) { opacity: 0; }
  .hamburger-menu.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

  /* Mobile Nav Buttons */
  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    width: 100%; max-width: 100%;
    box-sizing: border-box;
    padding: 10px 15px; /* Smaller padding */
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
    background-color: var(--dark-background); /* Match header-top background */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    min-height: 60px; /* Mobile buttons height */
    align-items: center;
  }
  .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 for mobile buttons */
    font-size: 13px; /* Smaller font size */
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word; /* Allow text wrapping */
    overflow-wrap: break-word;
    text-align: center;
  }

  /* Main Navigation (Mobile) */
  .main-nav {
    display: none; /* Hidden by default on mobile */
    flex-direction: column; /* Vertical layout */
    position: fixed; /* Fixed position for slide-in */
    top: var(--header-offset); /* Start below the header and mobile buttons */
    left: 0;
    width: 280px; /* Mobile menu width */
    height: calc(100vh - var(--header-offset)); /* Full height minus header */
    background-color: var(--primary-color); /* Match desktop main nav */
    transform: translateX(-100%); /* Off-screen to the left */
    transition: transform 0.3s ease;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    overflow-y: auto; /* Allow scrolling for long menus */
  }
  .main-nav.active {
    display: flex; /* Show menu when active */
    transform: translateX(0); /* Slide into view */
  }
  .main-nav .nav-container {
    flex-direction: column; /* Vertical links */
    padding: 20px 0;
    align-items: flex-start; /* Align links to the left */
  }
  .main-nav .nav-link {
    width: 100%;
    padding: 12px 20px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  .main-nav .nav-link:last-child {
    border-bottom: none;
  }

  /* Mobile Menu Overlay */
  .mobile-menu-overlay {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    transition: opacity 0.3s ease;
    opacity: 0;
  }
  .mobile-menu-overlay.active {
    display: block;
    opacity: 1;
  }

  /* Footer Mobile */
  .site-footer .footer-container {
    flex-direction: column;
    gap: 20px;
  }
  .site-footer .footer-col {
    min-width: unset;
    width: 100%;
    text-align: center;
  }
  .site-footer h3, .site-footer h4 {
    text-align: center;
  }
  .site-footer ul {
    text-align: center;
  }
}

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