/* ===========================================
   Common – Navigation / Footer / Shared
   Airtable Editorial (DESIGN.md)
   =========================================== */

.footer-icp {
    display: block;
}

main {
    margin-top: var(--nav-h);
}

/* ---------- TOP NAV ---------- */

.main-nav {
    background: var(--canvas);
    border-bottom: 1px solid var(--hairline);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    height: var(--nav-h);
}

.nav-container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--space-2xl);
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-image {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 10px;
}

.logo img {
    height: 28px;
    width: auto;
}

.logo-brand {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--ink);
    letter-spacing: 0.02em;
    line-height: 1.2;
    white-space: nowrap;
}

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

.nav-links a {
    color: var(--body);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    padding: 8px 14px;
    height: var(--nav-h);
    display: flex;
    align-items: center;
}

.nav-links a.active {
    color: var(--ink);
    font-weight: 500;
}

.nav-right {
    display: flex;
    align-items: center;
}

.language-switch {
    position: relative;
}

.language-switch::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 8px;
    background: transparent;
    z-index: 999;
}

.dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--body);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    border: 1px solid var(--hairline);
    background: var(--canvas);
    border-radius: var(--radius-sm);
}

.dropdown-trigger i.fa-chevron-down {
    font-size: 8px;
    opacity: 0.5;
}

.dropdown-content {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: var(--canvas);
    border: 1px solid var(--hairline);
    min-width: 140px;
    z-index: 1001;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 16px rgba(24, 29, 38, 0.08);
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.language-switch.show .dropdown-content {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.language-switch.show .dropdown-trigger {
    border-color: var(--border-strong);
}

/* 选择语言后强制收起，避免 :hover 再次撑开 */
.language-switch.is-closed .dropdown-content {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.dropdown-content a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    color: var(--body);
    text-decoration: none;
    border-bottom: 1px solid var(--hairline);
    font-size: 14px;
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a.active {
    color: var(--ink);
    font-weight: 500;
}

.lang-code {
    opacity: 0.45;
    font-size: 11px;
}

/* ---------- MOBILE NAV ---------- */

.mobile-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--ink);
    margin: 5px 0;
    transition: transform 0.3s var(--ease-out), opacity 0.3s var(--ease-out);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .nav-container {
        padding: 0 var(--space-lg);
    }

    .nav-links {
        display: none;
        position: fixed;
        top: var(--nav-h);
        left: 0;
        right: 0;
        background: var(--canvas);
        border-bottom: 1px solid var(--hairline);
        flex-direction: column;
        gap: 0;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        padding: 14px 24px;
        height: auto;
        border-bottom: 1px solid var(--hairline);
        width: 100%;
    }

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

/* ---------- FOOTER (light editorial) ---------- */

footer {
    background: var(--canvas);
    color: var(--body);
    border-top: 1px solid var(--hairline);
}

.footer-container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--space-2xl);
}

.footer-main {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: var(--space-lg);
    padding: var(--space-3xl) 0 var(--space-xl);
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding-right: var(--space-xl);
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.footer-logo:hover {
    text-decoration: none;
}

.footer-logo img {
    height: 24px;
    width: auto;
}

.footer-logo-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--ink);
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.footer-description {
    font-size: 14px;
    line-height: 1.5;
    color: var(--body);
    max-width: 280px;
}

.footer-group-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    margin-bottom: var(--space-md);
}

.footer-links-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.footer-links-list li a {
    font-size: 14px;
    color: var(--body);
    text-decoration: none;
}

.footer-contact-item {
    font-size: 14px;
    line-height: 1.5;
    color: var(--body);
}

.footer-contact-item strong {
    display: block;
    margin-bottom: 2px;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg) 0 var(--space-xl);
    border-top: 1px solid var(--hairline);
}

.footer-copyright {
    font-size: 14px;
    color: var(--muted);
}

.footer-icp a {
    color: var(--muted);
}

.footer-social {
    display: flex;
    gap: var(--space-xs);
}

.footer-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--hairline);
    border-radius: var(--radius-pill);
    color: var(--ink);
    font-size: 14px;
}

@media (max-width: 1024px) {
    .footer-main {
        grid-template-columns: 1fr 1fr;
    }

    .footer-brand {
        grid-column: 1 / -1;
        padding-right: 0;
    }
}

@media (max-width: 768px) {
    .footer-container {
        padding: 0 var(--space-lg);
    }

    .footer-main {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }
}

.contact-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.contact-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.contact-modal__panel {
    width: min(360px, 100%);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.22);
    color: var(--ink);
    overflow: hidden;
    transform: translateY(8px);
    transition: transform 0.2s ease;
}

.contact-modal.is-open .contact-modal__panel {
    transform: translateY(0);
}

.contact-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 10px;
}

.contact-modal__title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.contact-modal__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--hairline);
    border-radius: 50%;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
}

.contact-modal__body {
    padding: 0 20px 20px;
}

.contact-modal__label {
    margin: 0 0 8px;
    font-size: 13px;
    color: var(--muted);
}

.contact-modal__value {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    word-break: break-all;
}

@media (max-width: 480px) {
    .contact-modal {
        padding: 16px;
    }
}