:root {
  --primary-color: #FFD700; /* Gold */
  --secondary-color: #8B0000; /* Dark Red */
  --text-dark: #333333;
  --text-light: #FFFFFF;
  --header-offset: 110px; /* Desktop: header-top (60px) + main-nav (50px) */
}

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

/* Base Styles */
body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  padding-top: var(--header-offset); /* Apply header offset to body */
  overflow-x: hidden;
}

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

/* Site Header - Fixed Navigation */
.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 Section */
.header-top {
  background-color: var(--secondary-color); /* Dark Red */
  padding: 10px 0; /* Total height 60px with min-height 40px */
  min-height: 40px;
  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; /* Desktop padding */
  box-sizing: border-box;
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: var(--text-light); /* White for logo text on dark red background for contrast */
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 100%;
}

.logo img {
  max-height: 40px;
  width: auto;
}

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

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

.btn-register {
  background-color: var(--primary-color); /* Gold */
  color: #000000; /* Black text on gold for contrast (12.3:1) */
  border: 2px solid var(--primary-color);
}

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

.btn-login {
  background-color: var(--secondary-color); /* Dark Red */
  color: var(--text-light); /* White text on dark red for contrast (4.88:1) */
  border: 2px solid var(--primary-color); /* Gold border for emphasis */
}

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

/* Main Navigation Section (Desktop) */
.main-nav {
  background-color: var(--primary-color); /* Gold */
  padding: 10px 0; /* Total height 50px with min-height 30px */
  min-height: 30px;
  display: flex; /* Desktop default: flex */
  flex-direction: row; /* Desktop default: row */
  position: static; /* Desktop default: static */
  justify-content: center;
  align-items: center;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  justify-content: center; /* Center links */
  align-items: center;
  gap: 25px;
  padding: 0 20px; /* Desktop padding */
  box-sizing: border-box;
}

.nav-link {
  color: #000000; /* Black for nav links on gold background for contrast (12.3:1) */
  font-weight: bold;
  font-size: 16px;
  padding: 5px 0;
  transition: color 0.3s ease, border-bottom 0.3s ease;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background-color: var(--secondary-color); /* Dark red underline */
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Hamburger Menu (Mobile Only) */
.hamburger-menu {
  display: none; /* Hidden on desktop */
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 25px;
  cursor: pointer;
  z-index: 1001;
  padding: 5px;
}

.hamburger-menu span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--primary-color); /* Gold for hamburger lines */
  border-radius: 3px;
  transition: all 0.3s ease;
}

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

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

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

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

/* 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.7);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

/* Footer Styles */
.site-footer {
  background-color: #222; /* Dark background for footer */
  color: #ccc;
  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;
  padding-bottom: 30px;
  border-bottom: 1px solid #444;
}

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

.footer-col h3 {
  color: var(--primary-color); /* Gold for footer headings (9.3:1) */
  font-size: 18px;
  margin-bottom: 15px;
  text-transform: uppercase;
}

.footer-logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--primary-color); /* Gold for footer logo (9.3:1) */
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 15px;
  display: block;
}

.footer-col p {
  line-height: 1.8;
  color: #aaa; /* (6.4:1) */
}

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

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

.footer-nav a {
  color: #aaa; /* (6.4:1) */
  transition: color 0.3s ease;
}

.footer-nav a:hover {
  color: var(--primary-color);
}

.footer-bottom {
  max-width: 1200px;
  margin: 20px auto 0;
  text-align: center;
  color: #888; /* (8.9:1) */
}

/* Mobile specific styles */
@media (max-width: 768px) {
  /* Header adjustments */
  .header-container {
    padding: 0 15px; /* Mobile padding */
    width: 100%;
    max-width: none; /* Crucial for mobile container width */
    justify-content: space-between;
  }

  .logo {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    order: 2; /* Logo in center */
  }

  .hamburger-menu {
    display: flex; /* Show hamburger on mobile */
    order: 1; /* Hamburger on left */
  }

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

  .mobile-nav-buttons {
    display: flex !important; /* Show mobile buttons */
    width: 100%; max-width: 100%;
    box-sizing: border-box;
    padding: 10px 15px; /* Added padding for offset calculation */
    overflow: hidden;
    gap: 10px;
    flex-wrap: nowrap;
    background-color: var(--secondary-color); /* Match header top background */
    justify-content: center; /* Center buttons if less than 2 */
  }

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

  .main-nav {
    display: none; /* Hidden by default on mobile */
    flex-direction: column; /* Vertical layout for mobile menu */
    position: fixed; /* Fixed position for mobile menu */
    top: var(--header-offset); /* Position below header */
    left: 0;
    width: 80%; /* Sidebar width */
    max-width: 300px;
    height: calc(100% - var(--header-offset)); /* Full height below header */
    background-color: #333; /* Dark background for mobile menu */
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.5);
    transform: translateX(-100%); /* Slide out to the left */
    transition: transform 0.3s ease;
    overflow-y: auto; /* Enable scrolling for long menus */
    align-items: flex-start;
    padding-top: 20px;
  }

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

  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0 15px; /* Mobile padding */
    width: 100%;
    max-width: none; /* Crucial for mobile container width */
  }

  .nav-link {
    width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light); /* Light text for dark menu (6.4:1 on #333) */
  }

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

  .nav-link::after {
    background-color: var(--primary-color);
  }

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

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

  .footer-col h3, .footer-logo {
    text-align: center;
  }

  .footer-nav {
    text-align: center;
  }

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