:root {
  --primary-color: #26A9E0;
  --secondary-color: #FFFFFF;
  --login-button-color: #EA7C07;
  --background-color: #FFFFFF;
  --dark-text-color: #000000;
  --header-top-bg: #1A8EC7; /* Slightly darker blue */
  --main-nav-bg: #26A9E0; /* Primary blue */
  --footer-bg: #2C3E50; /* Dark blue-grey */
  --header-offset: 110px; /* Desktop: header-top (60px) + main-nav (50px) */
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: 'Arial', sans-serif;
  margin: 0;
  padding-top: var(--header-offset); /* Apply header offset to body */
  line-height: 1.6;
  color: #333;
  background-color: var(--background-color);
  overflow-x: hidden; /* Prevent body overflow-x */
}

/* Shared Container Styles */
.header-container,
.nav-container,
.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 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);
  min-height: 110px; /* Desktop min-height */
  background-color: var(--secondary-color); /* Default background, will be covered by sections */
}

/* Header Top Section */
.header-top {
  background-color: var(--header-top-bg);
  padding: 10px 0;
  display: flex;
  align-items: center;
  min-height: 60px; /* Desktop header-top height */
}

.header-top .header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo {
  color: var(--secondary-color);
  font-size: 28px;
  font-weight: bold;
  text-decoration: none;
  display: block; /* Ensure logo is visible */
  padding: 5px 0;
  white-space: nowrap;
}

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

.btn {
  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;
  display: inline-block;
  text-align: center;
  line-height: 1;
  box-sizing: border-box;
}

.btn-login {
  background-color: var(--login-button-color);
  color: var(--secondary-color);
}

.btn-register {
  background-color: var(--primary-color);
  color: var(--secondary-color);
}

.btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

/* Main Navigation */
.main-nav {
  background-color: var(--main-nav-bg);
  padding: 5px 0;
  display: flex; /* Desktop default: visible */
  flex-direction: row; /* Desktop default: horizontal */
  align-items: center;
  min-height: 50px; /* Desktop main-nav height */
}

.main-nav .nav-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

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

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

/* Hamburger Menu (Hidden on Desktop) */
.hamburger-menu {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 25px;
  cursor: pointer;
  z-index: 1001;
}

.hamburger-menu span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--secondary-color);
  transition: all 0.3s ease;
  border-radius: 2px;
}

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

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

/* Footer */
.site-footer {
  background-color: var(--footer-bg);
  color: var(--secondary-color);
  padding: 40px 0 20px 0;
  font-size: 14px;
}

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

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

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

.footer-description {
  line-height: 1.8;
  margin-top: 0;
}

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

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

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

.footer-nav a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  margin-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
  margin: 0;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .site-header {
    min-height: auto; /* Allow height to adjust for mobile */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  }

  .header-top {
    padding: 10px 0;
    min-height: 60px; /* Mobile header-top height */
    position: relative; /* For proper flex ordering and logo centering */
  }

  .header-top .header-container {
    padding: 0 15px;
    max-width: none; /* Mobile container full width */
    width: 100%;
    justify-content: space-between; /* Hamburger left, Logo center, empty space right */
  }

  .hamburger-menu {
    display: flex;
    order: 1;
    margin-right: auto; /* Push hamburger to left */
  }

  .hamburger-menu.active span:nth-child(1) {
    transform: translateY(11px) rotate(45deg);
  }

  .hamburger-menu.active span:nth-child(2) {
    opacity: 0;
  }

  .hamburger-menu.active span:nth-child(3) {
    transform: translateY(-11px) rotate(-45deg);
  }

  .logo {
    flex: 1 !important; /* Take remaining space */
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    order: 2;
    padding: 0;
    font-size: 24px;
  }

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

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px 15px; /* Added padding to container */
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
    background-color: var(--header-top-bg); /* Same background as header-top */
    justify-content: center;
    min-height: 60px; /* Mobile nav buttons height */
  }

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

  .main-nav {
    display: none; /* Hidden by default on mobile */
    position: fixed;
    top: var(--header-offset); /* Position below fixed header + mobile buttons */
    left: 0;
    width: 280px;
    height: calc(100% - var(--header-offset)); /* Full height below header */
    background-color: var(--main-nav-bg);
    flex-direction: column; /* Vertical menu */
    transform: translateX(-100%); /* Off-screen by default */
    transition: transform 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    z-index: 999;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

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

  .main-nav .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 15px;
    width: 100%;
    max-width: none; /* Mobile container full width */
  }

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

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

  .mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    transition: opacity 0.3s ease;
    opacity: 0;
  }

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

  body.no-scroll {
    overflow: hidden;
  }

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

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

  .footer-logo {
    margin-left: auto;
    margin-right: auto;
  }

  /* Mobile content overflow prevention */
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
}

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