/*!
 * 站点页脚样式 v7（单源 Common/site_footer.php 配套）
 * 桌面：品牌 + 双链接栏 + 联系方式四栏网格
 * 移动端：品牌居中 + 链接胶囊 + 紧凑联系/社交 + 紧凑版权栏
 * 明暗主题：亮色跟随 --bs-*，暗色显式覆盖（挂在 #page-container.dark-mode）
 */

#page-footer {
    background: var(--bs-body-extra-light, #f7f8fa);
}

#page-container.dark-mode #page-footer {
    background: #1f2937;
}

.site-footer {
    padding: 2.5rem 0 1.25rem;
    font-size: 0.875rem;
    line-height: 1.65;
    color: var(--bs-body-color, #334155);
}

.site-footer a {
    color: var(--bs-body-color, #334155);
    text-decoration: none;
    transition: color 0.15s ease, transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.site-footer a:hover,
.site-footer a:focus {
    color: var(--bs-primary, #4c78dd);
}

/* ---------- 四栏网格（替代 Bootstrap row/col） ---------- */
.site-footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.3fr;
    gap: 2rem 2.5rem;
    align-items: start;
}

/* ---------- 品牌区 ---------- */
.site-footer-brand .site-footer-logo {
    display: flex;
    width: fit-content;
    margin-top: -95px;      /* logo 上移，让公司描述行与旁边最后一行对齐（CDP 实测） */
    margin-bottom: 0.9rem;
    line-height: 0;
    transform: translate(-25px, 10px); /* PC logo 微调：左 25px、下 10px */
}

/* ---------- 页头品牌 Logo：与页脚同源（后台 Logo 配置），仅 PC 显示，移动端保留文字品牌 ---------- */
.hd-brand-logo {
    display: none;
    height: 82px;
    width: auto;
    vertical-align: middle;
    margin-right: 10px;
    border-radius: 6px;
}

@media (min-width: 992px) {
    .hd-brand-logo {
        display: inline-block;
    }
}

/* 暗色模式下白底 logo 托底，与页脚一致 */
.dark-mode .hd-brand-logo {
    padding: 3px 7px;
    background-color: #fff;
    border-radius: 8px;
    box-sizing: content-box;
}

.site-footer-brand .site-footer-logo img {
    height: 125px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

/* 暗色模式下白底 logo 需要托底，避免突兀白块 */
.dark-mode .site-footer-brand .site-footer-logo {
    padding: 7px 12px;
    background-color: #fff;
    border-radius: 0.5rem;
}

.site-footer-company {
    margin: 0 0 0.4rem;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.site-footer-address {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.7;
    color: var(--bs-gray-600, #6c757d);
}

.site-footer-site {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 600;
}

.site-footer-site a {
    color: var(--bs-primary, #4c78dd);
}

.site-footer-site i {
    margin-right: 0.35rem;
    font-size: 0.75rem;
    opacity: 0.85;
}

/* ---------- 栏目标题 ---------- */
.site-footer-heading {
    margin: 0 0 0.9rem;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--bs-gray-700, #495057);
}

/* ---------- 链接列表 ---------- */
.site-footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.site-footer-links > li {
    margin-bottom: 0.5rem;
}

.site-footer-links > li:last-child {
    margin-bottom: 0;
}

.site-footer-links a {
    display: inline-block;
    word-break: break-word;
}

.site-footer-links a:hover {
    transform: translateX(2px);
}

.site-footer-label {
    display: block;
    margin-bottom: 0.1rem;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--bs-gray-600, #6c757d);
}

/* ---------- 社交图标（正方形，悬停展开名称；桌面贴在联系方式栏下方） ---------- */
.site-footer-social-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    grid-column: 4;
}

.site-footer .site-footer-social-icon {
    color: var(--bs-gray-600, #6c757d);
}

.site-footer-social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    font-size: 0.8125rem;
    line-height: 1;
    border: 1px solid var(--bs-border-color, #dfe3ea);
    border-radius: 0.5rem;
    overflow: hidden;
    white-space: nowrap;
    transition: width 0.28s ease, padding 0.28s ease, border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.site-footer-social-icon i {
    flex: 0 0 auto;
    font-size: 1.05rem;
}

.site-footer-social-icon .site-footer-social-label {
    display: inline-block;
    max-width: 0;
    margin-left: 0;
    opacity: 0;
    overflow: hidden;
    font-size: 0.75rem;
    font-weight: 600;
    transition: max-width 0.28s ease, opacity 0.2s ease, margin-left 0.28s ease;
}

.site-footer-social-icon:hover,
.site-footer-social-icon:focus {
    width: auto;
    padding: 0 0.8rem;
    border-color: var(--bs-primary, #4c78dd);
    color: var(--bs-primary, #4c78dd);
    background-color: rgba(var(--bs-primary-rgb, 76, 120, 221), 0.08);
    transform: none;
}

.site-footer-social-icon:hover .site-footer-social-label,
.site-footer-social-icon:focus .site-footer-social-label {
    max-width: 240px;
    margin-left: 0.45rem;
    opacity: 1;
}

/* ---------- 底部版权（居中） ---------- */
.site-footer-bottom {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--bs-border-color, #dfe3ea);
    font-size: 0.8125rem;
    text-align: center;
}

.site-footer-bottom-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem 0.6rem;
}

.site-footer-copyright {
    color: var(--bs-gray-600, #6c757d);
}

.site-footer-divider {
    color: var(--bs-gray-400, #ced4da);
}

.site-footer-icp {
    color: var(--bs-gray-600, #6c757d);
}

.site-footer-icp i {
    margin-right: 0.25rem;
    font-size: 0.75rem;
    opacity: 0.85;
}

.site-footer-icp:hover {
    color: var(--bs-primary, #4c78dd);
}

/* ---------- 统计挂载点 ---------- */
.site-footer-statistics {
    margin-bottom: 1rem;
    text-align: center;
}

.site-footer-statistics:empty {
    margin-bottom: 0;
}

/* ---------- 暗色模式（OneUI 的 --bs-* 变量不随主题切换，需显式覆盖） ---------- */
.dark-mode .site-footer {
    color: #dde2e9;
}

.dark-mode .site-footer .site-footer-company {
    color: #eef2f7;
}

.dark-mode .site-footer a {
    color: #dde2e9;
}

.dark-mode .site-footer a:hover,
.dark-mode .site-footer a:focus {
    color: var(--bs-primary, #4c78dd);
}

.dark-mode .site-footer-address,
.dark-mode .site-footer-heading,
.dark-mode .site-footer-copyright,
.dark-mode .site-footer-icp {
    color: #bec8d5;
}

.dark-mode .site-footer-divider {
    color: #5b6b80;
}

.dark-mode .site-footer-icp:hover {
    color: #7fa0f0;
}

.dark-mode .site-footer-site a {
    color: #7fa0f0;
}

.dark-mode .site-footer-social-icon {
    border-color: #3a4759;
}

.dark-mode .site-footer-social-icon:hover,
.dark-mode .site-footer-social-icon:focus {
    border-color: var(--bs-primary, #4c78dd);
    color: #9db6f5;
    background-color: rgba(76, 120, 221, 0.16);
}

.dark-mode .site-footer-bottom {
    border-top-color: #3a4759;
}

/* ==========================================================================
   移动端（<768px）：品牌居中 → 导航/资源/联系 三栏并排 → 社交图标整行居中 → 备案版权
   ========================================================================== */
@media (max-width: 767.98px) {
    .site-footer {
        padding: 1.75rem 0 0.75rem;
    }

    /* 三栏并排，品牌与社交各占整行 */
    .site-footer-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.35rem 0.6rem;
        text-align: center;
    }

    .site-footer-brand {
        grid-column: 1 / -1;
    }

    .site-footer-social-icons {
        grid-column: 1 / -1;
        justify-content: center;
        margin-top: 0.25rem;
    }

    /* 品牌：居中收窄（移动端无对齐诉求，logo 不上移、不偏移）
       margin-inline:auto 是尺寸无关的自动居中：
       .site-footer-logo 是 display:flex; width:fit-content 的块盒，
       不吃父级 text-align:center —— 宽 logo 被 max-width:100% 撑满列宽时
       看似居中，窄 logo 就贴左。以后任意尺寸 logo 上传都靠它居中。 */
    .site-footer-brand .site-footer-logo {
        margin-top: 0;
        margin-bottom: 0.7rem;
        margin-inline: auto;
        transform: none;
    }

    .site-footer-brand .site-footer-logo img {
        height: 125px;
    }

    .site-footer-company {
        font-size: 0.95rem;
        margin-bottom: 0.3rem;
    }

    .site-footer-address {
        font-size: 0.78rem;
        line-height: 1.65;
        max-width: 20rem;
        margin-inline: auto;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* 三栏：标题小号，链接紧凑竖排 */
    .site-footer-heading {
        margin-bottom: 0.55rem;
        font-size: 0.72rem;
        letter-spacing: 0.1em;
    }

    .site-footer-links {
        text-align: center;
    }

    .site-footer-links > li {
        margin-bottom: 0.45rem;
        min-width: 0;
    }

    .site-footer-links a {
        font-size: 0.76rem;
        line-height: 1.5;
        overflow-wrap: anywhere;
        transform: none;
    }

    .site-footer-links a:hover {
        transform: none;
    }

    /* 联系方式窄栏：标签在上、邮箱在下，允许断行 */
    .site-footer-contact > li {
        margin-bottom: 0.65rem;
    }

    .site-footer-contact .site-footer-label {
        margin-bottom: 0.15rem;
        font-size: 0.68rem;
    }

    .site-footer-contact > li > a {
        font-size: 0.72rem;
        overflow-wrap: anywhere;
    }

    /* 社交图标：圆形大触点，悬停不横向展开 */
    .site-footer-social-icons {
        gap: 0.85rem;
    }

    .site-footer-social-icon {
        width: 42px;
        height: 42px;
        border-radius: 50%;
    }

    .site-footer-social-icon:hover,
    .site-footer-social-icon:focus {
        width: 42px;
        padding: 0;
    }

    .site-footer-social-icon .site-footer-social-label {
        display: none;
    }

    /* 备案版权：堆叠居中；stretch 按视口宽度换行，防长行溢出 */
    .site-footer-bottom {
        margin-top: 1.5rem;
        padding-top: 1rem;
    }

    .site-footer-bottom-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 0.3rem;
        padding: 0 0.5rem;
        text-align: center;
    }

    .site-footer-divider {
        display: none;
    }

    .site-footer-copyright,
    .site-footer-icp {
        font-size: 0.72rem;
        overflow-wrap: anywhere;
    }
}
