/* ==========================================================================
   Huatai Theme · Footer
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. 返回顶部按钮（PC / 移动端通用）
   -------------------------------------------------------------------------- */
.back-to-top {
    position: fixed;
    inset-block-end: var(--h-space-lg);
    inset-inline-end: var(--h-space-lg);
    z-index: var(--h-z-overlay);
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 0;
    border-radius: var(--h-radius-pill);
    background: var(--h-color-brand);
    color: #fff;
    box-shadow: var(--h-shadow-lg);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    translate: 0 8px;
    transition: opacity var(--h-dur-base) var(--h-ease-standard),
                visibility var(--h-dur-base),
                translate var(--h-dur-base) var(--h-ease-out),
                background-color var(--h-dur-base) var(--h-ease-standard);
}

.back-to-top svg { width: 20px; height: 20px; }

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    translate: 0 0;
}

.back-to-top:hover,
.back-to-top:focus-visible {
    background: var(--h-color-brand-strong);
    translate: 0 -2px;
}

/* 移动端：底部是全宽浮动 CTA 条，返回顶部按钮需抬到其上方 */
@media (max-width: 61.99em) {
    .back-to-top {
        inset-block-end: calc(var(--h-space-lg) + 64px + env(safe-area-inset-bottom, 0px));
    }
}

.site-footer {
    position: relative;
    margin-block-start: var(--h-section-y);
    padding-block: clamp(2.5rem, 2rem + 2.5vw, 4.5rem) var(--h-space-md);
    background: linear-gradient(180deg, var(--h-color-navy-deep) 0%, var(--h-color-navy) 100%);
    color: var(--h-text-inverse-muted);
}

/* 顶部金色细线，强化品牌识别 */
.site-footer::before {
    content: "";
    position: absolute;
    inset-block-start: 0;
    inset-inline: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--h-color-brand), var(--h-color-gold), var(--h-color-brand));
}

/* --------------------------------------------------------------------------
   1. 四列栅格
   -------------------------------------------------------------------------- */
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: var(--h-space-xl) var(--h-gutter);
    align-items: start;
}

.footer-col { min-width: 0; }

/* 第一列（品牌）在宽屏时占更大份额 */
@media (min-width: 62em) {
    .footer-grid {
        grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
    }
}

/* --------------------------------------------------------------------------
   2. 品牌区
   -------------------------------------------------------------------------- */
.footer-brand {
    display: flex;
    align-items: center;
    gap: var(--h-space-2xs);
    margin-block-end: var(--h-space-sm);
}

.footer-brand-logo {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: var(--h-radius-md);
    background: linear-gradient(135deg, var(--h-color-brand), var(--h-color-gold));
    color: #fff;
    font-weight: var(--h-fw-bold);
}

.footer-brand-name {
    font-size: var(--h-fs-500);
    font-weight: var(--h-fw-bold);
    color: #fff;
}

.footer-brand .brand-logo-img {
    width: auto;
    height: 48px;
    max-width: min(60vw, 220px);
    /* footer 背景是深色，logo 若为深色可提高亮度 */
    filter: brightness(1.05);
}

.footer-desc {
    max-width: 34ch;
    font-size: var(--h-fs-200);
    line-height: var(--h-lh-relaxed);
    color: var(--h-text-inverse-muted);
}

/* --------------------------------------------------------------------------
   3. 栏目标题
   -------------------------------------------------------------------------- */
.footer-title {
    margin-block-end: var(--h-space-sm);
    font-size: var(--h-fs-200);
    font-weight: var(--h-fw-bold);
    text-transform: uppercase;
    letter-spacing: var(--h-tracking-caps);
    color: #fff;
}

.footer-title::after {
    content: "";
    display: block;
    width: 32px;
    height: 2px;
    margin-block-start: var(--h-space-2xs);
    border-radius: var(--h-radius-pill);
    background: var(--h-color-gold);
}

/* --------------------------------------------------------------------------
   4. 链接列表
   -------------------------------------------------------------------------- */
.footer-links {
    display: grid;
    gap: var(--h-space-2xs);
}

.footer-link {
    display: inline-flex;
    align-items: center;
    gap: var(--h-space-2xs);
    font-size: var(--h-fs-200);
    line-height: 1.5;
    color: var(--h-text-inverse-muted);
    text-decoration: none;
    transition: translate var(--h-dur-base) var(--h-ease-out),
                color var(--h-dur-base) var(--h-ease-standard);
}

.footer-link::before {
    content: "";
    width: 5px;
    height: 5px;
    flex: none;
    rotate: 45deg;
    background: var(--h-color-gold);
    opacity: 0;
    transition: opacity var(--h-dur-base) var(--h-ease-standard);
}

.footer-link:hover,
.footer-link:focus-visible {
    color: #fff;
    translate: 4px 0;
}

.footer-link:hover::before,
.footer-link:focus-visible::before { opacity: 1; }

/* --------------------------------------------------------------------------
   5. 联系信息
   -------------------------------------------------------------------------- */
.footer-contact {
    display: grid;
    gap: var(--h-space-xs);
    margin-block-end: var(--h-space-md);
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: var(--h-space-2xs);
    font-size: var(--h-fs-200);
    line-height: 1.55;
    color: var(--h-text-inverse-muted);
    overflow-wrap: anywhere;
}

.contact-item .icon {
    width: 1.1em;
    height: 1.1em;
    flex: none;
    margin-block-start: 0.2em;
    color: var(--h-color-gold);
}

.contact-item a {
    color: var(--h-color-gold-soft);
    text-decoration: none;
    border-block-end: 1px solid transparent;
    transition: var(--h-transition);
}

.contact-item a:hover {
    color: #fff;
    border-block-end-color: currentColor;
}

.footer-contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--h-space-2xs);
    padding: var(--h-space-2xs) var(--h-space-md);
    border-radius: var(--h-radius-pill);
    background: var(--h-color-brand);
    color: #fff;
    font-size: var(--h-fs-200);
    font-weight: var(--h-fw-semibold);
    text-decoration: none;
    transition: var(--h-transition);
}

.footer-contact-btn svg { width: 15px; height: 15px; }

.footer-contact-btn:hover {
    background: var(--h-color-brand-strong);
    color: #fff;
    translate: 0 -2px;
    box-shadow: var(--h-shadow-md);
}

/* --------------------------------------------------------------------------
   6. 底栏
   -------------------------------------------------------------------------- */
.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--h-space-sm);
    margin-block-start: var(--h-space-xl);
    padding-block-start: var(--h-space-md);
    border-block-start: 1px solid rgb(255 255 255 / 12%);
}

.footer-bottom p {
    margin: 0;
    font-size: var(--h-fs-200);
    color: var(--h-text-inverse-muted);
}

.footer-social,
.social-links {
    display: flex;
    align-items: center;
    gap: var(--h-space-2xs);
}

.social-link {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: var(--h-radius-pill);
    background: rgb(255 255 255 / 10%);
    color: #fff;
    transition: var(--h-transition);
}

.social-link svg { width: 17px; height: 17px; }

.social-link:hover {
    background: var(--h-color-gold);
    color: var(--h-color-navy-deep);
    translate: 0 -2px;
}

/* --------------------------------------------------------------------------
   7. 移动端底部浮动 CTA（旧 .sm_cta）
   -------------------------------------------------------------------------- */
.sm_cta {
    display: none;
}

@media (max-width: 61.99em) {
    /* 有内容时才显示，避免空 ul 占位 */
    .sm_cta {
        display: block;
        position: fixed;
        inset-inline: 0;
        inset-block-end: 0;
        z-index: var(--h-z-overlay);
        padding: var(--h-space-2xs) var(--h-container-pad)
                 calc(var(--h-space-2xs) + env(safe-area-inset-bottom, 0px));
        background: rgb(255 255 255 / 96%);
        border-block-start: 1px solid var(--h-border-subtle);
        box-shadow: 0 -6px 20px rgb(15 12 10 / 10%);
        backdrop-filter: blur(8px);
    }

    .sm_cta ul {
        display: flex;
        align-items: stretch;
        gap: var(--h-space-2xs);
        width: 100%;
    }

    .sm_cta li {
        flex: 1 1 0;
        min-width: 0;
    }

    .sm_cta li a {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: var(--h-space-2xs);
        width: 100%;
        height: 100%;
        min-height: 46px;
        padding-inline: var(--h-space-2xs);
        border-radius: var(--h-radius-md);
        background: var(--h-color-brand);
        color: #fff;
        font-size: var(--h-fs-200);
        font-weight: var(--h-fw-semibold);
        text-align: center;
        text-decoration: none;
    }

    .sm_cta li:last-child a { background: var(--h-color-navy); }
    .sm_cta li a i { font-size: 1.05em; }

    /* 给浮动 CTA 留出空间，避免遮住页脚最后一行 */
    .site-footer { padding-block-end: calc(var(--h-space-2xl) + env(safe-area-inset-bottom, 0px)); }
}
