.site-footer {
    background: #f7f7f7;
    color: #333;
    padding: 100px 0;
}

.site-footer__inner {
    display: grid;
    grid-template-columns: minmax(0, 30%) minmax(0, 55%);
    grid-template-rows: auto 1fr;
    grid-template-areas: "brand details" "legal details";
    justify-content: space-between;
    align-items: start;
    row-gap: 40px;
    width: 88%;
    margin: 0 auto;
}

.site-footer__brand {
    grid-area: brand;
    justify-self: start;
}

.site-footer__brand img {
    display: block;
    width: clamp(120px, 10vw, 200px);
    height: auto;
}

.site-footer__details {
    grid-area: details;
}

.site-footer__contacts {
    display: grid;
    grid-template-columns: repeat(3, max-content) minmax(0, 1fr);
    gap: clamp(12px, 1vw, 24px);
    margin: 0;
    font-size: clamp(13px, 0.85vw, 16px);
    line-height: 1.5;
}

.site-footer__contact {
    position: relative;
}

.site-footer__contact--phone { --contact-icon: url(../images/phone.png); }
.site-footer__contact--email { --contact-icon: url(../images/xin.png); }
.site-footer__contact--address { --contact-icon: url(../images/di.png); }

.site-footer__contact::before {
    content: "";
    position: absolute;
    top: 0.15em;
    left: 0;
    width: 16px;
    height: 16px;
    background: var(--contact-icon) center / contain no-repeat;
}

.site-footer__contact dt {
    padding-left: 22px;
}

.site-footer__contact dd {
    margin: 4px 0 0;
    overflow-wrap: anywhere;
}

.site-footer__contact a,
.site-footer__legal a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.site-footer__channels {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin: 2vw 0 0;
    padding: 0;
    list-style: none;
    text-align: center;
    color: #555;
    font-size: clamp(11px, 0.7vw, 14px);
    line-height: 1.4;
}

.site-footer__channels li {
    flex: 0 1 115px;
    min-width: 0;
    overflow-wrap: anywhere;
}

.site-footer__channels img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 auto 6px;
}

.site-footer__legal {
    grid-area: legal;
    font-size: clamp(12px, 0.8vw, 15px);
    line-height: 1.7;
}

.site-footer__legal p {
    margin: 0 0 4px;
}

.site-footer__legal p:last-child {
    margin-bottom: 0;
}

/* 产品介绍页的末屏承载可滚动的页脚。 */
.section.product-footer-screen {
    height: 100vh;
    height: 100dvh;
    justify-content: flex-start;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    margin-top: 0;
}

.product-footer-screen > .site-footer {
    flex: none;
    width: 100%;
    margin: auto 0;
}

/* 品牌历程页只在页脚使用 FullPage 的滚动容器。 */
.section.history-footer-screen {
    padding: 0 !important;
}

.history-footer-screen.fp-auto-height > .fp-overflow {
    max-height: 100vh;
    max-height: 100dvh;
    overscroll-behavior-y: contain;
}

.history-sections > .fp-noscroll > .fp-overflow {
    display: contents;
}

@media (max-width: 1199px) {
    .site-footer__contacts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .site-footer {
        /* 窄屏页脚在页面滚动动画期间保持可见。 */
        opacity: 1;
        transform: none;
        transition: none;
        /* 为回到顶部按钮和手机底部安全区留出空间。 */
        padding: 28px 0 calc(76px + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid #e8e8e8;
    }

    .back-to-top {
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    }

    .product-footer-screen {
        padding-top: 64px;
    }

    .history-footer-screen .site-footer {
        padding-top: 88px;
    }

    .site-footer__inner {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto;
        grid-template-areas: "brand" "details" "legal";
        row-gap: 22px;
        width: min(calc(100% - 32px), 440px);
    }

    .site-footer__brand {
        justify-self: center;
    }

    .site-footer__brand img {
        width: 144px;
        max-width: 100%;
    }

    .site-footer__contacts {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        padding: 0 14px;
        background: #fff;
        border: 1px solid #e7e7e7;
        border-radius: 12px;
    }

    .site-footer__contact {
        padding: 10px 0 10px 42px;
    }

    .site-footer__contact + .site-footer__contact {
        border-top: 1px solid #ededed;
    }

    .site-footer__contact::before {
        top: 12px;
        width: 32px;
        height: 32px;
        background-color: #f5f5f5;
        background-size: 16px 19px;
        border-radius: 8px;
    }

    .site-footer__contact dt {
        padding-left: 0;
        color: #555;
    }

    .site-footer__contact dd {
        margin-top: 2px;
        font-size: 14px;
        font-weight: 600;
    }

    .site-footer__contact a {
        color: #9c2d23;
    }

    .site-footer__channels {
        flex-wrap: wrap;
        justify-content: center;
        gap: 14px 10px;
        margin-top: 22px;
        font-size: 12px;
    }

    .site-footer__channels li {
        flex: 0 0 min(calc((100% - 20px) / 3), 115px);
    }

    .site-footer__legal {
        padding-top: 14px;
        border-top: 1px solid #e1e1e1;
        color: #555;
        text-align: center;
    }
}

@media (max-width: 359px) {
    .site-footer__channels li {
        flex-basis: min(calc((100% - 10px) / 2), 115px);
    }
}
