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

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333333;
    background-color: #FFFFFF; /* Custom background color */
    padding-top: var(--header-offset);
    overflow-x: hidden; /* Prevent horizontal scroll on desktop too */
}

a {
    text-decoration: none;
    color: #26A9E0; /* Main color for links */
}

ul {
    list-style: none;
}

/* Header styles */
:root {
    --header-offset: 122px; /* 68px (header-top) + 52px (main-nav) + 2px buffer */
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: #FFFFFF; /* Default background for header itself, individual sections will have their own */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Suspended effect */
}

/* Header Top Section (Desktop) */
.header-top {
    box-sizing: border-box;
    min-height: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background-color: #333333; /* Dark background for header-top */
    color: #FFFFFF;
    width: 100%;
}

.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-left: 20px;
    padding-right: 20px;
}

.logo {
    font-size: 28px;
    font-weight: bold;
    color: #FFFFFF; /* Logo text color */
    display: block;
    line-height: 1; /* Ensure text logo fits */
}

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

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

.mobile-nav-buttons {
    box-sizing: border-box;
    display: none; /* Hidden by default on desktop */
    min-height: 48px;
    background-color: #f0f0f0; /* Light background for mobile buttons */
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
    text-decoration: none; /* Remove underline */
    white-space: nowrap; /* Prevent wrapping on desktop */
}

.btn-register {
    background-color: #EA7C07; /* Login color */
    color: #FFFFFF;
}

.btn-register:hover {
    background-color: #e06f00;
    transform: translateY(-1px);
}

.btn-login {
    background-color: #26A9E0; /* Main color */
    color: #FFFFFF;
}

.btn-login:hover {
    background-color: #1e87bb;
    transform: translateY(-1px);
}

/* Main Navigation Section (Desktop) */
.main-nav {
    box-sizing: border-box;
    min-height: 52px;
    height: 52px;
    display: flex; /* Desktop default: flex */
    align-items: center;
    overflow: hidden;
    background-color: #26A9E0; /* Main color for main-nav */
    width: 100%;
    position: static; /* Desktop default: static */
}

.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 {
    color: #FFFFFF;
    padding: 10px 15px;
    font-weight: bold;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* Hamburger Menu (Mobile) */
.hamburger-menu {
    display: none; /* Hidden 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: #FFFFFF; /* Hamburger icon color */
    margin-bottom: 5px;
    position: relative;
    transform-origin: 4px 0px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger-menu span:first-child {
    transform-origin: 0% 0%;
}

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

.hamburger-menu span:last-child {
    transform-origin: 0% 100%;
    margin-bottom: 0;
}

.hamburger-menu.active span:first-child {
    transform: rotate(45deg) translate(2px, -2px);
}

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

.hamburger-menu.active span:last-child {
    transform: rotate(-45deg) translate(2px, 2px);
}

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

/* Footer styles */
.site-footer {
    background-color: #333333; /* Dark background for footer */
    color: #CCCCCC;
    padding: 40px 20px 15px;
    font-size: 14px;
}

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

.footer-col h3 {
    color: #FFFFFF;
    font-size: 16px;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

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

.footer-description {
    line-height: 1.8;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

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

.footer-nav a {
    color: #CCCCCC;
    transition: color 0.3s ease;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #AAAAAA;
}

.footer-bottom p {
    margin: 0;
}

/* Dynamic slot anchors - ensure they are visible for content injection */
.footer-slot-anchor-inner {
    min-height: 1px; /* Ensure they take up minimal space if empty */
}

/* Media Queries for Mobile */
@media (max-width: 768px) {
    :root {
        --header-offset: 110px; /* 60px (header-top) + 48px (mobile-nav-buttons) + 2px buffer */
    }

    body {
        overflow-x: hidden;
    }

    .page-content img {
      max-width: 100% !important;
      height: auto !important;
      display: block;
    }
    .page-content {
      overflow-x: hidden;
      max-width: 100%;
    }

    .site-header {
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    }

    /* Header Top Section (Mobile) */
    .header-top {
        min-height: 60px !important;
        height: 60px !important;
        padding-left: 15px; /* Adjust padding for mobile */
        padding-right: 15px;
    }

    .header-container {
        width: 100%;
        max-width: none; /* Remove max-width for mobile */
        padding-left: 0; /* Handled by header-top padding */
        padding-right: 0; /* Handled by header-top padding */
        position: relative; /* For absolute positioning of logo if needed */
        justify-content: flex-start; /* Adjust for hamburger menu */
    }

    .hamburger-menu {
        display: block; /* Show hamburger menu on mobile */
        position: relative;
        z-index: 1002; /* Higher than logo if using absolute positioning */
    }

    /* Mobile Logo Centering (Method 1: Flexbox with !important) */
    .logo {
        flex: 1 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        position: absolute; /* To allow hamburger to be on far left */
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        margin: auto; /* For centering */
        z-index: 1001; /* Below hamburger, above general header content */
        color: #FFFFFF; /* Ensure logo text color is visible */
    }
    /* If logo is image, specific max-height */
    .logo img {
        max-height: 56px !important; /* Mobile max-height */
        max-width: calc(100% - 80px); /* Leave space for hamburger */
    }

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

    /* Mobile Buttons Section */
    .mobile-nav-buttons {
        display: flex !important; /* Show mobile buttons */
        min-height: 48px;
        align-items: center;
        justify-content: center; /* Center buttons horizontally */
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding-left: 15px;
        padding-right: 15px;
        overflow: hidden; /* Prevent overflow */
        gap: 10px;
        flex-wrap: nowrap; /* Ensure buttons stay in one line */
        background-color: #f0f0f0; /* Light background */
    }

    .mobile-nav-buttons .btn {
        flex: 1;
        min-width: 0;
        max-width: calc(50% - 5px); /* For two buttons with 10px gap */
        box-sizing: border-box;
        padding: 8px 12px; /* Smaller padding */
        font-size: 13px; /* Smaller font size */
        white-space: normal; /* Allow text to wrap */
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Main Navigation Section (Mobile) */
    .main-nav {
        min-height: 100vh; /* Full viewport height */
        height: 100vh;
        width: 70%; /* Adjust width for mobile menu */
        max-width: 300px; /* Max width for side menu */
        position: fixed; /* Fixed position for mobile menu */
        top: 0; /* Aligned to top */
        left: 0;
        transform: translateX(-100%); /* Hidden by default */
        transition: transform 0.3s ease;
        flex-direction: column; /* Vertical layout */
        justify-content: flex-start; /* Align items to top */
        align-items: flex-start; /* Align items to left */
        padding-top: calc(var(--header-offset) + 20px); /* Offset from fixed header + some padding */
        background-color: #26A9E0; /* Main color */
        z-index: 1000; /* Below hamburger, above overlay */
        display: none; /* Hidden by default for proper animation with transform */
    }

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

    .nav-container {
        width: 100%;
        max-width: none; /* Remove max-width for mobile */
        flex-direction: column;
        align-items: flex-start;
        padding: 0 15px; /* Adjust padding for mobile */
        height: auto; /* Allow content to dictate height */
    }

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

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

    .mobile-nav-overlay.active {
        display: block; /* Show overlay when menu is active */
    }

    body.no-scroll {
        overflow: hidden;
    }

    /* Footer Styles (Mobile) */
    .site-footer {
        padding: 30px 15px 10px;
    }

    .footer-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
        gap: 30px;
        margin-bottom: 20px;
    }

    .footer-col h3 {
        text-align: center;
        margin-bottom: 10px;
        padding-bottom: 5px;
    }

    .footer-logo {
        text-align: center;
        margin-bottom: 10px;
    }

    .footer-description {
        text-align: center;
    }

    .footer-nav {
        text-align: center;
    }

    .footer-nav li {
        margin-bottom: 5px;
    }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
