.xuanshu-contact-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f8f8fa;
}

.xuanshu-contact-page-main {
    flex: 1 0 auto;
    padding: 142px 0 100px;
}

.xuanshu-contact-page-hero {
    position: relative;
    display: block;
    width: calc(100% - 200px);
    max-width: 1240px;
    height: 260px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 4px;
    background: rgba(175, 176, 179, 0.2);
    user-select: none;
    -webkit-user-select: none;
}

.xuanshu-contact-page-hero img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 240ms ease;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
}

.xuanshu-contact-page-hero.is-loaded img {
    opacity: 1;
}

.xuanshu-contact-page-layout {
    display: flex;
    align-items: flex-start;
    gap: 42px;
    width: calc(100% - 240px);
    max-width: 1200px;
    margin: 80px auto 0;
}

.xuanshu-contact-page-copy {
    flex: 0 1 406px;
    padding-top: 50px;
}

.xuanshu-contact-page-copy h1 {
    margin: 0;
    color: #1a1a1a;
    font-size: 48px;
    font-weight: 700;
    line-height: var(--xuanshu-line-cn-heading);
}

.xuanshu-contact-page-copy p {
    max-width: 406px;
    margin: 16px 0 0;
    color: #666666;
    font-size: 16px;
    font-weight: 400;
    line-height: var(--xuanshu-line-cn-body);
}

.xuanshu-contact-page-form {
    flex: 0 1 752px;
    width: 752px;
    max-width: none;
    min-height: 578px;
    padding: 65px 60px 68px;
    border-radius: 20px;
}

.xuanshu-contact-page-footer {
    margin-top: auto;
    min-height: 149px;
}

.xuanshu-contact-page-footer-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    width: calc(100% - 200px);
    max-width: 1240px;
    margin: 0 auto;
    padding: 27px 8px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.2);
    color: #666666;
    font-size: 14px;
    line-height: var(--xuanshu-line-cn-label);
}

.xuanshu-contact-page-footer nav {
    display: flex;
    gap: 40px;
}

.xuanshu-contact-page-footer p {
    margin: 3px 0 0;
}

@media (max-width: 1279px) and (min-width: 1024px) {
    .xuanshu-contact-page-hero {
        width: calc(100% - 80px);
    }

    .xuanshu-contact-page-layout {
        gap: 48px;
        width: calc(100% - 80px);
    }

    .xuanshu-contact-page-copy {
        flex: 1 1 32%;
    }

    .xuanshu-contact-page-copy h1 {
        font-size: clamp(38px, 3.4vw, 44px);
        line-height: var(--xuanshu-line-cn-heading);
    }

    .xuanshu-contact-page-copy p {
        font-size: 15px;
        line-height: var(--xuanshu-line-cn-body);
    }

    .xuanshu-contact-page-form {
        flex: 0 1 752px;
        width: auto;
    }
}

@media (max-width: 1023px) {
    .xuanshu-contact-page-main {
        padding: 80px 0 100px;
    }

    .xuanshu-contact-page-hero {
        width: calc(100% - 60px);
        height: 260px;
        border-radius: 16px;
    }

    .xuanshu-contact-page-layout {
        display: block;
        width: 100%;
        margin-top: 60px;
    }

    .xuanshu-contact-page-copy {
        width: 100%;
        padding: 0 30px;
    }

    .xuanshu-contact-page-copy h1 {
        font-size: 32px;
        line-height: var(--xuanshu-line-cn-heading);
    }

    .xuanshu-contact-page-copy p {
        max-width: none;
        font-size: 15px;
        line-height: var(--xuanshu-line-cn-body);
    }

    .xuanshu-contact-page-copy .xuanshu-contact-email {
        margin-top: 40px;
    }

    .xuanshu-contact-page-form {
        width: 100%;
        min-height: 0;
        margin-top: 60px;
        padding: 40px 30px 80px;
        border-radius: 20px;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.04);
    }

    .xuanshu-contact-page-footer {
        min-height: 180px;
        padding: 0 30px;
    }

    .xuanshu-contact-page-footer-inner {
        display: block;
        width: 100%;
        padding: 26px 0 0;
    }

    .xuanshu-contact-page-footer p {
        margin-top: 28px;
    }
}

@media (max-width: 639px) {
    .xuanshu-contact-page-hero {
        width: 100%;
        height: 220px;
        border-radius: 0;
    }
}

@media (max-height: 499px) and (orientation: landscape) {
    .xuanshu-contact-page-layout {
        width: auto;
        margin-right: calc(20px + env(safe-area-inset-right));
        margin-left: calc(20px + env(safe-area-inset-left));
    }

    .xuanshu-contact-page-copy {
        padding-right: 20px;
        padding-left: 20px;
    }

    .xuanshu-contact-page-form {
        padding-right: 30px;
        padding-left: 30px;
    }

    .xuanshu-contact-page-footer {
        padding-right: calc(20px + env(safe-area-inset-right));
        padding-left: calc(20px + env(safe-area-inset-left));
    }
}

@media (max-width: 1023px) and (max-height: 499px) and (orientation: landscape) {
    .xuanshu-contact-page-hero {
        width: auto;
        margin-right: calc(20px + env(safe-area-inset-right));
        margin-left: calc(20px + env(safe-area-inset-left));
    }
}

/* The standalone contact page remains stacked below its existing tablet breakpoint;
   only the true two-column landscape range gets the right-side form treatment. */
@media (min-width: 1024px) and (max-width: 1279px) and (max-height: 499px) and (orientation: landscape) {
    .xuanshu-contact-page-copy .xuanshu-contact-email {
        width: 100%;
        padding-right: 14px;
        flex-direction: column;
        align-items: flex-start;
    }

    .xuanshu-contact-page-copy .xuanshu-contact-email-icon {
        margin-right: 0;
    }

    .xuanshu-contact-page-copy .xuanshu-contact-email-copy {
        width: 100%;
        margin-top: 6px;
        padding-left: 5px;
    }
}

/* Keep the contact copy and form side by side on wider mobile landscape viewports.
   The hero intentionally keeps its existing full-width landscape treatment. */
@media (min-width: 768px) and (max-width: 1023px) and (max-height: 499px) and (orientation: landscape) {
    .xuanshu-contact-page-layout {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 5.16%;
        width: calc(100% - 40px - env(safe-area-inset-left) - env(safe-area-inset-right));
        margin-right: calc(20px + env(safe-area-inset-right));
        margin-left: calc(20px + env(safe-area-inset-left));
    }

    .xuanshu-contact-page-copy {
        flex: 0 1 34%;
        width: auto;
        min-width: 0;
        padding: 0;
    }

    .xuanshu-contact-page-form {
        flex: 1 1 0;
        width: auto;
        min-width: 0;
        max-width: none;
        min-height: 578px;
        margin-top: 0;
        padding: 48px clamp(32px, 4vw, 44px) 70px;
        border-radius: 20px;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.04);
    }

    .xuanshu-contact-page-copy .xuanshu-contact-email {
        width: 100%;
        padding-right: 14px;
        flex-direction: column;
        align-items: flex-start;
    }

    .xuanshu-contact-page-copy .xuanshu-contact-email-icon {
        margin-right: 0;
    }

    .xuanshu-contact-page-copy .xuanshu-contact-email-copy {
        width: 100%;
        margin-top: 6px;
        padding-left: 5px;
    }
}
