/* General Reset & Base Styles */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    color: #333333; /* Default text color */
    line-height: 1.6;
    background-color: #FFFFFF; /* Custom background color */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden; /* Prevent body overflow on mobile */
}

/* Header Offset */
:root {
    --header-offset: 122px; /* Desktop: 68px (header-top) + 52px (main-nav) */
}
body {
    padding-top: var(--header-offset);
}

/* 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.2); /* Suspended effect */
    background-color: #FFFFFF; /* Ensure solid background */
    box-sizing: border-box;
    overflow-x: hidden; /* Prevent header content overflow */
}

/* Header Top Section */
.header-top {
    box-sizing: border-box;
    height: 68px; /* Desktop fixed height */
    display: flex;
    align-items: center;
    background-color: #26A9E0; /* Primary color for header top */
    color: #FFFFFF;
    width: 100%;
    position: relative; /* For mobile logo centering */
}

.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 logo and buttons */
}

/* Logo */
.logo, .footer-logo {
    font-size: 28px;
    font-weight: bold;
    color: #FFFFFF; /* White text on blue background */
    text-decoration: none;
    line-height: 1;
    display: flex;
    align-items: center;
    height: 100%; /* Align with header-top height */
}
.logo img {
    display: block;
    max-height: 60px; /* Desktop logo max height */
    height: auto;
    width: auto;
    max-width: 280px;
    object-fit: contain;
}

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

/* Mobile Navigation Buttons (hidden by default on desktop) */
.mobile-nav-buttons {
    box-sizing: border-box;
    display: none; /* Hidden on desktop */
    min-height: 48px; /* Mobile fixed height */
    background-color: #F0F0F0; /* Light background for mobile buttons */
    width: 100%;
    padding: 8px 15px; /* Adjust padding for mobile buttons */
    justify-content: center; /* Center buttons horizontally */
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap; /* Ensure buttons stay in one line */
}

/* Main Navigation */
.main-nav {
    box-sizing: border-box;
    height: 52px; /* Desktop fixed height */
    display: flex; /* Desktop default: visible, horizontal */
    align-items: center;
    background-color: #FFFFFF; /* Auxiliary color for main nav */
    width: 100%;
    overflow: hidden; /* Prevent content overflow */
}

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

.nav-link {
    color: #333333; /* Dark text on white background */
    text-decoration: none;
    padding: 0 15px;
    font-size: 16px;
    height: 100%;
    display: flex;
    align-items: center;
    transition: background-color 0.3s ease, color 0.3s ease;
    white-space: nowrap; /* Prevent menu items from wrapping */
}

.nav-link:hover, .nav-link.active {
    background-color: #E0F2F7; /* Lighter blue on hover */
    color: #26A9E0; /* Primary color on hover */
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    white-space: nowrap;
    border: none;
    box-sizing: border-box;
}

.btn-login {
    background-color: #EA7C07; /* Custom login color */
    color: #FFFFFF;
}

.btn-register {
    background-color: #26A9E0; /* Primary color for register */
    color: #FFFFFF;
}

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

/* Hamburger Menu (hidden on desktop) */
.hamburger-menu {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    position: relative;
    z-index: 1001; /* Above header content */
}

.hamburger-menu span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #FFFFFF; /* White lines on blue header */
    margin-bottom: 5px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

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

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

.overlay.active {
    display: block;
    opacity: 1;
}

/* Footer */
.site-footer {
    background-color: #1a1a1a; /* Dark background for footer */
    color: #CCCCCC; /* Light text for footer */
    padding: 40px 0 20px;
    font-size: 14px;
    box-sizing: border-box;
}

.site-footer a {
    color: #FFFFFF; /* White links */
    text-decoration: none;
    transition: color 0.3s ease;
}

.site-footer a:hover {
    color: #26A9E0; /* Primary color on hover */
}

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

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

.footer-about .footer-logo {
    font-size: 28px;
    margin-bottom: 15px;
    display: inline-block;
    color: #FFFFFF;
}

.footer-about .footer-description {
    line-height: 1.8;
    margin-bottom: 20px;
    word-wrap: break-word; /* Ensure description wraps */
    color: #CCCCCC;
}

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

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

.footer-bottom {
    border-top: 1px solid #333333;
    margin-top: 40px;
    padding-top: 20px;
    text-align: center;
    color: #999999;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 20px; /* Ensure padding even if no border */
    box-sizing: border-box;
}

/* Dynamic slot anchors - ensure they are visible */
.footer-slot-anchor-inner {
    min-height: 10px; /* Ensure visibility for debugging/layout */
    width: 100%;
    box-sizing: border-box;
}
.footer-mid-slots, .footer-bottom-slots {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column; /* Ensure vertical stacking of slots */
    gap: 10px;
}

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

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

    /* Header Top Section */
    .header-top {
        height: 60px; /* Mobile fixed height */
        padding: 0 15px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: relative; /* Needed for absolute positioning of logo */
    }

    .header-container {
        padding: 0; /* Container itself has no padding, handled by header-top */
        max-width: none; /* Remove max-width on mobile */
        width: 100%; /* Take full width */
    }

    /* Logo - Method 2 for image logo centering (stronger) */
    .logo {
        position: absolute !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        max-width: calc(100% - 100px); /* Ensure space for hamburger */
        height: 100%; /* To center vertically */
    }
    .logo img {
        max-height: 56px; /* Mobile logo max height */
    }

    /* Hamburger Menu position */
    .hamburger-menu {
        display: block; /* Show on mobile */
        position: relative; /* Ensure it's clickable and layered correctly */
        z-index: 2; /* Above logo if needed, but below main nav when open */
        padding: 0;
        width: 40px;
        height: 40px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        margin-left: -5px; /* Adjust to align with edge */
    }
    .hamburger-menu span {
        background-color: #FFFFFF;
    }
    .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);
    }

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

    /* Mobile Navigation Buttons */
    .mobile-nav-buttons {
        display: flex !important; /* Show on mobile */
        min-height: 48px;
        background-color: #F0F0F0; /* Consistent light background */
        padding: 8px 15px; /* Mobile padding */
        justify-content: center;
        align-items: center;
        gap: 10px;
        flex-wrap: nowrap;
        width: 100%;
        max-width: 100%;
        overflow: hidden; /* Prevent overflow */
    }
    .mobile-nav-buttons .btn {
        flex: 1;
        min-width: 0;
        max-width: calc(50% - 5px); /* Two buttons, with 10px gap */
        padding: 8px 12px;
        font-size: 13px;
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
        text-align: center;
    }

    /* Main Navigation (Mobile - Hamburger Menu) */
    .main-nav {
        display: none; /* Hidden by default */
        position: fixed;
        top: var(--header-offset); /* Position below fixed header */
        left: 0;
        width: 280px; /* Width of the side menu */
        height: calc(100% - var(--header-offset)); /* Full height below header */
        background-color: #FFFFFF;
        flex-direction: column;
        padding: 20px 0;
        box-shadow: 2px 0 5px rgba(0,0,0,0.2);
        transform: translateX(-100%); /* Slide out to the left */
        transition: transform 0.3s ease;
        overflow-y: auto; /* Enable scrolling for long menus */
        z-index: 1000; /* Ensure it's above content */
    }

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

    .nav-container {
        flex-direction: column; /* Vertical menu items */
        align-items: flex-start; /* Align menu items to the left */
        padding: 0 20px;
        max-width: none; /* No max-width on mobile */
        width: 100%;
    }

    .nav-link {
        width: 100%;
        padding: 12px 15px;
        border-bottom: 1px solid #EEEEEE;
        font-size: 15px;
        justify-content: flex-start;
        height: auto; /* Allow height to adjust */
    }
    .nav-link:last-child {
        border-bottom: none;
    }

    /* Overlay */
    .overlay.active {
        display: block;
        opacity: 1;
        z-index: 999; /* Ensure overlay is behind menu but above content */
    }

    /* Footer */
    .site-footer {
        padding: 30px 0 15px;
    }
    .footer-top-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
        gap: 20px;
        padding: 0 15px;
    }
    .footer-col {
        margin-bottom: 20px;
    }
    .footer-col:last-child {
        margin-bottom: 0;
    }
    .footer-mid-slots, .footer-bottom-slots {
        padding: 0 15px;
    }
    .footer-bottom {
        padding: 15px;
    }

    /* Mobile content overflow prevention */
    .page-content img {
        max-width: 100% !important;
        height: auto !important;
        display: block;
    }
    .page-content {
        overflow-x: hidden;
        max-width: 100%;
    }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
}
