:root {
  --header-offset: 105px; /* Desktop: header-top (min-height: 55px) + main-nav (min-height: 50px) */
}

@media (max-width: 768px) {
  :root {
    --header-offset: 101px; /* Mobile: header-top (min-height: 55px) + mobile-nav-buttons (min-height: 46px) */
  }
}

/* Base Styles */
body {
  margin: 0;
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: #333333;
  background-color: #FFFFFF;
  padding-top: var(--header-offset);
  overflow-x: hidden; /* Prevent horizontal scroll */
}

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

/* Site Header */
.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 Top Bar (Desktop) */
.header-top {
  background-color: #004d2b; /* Darker green for contrast */
  color: #FFFFFF;
  padding: 10px 0;
  min-height: 55px; /* Calculated height */
  display: flex;
  align-items: center;
}

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

.logo {
  font-size: 24px;
  font-weight: bold;
  color: #FFFFFF;
  text-decoration: none;
  padding: 5px 0;
  white-space: nowrap;
  display: block; /* Ensure visibility */
}

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

.btn {
  padding: 10px 15px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease, color 0.3s ease;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-register, .btn-download {
  background-color: #C30808;
  color: #FFFF00;
}

.btn-register:hover, .btn-download:hover {
  background-color: #a00606;
}

/* Main Navigation (Desktop) */
.main-nav {
  background-color: #017439; /* Primary Green */
  padding: 0;
  min-height: 50px; /* Calculated height */
  display: flex; /* Default for desktop */
  align-items: center;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: row; /* Default for desktop */
  justify-content: center;
  align-items: center;
  width: 100%;
}

.nav-link {
  color: #FFFFFF;
  text-decoration: none;
  padding: 15px 20px;
  display: block;
  transition: background-color 0.3s ease;
  white-space: nowrap;
}

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

/* Hamburger Menu (Mobile - hidden on desktop) */
.hamburger-menu {
  display: none; 
  width: 30px;
  height: 20px;
  position: relative;
  cursor: pointer;
  z-index: 1001; 
}

.hamburger-menu span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: #FFFFFF;
  position: absolute;
  left: 0;
  transition: all 0.3s ease;
}

.hamburger-menu span:nth-child(1) { top: 0; }
.hamburger-menu span:nth-child(2) { top: 9px; }
.hamburger-menu span:nth-child(3) { top: 18px; }

.hamburger-menu.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}
.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
}
.hamburger-menu.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

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

/* Mobile Menu Overlay (Hidden by default) */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

/* Footer */
.site-footer {
  background-color: #017439;
  color: #FFFFFF;
  padding: 40px 0 20px;
  font-size: 14px;
}

.footer-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-col {
  flex: 1;
  min-width: 250px;
}

.footer-col h3 {
  color: #FFFFFF;
  font-size: 18px;
  margin-bottom: 15px;
}

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

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

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

.footer-col ul li a {
  color: #FFFFFF;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-col ul li a:hover {
  color: #CCCCCC;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  margin-top: 30px;
  text-align: center;
}

.footer-bottom p {
  margin: 0;
  color: #CCCCCC;
}

/* Mobile Styles */
@media (max-width: 768px) {
  .header-top {
    padding: 10px 0;
    min-height: 55px;
  }
  .header-container {
    padding: 0 15px;
    width: 100%;
    max-width: none; /* Important: remove max-width for mobile */
    justify-content: space-between;
    position: relative;
  }

  .hamburger-menu {
    display: block;
    order: 1;
  }

  .logo {
    order: 2;
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    position: static !important; /* Reset any absolute positioning */
    transform: none !important; /* Reset any transform */
    padding: 0;
    font-size: 20px;
  }
  .logo img {
    max-width: 100%;
    height: auto;
    max-height: 40px;
  }

  .desktop-nav-buttons {
    display: none;
  }

  .mobile-nav-buttons {
    display: flex !important; /* Force display for mobile */
    width: 100%; max-width: 100%;
    box-sizing: border-box;
    padding: 10px 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
    background-color: #017439; /* Use primary color for mobile buttons bar */
    min-height: 46px; /* Calculated height */
    align-items: center;
    justify-content: center;
  }

  .mobile-nav-buttons .btn {
    flex: 1; min-width: 0;
    max-width: calc(50% - 5px); /* Ensures two buttons fit with gap */
    box-sizing: border-box;
    padding: 8px 12px;
    font-size: 13px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .main-nav {
    display: none; /* Hidden by default for mobile */
    flex-direction: column; /* Vertical for mobile */
    position: fixed;
    top: var(--header-offset); /* Start below the fixed header */
    left: 0;
    width: 250px; /* Sidebar width */
    height: calc(100% - var(--header-offset)); /* Full height below header */
    background-color: #017439;
    transform: translateX(-100%); /* Slide out of view */
    transition: transform 0.3s ease;
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
    overflow-y: auto;
    z-index: 999;
  }

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

  .nav-container {
    flex-direction: column;
    padding: 0;
    width: 100%;
    max-width: none; /* Important: remove max-width for mobile */
  }

  .nav-link {
    padding: 12px 20px;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
  }

  .nav-link:last-child {
    border-bottom: none;
  }

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

  .footer-container {
    flex-direction: column;
    padding: 0 15px;
  }

  .footer-col {
    min-width: unset;
    width: 100%;
  }
}

/* Ensure body no-scroll works */
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;
  }
}
