/* General reset and base styles */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    color: var(--text-main);
    background-color: var(--background);
    padding-top: var(--header-offset); /* Critical for header offset */
    overflow-x: hidden; /* Prevent horizontal scroll on desktop too */
}

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

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

/* Color variables */
:root {
    --primary-color: #11A84E;
    --accent-color: #22C768;
    --button-gradient: linear-gradient(180deg, #2AD16F 0%, #13994A 100%);
    --card-bg: #11271B;
    --background: #08160F;
    --text-main: #F2FFF6;
    --text-secondary: #A7D9B8;
    --border-color: #2E7A4E;
    --glow-color: #57E38D;
    --gold-color: #F2C14E;
    --divider-color: #1E3A2A;
    --deep-green: #0A4B2C;

    /* Header offset calculation */
    --header-offset: 122px; /* Desktop: header-top (68px) + main-nav (52px) = 120px + 2px */
}

/* Shared Header Styles */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    background-color: var(--deep-green); /* Fallback, specific sections will override */
}

.header-top {
    box-sizing: border-box;
    height: 68px; /* Desktop fixed height */
    display: flex;
    align-items: center;
    background-color: var(--deep-green); /* Deep Green for header-top */
    width: 100%;
    overflow: hidden;
}

.header-container {
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px; /* Padding for content inside container */
}

.logo {
    font-size: 28px;
    font-weight: bold;
    color: var(--gold-color); /* Gold for brand name */
    text-transform: uppercase;
    display: block; /* Ensure visibility */
    padding: 0; /* Remove default padding if any */
    line-height: 1;
}

.logo img {
    display: block;
    max-height: 60px; /* Desktop max height */
    height: auto;
    width: auto;
    max-width: 280px;
    object-fit: contain;
}

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

.btn {
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none; /* Remove default button border */
    text-decoration: none; /* Remove underline for button links */
    color: var(--text-main); /* Button text color */
}

.btn-login, .btn-register {
    background: var(--button-gradient);
    box-shadow: 0 4px 15px rgba(42, 209, 111, 0.4);
}

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

.hamburger-menu {
    display: none; /* Hidden on desktop */
    width: 30px;
    height: 24px;
    position: relative;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    z-index: 1001; /* Above logo on mobile */
}

.hamburger-menu span {
    display: block;
    height: 3px;
    width: 100%;
    background: var(--text-main);
    border-radius: 3px;
    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) { top: 50%; transform: translateY(-50%) rotate(45deg); }
.hamburger-menu.active span:nth-child(2) { opacity: 0; }
.hamburger-menu.active span:nth-child(3) { bottom: 50%; transform: translateY(50%) rotate(-45deg); }

.mobile-nav-buttons {
    box-sizing: border-box;
    display: none; /* Hidden on desktop by default */
    min-height: 48px; /* Mobile fixed height */
    background-color: var(--deep-green); /* Same as header-top for consistency */
    width: 100%;
    padding: 0 15px; /* Mobile padding */
    gap: 10px;
    flex-wrap: nowrap; /* Prevent wrapping */
    overflow: hidden; /* Prevent overflow */
    justify-content: center; /* Center buttons horizontally */
    align-items: center;
}

.main-nav {
    box-sizing: border-box;
    height: 52px; /* Desktop fixed height */
    display: flex; /* Desktop default: flex */
    align-items: center;
    background-color: var(--primary-color); /* Primary color for main-nav */
    width: 100%;
    overflow: hidden;
}

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

.nav-link {
    display: block;
    padding: 10px 15px;
    font-weight: bold;
    color: var(--text-main);
    transition: color 0.3s ease, background-color 0.3s ease;
    text-transform: uppercase;
    white-space: nowrap; /* Prevent wrapping in desktop nav */
    font-size: 15px;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 998; /* Below menu, above content */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Footer Styles */
.site-footer {
    background-color: var(--background);
    color: var(--text-secondary);
    padding: 40px 20px 20px;
    border-top: 1px solid var(--divider-color);
}

.footer-top-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto 30px;
}

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

.footer-logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--gold-color);
    text-transform: uppercase;
    display: block;
    margin-bottom: 15px;
}

.footer-description {
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

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

.footer-nav a {
    color: var(--text-secondary);
    font-size: 14px;
    transition: color 0.3s ease;
}

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

.footer-mid-slots {
    max-width: 1200px;
    margin: 0 auto 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.footer-mid-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Ensure footer slot anchors are visible */
.footer-slot-anchor-inner {
    min-height: 10px; /* Small height to ensure visibility/space */
    width: 100%; /* Ensure it takes full width of its column */
    box-sizing: border-box;
}

.footer-bottom {
    border-top: 1px solid var(--divider-color);
    padding-top: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
}

.footer-bottom-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column; /* Default to column for small screens/single item */
    align-items: center;
    gap: 10px;
}

.footer-bottom p {
    margin: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    :root {
        --header-offset: 110px; /* Mobile: header-top (60px) + mobile-nav-buttons (48px) = 108px + 2px */
    }

    /* Mobile header top */
    .header-top {
        height: 60px !important; /* Mobile fixed height */
        padding: 0 15px; /* Adjust padding for mobile */
    }

    .header-container {
        padding: 0; /* Hamburger and logo have their own spacing */
        justify-content: space-between; /* Space out hamburger and logo */
        position: relative; /* For absolute logo positioning */
        width: 100%;
        max-width: none;
    }

    .logo {
        flex: 1 !important; /* Take remaining space */
        display: flex !important;
        justify-content: center !important; /* Center logo */
        align-items: center !important;
        max-width: calc(100% - 100px); /* Leave space for hamburger and potential right element */
        font-size: 24px; /* Adjust font size for mobile */
    }
    
    .logo img {
        max-height: 56px !important; /* Mobile max height */
        max-width: 100%;
    }

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

    .hamburger-menu {
        display: block; /* Show hamburger menu on mobile */
        position: relative; /* Ensure it stays in flow */
        z-index: 1001; /* Ensure it's above the logo for interaction */
    }

    .mobile-nav-buttons {
        display: flex !important; /* Show mobile buttons on mobile */
        min-height: 48px;
        align-items: center;
        width: 100%; max-width: 100%;
        box-sizing: border-box;
        padding: 0 15px; /* Adjusted padding */
        overflow: hidden;
        gap: 10px;
        flex-wrap: nowrap;
        justify-content: center; /* Center the buttons */
        background-color: var(--deep-green); /* Consistent background */
    }

    .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 */
        font-size: 13px; /* Smaller font size */
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .main-nav {
        height: auto; /* Auto height for expanded menu */
        position: fixed; /* Fixed position for mobile menu */
        top: var(--header-offset); /* Position below fixed header elements */
        left: 0;
        width: 80%; /* Menu width */
        max-width: 300px;
        background-color: var(--card-bg); /* Darker background for mobile menu */
        flex-direction: column; /* Vertical alignment */
        align-items: flex-start; /* Align menu items to the left */
        padding: 20px 0;
        transform: translateX(-100%); /* Hidden by default */
        transition: transform 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
        display: none; /* Hidden by default, JS will change to flex/block */
        overflow-y: auto; /* Enable scrolling for long menus */
        bottom: 0; /* Extend to bottom */
        z-index: 999; /* Below overlay */
    }

    .main-nav.active {
        transform: translateX(0); /* Show menu */
        display: flex; /* Show as flex column */
    }

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

    .nav-link {
        width: 100%;
        padding: 12px 20px;
        border-bottom: 1px solid var(--divider-color);
        text-align: left;
    }
    .nav-link:last-child {
        border-bottom: none;
    }

    .overlay {
        z-index: 998; /* Below mobile menu, above content */
    }

    /* Footer responsive */
    .site-footer {
        padding: 30px 15px 15px;
    }

    .footer-top-grid {
        grid-template-columns: 1fr; /* Single column layout for mobile */
        gap: 25px;
        margin-bottom: 25px;
    }

    .footer-mid-row {
        grid-template-columns: 1fr; /* Single column for mid rows */
    }

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

    .footer-bottom p {
        text-align: center;
    }

    /* Mobile content 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;
    }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
/* 内容保护（系统追加，请勿删除） */
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
input, textarea, select, [contenteditable="true"] {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}
