/* ============================================
   Shared Header & Footer Styles - zh-CN
   ============================================ */

/* Navigation */
header.nav-header {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 80px);
    max-width: 1200px;
    z-index: 100;
    border-radius: 100px;
    padding: 14px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.4s ease;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.05em;
    font-family: var(--font-heading);
    color: var(--text-main);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo i {
    color: var(--accent-primary);
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    gap: 48px;
    align-items: center;
}

.nav-links a {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-sub);
    transition: color 0.3s ease;
    text-decoration: none;
}

.nav-links a:hover,
.nav-links a.nav-active {
    color: var(--text-main);
}

/* Language Switcher */
.lang-switch { position: relative; cursor: pointer; }

.lang-btn {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.9rem; font-weight: 500;
    padding: 8px 16px; border-radius: 20px;
    background: rgba(15, 23, 42, 0.03);
    border: 1px solid rgba(15, 23, 42, 0.05);
    color: var(--text-sub); transition: all 0.3s ease;
    cursor: pointer;
}

.lang-btn:hover { background: rgba(15, 23, 42, 0.06); color: var(--text-main); }

.lang-dropdown {
    position: absolute; top: 140%; right: 0; width: 140px;
    padding: 8px; border-radius: 20px;
    display: flex; flex-direction: column; gap: 4px;
    opacity: 0; visibility: hidden; transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    backdrop-filter: blur(20px);
    z-index: 200;
}

.lang-switch.active .lang-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }

.lang-dropdown a {
    padding: 10px 16px; border-radius: 12px; font-size: 0.9rem;
    color: var(--text-sub); text-decoration: none; display: block;
    transition: all 0.2s ease;
}

.lang-dropdown a.active, .lang-dropdown a:hover {
    background: rgba(15, 23, 42, 0.04); color: var(--text-main);
}

.mobile-toggle { display: none; font-size: 1.5rem; color: var(--text-main); cursor: pointer; }

/* Footer */
footer {
    padding: 80px 0 40px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(20px);
}

/* Popular keyword tags section */
.footer-keywords {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 28px 36px;
    margin-bottom: 72px;
    background: rgba(79, 70, 229, 0.04);
    border: 1px solid rgba(79, 70, 229, 0.1);
    border-radius: 20px;
}

.footer-keywords-label {
    flex-shrink: 0;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding-top: 5px;
    font-family: var(--font-heading);
}

.footer-keywords-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-keywords-list a {
    display: inline-block;
    padding: 5px 14px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-sub);
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 100px;
    text-decoration: none;
    transition: color 0.25s ease, background 0.25s ease, border-color 0.25s ease;
    white-space: nowrap;
}

.footer-keywords-list a:hover {
    color: var(--accent-primary);
    background: rgba(79, 70, 229, 0.06);
    border-color: rgba(79, 70, 229, 0.25);
}

/* 5-column main content grid */
.footer-content {
    display: grid;
    grid-template-columns: 1.8fr 1fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 72px;
}

.footer-col h4 {
    font-size: 0.82rem;
    margin-bottom: 28px;
    color: var(--text-main);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-family: var(--font-heading);
}

.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 14px; }

.footer-col a {
    color: var(--text-sub);
    font-size: 0.925rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.25s ease;
    line-height: 1.5;
}

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

.footer-brand p {
    color: var(--text-sub);
    margin-top: 24px;
    font-size: 0.95rem;
    line-height: 1.8;
}

.footer-brand p strong {
    color: var(--text-main);
    font-weight: 600;
}

/* Brand trust badges */
.footer-brand-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.footer-brand-badges span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-primary);
    background: rgba(79, 70, 229, 0.07);
    border: 1px solid rgba(79, 70, 229, 0.15);
    border-radius: 100px;
}

/* Bottom bar */
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 32px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    color: var(--text-muted);
    font-size: 0.88rem;
    gap: 24px;
}

.footer-bottom-left {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-legal-links {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.footer-legal-links a {
    color: var(--text-muted);
    font-size: 0.82rem;
    text-decoration: none;
    transition: color 0.25s ease;
    padding: 0 6px;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
}

.footer-legal-links a:first-child { border-left: none; padding-left: 0; }

.footer-legal-links a:hover { color: var(--accent-primary); }

/* ============================================
   Responsive - Header & Footer
   ============================================ */
@media (max-width: 1280px) {
    .footer-content { grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr; gap: 36px; }
}

@media (max-width: 1024px) {
    .footer-content { grid-template-columns: 1fr 1fr 1fr; gap: 48px; }
    .footer-col.footer-brand { grid-column: 1 / -1; }
    .footer-brand p { max-width: 560px; }
    .footer-keywords { padding: 20px 24px; }
}

@media (max-width: 768px) {
    header.nav-header {
        top: 16px;
        width: calc(100% - 32px);
        padding: 12px 20px;
    }

    .nav-links {
        display: flex;
        position: absolute;
        top: calc(100% + 12px);
        left: 0;
        width: 100%;
        flex-direction: column;
        gap: 4px;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(24px) saturate(180%);
        -webkit-backdrop-filter: blur(24px) saturate(180%);
        padding: 20px;
        border-radius: 24px;
        border: 1px solid rgba(0, 0, 0, 0.06);
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
        /* Hidden state with smooth animation */
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(-10px) scale(0.97);
        transform-origin: top center;
        transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                    transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                    visibility 0.28s;
    }

    .nav-links.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0) scale(1);
    }

    .nav-links > a {
        padding: 12px 16px;
        border-radius: 12px;
        font-size: 1rem;
        transition: background 0.2s ease, color 0.2s ease;
    }

    .nav-links > a:hover {
        background: rgba(15, 23, 42, 0.04);
    }

    .mobile-toggle { display: block; }

    /* Language options always expanded on mobile - no dropdown needed */
    .lang-switch {
        width: 100%;
        cursor: default;
    }

    .lang-switch .lang-btn {
        display: none;
    }

    .lang-switch .lang-dropdown {
        position: static;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        background: transparent;
        border: none;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        padding: 4px 0 0;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
        width: 100%;
        transition: none;
    }

    .lang-switch .lang-dropdown a {
        flex: 0 0 auto;
        padding: 7px 14px;
        font-size: 0.88rem;
        border-radius: 10px;
        background: rgba(15, 23, 42, 0.04);
    }

    .lang-switch .lang-dropdown a.active {
        background: rgba(15, 23, 42, 0.08);
        color: var(--text-main);
        font-weight: 600;
    }

    .footer-content { grid-template-columns: 1fr 1fr; }
    .footer-col.footer-brand { grid-column: 1 / -1; }

    .footer-keywords {
        flex-direction: column;
        gap: 10px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .footer-bottom-left {
        align-items: center;
    }

    .footer-legal-links {
        justify-content: center;
    }
}
