:root {
    --primary-color: #017439;
    --secondary-color: #FFFFFF;
    --btn-register-bg: #C30808;
    --btn-login-bg: #C30808;
    --btn-text-color: #FFFF00;
    --header-top-bg: #017439; /* Darker green for top bar */
    --main-nav-bg: #1a884f; /* Lighter green for nav bar */
    --footer-bg: #1a1a1a;
    --footer-text: #e0e0e0;
    --header-offset: 100px; /* Desktop: header-top (60px) + main-nav (40px) */
}

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

/* Base Styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding-top: var(--header-offset); /* Ensure content is not hidden by fixed header */
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Common Container Styles */
.header-container, .nav-container, .footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

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

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

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

.header-top {
    background-color: var(--header-top-bg);
    padding: 15px 0;
    color: var(--secondary-color);
}

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

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--secondary-color);
    text-decoration: none;
    white-space: nowrap;
    display: block; /* Ensure logo is visible */
}

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

.mobile-nav-buttons {
    display: none; /* Hidden by default on desktop */
    background-color: var(--header-top-bg); /* Same as header-top */
    padding: 10px 0;
    margin-top: 0; /* Ensures no extra space */
    margin-bottom: 0;
}

/* Main Navigation (Desktop) */
.main-nav {
    background-color: var(--main-nav-bg);
    padding: 10px 0;
    display: flex; /* Desktop default: flex */
    flex-direction: row; /* Desktop default: row */
    position: static; /* Desktop default: static */
    transition: transform 0.3s ease; /* For mobile menu animation */
}

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

.nav-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: bold;
    padding: 10px 15px;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
    white-space: nowrap;
    font-size: 15px;
}

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

/* Hamburger Menu (Hidden on Desktop) */
.hamburger-menu {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 24px;
    position: relative;
    z-index: 1001; /* Ensure it's above other elements */
    order: 0; /* Default order, will be -1 on mobile */
}

.hamburger-menu span {
    display: block;
    height: 3px;
    background-color: var(--secondary-color);
    border-radius: 2px;
    margin-bottom: 5px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

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

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

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

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

/* Mobile Menu Overlay (Hidden on Desktop) */
.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;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

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

.footer-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.footer-logo {
    font-size: 20px;
    font-weight: bold;
    color: var(--secondary-color);
    margin-top: 0;
    margin-bottom: 15px;
}

.footer-col h3 {
    color: var(--secondary-color);
    font-size: 16px;
    margin-top: 0;
    margin-bottom: 15px;
}

.footer-col p {
    margin: 0;
    line-height: 1.8;
}

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

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

.footer-col ul li a {
    color: var(--footer-text);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-col ul li a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    font-size: 13px;
    color: #aaa;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .header-container, .nav-container, .footer-container {
        width: 100%;
        max-width: none;
        padding: 0 15px;
    }

    /* Header Top Bar */
    .header-top .header-container {
        justify-content: space-between;
        padding: 15px 15px;
    }

    .hamburger-menu {
        display: block;
        order: -1; /* Move hamburger to the left */
    }

    .logo {
        flex: 1 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        font-size: 20px;
        order: 0;
    }

    .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: 10px 15px; /* Adjust padding for mobile */
        overflow: hidden;
        gap: 10px;
        flex-wrap: nowrap;
        justify-content: center;
        margin-top: 0;
        margin-bottom: 0;
    }

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

    /* Main Navigation (Mobile) */
    .main-nav {
        display: none; /* Hidden by default on mobile */
        flex-direction: column; /* Vertical layout for mobile menu */
        position: fixed;
        top: var(--header-offset); /* Start below the fixed header + mobile buttons */
        left: 0;
        width: 80%; /* Width of the mobile menu */
        height: calc(100% - var(--header-offset));
        background-color: var(--main-nav-bg);
        transform: translateX(-100%); /* Off-screen to the left */
        transition: transform 0.3s ease;
        overflow-y: auto;
        z-index: 9999; /* Higher than overlay */
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    }

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

    .main-nav .nav-container {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px 15px;
    }

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

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

    /* Footer Mobile */
    .footer-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

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

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

    .footer-col ul li a {
        padding: 5px 0;
        display: block;
    }

    .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 class for body */
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;
  }
}
