:root {
    --primary-color: #017439;
    --secondary-color: #FFFFFF;
    --button-register-bg: #C30808;
    --button-login-bg: #C30808;
    --button-text-color: #FFFF00;
    --header-offset: 110px; /* Desktop: header-top (60px) + main-nav (50px) */
}

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

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* General Container Styling */
.header-container, .nav-container, .footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* 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.1);
    background-color: var(--secondary-color); /* Default background for entire header */
    overflow-x: hidden;
}

.header-top {
    background-color: var(--primary-color); /* Distinct background for header-top */
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    height: 60px; /* Fixed height for header-top */
}

.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;
    padding: 0;
    display: block; /* Ensure logo is visible */
}

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

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

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

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

.btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.mobile-nav-buttons {
    display: none; /* Hidden by default on desktop */
}

/* Main Navigation */
.main-nav {
    background-color: var(--secondary-color); /* Distinct background for main-nav */
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    height: 50px; /* Fixed height for main-nav */
    display: flex; /* Desktop default: flex for horizontal menu */
    align-items: center;
}

.main-nav .nav-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

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

.nav-link:hover {
    color: #004d2b; /* Darker shade for hover */
}

.hamburger-menu {
    display: none; /* Hidden by default on desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    position: relative;
    z-index: 1001;
}

.hamburger-menu span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--secondary-color);
    margin: 5px 0;
    transition: all 0.3s ease;
}

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

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

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

.site-footer h3 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-size: 18px;
}

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

.footer-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

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

.footer-nav {
    list-style: none;
}

.footer-nav li a {
    color: var(--secondary-color);
    text-decoration: none;
    margin-bottom: 8px;
    display: block;
    transition: color 0.3s ease;
}

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

/* Responsive Styles */
@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 {
        overflow-x: hidden;
        width: 100%;
        max-width: 100%;
    }

    .header-top .header-container {
        padding: 0 15px;
        justify-content: flex-start; /* Adjust for hamburger menu */
        position: relative; /* For logo centering */
    }

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

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

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

    .mobile-nav-buttons {
        display: flex !important; /* Show mobile buttons */
        width: 100%; max-width: 100%;
        box-sizing: border-box;
        padding: 10px 15px;
        overflow: hidden;
        gap: 10px;
        flex-wrap: nowrap;
        background-color: var(--primary-color); /* Same as header-top for consistency */
    }

    .mobile-nav-buttons .btn {
        flex: 1; min-width: 0;
        max-width: calc(50% - 5px); /* Max width for 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-nav {
        display: none; /* Hide main nav by default */
        position: fixed;
        top: 0; /* Adjusted to cover full height */
        left: 0;
        width: 80%; /* Sidebar width */
        height: 100vh;
        background-color: var(--secondary-color);
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
        transform: translateX(-100%); /* Slide out to the left */
        transition: transform 0.3s ease-in-out;
        z-index: 999; /* Below overlay */
        overflow-y: auto;
        box-shadow: 2px 0 5px rgba(0,0,0,0.2);
        padding-top: 80px; /* Space for fixed header content */
    }

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

    .main-nav .nav-container {
        flex-direction: column;
        align-items: flex-start;
        padding: 0;
        width: 100%; /* Take full width of sidebar */
    }

    .nav-link {
        padding: 12px 0;
        width: 100%;
        border-bottom: 1px solid #eee;
    }

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

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

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

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

    .footer-nav li a {
        display: inline-block;
        margin: 0 5px;
    }
}

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