html {
  scroll-behavior: smooth;
}
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding-top: var(--header-offset); /* Ensure content isn't hidden by fixed header */
  background-color: #FFFFFF;
  color: #333;
  overflow-x: hidden; /* Prevent horizontal scroll */
}
/* Body scroll control for mobile menu */
body.no-scroll {
  overflow: hidden;
}
a {
  text-decoration: none;
  color: inherit;
}
:root {
  --primary-color: #017439;
  --secondary-color: #FFFFFF;
  --button-register-bg: #C30808;
  --button-login-bg: #C30808;
  --button-text-color: #FFFF00;
  --header-offset: 110px; /* Desktop: header-top (60px) + main-nav (50px) */
}

/* 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, specific colors for sections */
}

/* Header Top Section (Desktop) */
.header-top {
  background-color: var(--primary-color); /* Distinct from main-nav */
  padding: 15px 0; /* Vertical padding for header-top content */
  min-height: 60px; /* Ensure minimum height for header-top */
  display: flex; /* Use flex to align items for offset calculation */
  align-items: center;
}
.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 30px; /* Padding for content inside container */
  width: 100%;
  box-sizing: border-box;
}

/* Logo */
.logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--secondary-color);
  white-space: nowrap;
  padding: 0; /* Rely on container padding */
}
.logo:hover {
  opacity: 0.9;
}

/* Desktop Navigation Buttons */
.desktop-nav-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 0; /* Rely on container padding */
}

/* Buttons General Styling */
.btn {
  padding: 10px 18px;
  border-radius: 5px;
  font-weight: bold;
  text-align: center;
  transition: background-color 0.3s ease, transform 0.2s ease;
  white-space: nowrap;
  text-decoration: none; /* Remove underline */
  cursor: pointer;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn-register {
  background-color: var(--button-register-bg);
  color: var(--button-text-color);
}
.btn-login {
  background-color: var(--button-login-bg);
  color: var(--button-text-color);
}

/* Main Navigation (Desktop) */
.main-nav {
  background-color: #2c3e50; /* A darker shade for contrast, not primary/secondary directly */
  padding: 10px 0; /* Vertical padding for nav links */
  min-height: 50px; /* Ensure minimum height for main-nav */
  display: flex; /* Desktop default: flex */
  align-items: center;
}
.main-nav .nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: row; /* Desktop default: row */
  justify-content: center;
  align-items: center;
  padding: 0 20px;
  width: 100%;
  box-sizing: border-box;
}
.main-nav .nav-link {
  color: var(--secondary-color);
  padding: 8px 15px;
  font-size: 16px;
  white-space: nowrap;
  transition: background-color 0.3s ease;
  border-radius: 4px;
}
.main-nav .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Hamburger Menu (Hidden on Desktop) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 24px;
  position: relative;
  z-index: 1001;
  order: 0; /* Leftmost on mobile */
  margin-right: 15px; /* Space between hamburger and logo on mobile */
}
.hamburger-menu span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--secondary-color);
  margin-bottom: 5px;
  transition: all 0.3s ease;
}
.hamburger-menu span:last-child {
  margin-bottom: 0;
}
.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 Navigation Buttons (Hidden on Desktop) */
.mobile-nav-buttons {
  display: none; /* Hidden on desktop */
}

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

/* Footer Styles */
.site-footer {
  background-color: var(--primary-color);
  color: var(--secondary-color);
  padding: 40px 0 20px;
  font-size: 14px;
  line-height: 1.6;
}
.site-footer .footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 0 30px;
  box-sizing: border-box;
}
.site-footer .footer-col {
  flex: 1;
  min-width: 250px;
  margin-bottom: 20px;
  padding-right: 20px;
}
.site-footer .footer-col:last-child {
  padding-right: 0;
}
.site-footer h3 {
  color: var(--secondary-color);
  font-size: 18px;
  margin-bottom: 15px;
}
.site-footer p {
  margin-bottom: 10px;
}
.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.site-footer ul li {
  margin-bottom: 8px;
}
.site-footer ul li a {
  color: var(--secondary-color);
  opacity: 0.8;
  transition: opacity 0.3s ease;
}
.site-footer ul li a:hover {
  opacity: 1;
  text-decoration: underline;
}
.footer-bottom {
  text-align: center;
  padding-top: 20px;
  margin-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.footer-bottom p {
  margin: 0;
  color: var(--secondary-color);
  opacity: 0.7;
}

/* Mobile Styles */
@media (max-width: 768px) {
  :root {
    --header-offset: 112px; /* Mobile: header-top (60px) + mobile-nav-buttons (52px) */
  }
  body {
    overflow-x: hidden;
  }
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }

  .site-header {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  }

  /* Header Top Mobile Layout */
  .header-top {
    padding: 10px 0; /* Adjust padding for mobile */
    min-height: 60px; /* Maintain min-height */
  }
  .header-container {
    padding: 0 15px; /* Smaller padding for mobile */
    width: 100%;
    max-width: none; /* No max-width on mobile */
    justify-content: space-between; /* Hamburger left, logo center, space right */
    position: relative; /* For logo centering */
  }
  .hamburger-menu {
    display: block; /* Show hamburger on mobile */
    order: 0; /* Leftmost */
    position: relative; /* ensure it's above logo if logo is absolute */
    z-index: 2;
  }
  .logo {
    font-size: 20px;
    color: var(--secondary-color);
    white-space: nowrap;
    position: absolute; /* Absolute positioning for precise centering */
    left: 50%;
    transform: translateX(-50%);
    display: flex; /* To center potential image within it */
    align-items: center;
    justify-content: center;
    height: 100%; /* To ensure vertical centering if flex is used */
    max-width: calc(100% - 100px); /* Adjust max-width to not overlap hamburger/empty space */
  }
  .desktop-nav-buttons {
    display: none; /* Hide desktop buttons on mobile */
  }

  /* Mobile Navigation Buttons */
  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px 15px; /* Padding for the button container */
    overflow: hidden; /* Prevent overflow */
    gap: 10px;
    flex-wrap: nowrap; /* Ensure buttons stay in one row */
    background-color: var(--primary-color); /* Same as header-top for continuity */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Slight shadow */
    min-height: 52px; /* For offset calculation */
  }
  .mobile-nav-buttons .btn {
    flex: 1;
    min-width: 0;
    max-width: calc(50% - 5px); /* Half width minus half of 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; /* Allow text wrapping */
  }

  /* Main Navigation Mobile (Hamburger Menu Content) */
  .main-nav {
    display: none; /* Hidden by default on mobile */
    flex-direction: column; /* Vertical layout for mobile menu */
    position: fixed; /* Fixed position for mobile menu */
    top: var(--header-offset); /* Position below fixed header and mobile buttons */
    left: 0;
    width: 280px; /* Width of the mobile menu */
    height: calc(100% - var(--header-offset)); /* Full height below header */
    background-color: #34495e; /* Darker background for mobile menu */
    transform: translateX(-100%); /* Start off-screen to the left */
    transition: transform 0.3s ease;
    overflow-y: auto; /* Enable scrolling for long menus */
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
  }
  .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;
    padding: 20px 15px;
    width: 100%;
    max-width: none; /* No max-width on mobile */
  }
  .main-nav .nav-link {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    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: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999; /* Below menu, above content */
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  .mobile-menu-overlay.active {
    display: block; /* Show when active */
    opacity: 1;
  }

  /* Footer Mobile Layout */
  .site-footer .footer-container {
    flex-direction: column;
    padding: 0 15px;
  }
  .site-footer .footer-col {
    min-width: unset;
    padding-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
    margin-bottom: 15px;
  }
  .site-footer .footer-col:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 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;
  }
}
