/* General Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    padding-top: var(--header-offset); /* Must be here */
    overflow-x: hidden; /* Added for mobile content protection */
}
a {
    text-decoration: none;
    color: inherit;
}
ul {
    list-style: none;
}

/* Header Offset - MUST BE HERE */
:root {
    --header-offset: 122px; /* 68px (header-top) + 52px (main-nav) */
}

/* Site Header - Fixed & Suspended */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Suspended effect */
    background-color: #017439; /* Default background, will be covered by header-top */
}

/* Header Top Section */
.header-top {
    min-height: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background-color: #017439; /* Primary color for header top */
    color: #FFFFFF;
    width: 100%;
}

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

.logo {
    font-size: 28px;
    font-weight: bold;
    color: #FFFFFF;
    text-transform: uppercase;
    display: flex; /* For potential image logo centering in mobile */
    align-items: center;
    justify-content: flex-start; /* Default for desktop */
}

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

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

/* Mobile Navigation Buttons (Hidden by default on desktop) */
.mobile-nav-buttons {
    display: none; /* Hidden on desktop */
    min-height: 48px; /* Placeholder for mobile */
    background-color: #F0F0F0; /* Contrasting background for mobile buttons */
    padding: 8px 15px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    justify-content: center; /* Centered on mobile */
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

/* Main Navigation */
.main-nav {
    min-height: 52px;
    height: 52px;
    display: flex; /* Desktop default: visible, horizontal */
    align-items: center;
    overflow: hidden;
    background-color: #FFFFFF; /* Secondary color for main nav */
    width: 100%;
    border-top: 1px solid rgba(0, 0, 0, 0.1); /* Separator */
}

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

.nav-link {
    display: block;
    padding: 10px 15px;
    color: #333;
    font-weight: bold;
    transition: color 0.3s ease, background-color 0.3s ease;
    white-space: nowrap;
}

.nav-link:hover {
    color: #017439; /* Primary color on hover */
    background-color: #F0F0F0;
    border-radius: 4px;
}

/* Hamburger Menu (Hidden on desktop) */
.hamburger-menu {
    display: none; /* Hidden on desktop */
    width: 30px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    z-index: 1001; /* Above header */
    padding: 0;
    margin-left: -5px; /* Adjust for visual alignment */
}

.hamburger-menu span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #FFFFFF; /* White for dark header */
    margin-bottom: 5px;
    transition: all 0.3s ease;
    border-radius: 2px;
}
.hamburger-menu span:last-child {
    margin-bottom: 0;
}

/* Hamburger active state */
.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);
}

/* Overlay for 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;
}
.overlay.active {
    display: block;
}

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

/* Specific button styles */
.btn-login, .btn-register {
    background-color: #C30808; /* Custom red for login/register */
    color: #FFFF00; /* Custom yellow font */
    box-shadow: 0 2px 8px rgba(195, 8, 8, 0.4);
}

.btn-login:hover, .btn-register:hover {
    background-color: #E00A0A; /* Slightly lighter red on hover */
    box-shadow: 0 4px 12px rgba(195, 8, 8, 0.6);
}

/* Footer */
.site-footer {
    background-color: #017439; /* Primary color for footer */
    color: #FFFFFF;
    padding: 40px 20px 20px;
    font-size: 14px;
}

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

.footer-col h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #FFFFFF;
}

.footer-logo {
    font-size: 24px;
    font-weight: bold;
    color: #FFFFFF;
    text-transform: uppercase;
    margin-bottom: 15px;
    display: block;
}

.footer-description {
    line-height: 1.8;
    margin-bottom: 15px;
    word-wrap: break-word; /* Ensure description wraps */
    overflow-wrap: break-word;
}

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

.footer-nav a {
    color: #FFFFFF;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.footer-nav a:hover {
    opacity: 1;
    text-decoration: underline;
}

.footer-bottom {
    max-width: 1200px;
    margin: 20px auto 0;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

/* Dynamic Slot Anchor Styling (ensure visibility) */
.footer-slot-anchor-inner {
    min-height: 1px; /* Ensure it takes up space, even if empty */
    display: block; /* Or flex, grid, etc., based on parent context */
    visibility: visible;
    opacity: 1;
    height: auto;
    max-height: none;
    overflow: visible;
}

/* Prevents body scroll when mobile menu is open */
body.no-scroll {
    overflow: hidden;
}

/* Mobile styles */
@media (max-width: 768px) {
    /* Header Offset for Mobile */
    :root {
        --header-offset: 110px; /* 60px (header-top) + 48px (mobile-nav-buttons) */
    }
    body {
        overflow-x: hidden;
    }
    .page-content img {
      max-width: 100% !important;
      height: auto !important;
      display: block;
    }
    .page-content {
      overflow-x: hidden;
      max-width: 100%;
    }

    /* Header Top */
    .header-top {
        min-height: 60px;
        height: 60px;
    }
    .header-container {
        padding: 0 15px; /* Smaller padding for mobile */
        justify-content: space-between; /* Space out hamburger and logo */
    }
    .logo {
        flex: 1 !important; /* Take available space */
        display: flex !important;
        justify-content: center !important; /* Centered logo */
        align-items: center !important;
        max-width: calc(100% - 60px); /* Adjust max-width to not overlap hamburger */
        font-size: 24px;
    }
    .logo img {
        max-height: 56px !important; /* Mobile max height */
    }

    /* Hamburger Menu */
    .hamburger-menu {
        display: block; /* Visible on mobile */
        order: -1; /* Place it first */
        margin-right: auto; /* Push logo to center */
        width: 28px;
        height: 22px;
    }
    .hamburger-menu span {
        background-color: #FFFFFF; /* Ensure white for dark header */
    }

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

    /* Mobile buttons visible on mobile */
    .mobile-nav-buttons {
        display: flex !important; /* Visible on mobile */
        min-height: 48px;
        align-items: center;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 8px 15px; /* Adjusted padding */
        overflow: hidden;
        gap: 10px;
        flex-wrap: nowrap; /* Ensure buttons stay in one line */
        background-color: #F0F0F0; /* Light background for visibility */
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }
    .mobile-nav-buttons .btn {
        flex: 1;
        min-width: 0;
        max-width: calc(50% - 5px); /* Max width for two buttons with gap */
        box-sizing: border-box;
        padding: 8px 12px; /* Smaller padding */
        font-size: 13px;
        white-space: normal; /* Allow text wrapping */
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Main Navigation (Mobile Menu) */
    .main-nav {
        display: none; /* Hidden by default for mobile */
        position: fixed;
        top: var(--header-offset); /* Position below fixed header and mobile buttons */
        left: 0;
        width: 80%; /* Menu width */
        max-width: 300px; /* Max width for mobile menu */
        height: calc(100% - var(--header-offset)); /* Full height below header */
        background-color: #FFFFFF; /* White background for menu */
        flex-direction: column; /* Vertical layout */
        align-items: flex-start; /* Align items to the start */
        padding: 20px 0;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
        transform: translateX(-100%); /* Off-screen by default */
        transition: transform 0.3s ease;
        z-index: 1000; /* Below overlay, above body */
        overflow-y: auto; /* Enable scrolling for long menus */
        border-top: none; /* Remove desktop border */
    }
    .main-nav.active {
        display: flex; /* Show menu when active */
        transform: translateX(0); /* Slide in */
    }
    .nav-container {
        flex-direction: column; /* Vertical links */
        padding: 0;
        width: 100%;
        max-width: none;
        align-items: flex-start;
    }
    .nav-link {
        width: 100%;
        padding: 12px 20px;
        border-bottom: 1px solid #eee;
        color: #333;
    }
    .nav-link:last-child {
        border-bottom: none;
    }
    .nav-link:hover {
        background-color: #f5f5f5;
    }

    /* Footer Mobile */
    .footer-top-grid {
        grid-template-columns: 1fr; /* Single column layout */
    }
    .footer-col {
        text-align: center;
        margin-bottom: 20px;
    }
    .footer-nav {
        padding: 0;
    }
    .footer-nav li {
        margin-bottom: 5px;
    }
    .footer-nav a {
        display: inline-block;
        padding: 5px 0;
    }
    .footer-description {
        text-align: center;
    }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
}
