/* =========================================================
   全站统一页脚 / foot.css  —— v3 重做
   结构：品牌栏 + 三列站点导航 + 底部分隔版权栏
   桌面：左右两栏；手机：单列 + 两列导航 + 居中版权
   由 app/views/partials/foot.php 唯一输出，旧静态页共用
   ========================================================= */
.xh-foot {
    --foot-gap: 34px;
    width: 100%;
    max-width: 1240px;
    margin: 56px auto 0;
    box-sizing: border-box;
    padding: 0 20px 26px;
    color: var(--xh-muted, #8fa2c2) !important;
    font-size: 13px;
    line-height: 1.7;
}

.xh-foot-wrap {
    position: relative;
    border-top: 1px solid var(--xh-line, rgba(var(--xh-w, 255), var(--xh-w, 255), var(--xh-w, 255), .09));
    padding-top: var(--foot-gap);
}

/* 顶部品牌渐变发光线，替代旧版干巴巴的分割线 */
.xh-foot-wrap::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 0;
    width: 96px;
    height: 2px;
    border-radius: 2px;
    background: var(--xh-primary-grad, linear-gradient(120deg, #4f8cff, #7a5cff));
    box-shadow: 0 0 16px rgba(var(--xh-primary-rgb, 79, 140, 255), .55);
}

.xh-foot-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.6fr);
    gap: 40px;
    align-items: start;
}

/* ---------------- 品牌栏 ---------------- */
.xh-foot-brandcol { min-width: 0; }

.xh-foot-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
    color: inherit;
}

.xh-foot-mark {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(var(--xh-primary-rgb, 79, 140, 255), .12);
    border: 1px solid var(--xh-line, rgba(var(--xh-w, 255), var(--xh-w, 255), var(--xh-w, 255), .1));
}

.xh-foot-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.xh-foot-brandtxt {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.xh-foot-brandtxt b {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .2px;
    color: var(--xh-text, #eaf1ff) !important;
}

.xh-foot-brandtxt i {
    font-style: normal;
    font-size: 11.5px;
    color: var(--xh-muted, #8fa2c2) !important;
}

.xh-foot-slogan {
    margin: 12px 0 0;
    font-size: 12.5px;
    line-height: 1.75;
    max-width: 34ch;
    color: var(--xh-muted, #8fa2c2) !important;
}

.xh-foot-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 13px;
}

.xh-foot-tags span {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 11px;
    letter-spacing: .2px;
    color: var(--xh-muted, #8fa2c2) !important;
    background: rgba(var(--xh-w, 255), var(--xh-w, 255), var(--xh-w, 255), .05);
    border: 1px solid var(--xh-line, rgba(var(--xh-w, 255), var(--xh-w, 255), var(--xh-w, 255), .08));
}

/* ---------------- 三列导航 ---------------- */
.xh-foot-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.xh-foot-col h4 {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .9px;
    color: var(--xh-text-2, #c7d6f2) !important;
    text-transform: uppercase;
}

.xh-foot-col a {
    display: block;
    padding: 4px 0;
    font-size: 12.5px;
    color: var(--xh-muted, #8fa2c2) !important;
    text-decoration: none !important;
    transition: color .16s ease, transform .16s ease;
}

.xh-foot-col a:hover {
    color: var(--xh-primary, #4f8cff) !important;
    transform: translateX(2px);
}

/* ---------------- 底部版权栏 ---------------- */
.xh-foot-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-top: 26px;
    padding-top: 16px;
    border-top: 1px solid var(--xh-line, rgba(var(--xh-w, 255), var(--xh-w, 255), var(--xh-w, 255), .08));
    font-size: 12px;
}

.xh-foot-copy { color: var(--xh-faint, #6c7d99) !important; }

.xh-foot-legal {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 14px;
}

.xh-foot-legal a {
    position: relative;
    color: var(--xh-faint, #6c7d99) !important;
    text-decoration: none !important;
    transition: color .16s ease;
}

.xh-foot-legal a:hover { color: var(--xh-primary, #4f8cff) !important; }

.xh-foot-legal a + a::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 50%;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: currentColor;
    opacity: .5;
    transform: translateY(-50%);
}

body.xh-has-nav > footer:not(.xh-foot) {
    display: none !important;
}

/* ---------------- 手机端 ---------------- */
@media (max-width: 760px) {
    .xh-foot {
        --foot-gap: 20px;
        margin-top: 30px;
        padding: 0 16px calc(18px + env(safe-area-inset-bottom, 0px));
    }

    .xh-foot-wrap { padding-top: var(--foot-gap); }

    /* 品牌区：收紧为一行标识 + 一行简述，去掉标签堆叠 */
    .xh-foot-grid { display: block; }
    .xh-foot-brandcol { text-align: center; }
    .xh-foot-brand { justify-content: center; gap: 9px; }
    .xh-foot-mark { width: 30px; height: 30px; border-radius: 9px; }
    .xh-foot-brandtxt b { font-size: 15px; }
    .xh-foot-brandtxt i { display: none; }
    .xh-foot-slogan {
        margin: 8px auto 0;
        max-width: 32ch;
        font-size: 12px;
        line-height: 1.6;
        color: var(--xh-muted, #64748b);
    }
    .xh-foot-tags { display: none; }

    /* 导航：三列解散为 chip 流，轻量不压屏 */
    .xh-foot-nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px 8px;
        margin-top: 16px;
        padding: 16px 0 0;
        border-top: 1px solid var(--xh-line, rgba(var(--xh-w, 255), var(--xh-w, 255), var(--xh-w, 255), .07));
    }
    .xh-foot-col { display: contents; }
    .xh-foot-col h4 { display: none; }
    .xh-foot-col a {
        display: inline-flex;
        align-items: center;
        min-height: 34px;
        padding: 0 13px;
        border-radius: 999px;
        font-size: 12.5px;
        font-weight: 500;
        color: var(--xh-text-2, #c7d6f2);
        background: rgba(var(--xh-w, 255), var(--xh-w, 255), var(--xh-w, 255), .06);
        border: 1px solid var(--xh-line-strong, rgba(var(--xh-w, 255), var(--xh-w, 255), var(--xh-w, 255), .16));
        text-decoration: none;
        transition: background .16s ease, color .16s ease;
    }
    .xh-foot-col a:active {
        color: var(--xh-primary, #4f8cff) !important;
        background: rgba(var(--xh-primary-rgb, 79, 140, 255), .14);
        transform: none;
    }

    /* 版权区：单行文案 + 一行法务，细线分隔 */
    .xh-foot-bar {
        flex-direction: column;
        align-items: center;
        gap: 6px;
        margin-top: 16px;
        padding-top: 14px;
        border-top: 1px solid var(--xh-line, rgba(var(--xh-w, 255), var(--xh-w, 255), var(--xh-w, 255), .07));
        text-align: center;
    }
    .xh-foot-copy {
        display: block !important;
        font-size: 12px !important;
        line-height: 1.7;
        color: var(--xh-muted, #64748b);
    }
    .xh-foot-legal { justify-content: center; gap: 6px 14px; }
    .xh-foot-legal a {
        min-height: 28px;
        display: inline-flex;
        align-items: center;
        font-size: 12px;
        font-weight: 500;
        color: var(--xh-muted, #64748b);
    }
    .xh-foot-legal a:active { color: var(--xh-primary, #4f8cff) !important; }
}

/* 底部 TabBar 存在时给页脚留出安全区，避免被遮挡 */
body.xh-has-tabbar .xh-foot {
    padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px));
}

/* 全站统一「回到顶部」按钮（替代旧站各页面自带的浮动图标） */
.xh-top {
    position: fixed;
    right: 22px;
    bottom: 26px;
    z-index: 900;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 12px;
    border: 1px solid var(--xh-line, rgba(var(--xh-w, 255), var(--xh-w, 255), var(--xh-w, 255), .12));
    background: var(--xh-panel, rgba(18, 26, 44, .82));
    color: var(--xh-text-2, #c7d6f2);
    cursor: pointer;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .18s ease, transform .18s ease, color .16s ease, border-color .16s ease, visibility .18s;
}

.xh-top.is-on { opacity: 1; visibility: visible; transform: none; }
.xh-top:hover { color: var(--xh-primary, #4f8cff); border-color: var(--xh-primary, #4f8cff); }
.xh-top:active { transform: translateY(1px); }

body.xh-has-tabbar .xh-top {
    bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    right: 16px;
    width: 38px;
    height: 38px;
    border-radius: 11px;
}

/* ---------------- v5：手机端页脚导航恢复为轻量 chip 流（不再整块隐藏） ---------------- */
@media (max-width: 760px) {
    .xh-foot-nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        margin-top: 18px;
    }
    .xh-foot-nav > div { flex: 0 0 auto; text-align: center; }
    .xh-foot-nav h4 {
        width: 100%;
        margin: 0 0 2px;
        font-size: 11px;
        letter-spacing: .08em;
        opacity: .62;
    }
    .xh-foot-nav ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
    .xh-foot-nav li { margin: 0; }
    .xh-foot-nav a {
        display: inline-flex;
        align-items: center;
        padding: 5px 11px;
        border-radius: 999px;
        font-size: 12.5px;
        background: rgba(127, 127, 127, .10);
        text-decoration: none;
    }
    .xh-foot-nav a:active { transform: scale(.97); }
    .xh-foot-grid { display: block; }
    .xh-foot-brandcol { text-align: center; padding-bottom: 2px; }
    .xh-foot-bar {
        margin-top: 16px;
        padding-top: 14px;
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    .xh-foot-legal { justify-content: center; flex-wrap: wrap; gap: 6px 14px; }
    .xh-foot-copy { font-size: 11.5px; }
}

