:root {
    --header-offset: 122px;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding-top: var(--header-offset);
    background-color: #FFFFFF;
    color: #333;
    overflow-x: hidden;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    background-color: #017439; /* Default for header-top, will be overridden */
}

.header-top {
    box-sizing: border-box;
    min-height: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background-color: #004d2b; /* Darker green for top bar */
    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: 0 20px;
}

.logo {
    color: #FFFFFF;
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

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

.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.btn-register {
    background-color: #C30808;
    color: #FFFF00;
    border: 1px solid #C30808;
}

.btn-register:hover {
    background-color: #e00b0b;
}

.btn-login {
    background-color: #C30808;
    color: #FFFF00;
    border: 1px solid #C30808;
}

.btn-login:hover {
    background-color: #e00b0b;
}

.mobile-nav-buttons {
    display: none; /* Hidden by default, shown in mobile */
}

.main-nav {
    box-sizing: border-box;
    min-height: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background-color: #017439; /* Primary green for main nav */
    width: 100%;
}

.nav-container {
    box-sizing: border-box;
    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: #FFFFFF;
    text-decoration: none;
    padding: 10px 15px;
    white-space: nowrap;
    font-size: 15px;
    transition: background-color 0.3s ease;
}

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

.hamburger-menu {
    display: none; /* Hidden by default, shown in mobile */
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}

.hamburger-menu .bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #FFFFFF;
    margin: 5px 0;
    transition: 0.4s;
}

.hamburger-menu.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(-45deg);
}

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

.hamburger-menu.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(45deg);
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    transition: opacity 0.3s ease;
    opacity: 0;
}

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

/* Footer Styles */
.site-footer {
    background-color: #1a1a1a; /* Dark background 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 {
    color: #FFFFFF;
    font-size: 16px;
    margin-bottom: 15px;
}

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

.footer-description {
    line-height: 1.6;
    color: #ccc;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

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

.footer-nav li a {
    color: #ccc;
    text-decoration: none;
    display: block;
    padding: 5px 0;
    transition: color 0.3s ease;
}

.footer-nav li a:hover {
    color: #FFFFFF;
}

.footer-dynamic-row {
    max-width: 1200px;
    margin: 0 auto 20px;
    padding: 0 10px;
}

.footer-dynamic-row .footer-slot-anchor-inner {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
}

.footer-dynamic-col .footer-slot-anchor-inner {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    align-items: flex-start;
    gap: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #333;
    color: #ccc;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-bottom p {
    margin: 0;
}

/* Mobile Styles */
@media (max-width: 768px) {
    :root {
        --header-offset: 110px;
    }

    .header-top {
        min-height: 60px !important;
        height: 60px !important;
        padding-left: 15px;
        padding-right: 15px;
    }

    .header-container {
        width: 100%;
        max-width: none;
        padding: 0;
        justify-content: space-between;
    }

    .logo {
        flex: 1 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        font-size: 20px;
        max-width: calc(100% - 70px); /* Account for hamburger width */
    }

    .desktop-nav-buttons {
        display: none;
    }

    .mobile-nav-buttons {
        display: flex !important;
        min-height: 48px;
        align-items: center;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 0 15px;
        overflow: hidden;
        gap: 10px;
        flex-wrap: nowrap;
        justify-content: center;
        background-color: #017439; /* Same as main nav for consistency */
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    .mobile-nav-buttons .btn {
        flex: 1;
        min-width: 0;
        max-width: calc(50% - 5px);
        box-sizing: border-box;
        padding: 8px 12px;
        font-size: 13px;
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
        text-align: center;
    }

    .main-nav {
        min-height: 48px !important;
        height: calc(100% - var(--header-offset)) !important; /* Full height minus header */
        position: fixed;
        top: var(--header-offset);
        left: 0;
        width: 75%;
        max-width: 300px;
        flex-direction: column;
        align-items: flex-start;
        padding: 20px 0;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1001;
        display: none; /* Hidden by default */
    }

    .main-nav.active {
        transform: translateX(0);
        display: flex;
    }

    .nav-container {
        width: 100%;
        max-width: none;
        flex-direction: column;
        align-items: flex-start;
        padding: 0 15px;
        height: auto;
    }

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

    .hamburger-menu {
        display: block;
        order: -1; /* Place hamburger to the left */
        margin-right: auto; /* Push logo to center */
        color: #FFFFFF;
    }

    .footer-top-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-col h3 {
        margin-top: 0;
    }

    .footer-dynamic-row,
    .footer-bottom {
        padding: 0 15px;
    }

    .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: 480px) {
    .logo {
        font-size: 18px;
    }
    .btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    .nav-link {
        font-size: 14px;
    }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
