:root {
  --primary-color: #017439;
  --secondary-color: #FFFFFF;
  --button-bg-color: #C30808;
  --button-text-color: #FFFF00;
  --header-top-bg: #00502A; /* Darker green for contrast */
  --main-nav-bg: #017439; /* Primary green */
  --footer-bg: #1a1a1a; /* Dark grey for footer */
  --footer-text-color: #FFFFFF;
  --header-offset: 110px; /* Desktop: header-top (60px) + main-nav (50px) */
}
@media (max-width: 768px) {
  :root {
    --header-offset: 100px; /* Mobile: header-top (50px) + mobile-nav-buttons (50px) */
  }
}

/* Base styles */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333;
}
a {
  text-decoration: none;
  color: inherit;
}
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.header-container, .nav-container, .footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
}

/* Header Top */
.header-top {
  background-color: var(--header-top-bg);
  color: var(--secondary-color);
  min-height: 60px; /* Desktop height */
}
.header-top .header-container {
  justify-content: space-between;
  height: 60px; /* Explicit height to match offset calc */
}
.logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--secondary-color);
  white-space: nowrap;
}

/* Desktop Navigation Buttons */
.desktop-nav-buttons {
  display: flex;
  gap: 10px;
}
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: bold;
  text-align: center;
  transition: background-color 0.3s ease, transform 0.3s ease;
  text-decoration: none; /* Remove underline */
  white-space: nowrap;
}
.btn-register {
  background-color: var(--button-bg-color);
  color: var(--button-text-color);
}
.btn-login {
  background-color: var(--button-bg-color);
  color: var(--button-text-color);
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Main Navigation */
.main-nav {
  background-color: var(--main-nav-bg);
  color: var(--secondary-color);
  min-height: 50px; /* Desktop height */
  display: flex; /* Desktop default: visible */
}
.main-nav .nav-container {
  justify-content: center;
  flex-wrap: wrap;
  height: 50px; /* Explicit height to match offset calc */
}
.nav-link {
  padding: 15px 20px;
  font-weight: bold;
  transition: background-color 0.3s ease;
  white-space: nowrap;
}
.nav-link:hover {
  background-color: rgba(255,255,255,0.1);
}

/* Hamburger Menu (Desktop - hidden) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  position: relative;
  z-index: 1001;
}
.hamburger-menu span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--secondary-color);
  margin-bottom: 5px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.hamburger-menu span:last-child {
  margin-bottom: 0;
}
.mobile-header-right-placeholder {
  display: none; /* Hidden on desktop */
}

/* Mobile specific styles */
@media (max-width: 768px) {
  .header-container, .nav-container, .footer-container {
    padding: 0 15px; /* Smaller padding for mobile */
    max-width: none; /* Crucial: no max-width on mobile containers */
    width: 100%; /* Ensure full width */
  }

  /* Header Top */
  .header-top {
    min-height: 50px; /* Mobile height */
  }
  .header-top .header-container {
    height: 50px; /* Explicit height for mobile offset */
    justify-content: space-between; /* Hamburger left, Logo center, Placeholder right */
    position: relative; /* For absolute positioning of hamburger/placeholder */
  }
  .hamburger-menu {
    display: block; /* Show hamburger on mobile */
    position: absolute; /* Absolute position for hamburger */
    left: 15px; /* Align with container padding */
    top: 50%;
    transform: translateY(-50%);
  }
  .logo {
    flex: 1; /* Allow logo to take available space */
    text-align: center; /* Center text logo */
    font-size: 20px;
    line-height: 50px; /* Match header-top height */
    padding: 0 40px; /* Padding to avoid overlapping hamburger/placeholder */
  }
  .desktop-nav-buttons {
    display: none; /* Hide desktop buttons on mobile */
  }
  .mobile-header-right-placeholder {
    display: block; /* Show placeholder to balance logo centering */
    width: 30px; /* Match hamburger width */
    height: 30px;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
  }

  /* Mobile Nav Buttons (below header-top, above main-nav) */
  .mobile-nav-buttons {
    display: flex !important; /* Always visible on mobile */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px 15px; /* Padding for the button container */
    overflow: hidden; /* Prevent overflow */
    gap: 10px; /* Space between buttons */
    flex-wrap: nowrap; /* Ensure buttons stay in one line */
    background-color: var(--header-top-bg); /* Match header-top background */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    min-height: 50px; /* Explicit height to match offset calc */
  }
  .mobile-nav-buttons .btn {
    flex: 1; /* Distribute space evenly */
    min-width: 0; /* Allow shrinking */
    max-width: calc(50% - 5px); /* Max width for two buttons with gap */
    box-sizing: border-box;
    padding: 8px 12px; /* Smaller padding */
    font-size: 13px; /* Smaller font size */
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word; /* Allow text wrapping */
    overflow-wrap: break-word;
  }

  /* Main Navigation (mobile - hidden by default, slides in) */
  .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));
    background-color: var(--main-nav-bg);
    flex-direction: column;
    transform: translateX(-100%); /* Slide out to the left */
    transition: transform 0.3s ease;
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
    overflow-y: auto; /* Enable scrolling for long menus */
  }
  .main-nav .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 0; /* Remove container padding as nav-link has it */
    height: auto; /* Allow content to dictate height */
  }
  .nav-link {
    width: 100%;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    box-sizing: border-box;
  }
  .nav-link:last-child {
    border-bottom: none;
  }

  /* Hamburger Menu Active State */
  .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 Active State (Show menu) */
  .main-nav.active {
    display: flex; /* Crucial: Change display to show menu */
    transform: translateX(0); /* Slide in */
  }

  /* 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;
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  .mobile-menu-overlay.active {
    display: block; /* Show overlay */
    opacity: 1;
  }

  /* Body no-scroll when menu is open */
  body.no-scroll {
    overflow: hidden;
  }

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

/* Footer Styles */
.site-footer {
  background-color: var(--footer-bg);
  color: var(--footer-text-color);
  padding: 40px 0 20px;
  font-size: 14px;
}
.footer-container {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 30px;
}
.footer-col {
  flex: 1;
  min-width: 250px;
}
.footer-logo {
  font-size: 22px;
  font-weight: bold;
  color: var(--secondary-color);
  margin-bottom: 15px;
  display: block;
}
.footer-col h3 {
  font-size: 18px;
  margin-bottom: 20px;
  color: var(--secondary-color);
}
.footer-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-nav li {
  margin-bottom: 10px;
}
.footer-nav a {
  color: rgba(255,255,255,0.7);
  transition: color 0.3s ease;
}
.footer-nav a:hover {
  color: var(--secondary-color);
}
.contact-info-col p {
  margin-bottom: 10px;
  color: rgba(255,255,255,0.7);
}
.about-col p {
  color: rgba(255,255,255,0.7);
}

@media (max-width: 768px) {
  .footer-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .footer-col {
    min-width: unset;
    width: 100%;
    margin-bottom: 20px;
  }
  .footer-nav {
    text-align: center;
  }
  .footer-nav li {
    display: inline-block;
    margin: 0 10px 10px;
  }
}
/* 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;
  }
}
