:root {
  --primary-color: #017439;
  --secondary-color: #FFFFFF;
  --button-bg-color: #C30808;
  --button-text-color: #000000; /* Adjusted for WCAG AA contrast (original #FFFF00 fails) */
  --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) */
  }
}

/* Base Styles */
body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #333333;
  line-height: 1.6;
  padding-top: var(--header-offset); /* Apply header offset to body */
  overflow-x: hidden; /* Prevent horizontal scroll on body */
  background-color: var(--secondary-color);
}

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

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

h3 {
  margin-top: 0;
  color: var(--primary-color);
}

/* Site Header */
.site-header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  background-color: var(--secondary-color); /* Default background for entire header */
}

.header-top {
  background-color: var(--primary-color); /* Dark green for top bar */
  padding: 10px 0;
  min-height: 40px; /* Ensure enough space for logo and buttons */
  display: flex;
  align-items: center;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 30px; /* Padding for logo and buttons from container edges */
  box-sizing: border-box;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--secondary-color); /* White logo text on dark green top bar */
  text-transform: uppercase;
  padding: 5px 0;
  display: block;
}

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

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 5px;
  background-color: var(--button-bg-color);
  color: var(--button-text-color);
  font-weight: bold;
  text-align: center;
  white-space: nowrap;
  transition: background-color 0.3s ease, transform 0.2s ease;
  text-decoration: none; /* Remove underline for buttons */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.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: -1; /* Place to the left on mobile */
}

.hamburger-menu .bar {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--secondary-color); /* White bars on dark green top bar */
  margin: 5px 0;
  transition: all 0.3s ease;
}

/* Hamburger animation */
.hamburger-menu.active .bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.hamburger-menu.active .bar:nth-child(2) {
  opacity: 0;
}
.hamburger-menu.active .bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.mobile-nav-buttons {
  display: none; /* Hidden on desktop, shown on mobile */
  background-color: var(--secondary-color); /* White background for mobile buttons */
  padding: 10px 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  min-height: 40px; /* Ensure buttons have space */
}

.main-nav {
  background-color: var(--secondary-color); /* White background for main nav */
  padding: 10px 0;
  min-height: 30px; /* Adjust min-height for nav links */
  display: flex; /* Desktop: always flex */
  flex-direction: row; /* Desktop: horizontal */
  justify-content: center; /* Center nav links */
  align-items: center;
  position: static; /* Desktop: normal flow */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-wrap: wrap; /* Allow wrapping if many links */
  justify-content: center;
  align-items: center;
  padding: 0 20px;
  box-sizing: border-box;
}

.nav-link {
  color: var(--primary-color); /* Green nav links on white background */
  padding: 8px 15px;
  font-weight: bold;
  transition: color 0.3s ease, background-color 0.3s ease;
  border-radius: 3px;
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: var(--secondary-color); /* White text on hover */
  background-color: var(--primary-color); /* Green background on hover */
}

/* Footer */
.site-footer {
  background-color: var(--primary-color);
  color: var(--secondary-color);
  padding: 40px 20px;
  text-align: center;
  margin-top: 40px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  text-align: left;
  gap: 30px;
}

.footer-col {
  flex: 1;
  min-width: 200px; /* Adjusted min-width for better distribution */
}

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

.footer-col p {
  font-size: 14px;
  margin: 10px 0;
}

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

.footer-col ul li a {
  color: var(--secondary-color);
  font-size: 15px;
  padding: 5px 0;
  display: block;
  transition: color 0.3s ease;
}

.footer-col ul li a:hover {
  color: rgba(255, 255, 255, 0.8);
}

/* Mobile Specific Styles */
@media (max-width: 768px) {
  .header-container {
    padding: 0 15px; /* Smaller padding for mobile */
    min-height: 60px; /* Ensure enough space for hamburger and logo */
    position: relative; /* Crucial for absolutely positioned logo */
    justify-content: space-between; /* Keep hamburger on left, space for potential right icon */
  }

  .hamburger-menu {
    display: block; /* Show hamburger on mobile */
    position: relative; /* Ensure it's above logo if overlapping */
    z-index: 2;
  }

  .logo {
    /* Robust centering for text logo using absolute positioning */
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important; /* Use flex for alignment */
    align-items: center !important;
    justify-content: center !important;
    max-width: calc(100% - 100px); /* Account for hamburger width on left */
    font-size: 20px;
    white-space: nowrap; /* Prevent text wrapping for logo if possible */
    text-overflow: ellipsis; /* Truncate if too long */
    overflow: hidden; /* Hide overflow */
  }

  .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; /* Padding for mobile buttons */
    overflow: hidden; /* Prevent horizontal overflow */
    gap: 10px;
    flex-wrap: nowrap; /* Ensure buttons stay in one line */
    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 for mobile buttons */
    font-size: 13px; /* Smaller font for mobile buttons */
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .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: 0; /* Full height from top */
    left: 0;
    width: 80%; /* Menu width */
    max-width: 300px; /* Max width for mobile menu */
    height: 100%;
    background-color: var(--primary-color); /* Green background for mobile menu */
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    transform: translateX(-100%); /* Slide out to the left */
    transition: transform 0.3s ease;
    padding-top: var(--header-offset); /* Push menu content below fixed header */
    box-sizing: border-box;
    overflow-y: auto; /* Enable scrolling for long menus */
  }

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

  .nav-container {
    flex-direction: column; /* Vertical links in mobile menu */
    align-items: flex-start; /* Align links to the left */
    padding: 20px 15px;
    width: 100%;
    max-width: none; /* No max-width on mobile container */
  }

  .nav-link {
    color: var(--secondary-color); /* White links on green mobile menu */
    width: 100%;
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .nav-link:hover, .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--secondary-color);
  }

  .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;
  }

  .mobile-menu-overlay.active {
    display: block; /* Show overlay when active */
  }

  .footer-container {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }

  .footer-col {
    min-width: unset; /* Remove min-width for mobile */
    width: 100%;
  }

  .footer-col ul {
    text-align: center;
  }

  /* Mobile content overflow prevention */
  .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 class for mobile menu */
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;
  }
}
