/* =========================================================
   博讯 · 品牌推广卡片 v2.2（基础结构）
   结构：深色品牌栏（通栏）+ 内容区 + 转化列 + 合规底栏
   换品牌只需在 brands.css 里覆盖色值令牌，本文件不用改
   依赖：无。容器查询为主，附媒体查询回退
   作用域：所有选择器均以 .tp-bv-wrap 起头，避免污染主题
   ========================================================= */

.tp-bv-wrap,
.tp-bv-wrap *,
.tp-bv-wrap *::before,
.tp-bv-wrap *::after {
    box-sizing: border-box;
}

/* ---------- 设计令牌 ---------- */
.tp-bv-wrap {
    /* 品牌色：取自 Logo 本身 */
    --bv-navy: #131c28;
    --bv-navy-top: #24344a;
    --bv-cyan: #39b9e5;

    /* 功能色 */
    --bv-blue: #0b7fc9;
    --bv-blue-dark: #0a6aa8;
    --bv-cta-shadow: rgba(11, 127, 201, 0.5);

    /* 按钮配色独立于强调色：
       浅色按钮（如威廉希尔的品牌黄）需要深色文字，不能跟着强调色走 */
    --bv-cta-bg: var(--bv-blue);
    --bv-cta-bg-hover: var(--bv-blue-dark);
    --bv-cta-text: #ffffff;
    --bv-gold-1: #f3c164;
    --bv-gold-2: #dc9a1e;

    /* 中性色阶 */
    --bv-ink: #16202c;
    --bv-text: #4d5c6d;
    --bv-muted: #8d9aa9;
    --bv-line: #e5eaf0;
    --bv-surface: #f6f8fb;
    --bv-tint: #eef7fd;
    --bv-tint-line: #d2e7f6;

    display: block;
    width: 100%;
    max-width: 860px;
    margin: 0 auto 24px;

    container-type: inline-size;

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* =========================================================
   卡片骨架
   ========================================================= */
.tp-bv-wrap .tp-bv-card {
    display: grid;
    grid-template-columns: 176px minmax(0, 1fr) 210px;
    grid-template-areas:
        "brand content actions"
        "brand legal   legal";
    column-gap: 20px;

    position: relative;
    background: #ffffff;
    border: 1px solid var(--bv-line);
    border-radius: 14px;
    box-shadow:
        0 1px 2px rgba(16, 32, 48, 0.04),
        0 14px 30px -20px rgba(16, 32, 48, 0.45);
    overflow: hidden;

    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.tp-bv-wrap .tp-bv-card:hover {
    border-color: #d6dde6;
    box-shadow:
        0 1px 2px rgba(16, 32, 48, 0.05),
        0 18px 36px -20px rgba(16, 32, 48, 0.55);
}

/* =========================================================
   品牌栏（深色通栏）
   ========================================================= */
.tp-bv-wrap .tp-bv-brand {
    grid-area: brand;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 18px 16px;

    background: linear-gradient(165deg, var(--bv-navy-top) 0%, var(--bv-navy) 62%);
    color: #ffffff;
}

.tp-bv-wrap .tp-bv-logo {
    display: block;
    width: 100%;
    max-width: 146px;
}

.tp-bv-wrap .tp-bv-logo svg {
    display: block;
    width: 100%;
    height: auto;
}

/* 评级：深底上的金色是全卡唯一高光 */
.tp-bv-wrap .tp-bv-rating {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tp-bv-wrap .tp-bv-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    min-width: 36px;
    padding: 0 8px;

    color: #2a1c05;
    background: linear-gradient(180deg, var(--bv-gold-1) 0%, var(--bv-gold-2) 100%);
    border-radius: 7px;

    font-size: 14px;
    line-height: 1;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.tp-bv-wrap .tp-bv-score-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 11.5px;
    line-height: 1.35;
    font-weight: 500;
}

/* 推广披露：可读但不喧宾夺主 */
.tp-bv-wrap .tp-bv-ad {
    align-self: flex-start;
    margin-top: auto;
    padding: 3px 7px;

    color: rgba(255, 255, 255, 0.62);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 4px;

    font-size: 10.5px;
    line-height: 1.45;
    white-space: nowrap;
}

/* =========================================================
   内容区
   ========================================================= */
.tp-bv-wrap .tp-bv-content {
    grid-area: content;
    align-self: center;
    min-width: 0;
    padding: 18px 0;
}

.tp-bv-wrap .tp-bv-title {
    margin: 0 0 6px !important;
    padding: 0 !important;
    color: var(--bv-ink) !important;
    font-size: 19px !important;
    line-height: 1.3 !important;
    font-weight: 700 !important;
    letter-spacing: -0.01em;
}

.tp-bv-wrap .tp-bv-desc {
    margin: 0 !important;
    padding: 0 !important;
    color: var(--bv-text) !important;
    font-size: 13px !important;
    line-height: 1.6 !important;
    max-width: 46em;
}

/* 特性标签：承载「为什么值得点」的事实，而非装饰 */
.tp-bv-wrap .tp-bv-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.tp-bv-wrap .tp-bv-tags li {
    margin: 0 !important;
    padding: 3px 9px !important;
    color: var(--bv-text);
    background: var(--bv-surface);
    border: 1px solid var(--bv-line);
    border-radius: 999px;
    list-style: none !important;
    font-size: 11.5px;
    line-height: 1.5;
}

.tp-bv-wrap .tp-bv-tags li::before,
.tp-bv-wrap .tp-bv-tags li::marker {
    content: none !important;
}

/* =========================================================
   转化列：优惠 → 主按钮 → 评测
   ========================================================= */
.tp-bv-wrap .tp-bv-actions {
    grid-area: actions;
    align-self: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    padding: 18px 20px 18px 0;
}

.tp-bv-wrap .tp-bv-offer {
    padding: 10px 12px;
    background: var(--bv-tint);
    border: 1px solid var(--bv-tint-line);
    border-radius: 9px;
}

.tp-bv-wrap .tp-bv-offer-label {
    display: block;
    margin-bottom: 3px;
    color: var(--bv-blue);
    font-size: 11px;
    line-height: 1.3;
    font-weight: 700;
}

.tp-bv-wrap .tp-bv-offer-main {
    margin: 0 !important;
    padding: 0 !important;
    color: var(--bv-ink) !important;
    font-size: 12.5px !important;
    line-height: 1.25 !important;
    font-weight: 600 !important;
}

.tp-bv-wrap .tp-bv-offer-main .tp-bv-amount {
    margin-right: 4px;
    color: var(--bv-ink);
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.tp-bv-wrap .tp-bv-offer-note {
    margin: 4px 0 0 !important;
    padding: 0 !important;
    color: var(--bv-muted) !important;
    font-size: 11px !important;
    line-height: 1.45 !important;
}

/* 主按钮 */
.tp-bv-wrap .tp-bv-primary {
    display: flex !important;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 42px;
    padding: 10px 14px !important;

    color: var(--bv-cta-text) !important;
    background: var(--bv-cta-bg) !important;
    border: 1px solid var(--bv-cta-bg) !important;
    border-radius: 9px !important;
    box-shadow: 0 2px 10px -2px var(--bv-cta-shadow);

    text-decoration: none !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
    white-space: nowrap;

    transition: background-color 0.18s ease, box-shadow 0.18s ease;
}

.tp-bv-wrap .tp-bv-primary:hover,
.tp-bv-wrap .tp-bv-primary:focus-visible {
    color: var(--bv-cta-text) !important;
    background: var(--bv-cta-bg-hover) !important;
    border-color: var(--bv-cta-bg-hover) !important;
    box-shadow: 0 4px 14px -2px var(--bv-cta-shadow);
}

.tp-bv-wrap .tp-bv-primary:active {
    transform: translateY(1px);
}

/* 次按钮：弱化成文字链，与主按钮拉开层级 */
.tp-bv-wrap .tp-bv-secondary {
    display: flex !important;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 32px;
    padding: 6px 10px !important;

    color: var(--bv-text) !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 8px !important;

    text-decoration: none !important;
    font-size: 12.5px !important;
    line-height: 1.2 !important;
    font-weight: 500 !important;
    white-space: nowrap;

    transition: color 0.18s ease, background-color 0.18s ease;
}

.tp-bv-wrap .tp-bv-secondary:hover,
.tp-bv-wrap .tp-bv-secondary:focus-visible {
    color: var(--bv-ink) !important;
    background: var(--bv-surface) !important;
}

/* =========================================================
   合规底栏
   ========================================================= */
.tp-bv-wrap .tp-bv-legal {
    grid-area: legal;
    margin: 0 !important;
    padding: 11px 20px 13px 0 !important;

    color: var(--bv-muted) !important;
    border-top: 1px solid var(--bv-line);

    font-size: 10.5px !important;
    line-height: 1.6 !important;
}

.tp-bv-wrap .tp-bv-legal strong {
    color: var(--bv-text);
    font-weight: 700;
}

/* =========================================================
   可访问性
   ========================================================= */
.tp-bv-wrap a:focus-visible {
    outline: 2px solid var(--bv-blue);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .tp-bv-wrap .tp-bv-card,
    .tp-bv-wrap .tp-bv-primary,
    .tp-bv-wrap .tp-bv-secondary {
        transition: none;
    }

    .tp-bv-wrap .tp-bv-primary:active {
        transform: none;
    }
}

/* =========================================================
   响应式：容器查询
   ========================================================= */

/* 中等宽度：品牌栏保留，转化区转为横向一行 */
@container (max-width: 720px) {
    .tp-bv-wrap .tp-bv-card {
        grid-template-columns: 152px minmax(0, 1fr);
        grid-template-areas:
            "brand content"
            "brand actions"
            "legal legal";
        column-gap: 18px;
    }

    .tp-bv-wrap .tp-bv-logo {
        max-width: 128px;
    }

    .tp-bv-wrap .tp-bv-content {
        align-self: end;
        padding: 16px 18px 0 0;
    }

    .tp-bv-wrap .tp-bv-actions {
        align-self: start;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px;
        padding: 14px 18px 16px 0;
    }

    .tp-bv-wrap .tp-bv-offer {
        flex: 1 1 210px;
    }

    .tp-bv-wrap .tp-bv-primary {
        width: auto;
        flex: 0 0 auto;
        min-width: 132px;
    }

    .tp-bv-wrap .tp-bv-secondary {
        width: auto;
        flex: 0 0 auto;
    }

    .tp-bv-wrap .tp-bv-legal {
        padding: 11px 18px 13px !important;
    }
}

/* 窄屏：整卡纵向堆叠，品牌栏变顶部横幅 */
@container (max-width: 520px) {
    .tp-bv-wrap .tp-bv-card {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "brand"
            "content"
            "actions"
            "legal";
        column-gap: 0;
        border-radius: 12px;
    }

    .tp-bv-wrap .tp-bv-brand {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        gap: 10px 14px;
        padding: 13px 16px;
    }

    .tp-bv-wrap .tp-bv-logo {
        max-width: 124px;
    }

    .tp-bv-wrap .tp-bv-rating {
        margin-left: auto;
    }

    .tp-bv-wrap .tp-bv-ad {
        margin-top: 0;
    }

    .tp-bv-wrap .tp-bv-content {
        padding: 16px 16px 0;
    }

    .tp-bv-wrap .tp-bv-actions {
        flex-direction: column;
        align-items: stretch;
        padding: 14px 16px 16px;
    }

    .tp-bv-wrap .tp-bv-offer {
        flex: 0 0 auto;
    }

    .tp-bv-wrap .tp-bv-primary,
    .tp-bv-wrap .tp-bv-secondary {
        width: 100%;
        min-width: 0;
    }

    .tp-bv-wrap .tp-bv-legal {
        padding: 11px 16px 13px !important;
    }
}

@container (max-width: 360px) {
    .tp-bv-wrap .tp-bv-rating {
        margin-left: 0;
    }

    .tp-bv-wrap .tp-bv-title {
        font-size: 17.5px !important;
    }
}

/* =========================================================
   回退：不支持容器查询的浏览器
   ========================================================= */
@supports not (container-type: inline-size) {
    @media (max-width: 780px) {
        .tp-bv-wrap .tp-bv-card {
            grid-template-columns: 152px minmax(0, 1fr);
            grid-template-areas:
                "brand content"
                "brand actions"
                "legal legal";
        }

        .tp-bv-wrap .tp-bv-content {
            align-self: end;
            padding: 16px 18px 0 0;
        }

        .tp-bv-wrap .tp-bv-actions {
            align-self: start;
            flex-direction: row;
            flex-wrap: wrap;
            align-items: center;
            padding: 14px 18px 16px 0;
        }

        .tp-bv-wrap .tp-bv-offer {
            flex: 1 1 210px;
        }

        .tp-bv-wrap .tp-bv-primary,
        .tp-bv-wrap .tp-bv-secondary {
            width: auto;
        }

        .tp-bv-wrap .tp-bv-legal {
            padding: 11px 18px 13px !important;
        }
    }

    @media (max-width: 560px) {
        .tp-bv-wrap .tp-bv-card {
            grid-template-columns: minmax(0, 1fr);
            grid-template-areas:
                "brand"
                "content"
                "actions"
                "legal";
        }

        .tp-bv-wrap .tp-bv-brand {
            flex-direction: row;
            align-items: center;
            flex-wrap: wrap;
            gap: 10px 14px;
            padding: 13px 16px;
        }

        .tp-bv-wrap .tp-bv-rating {
            margin-left: auto;
        }

        .tp-bv-wrap .tp-bv-ad {
            margin-top: 0;
        }

        .tp-bv-wrap .tp-bv-content {
            padding: 16px 16px 0;
        }

        .tp-bv-wrap .tp-bv-actions {
            flex-direction: column;
            align-items: stretch;
            padding: 14px 16px 16px;
        }

        .tp-bv-wrap .tp-bv-primary,
        .tp-bv-wrap .tp-bv-secondary {
            width: 100%;
        }

        .tp-bv-wrap .tp-bv-legal {
            padding: 11px 16px 13px !important;
        }
    }
}
