:root {
  --primary-color: #017439;
  --secondary-color: #FFFFFF;
  --btn-register-bg: #C30808;
  --btn-login-bg: #C30808;
  --btn-text-color: #FFFF00;
  --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 (50px) */
  }
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding-top: var(--header-offset); /* Ensure content is not hidden by fixed header */
  line-height: 1.6;
  color: #333;
  overflow-x: hidden; /* Prevent body overflow on mobile */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

/* Header Top Section */
.header-top {
  background-color: var(--primary-color); /* Dark green for top bar */
  padding: 10px 0;
  min-height: 40px; /* Base height for logo/hamburger */
  display: flex;
  align-items: center;
  position: relative; /* For absolute logo positioning on mobile */
}

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

/* Logo */
.logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--btn-text-color); /* Yellow for contrast on dark green */
  text-decoration: none;
  white-space: nowrap;
  padding: 5px 0; /* Adjust padding for better visual alignment */
}

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

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

.btn-register {
  background-color: var(--btn-register-bg); /* Red */
  color: var(--btn-text-color); /* Yellow */
}

.btn-login {
  background-color: var(--btn-login-bg); /* Red */
  color: var(--btn-text-color); /* Yellow */
}

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

/* Main Navigation Section (Desktop) */
.main-nav {
  background-color: var(--secondary-color); /* White for main nav */
  padding: 10px 0;
  display: flex; /* Desktop: visible, row */
  flex-direction: row;
  align-items: center;
  justify-content: center;
  min-height: 30px; /* Base height for nav links */
}

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

.nav-link {
  color: var(--primary-color); /* Green for nav links */
  text-decoration: none;
  font-weight: bold;
  padding: 5px 0;
  transition: color 0.3s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: #005f2f; /* Darker green on hover */
}

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

.hamburger-menu span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--btn-text-color); /* Yellow for contrast */
  margin-bottom: 5px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger-menu span:last-child {
  margin-bottom: 0;
}

/* Mobile Navigation Buttons (Hidden on Desktop) */
.mobile-nav-buttons {
  display: none; /* Hidden by default on desktop */
  background-color: var(--primary-color); /* Same as header-top */
  padding: 10px 15px; /* Added padding here for spacing */
  overflow: hidden;
  box-sizing: border-box;
}

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


/* Site Footer */
.site-footer {
  background-color: #222222; /* Dark grey for footer */
  color: var(--secondary-color); /* White text */
  padding: 40px 0 20px;
  font-size: 14px;
}

.site-footer h3 {
  color: var(--btn-text-color); /* Yellow for footer headings */
  font-size: 18px;
  margin-bottom: 15px;
}

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

.footer-section {
  flex: 1;
  min-width: 250px;
  margin-bottom: 20px;
}

.footer-section p {
  line-height: 1.8;
  color: #ccc;
}

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

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

.footer-section ul li a {
  color: var(--secondary-color); /* White for footer links */
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section ul li a:hover {
  color: var(--btn-text-color); /* Yellow on hover */
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  margin-top: 20px;
  border-top: 1px solid #333;
  color: #ccc;
}

/* Mobile Specific Styles */
@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;
  }

  /* Header Top Mobile */
  .header-top .header-container {
    padding-left: 15px;
    padding-right: 15px;
    justify-content: space-between;
    position: relative; /* For absolute logo positioning */
  }

  /* Hamburger Menu Visible on Mobile */
  .hamburger-menu {
    display: block;
    order: 0; /* Leftmost */
  }

  /* Logo Centered on Mobile (using absolute positioning for robust centering) */
  .logo {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    max-width: calc(100% - 80px); /* Account for hamburger menu space */
    font-size: 20px;
  }
  .logo img {
    display: block !important;
    max-width: 100%;
    height: auto;
    max-height: 40px;
  }

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

  /* Mobile Navigation Buttons Visible on Mobile */
  .mobile-nav-buttons {
    display: flex !important; /* Override desktop hidden */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding-left: 15px;
    padding-right: 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
    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 2 buttons with 10px gap */
    box-sizing: border-box;
    padding: 8px 12px;
    font-size: 13px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }


  /* Main Navigation (Hamburger Menu Content) */
  .main-nav {
    display: none; /* Hidden by default */
    position: fixed;
    top: var(--header-offset); /* Start below the fixed header + mobile buttons */
    left: 0;
    width: 280px; /* Sidebar width */
    height: calc(100% - var(--header-offset)); /* Full height below header */
    background-color: var(--primary-color); /* Dark green sidebar */
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
    transform: translateX(-100%); /* Off-screen initially */
    transition: transform 0.3s ease-in-out;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    overflow-y: auto; /* Scroll if content is too long */
    z-index: 999; /* Below overlay, above content */
  }

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

  .main-nav .nav-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    padding: 0;
    max-width: none; /* No max-width on mobile container */
    width: 100%;
  }

  .main-nav .nav-link {
    color: var(--secondary-color); /* White text for sidebar links */
    width: 100%;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  .main-nav .nav-link:last-child {
    border-bottom: none;
  }
  .nav-link:hover {
    color: var(--btn-text-color); /* Yellow on hover */
  }

  /* Hamburger Menu Active State (X icon) */
  .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: rgba(0, 0, 0, 0.5);
    z-index: 998; /* Below menu, above content */
    transition: opacity 0.3s ease-in-out;
    opacity: 0;
  }

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

  /* Footer Mobile */
  .footer-container {
    flex-direction: column;
    padding-left: 15px;
    padding-right: 15px;
  }
  .footer-section {
    min-width: unset;
    width: 100%;
  }
}

/* Helper class to prevent body scroll */
body.no-scroll {
  overflow: hidden;
}

/* General Link styling (for buttons) */
a.btn {
  text-decoration: none;
}
/* 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;
  }
}
