: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) */
  }
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Arial', sans-serif;
  margin: 0;
  padding-top: var(--header-offset); /* Apply header offset to body */
  background-color: var(--secondary-color); /* Background color for body */
  color: #333;
  overflow-x: hidden; /* Prevent horizontal scroll on body */
}
body.no-scroll {
  overflow: hidden;
}

/* --- General Link/Button Styles --- */
a {
  text-decoration: none;
  color: inherit;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
  text-decoration: none; /* Ensure no underline */
  white-space: nowrap; /* Prevent text wrapping on desktop */
  box-sizing: border-box;
}

.btn-register {
  background-color: var(--btn-register-bg);
  color: var(--btn-text-color);
  box-shadow: 0 4px 10px rgba(195, 8, 8, 0.4);
}
.btn-register:hover {
  background-color: #e00b0b; /* Slightly darker red */
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(195, 8, 8, 0.6);
}

.btn-login {
  background-color: var(--btn-login-bg);
  color: var(--btn-text-color);
  box-shadow: 0 4px 10px rgba(195, 8, 8, 0.4);
}
.btn-login:hover {
  background-color: #e00b0b; /* Slightly darker red */
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(195, 8, 8, 0.6);
}

/* --- Site Header --- */
.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 sections will override */
}

/* Header Top Section (Logo + Desktop Buttons) */
.header-top {
  background-color: var(--primary-color); /* Dark green */
  padding: 10px 0; /* Vertical padding */
  min-height: 40px; /* Ensure minimum height for content */
  display: flex; /* For flexbox inside header-container */
  align-items: center; /* Vertically align items */
  box-sizing: border-box;
}
.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px; /* Horizontal padding for desktop */
  width: 100%;
  box-sizing: border-box;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--secondary-color); /* White text for logo */
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
  display: block; /* Ensure it's not hidden by default */
}
.logo:hover {
  opacity: 0.9;
}

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

/* Main Navigation Section */
.main-nav {
  background-color: var(--secondary-color); /* White background for nav */
  padding: 10px 0; /* Vertical padding */
  min-height: 30px; /* Minimum height for nav links */
  display: flex; /* Desktop: display flex */
  box-sizing: border-box;
}
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: row; /* Desktop: horizontal */
  justify-content: center; /* Center nav items */
  align-items: center;
  padding: 0 20px; /* Horizontal padding for desktop */
  width: 100%;
  box-sizing: border-box;
  flex-wrap: wrap; /* Allow wrapping if many items on wider desktops */
}

.nav-link {
  color: #333; /* Dark text for nav links */
  padding: 8px 15px;
  font-weight: bold;
  transition: color 0.3s ease, background-color 0.3s ease;
  border-radius: 4px;
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active {
  color: var(--primary-color); /* Green on hover/active */
  background-color: #f0f0f0; /* Light background on hover */
}

/* Hamburger Menu (Mobile Only) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  width: 30px;
  height: 20px;
  position: relative;
  cursor: pointer;
  z-index: 1001; /* Above logo and buttons */
}
.hamburger-menu .bar {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--secondary-color); /* White bars */
  border-radius: 2px;
  position: absolute;
  left: 0;
  transition: all 0.3s ease;
}
.hamburger-menu .bar:nth-child(1) { top: 0; }
.hamburger-menu .bar:nth-child(2) { top: 8px; }
.hamburger-menu .bar:nth-child(3) { top: 16px; }

.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 Navigation Buttons (Hidden on desktop) */
.mobile-nav-buttons {
  display: none; /* Hidden on desktop, will be flex on mobile */
  background-color: #f0f0f0; /* Light background for mobile buttons */
  padding: 10px 15px; /* Padding for mobile buttons */
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
  width: 100%;
}

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

/* --- Site Footer --- */
.site-footer {
  background-color: var(--primary-color); /* Dark green footer */
  color: var(--secondary-color); /* White text */
  padding: 40px 20px 20px;
  font-size: 14px;
  line-height: 1.6;
  box-sizing: border-box;
}
.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.footer-col {
  flex: 1;
  min-width: 200px;
  max-width: 300px; /* Limit max width for columns */
}
.footer-col h3 {
  font-size: 18px;
  margin-bottom: 15px;
  color: var(--secondary-color);
}
.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-col ul li {
  margin-bottom: 8px;
}
.footer-col ul li a {
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.3s ease;
}
.footer-col ul li a:hover {
  color: var(--secondary-color);
}
.footer-info p {
  color: rgba(255, 255, 255, 0.8);
}
.footer-bottom {
  max-width: 1200px;
  margin: 20px auto 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
}

/* --- Mobile Specific Styles --- */
@media (max-width: 768px) {
  /* General mobile overrides */
  .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 {
    padding: 10px 0;
    min-height: 40px;
    position: relative; 
  }
  .header-container {
    padding: 0 15px; /* Smaller horizontal padding */
    width: 100%;
    max-width: none; /* Crucial: no max-width on mobile containers */
    justify-content: space-between; /* Hamburger left, Logo center (visually), gap right */
  }

  .hamburger-menu {
    display: block; /* Show hamburger menu */
    order: 0; /* Place to the left */
    margin-right: 0; 
  }

  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    order: 1; /* Place in the middle */
    font-size: 20px; /* Smaller font size for mobile */
    text-align: center; /* Fallback for text logo */
  }
  .logo img {
    display: block !important;
    max-width: 100%;
    height: auto;
    max-height: 40px; /* Max height for image logo */
  }

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

  /* Mobile Navigation Buttons */
  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    width: 100%; max-width: 100%;
    box-sizing: border-box;
    padding: 10px 15px; /* Smaller padding */
    overflow: hidden; /* Prevent overflow */
    gap: 10px; /* Space between buttons */
    flex-wrap: nowrap; /* Ensure buttons stay on one line */
    justify-content: center; /* Center buttons if less than 2 */
  }
  .mobile-nav-buttons .btn {
    flex: 1; min-width: 0; /* Allow buttons to shrink */
    max-width: calc(50% - 5px); /* Max width for two buttons with gap */
    padding: 8px 12px; /* Smaller padding for mobile buttons */
    font-size: 13px; /* Smaller font size */
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word;
    overflow-wrap: break-word;
    height: auto; /* Allow height to adjust for wrapped text */
  }

  /* Main Navigation (Mobile Menu) */
  .main-nav {
    display: none; /* Hidden by default on mobile */
    position: fixed;
    top: var(--header-offset); /* Start below the header */
    left: 0;
    width: 280px; /* Fixed width for the sliding menu */
    height: calc(100vh - var(--header-offset)); /* Full height below header */
    background-color: #333; /* Dark background for mobile menu */
    flex-direction: column; /* Vertical menu items */
    padding: 20px 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    transform: translateX(-100%); /* Slide out of view */
    transition: transform 0.3s ease;
    overflow-y: auto; /* Enable scrolling for long menus */
    z-index: 999; /* Below overlay */
    box-sizing: border-box;
  }
  .main-nav.active {
    display: flex; /* Show the menu */
    transform: translateX(0); /* Slide into view */
  }
  .main-nav .nav-container {
    flex-direction: column; /* Vertical links */
    padding: 0 15px;
    max-width: none; /* No max-width */
    align-items: flex-start; /* Align links to the left */
  }
  .main-nav .nav-link {
    width: 100%;
    color: var(--secondary-color); /* White text in dark menu */
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
  }
  .main-nav .nav-link:last-child {
    border-bottom: none;
  }
  .main-nav .nav-link:hover, .main-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--secondary-color);
  }

  /* Footer Mobile */
  .footer-container {
    flex-direction: column;
    gap: 20px;
    padding: 0 15px 20px;
    max-width: none;
  }
  .footer-col {
    max-width: 100%;
    min-width: unset;
  }
  .footer-bottom {
    padding: 0 15px;
  }
}
/* 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;
  }
}
