:root {
  --primary-color: #26A9E0;
  --accent-color: #FFFFFF;
  --login-btn-color: #EA7C07;
  --background-color: #FFFFFF;
  --text-color-dark: #333333;
  --text-color-light: #FFFFFF;
  --header-top-bg: #222222; /* Darker background for header top */
  --nav-bg: var(--primary-color); /* Primary color for main nav */
  --header-offset: 110px; /* Desktop: header-top (60px) + main-nav (50px) */
}

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

/* Global Reset & Body */
html {
  scroll-behavior: smooth;
}

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

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

a:hover {
  text-decoration: underline;
}

/* Site Header - Fixed Navigation */
.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(--accent-color); /* Default light background for overall header */
}

/* Header Top Section */
.header-top {
  background-color: var(--header-top-bg);
  color: var(--text-color-light);
  padding: 10px 0;
  min-height: 60px; /* Fixed height for desktop header-top */
  display: flex;
  align-items: center;
}

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

/* Logo */
.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--primary-color);
  text-decoration: none;
  white-space: nowrap;
  padding: 5px 0;
  display: block; /* Ensure it's block-level for consistent spacing */
}

.logo:hover {
  text-decoration: none;
  opacity: 0.9;
}

/* Desktop Navigation Buttons */
.desktop-nav-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Main Navigation */
.main-nav {
  background-color: var(--nav-bg);
  padding: 10px 0;
  min-height: 50px; /* Fixed height for desktop main-nav */
  display: flex; /* Desktop default: visible */
  align-items: center;
}

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

.nav-link {
  color: var(--text-color-light);
  padding: 8px 15px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease, color 0.3s ease;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  text-decoration: none;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  text-align: center;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.btn-login {
  background-color: var(--login-btn-color);
  color: var(--text-color-light);
  border: 1px solid var(--login-btn-color);
}

.btn-login:hover {
  background-color: #cc6c06; /* Darken by ~10% */
  border-color: #cc6c06;
  box-shadow: 0 0 10px rgba(234, 124, 7, 0.5);
  text-decoration: none;
}

.btn-register {
  background-color: var(--primary-color);
  color: var(--text-color-light);
  border: 1px solid var(--primary-color);
}

.btn-register:hover {
  background-color: #2087b3; /* Darken by ~10% */
  border-color: #2087b3;
  box-shadow: 0 0 10px rgba(38, 169, 224, 0.5);
  text-decoration: none;
}

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

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

.hamburger-menu span:nth-child(1) {
  top: 0;
}

.hamburger-menu span:nth-child(2) {
  top: 50%;
  transform: translateY(-50%);
}

.hamburger-menu span:nth-child(3) {
  bottom: 0;
}

.hamburger-menu.active span:nth-child(1) {
  transform: translateY(10.5px) rotate(45deg);
}

.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
  transform: translateY(-10.5px) rotate(-45deg);
}

/* Mobile Navigation Buttons (Mobile Only) */
.mobile-nav-buttons {
  display: none; /* Hidden on desktop */
  background-color: var(--header-top-bg); /* Match header top background */
  padding: 10px 15px;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden; /* Prevent overflow */
  justify-content: center;
  align-items: center;
  min-height: 45px;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  display: none; /* Hidden on desktop */
  position: fixed;
  top: var(--header-offset);
  left: 0;
  width: 100%;
  height: calc(100% - var(--header-offset));
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

/* Footer */
.site-footer {
  background-color: #333333;
  color: var(--text-color-light);
  padding: 40px 20px 20px;
  font-size: 14px;
}

.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;
}

.footer-col h3 {
  color: var(--primary-color);
  font-size: 18px;
  margin-bottom: 15px;
}

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

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

.footer-nav li a {
  color: var(--text-color-light);
  text-decoration: none;
  padding: 5px 0;
  display: block;
}

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

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

.footer-bottom p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
}

/* Responsive Styles */
@media (max-width: 768px) {
  .header-top {
    justify-content: space-between;
    padding: 10px 15px;
    min-height: 60px;
  }

  .header-container {
    padding: 0;
    width: 100%;
    max-width: none;
    justify-content: flex-start; /* Adjust for hamburger */
    position: relative; /* For logo absolute positioning */
  }

  .logo {
    flex: 1 !important; /* Take remaining space */
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-size: 24px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 80px); /* Account for hamburger menu (30px) + right padding (30px) + safety margin */
  }

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

  .mobile-nav-buttons {
    display: flex !important; /* Always visible on mobile */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 8px 15px;
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
    justify-content: center; /* Center buttons if only one */
  }

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

  .hamburger-menu {
    display: block;
    order: -1; /* Place it at the beginning */
    margin-right: 0;
  }

  .main-nav {
    display: none; /* Hidden by default on mobile */
    position: fixed;
    top: var(--header-offset); /* Start below fixed header */
    left: 0;
    width: 280px;
    height: calc(100% - var(--header-offset));
    background-color: #333333; /* Dark background for mobile menu */
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    transform: translateX(-100%); /* Slide out to the left */
    transition: transform 0.3s ease;
    overflow-y: auto;
  }

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

  .nav-container {
    flex-direction: column;
    padding: 0;
    align-items: flex-start;
    width: 100%;
    max-width: none;
  }

  .nav-link {
    width: 100%;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color-light);
  }

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

  .site-footer {
    padding: 30px 15px 15px;
  }

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

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

  /* Mobile content overflow prevention */
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: hidden;
  }

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