:root {
  --primary-color: #26A9E0;
  --secondary-color: #FFFFFF;
  --login-button-color: #EA7C07;
  --background-color: #FFFFFF;
  --text-color-dark: #000000;
  --text-color-light: #FFFFFF;
  --header-top-bg: #1a1a1a; /* Dark grey/black for contrast */
  --main-nav-bg: var(--primary-color); /* Primary color for main nav */
  --header-offset: 108px; /* Desktop: header-top (60px) + main-nav (48px) */
}

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

body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: var(--text-color-dark);
  background-color: var(--background-color);
  padding-top: var(--header-offset); /* Apply header offset to body */
  overflow-x: hidden; /* Prevent horizontal scroll on body */
}

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

a:hover {
  text-decoration: underline;
}

/* Shared Container Styles */
.header-container, .nav-container, .footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* Site Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--background-color);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

.header-top {
  background-color: var(--header-top-bg);
  padding: 15px 0;
  min-height: 30px; /* Minimal height for content */
}

.header-top .header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--text-color-light);
  text-decoration: none;
  display: block; /* Ensure logo is visible on desktop */
}

.hamburger-menu {
  display: none; /* Hidden on desktop */
  cursor: pointer;
  width: 30px;
  height: 22px;
  position: relative;
  z-index: 1001;
}

.hamburger-menu span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--text-color-light);
  margin-bottom: 5px;
  transition: all 0.3s ease;
}

.hamburger-menu span:last-child {
  margin-bottom: 0;
}

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

.btn {
  padding: 10px 18px;
  border-radius: 5px;
  font-weight: bold;
  text-decoration: none;
  transition: background-color 0.3s ease, transform 0.2s ease;
  white-space: nowrap;
  display: inline-block;
  text-align: center;
}

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

.btn-register:hover {
  background-color: #d86c06;
  transform: translateY(-2px);
}

.btn-download {
  background-color: var(--primary-color);
  color: var(--text-color-light);
}

.btn-download:hover {
  background-color: #208ac2;
  transform: translateY(-2px);
}

.mobile-nav-buttons {
  display: none; /* Hidden on desktop */
  background-color: var(--header-top-bg);
  padding: 10px 20px;
  width: 100%;
  box-sizing: border-box;
}

/* Main Navigation */
.main-nav {
  background-color: var(--main-nav-bg);
  padding: 12px 0;
  min-height: 24px; /* Minimal height for content */
  display: flex; /* Desktop default */
}

.main-nav .nav-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.nav-link {
  color: var(--text-color-light);
  font-weight: bold;
  padding: 5px 0;
  white-space: nowrap;
}

.nav-link:hover {
  color: #c0e0f0; /* Lighter shade of primary for hover */
  text-decoration: none;
}

.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;
  transition: opacity 0.3s ease;
  opacity: 0;
}

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

/* Site Footer */
.site-footer {
  background-color: var(--header-top-bg);
  color: #cccccc;
  padding: 40px 0 20px;
  font-size: 14px;
}

.site-footer .footer-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 30px;
}

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

.footer-column h3 {
  color: var(--text-color-light);
  font-size: 18px;
  margin-bottom: 15px;
}

.footer-column p, .footer-column ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

.footer-column ul li a {
  color: #cccccc;
  text-decoration: none;
}

.footer-column ul li a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #333333;
}

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

/* Responsive Styles */
@media (max-width: 768px) {
  .header-container, .nav-container, .footer-container {
    padding-left: 15px;
    padding-right: 15px;
    max-width: none; /* Ensure full width on mobile */
    width: 100%; /* Ensure full width on mobile */
  }

  .site-header {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  }

  .header-top .header-container {
    justify-content: space-between; /* Hamburger left, Logo center, space right */
    position: relative;
    min-height: 60px;
  }

  .hamburger-menu {
    display: block;
    order: 1;
    position: relative;
    z-index: 1002;
  }

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

  .logo {
    flex: 1 !important; /* Take remaining space */
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    order: 2;
    font-size: 20px;
    text-align: center; /* For text logo */
    padding: 0 10px; /* Add some padding to prevent text from touching hamburger */
  }

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

  .mobile-nav-buttons {
    display: flex !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding-left: 15px;
    padding-right: 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
    justify-content: center; /* Center buttons if only one, or for even distribution */
    background-color: var(--header-top-bg);
    padding-bottom: 15px;
  }

  .mobile-nav-buttons .btn {
    flex: 1;
    min-width: 0;
    max-width: calc(50% - 5px); /* Account for 10px 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 on mobile */
    flex-direction: column;
    position: fixed;
    top: var(--header-offset); /* Start below header */
    left: 0;
    width: 80%;
    max-width: 300px;
    height: calc(100% - var(--header-offset));
    background-color: var(--main-nav-bg);
    padding: 20px 0;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    transform: translateX(-100%); /* Off-screen by default */
    transition: transform 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
  }

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

  .main-nav .nav-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    padding-left: 20px; /* Indent menu items */
    padding-right: 20px;
  }

  .nav-link {
    width: 100%;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

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

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

  .footer-column {
    min-width: unset;
    width: 100%;
    text-align: center;
  }

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

  .footer-column ul li {
    display: inline-block;
    margin: 0 8px 8px 0;
  }

  .footer-column ul li:last-child {
    margin-right: 0;
  }

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

/* No scroll for body when menu is open */
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;
  }
}
