:root {
  --primary-color: #017439;
  --secondary-color: #FFFFFF;
  --register-btn-color: #C30808;
  --login-btn-color: #C30808;
  --btn-text-color: #FFFF00;
  --header-top-bg: #015C2E; /* Darker green for header top */
  --footer-bg: #004D26; /* Even darker green for footer */
  --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: 'Arial', sans-serif;
  color: #333;
  padding-top: var(--header-offset); /* Fixed header offset */
  overflow-x: hidden; /* Prevent body overflow */
}

a {
  text-decoration: none;
  color: inherit;
}

/* Header Styles */
.site-header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  background-color: var(--primary-color); /* Fallback, specific sections will override */
}

.header-top {
  background-color: var(--header-top-bg);
  width: 100%;
  padding: 10px 0;
  min-height: 40px; /* Ensure minimum height for content */
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

.logo {
  color: var(--secondary-color);
  font-size: 24px;
  font-weight: bold;
  text-decoration: none;
  padding: 5px 0; /* Adjust padding if needed */
  display: block; /* Ensure it's not inline for better alignment */
}

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

.btn {
  padding: 10px 15px;
  border-radius: 5px;
  font-weight: bold;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  transition: background-color 0.3s ease, color 0.3s ease;
  box-sizing: border-box; /* Include padding and border in the element's total width and height */
}

.btn-register {
  background-color: var(--register-btn-color);
  color: var(--btn-text-color);
}

.btn-login {
  background-color: var(--login-btn-color);
  color: var(--btn-text-color);
}

.btn-register:hover, .btn-login:hover {
  filter: brightness(1.1);
}

.main-nav {
  background-color: var(--primary-color);
  width: 100%;
  display: flex; /* Desktop default: flex */
  flex-direction: row; /* Desktop default: row */
  justify-content: center;
  align-items: center;
  padding: 10px 0;
  min-height: 30px; /* Ensure minimum height for content */
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 0 20px;
  flex-wrap: wrap; /* Allow wrapping on smaller desktop sizes if needed */
}

.nav-link {
  color: var(--secondary-color);
  padding: 5px 10px;
  transition: color 0.3s ease, background-color 0.3s ease;
  white-space: nowrap;
}

.nav-link:hover {
  background-color: rgba(255,255,255,0.1);
  border-radius: 3px;
}

/* Hamburger Menu (Mobile Only) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  cursor: pointer;
  width: 30px;
  height: 24px;
  position: relative;
  z-index: 1001; /* Above logo on mobile */
  margin-right: 15px; /* Spacing from logo */
  flex-shrink: 0; /* Prevent shrinking */
}

.hamburger-menu .bar {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--secondary-color);
  border-radius: 3px;
  position: absolute;
  left: 0;
  transition: all 0.3s ease;
}

.hamburger-menu .bar:nth-child(1) { top: 0; }
.hamburger-menu .bar:nth-child(2) { top: 50%; transform: translateY(-50%); }
.hamburger-menu .bar:nth-child(3) { bottom: 0; }

.hamburger-menu.active .bar:nth-child(1) {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}
.hamburger-menu.active .bar:nth-child(2) {
  opacity: 0;
}
.hamburger-menu.active .bar:nth-child(3) {
  bottom: 50%;
  transform: translateY(50%) rotate(-45deg);
}

/* Mobile Nav Buttons (Mobile Only) */
.mobile-nav-buttons {
  display: none; /* Hidden on desktop */
}

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

/* Footer Styles */
.site-footer {
  background-color: var(--footer-bg);
  color: var(--secondary-color);
  padding: 40px 20px;
  font-size: 14px;
  line-height: 1.6;
}

.site-footer a {
  color: var(--secondary-color);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

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

.footer-col {
  flex: 1;
  min-width: 250px;
  max-width: 30%; /* Adjust for 3 columns on desktop */
}

.footer-logo {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 15px;
  display: block;
}

.footer-info p {
  margin-bottom: 10px;
}

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

.footer-col h3::after {
  content: '';
  display: block;
  width: 40px;
  height: 2px;
  background-color: var(--primary-color); /* Using primary for accent */
  margin-top: 5px;
}

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

.footer-nav li {
  margin-bottom: 10px;
}

.footer-contact p {
  margin-bottom: 10px;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .header-top {
    padding: 10px 0;
    min-height: 40px;
  }

  .header-container {
    width: 100%;
    max-width: none; /* Remove max-width on mobile */
    padding: 0 15px;
    justify-content: space-between; /* Hamburger left, Logo center, empty space right */
    position: relative; /* For absolute logo centering if needed */
    min-height: 40px; /* Ensure enough height for elements */
  }

  .hamburger-menu {
    display: block; /* Show hamburger on mobile */
    order: 1; /* Place hamburger first */
    margin-right: 0; /* Reset margin */
  }

  .logo {
    order: 2; /* Place logo second */
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    max-width: calc(100% - 60px); /* Adjust max-width to not overlap hamburger */
    font-size: 20px; /* Smaller font size for mobile */
    padding: 0; /* Reset padding if necessary */
    text-align: center; /* Fallback for text logo */
  }

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

  /* Mobile Nav Buttons */
  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap; /* Ensure buttons stay on one line */
    background-color: var(--header-top-bg); /* Same background as header-top */
    justify-content: center; /* Center buttons if less than 2, or space-between if 2 */
    min-height: 30px; /* Ensure minimum height */
  }

  .mobile-nav-buttons .btn {
    flex: 1;
    min-width: 0; /* Allow shrinking */
    max-width: calc(50% - 5px); /* Max width for two buttons with gap */
    padding: 8px 12px; /* Smaller padding */
    font-size: 13px; /* Smaller font size */
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word; /* Ensure text breaks */
    overflow-wrap: break-word;
  }

  .main-nav {
    display: none; /* Hidden by default on mobile */
    position: fixed;
    top: var(--header-offset); /* Position below header */
    left: 0;
    width: 80%; /* Sidebar width */
    max-width: 300px; /* Max width for sidebar */
    height: calc(100vh - var(--header-offset)); /* Full height minus header */
    background-color: var(--primary-color);
    flex-direction: column;
    align-items: flex-start;
    transform: translateX(-100%); /* Slide out to the left */
    transition: transform 0.3s ease;
    overflow-y: auto; /* Enable scrolling for long menus */
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
    z-index: 1000;
  }

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

  .nav-container {
    width: 100%;
    max-width: none; /* Remove max-width on mobile */
    flex-direction: column; /* Stack links vertically */
    gap: 0; /* Remove gap */
    padding: 0; /* Reset padding */
    align-items: flex-start;
  }

  .nav-link {
    width: 100%;
    padding: 15px 20px; /* Larger clickable area */
    border-bottom: 1px solid rgba(255,255,255,0.1);
    box-sizing: border-box;
  }

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

  /* Footer responsive */
  .footer-container {
    flex-direction: column;
    gap: 40px;
    padding: 0 15px;
  }

  .footer-col {
    max-width: 100%; /* Stack columns */
    min-width: unset;
  }

  /* Prevent content overflow on mobile */
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
}
/* 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;
  }
}
