.ad-slot {
    width: 100%;
    margin: 0 0 14px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.ad-slot-banner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.ad-slot-gif-only {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ad-gif-only {
    display: block;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
}

.ad-gif-only img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: cover;
}

.ad-slot-home_bottom,
.ad-slot-tool_bottom,
.ad-slot-trace_bottom {
    margin-top: 14px;
    margin-bottom: 0;
}

.ad-item {
    min-height: 54px;
    border: 1px solid #d9e2ed;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(29, 45, 68, 0.16);
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: #23364c;
    overflow: hidden;
    position: relative;
}

.ad-image {
    width: 112px;
    height: 38px;
    border-radius: 4px;
    background: #eef3f8;
    overflow: hidden;
}

.ad-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ad-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.ad-copy strong,
.ad-copy em {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ad-copy strong {
    font-size: 18px;
    color: #203247;
}

.ad-copy em {
    color: #6f8197;
    font-style: normal;
    font-size: 12px;
}

.ad-item b {
    min-width: 42px;
    height: 28px;
    border-radius: 3px;
    background: #2563eb;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ad-mark {
    width: 48px;
    height: 30px;
    border-radius: 3px;
    background: #ffe500;
    color: #172338;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.ad-preview {
    border-color: #c9d7ea;
    background:
        linear-gradient(90deg, #0f4fa8 0, #1467d8 46%, #ffffff 46%, #f7fbff 100%);
}

.ad-preview .ad-copy strong {
    color: #fff;
}

.ad-preview .ad-copy em {
    color: #e8f2ff;
}

.ad-preview::after {
    content: "广告";
    position: absolute;
    right: 6px;
    top: 3px;
    color: #9aa8ba;
    font-size: 11px;
}

.ad-slot-float {
    position: fixed;
    top: 282px;
    width: 96px;
    z-index: 20;
    margin: 0;
}

.ad-slot-float .ad-item {
    min-height: 320px;
    grid-template-columns: 1fr;
    align-content: start;
    justify-items: center;
    gap: 8px;
    padding: 10px 8px;
    text-align: center;
    background:
        linear-gradient(180deg, #0f8896 0, #0fa1aa 42%, #13324b 42%, #13324b 100%);
    color: #fff;
}

.ad-slot-float .ad-mark {
    width: 100%;
    background: #fff;
    color: #0f6574;
}

.ad-slot-float .ad-copy {
    writing-mode: horizontal-tb;
    align-items: center;
    justify-items: center;
    gap: 10px;
}

.ad-slot-float .ad-copy strong {
    color: #fff;
    width: 64px;
    font-size: 22px;
    line-height: 1.18;
    letter-spacing: 0;
    writing-mode: horizontal-tb;
    height: auto;
    overflow: visible;
    white-space: normal;
}

.ad-slot-float .ad-copy em {
    color: #e9ffff;
    font-size: 14px;
    line-height: 1.25;
    writing-mode: horizontal-tb;
    overflow: visible;
    white-space: normal;
}

.ad-slot-float .ad-image {
    width: 80px;
    height: 110px;
}

.ad-slot-float .ad-item b {
    width: 100%;
    margin-top: auto;
    background: rgba(255, 255, 255, 0.18);
}

.ad-close {
    height: 24px;
    width: 100%;
    border: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #c8c8c8;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
}

.ad-slot.ad-closed {
    display: none;
}

.ad-slot-float.ad-slot-float_left {
    left: 16px;
}

.ad-slot-float.ad-slot-float_right {
    right: 16px;
}

@media (max-width: 1500px) {
    .ad-slot-float {
        display: none;
    }
}

@media (max-width: 620px) {
    .ad-slot-banner {
        grid-template-columns: 1fr;
    }

    .ad-slot-gif-only {
        grid-template-columns: minmax(0, 1fr);
    }

    .ad-item {
        grid-template-columns: minmax(0, 1fr) auto;
        min-height: 70px;
    }

    .ad-mark {
        grid-column: 1 / -1;
        width: 58px;
    }

    .ad-image {
        grid-column: 1 / -1;
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 6;
    }
}
