/**
 * 自定义页脚样式
 *
 * 变量由 inc/footer.php 通过 wp_add_inline_style 注入 :root：
 *   --b2c-f-accent    强调色（默认跟随主题主色）
 *   --b2c-f-bg-from   背景渐变起始
 *   --b2c-f-bg-to     背景渐变结束
 */

.b2c-footer {
    --b2c-f-text: rgba(255, 255, 255, .72);
    --b2c-f-muted: rgba(255, 255, 255, .42);
    --b2c-f-tile: rgba(255, 255, 255, .06);
    --b2c-f-tile-hover: rgba(255, 255, 255, .1);
    --b2c-f-line: rgba(255, 255, 255, .12);

    position: relative;
    background: linear-gradient(135deg, var(--b2c-f-bg-from, #0B1512) 0%, var(--b2c-f-bg-to, #0E1A17) 100%);
    color: var(--b2c-f-text);
    padding: 56px 0 44px;
    overflow: hidden;
}

/* 右上角一团柔光，参考站有类似处理 */
.b2c-footer::before {
    content: "";
    position: absolute;
    top: -30%;
    right: -8%;
    width: 46%;
    padding-bottom: 46%;
    border-radius: 50%;
    background: radial-gradient(circle, var(--b2c-f-accent) 0%, transparent 68%);
    opacity: .06;
    pointer-events: none;
}

.b2c-footer-in {
    position: relative;
    z-index: 1;
}

/* ── Logo ───────────────────────────────────────────── */

.b2c-f-logos { margin-bottom: 26px; }

.b2c-f-logos a {
    display: inline-flex;
    align-items: center;
    gap: 18px;
}

.b2c-f-logo {
    height: 40px;
    width: auto;
    display: block;
}

.b2c-f-logo-sub { height: 30px; }

.b2c-f-divider {
    width: 1px;
    height: 26px;
    background: var(--b2c-f-line);
    display: block;
}

/* ── 行布局 ─────────────────────────────────────────── */

.b2c-f-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
}

.b2c-f-row-top { margin-bottom: 30px; }
.b2c-f-row-mid { margin-bottom: 34px; }

/* ── 标语胶囊 + 次要按钮 ────────────────────────────── */

.b2c-f-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.b2c-f-pill {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid var(--b2c-f-accent);
    border-radius: 10px;
    overflow: hidden;
    min-height: 44px;
}

.b2c-f-pill-text {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 18px;
    font-size: 14px;
    white-space: nowrap;
}

.b2c-f-pill-text b {
    color: var(--b2c-f-accent);
    font-weight: 400;
}

.b2c-f-pill-text em {
    color: var(--b2c-f-text);
    font-style: normal;
}

.b2c-f-pill-btn {
    appearance: none;
    border: 0;
    cursor: pointer;
    background: var(--b2c-f-accent);
    color: #06120f;
    font-size: 14px;
    padding: 0 17px;
    white-space: nowrap;
    transition: filter .2s ease;
}

.b2c-f-pill-btn:hover { filter: brightness(1.08); }

.b2c-f-ghost {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 26px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    transition: border-color .2s ease, background .2s ease;
}

.b2c-f-ghost:hover {
    border-color: var(--b2c-f-accent);
    background: rgba(255, 255, 255, .04);
}

/* ── 社交入口 ───────────────────────────────────────── */

.b2c-f-socials {
    display: flex;
    gap: 14px;
    margin-left: auto;
}

.b2c-f-social {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--b2c-f-muted);
    font-size: 13px;
}

.b2c-f-social-tile {
    position: relative;
    width: 62px;
    height: 48px;
    border-radius: 10px;
    background: var(--b2c-f-tile);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease;
}

.b2c-f-social:hover .b2c-f-social-tile { background: var(--b2c-f-tile-hover); }
.b2c-f-social:hover { color: #fff; }

.b2c-f-social-tile img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

/* 悬停弹出二维码 —— 纯 CSS，无需 JS */
.b2c-f-qr {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    width: 128px;
    padding: 8px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .38);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
    pointer-events: none;
    z-index: 5;
}

.b2c-f-qr::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #fff;
}

.b2c-f-qr img {
    width: 100%;
    height: auto;
    display: block;
}

.b2c-f-social:hover .b2c-f-qr,
.b2c-f-social:focus-within .b2c-f-qr {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ── 简介 + 数字 ────────────────────────────────────── */

.b2c-f-intro {
    max-width: 62%;
    font-size: 14px;
    line-height: 2;
    color: var(--b2c-f-text);
}

.b2c-f-intro p { margin: 0; }

.b2c-f-stat {
    text-align: right;
    margin-left: auto;
}

.b2c-f-stat-num {
    display: block;
    font-family: Impact, "Haettenschweiler", "Arial Narrow Bold", "PingFang SC", sans-serif;
    font-size: 50px;
    line-height: 1.1;
    font-weight: 400;
    color: var(--b2c-f-accent);
    letter-spacing: .02em;
}

.b2c-f-stat-desc {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--b2c-f-muted);
}

/* ── 链接卡片 ───────────────────────────────────────── */

.b2c-f-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
}

.b2c-f-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 58px;
    padding: 0 14px;
    border-radius: 10px;
    background: var(--b2c-f-tile);
    color: var(--b2c-f-text);
    font-size: 14px;
    text-align: center;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}

.b2c-f-card:hover {
    background: var(--b2c-f-tile-hover);
    color: #fff;
    transform: translateY(-2px);
}

.b2c-f-card i { font-size: 17px; opacity: .8; }

.b2c-f-card-ico {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

/* ── 接管父主题页脚 ─────────────────────────────────── */

/* 隐藏父主题的小工具页脚区（sidebar-2），新页脚取而代之 */
.b2c-footer ~ .site-footer,
#colophon > .site-footer { display: none !important; }

/*
 * 底部版权条保留 —— 里面有 ICP 备案号，法规要求必须展示。
 * 这里只把它改成深色以衔接新页脚。
 */
#colophon .site-footer-nav {
    background: var(--b2c-f-bg-to, #0E1A17) !important;
    border-top: 1px solid rgba(255, 255, 255, .07);
}

#colophon .site-footer-nav,
#colophon .site-footer-nav .copyright,
#colophon .site-footer-nav .beian,
#colophon .site-footer-nav .footer-bottom-right {
    color: rgba(255, 255, 255, .38);
}

#colophon .site-footer-nav a { color: rgba(255, 255, 255, .55); }
#colophon .site-footer-nav a:hover { color: var(--b2c-f-accent); }

/* ── 响应式 ─────────────────────────────────────────── */

@media (max-width: 1024px) {
    .b2c-f-intro { max-width: 100%; }
}

@media (max-width: 768px) {
    .b2c-footer { padding: 38px 0 30px; }

    .b2c-f-row { gap: 24px; }

    .b2c-f-actions { width: 100%; }

    .b2c-f-pill { width: 100%; }
    .b2c-f-pill-text { flex: 1; white-space: normal; }
    .b2c-f-ghost { width: 100%; justify-content: center; }

    .b2c-f-socials {
        margin-left: 0;
        width: 100%;
        justify-content: space-between;
        gap: 8px;
    }

    .b2c-f-social-tile { width: 100%; min-width: 56px; }

    .b2c-f-stat {
        text-align: left;
        margin-left: 0;
    }

    .b2c-f-stat-num { font-size: 38px; }

    .b2c-f-cards { grid-template-columns: repeat(2, 1fr); }

    .b2c-f-logo { height: 32px; }
    .b2c-f-logo-sub { height: 24px; }
}
