﻿ 
.brand-section {
    margin: 40px 0;
    padding: 18px 0;
}

/* header：左侧标题，右侧操作 */
.brand-section__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.brand-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.brand-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    color: #222;
}

.brand-sub {
    margin: 0;
    font-size: 13px;
    color: #777;
}

/* 操作按钮（简易）*/
.brand-actions .btn {
    display: inline-block;
    padding: 6px 12px;
    background: #f5f5f5;
    color: #222;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
}

/* grid：4 列（桌面），响应式到 2 / 1 */
.brand-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    align-items: start;
}

/* card 风格 */
.brand-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(0,0,0,0.06);
    transition: transform .18s ease, box-shadow .18s ease;
}

.brand-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

/* 媒体区域：保持固定长宽比（更规整），图片铺满并裁切 */
.brand-card__media {
    width: 100%;
    aspect-ratio: 4 / 3; /* 图片区域比例，可按需改为 16/9 或 1/1 */
    background: #f6f6f6;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

    .brand-card__media img {
        width: 100%;
        height: 100%;
        object-fit: cover; /* cover 会裁切以填满容器（视觉更密实） */
        display: block;
    }

/* 文本信息 */
.brand-card__body {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.brand-card__title {
    font-size: 14px;
    color: #222;
    margin: 0;
    line-height: 1.2;
    font-weight: 600;
    display: inline-block; /* 或 block */
    max-width: 15em; /* 相当于约 15 个字符宽 */
    white-space: nowrap; /* 不换行 */
    overflow: hidden; /* 超出隐藏 */
    text-overflow: ellipsis; /* 显示省略号 */
}

.brand-card__meta {
    font-size: 12px;
    color: #777;
    margin: 0;
}

/* Hover 效果 */
.brand-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 32px rgba(0,0,0,0.12);
}

/* 响应式：桌面 -> 平板 -> 手机 */
@media (max-width: 1200px) {
    .brand-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .brand-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .brand-section__header {
        align-items: center;
    }
}

@media (max-width: 576px) {
    .brand-grid {
        grid-template-columns: 1fr;
    }

    .brand-card__media {
        aspect-ratio: 16 / 9;
    } 
}

.rec-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.rec-actions {
    display: flex;
    align-items: center;
    gap: 12px; /* 按钮和下拉之间的间距 */
}

.view-all {
    display: inline-block;
    padding: 6px 14px;
    background: #f5f5f5;
    border-radius: 20px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s;
}

    .view-all:hover {
        background: #e2e2e2;
    }

.rec-filter {
    padding: 6px 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    outline: none;
    cursor: pointer;
}

    .rec-filter:focus {
        border-color: #999;
    }


/* -------- brand card actions (rec.css) -------- */
.brand-card__actions {
    padding: 12px 12px 16px; /* 底部空间，可根据需要调整 */
    display: flex;
    justify-content: center; /* 居中按钮 */
    align-items: center;
    background: transparent; /* 保持卡片底色一致 */
}

/* 按钮外观 */
.brand-card__btn {
    display: inline-block;
    min-width: 110px;
    padding: 8px 14px;
    border-radius: 24px;
    background: #e53935; /* 主色，按站点主题改色 */
    color: #fff;
    font-size: 13px;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 6px 14px rgba(0,0,0,0.08);
    transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}

    /* hover / focus 样式（键盘可访问）*/
    .brand-card__btn:hover,
    .brand-card__btn:focus {
        transform: translateY(-2px);
        box-shadow: 0 12px 26px rgba(0,0,0,0.12);
        background-color: #d32f2f; /* 深一点的 hover 色 */
        outline: none;
    }

    /* 按下效果 */
    .brand-card__btn:active {
        transform: translateY(0);
        box-shadow: 0 6px 14px rgba(0,0,0,0.08);
    }

/* 在窄屏时让按钮宽度自适应（更好触控体验） */
@media (max-width: 576px) {
    .brand-card__btn {
        min-width: 140px;
        padding: 10px 16px;
    }

    .brand-card__actions {
        padding-bottom: 14px;
    }
}

/* 避免与全局样式冲突（若全局有 a{} 规则，可以用更具体的选择器） */


/* ---------- hover overlay: 查看详情 ---------- */

/* 需要 .brand-card 为定位上下文 */
.brand-card {
    position: relative; /* 若已设置请保留 */
}

/* 覆盖层：覆盖整个 card，内容水平垂直居中 */
.brand-card__overlay {
    position: absolute;
    inset: 0; /* top:0; right:0; bottom:0; left:0 */
    display: grid;
    place-items: center; /* 居中按钮 */
    background: rgba(0,0,0,0.35); /* 半透明遮罩，可按需调 */
    opacity: 0;
    transform: translateY(6px); /* 初始轻微位移，更有动感 */
    transition: opacity .18s ease, transform .18s ease;
    pointer-events: none; /* 默认穿透（不可点） */
    z-index: 10; /* 确保在卡片上层 */
}

/* 当鼠标移到卡片或卡片内元素获得焦点时显示 overlay */
.brand-card:hover .brand-card__overlay,
.brand-card:focus-within .brand-card__overlay {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto; /* 允许点击 overlay 内的按钮 */
}

/* CTA 按钮样式（白底红字风格，圆角） */
.brand-card__cta {
    display: inline-block;
    min-width: 120px;
    padding: 10px 18px;
    border-radius: 24px;
    background: #fff;
    color: #e53935;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    transition: transform .12s ease, box-shadow .12s ease;
}

    /* hover / focus 效果（按钮）*/
    .brand-card__cta:hover,
    .brand-card__cta:focus {
        transform: translateY(-3px);
        box-shadow: 0 14px 36px rgba(0,0,0,0.18);
        outline: none;
    }

    /* 键盘可访问的可见聚焦指示 */
    .brand-card__cta:focus-visible {
        outline: 3px solid rgba(229,57,53,0.14);
        outline-offset: 3px;
    }

/* 移动端：hover 无效，改为总是显示一个小按钮（可选） */
@media (max-width: 576px) {
    .brand-card__overlay {
        background: linear-gradient(180deg, rgba(0,0,0,0) 60%, rgba(0,0,0,0.4));
        pointer-events: auto;
    }

    .brand-card__cta {
        min-width: 140px;
    }
}
