/* ============================================================
   广告位 · 四卡片（v3 · 图标内嵌标题版）
============================================================ */
.ad-cards-wrap { padding: 14px 0 14px; }

.ad-cards-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 12px;
    color: var(--c-muted);
}
.ad-cards-header::before,
.ad-cards-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--c-border), transparent);
}
.ad-cards-header .label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    letter-spacing: .5px;
    white-space: nowrap;
}
.ad-cards-header i { color: var(--c-amber); font-size: 11px; }

.ad-cards-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

/* ===== 桌面端卡片：图标绝对定位到左侧 ===== */
.ad-card {
    position: relative;
    display: block;
    border: 1px solid;
    border-radius: 10px;
    padding: 13px 32px 13px 68px;    /* 左 68 给图标腾位，右 32 给箭头 */
    text-decoration: none;
    overflow: hidden;
    min-height: 70px;
    transition: all .25s ease;
}

.ad-card::before {
    content: "AD";
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 9px;
    font-weight: 600;
    color: #fff;
    background: rgba(0,0,0,.25);
    padding: 1px 5px;
    border-radius: 3px;
    letter-spacing: .5px;
    z-index: 2;
}

.ad-card::after {
    content: '\f061';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 12px;
    bottom: 11px;
    font-size: 11px;
    opacity: .55;
    transition: all .25s ease;
}

.ad-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(26,111,196,.18);
}
.ad-card:hover::after { opacity: 1; transform: translateX(3px); }

/* 桌面端：图标绝对定位到左侧大块 */
.ad-card-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    color: #fff;
    font-style: normal;
    box-shadow: 0 4px 10px rgba(0,0,0,.15);
    transition: transform .25s ease;
    flex-shrink: 0;
}
.ad-card:hover .ad-card-icon {
    transform: translateY(-50%) scale(1.06) rotate(-3deg);
}

.ad-card-body { min-width: 0; }

.ad-card-title {
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ad-card-desc {
    font-size: 11.5px;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ad-card-price {
    display: inline-flex;
    align-items: baseline;
    gap: 1px;
    font-weight: 700;
    margin-right: 4px;
}
.ad-card-price .symbol { font-size: 10px; }
.ad-card-price .num    { font-size: 14px; }
.ad-card-price .unit   { font-size: 10px; font-weight: 500; opacity: .7; }

/* ===== 主题配色 ===== */
.ad-card.t-blue {
    background: linear-gradient(135deg, #EBF4FD 0%, #F7FBFE 100%);
    border-color: #C6DFF6;
}
.ad-card.t-blue  .ad-card-icon  { background: linear-gradient(135deg, #1A6FC4, #4A9FD6); }
.ad-card.t-blue  .ad-card-title { color: #0D3D6E; }
.ad-card.t-blue  .ad-card-desc  { color: #3E6A9C; }
.ad-card.t-blue  .ad-card-price { color: var(--c-blue); }
.ad-card.t-blue::after          { color: var(--c-blue); }

.ad-card.t-green {
    background: linear-gradient(135deg, #E7F7EF 0%, #F4FCF7 100%);
    border-color: #B8E4CC;
}
.ad-card.t-green .ad-card-icon  { background: linear-gradient(135deg, #2DAE6B, #55C288); }
.ad-card.t-green .ad-card-title { color: #175A3A; }
.ad-card.t-green .ad-card-desc  { color: #3D7E5C; }
.ad-card.t-green .ad-card-price { color: var(--c-green); }
.ad-card.t-green::after         { color: var(--c-green); }

.ad-card.t-red {
    background: linear-gradient(135deg, #FDECEC 0%, #FEF6F6 100%);
    border-color: #F6C6C6;
}
.ad-card.t-red   .ad-card-icon  { background: linear-gradient(135deg, #EF4444, #F87171); }
.ad-card.t-red   .ad-card-title { color: #8B1F1F; }
.ad-card.t-red   .ad-card-desc  { color: #9F4545; }
.ad-card.t-red   .ad-card-price { color: var(--c-red); }
.ad-card.t-red::after           { color: var(--c-red); }

.ad-card.t-amber {
    background: linear-gradient(135deg, #FEF4DE 0%, #FEFAEE 100%);
    border-color: #FADC99;
}
.ad-card.t-amber .ad-card-icon  { background: linear-gradient(135deg, #F59E0B, #FBBF24); }
.ad-card.t-amber .ad-card-title { color: #8C5A0B; }
.ad-card.t-amber .ad-card-desc  { color: #A77B2C; }
.ad-card.t-amber .ad-card-price { color: var(--c-amber); }
.ad-card.t-amber::after         { color: var(--c-amber); }

/* ============================================================
   响应式
============================================================ */

/* ≤ 991px：平板 2x2，桌面样式不变 */
@media (max-width: 991.98px) {
    .ad-cards-row { grid-template-columns: repeat(2, 1fr); }
}

/* ≤ 575px：手机端 · 图标回到文本流、内联到标题行首 */
@media (max-width: 575.98px) {
    .ad-cards-wrap { padding: 10px 0 10px; }
    .ad-cards-header { margin-bottom: 8px; font-size: 11px; }
    .ad-cards-row { gap: 8px; }

    /* 卡片去掉左侧 68px 的图标预留、右侧 32px 的箭头预留 */
    .ad-card {
        padding: 10px 12px;
        min-height: 0;
    }

    /* 隐藏 AD 角标和右下箭头 */
    .ad-card::before,
    .ad-card::after { display: none; }

    /* 【关键】图标取消绝对定位，回到文本流，作为标题的行内前缀 */
    .ad-card-icon {
        position: static;
        transform: none;
        display: inline-flex;
        width: 20px;
        height: 20px;
        font-size: 12px;
        border-radius: 5px;
        vertical-align: -4px;
        margin-right: 6px;
        box-shadow: 0 2px 5px rgba(0,0,0,.12);
    }
    .ad-card:hover .ad-card-icon {
        transform: scale(1.05);
    }

    /* 标题允许 2 行换行 */
    .ad-card-title {
        font-size: 13px;
        line-height: 1.45;
        margin-bottom: 4px;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .ad-card-desc {
        font-size: 11px;
        line-height: 1.4;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .ad-card-price .num    { font-size: 12.5px; }
    .ad-card-price .symbol { font-size: 9px; }
    .ad-card-price .unit   { font-size: 9px; }
}

/* ≤ 400px：超窄屏兜底 */
@media (max-width: 400px) {
    .ad-card { padding: 9px 10px; }
    .ad-card-icon {
        width: 18px;
        height: 18px;
        font-size: 11px;
        margin-right: 5px;
        vertical-align: -3px;
    }
    .ad-card-title { font-size: 12.5px; }
    .ad-card-desc  { font-size: 10.5px; }
    .ad-card-price .num { font-size: 12px; }
}

/**
谷歌广告样式
 */
.ad-slot {
    display: block;
    width: 100%;
    min-height: 200px;
    margin-bottom: .5rem;
    /* 可选：空占位时的视觉处理 */
    background: #fafafa;
    border-radius: 4px;
}
@media (max-width: 768px) {
    .ad-slot { min-height: 160px; }
}