/* 4个小方块广告位样式 */
.small-ad-item {
    display: block;
    text-decoration: none;
    color: inherit;
}

.small-ad-item .ad-placeholder {
    width: 100%;
    height: 120px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    gap: 15px;
}

.small-ad-item:hover .ad-placeholder {
    border-color: #4a90e2;
    background: #f0f8ff;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.small-ad-item .ad-icon {
    font-size: 32px;
}

.small-ad-item .ad-text {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.small-ad-item .ad-price {
    font-size: 14px;
    color: #666;
    margin: 0;
    background: #f0f0f0;
    padding: 4px 12px;
    border-radius: 20px;
}

/* 有图片时的样式 */
.small-ad-item.has-image .ad-placeholder {
    padding: 0;
    height: 120px;
    background: transparent;
    border: none;
}

.small-ad-item.has-image img {
    width: 100%;
    height: 120px;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}

/* 手机端适配 */
@media (max-width: 768px) {
    .small-ad-item .ad-placeholder {
        height: 100px;
        gap: 10px;
    }

    .small-ad-item .ad-icon {
        font-size: 28px;
    }

    .small-ad-item .ad-text {
        font-size: 16px;
    }

    .small-ad-item .ad-price {
        font-size: 12px;
        padding: 3px 10px;
    }

    .small-ad-item.has-image .ad-placeholder {
        height: 100px;
    }

    .small-ad-item.has-image img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
}

@media (max-width: 480px) {
    .small-ad-item .ad-placeholder {
        height: 80px;
        gap: 8px;
    }

    .small-ad-item .ad-icon {
        font-size: 24px;
    }

    .small-ad-item .ad-text {
        font-size: 15px;
    }

    .small-ad-item .ad-price {
        font-size: 11px;
        padding: 2px 8px;
    }

    .small-ad-item.has-image .ad-placeholder {
        height: 80px;
    }

    .small-ad-item.has-image img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
}

/* 首页API文本省略样式 */
.apilist_box .api_item .api_name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal;
    line-height: 1.4;
    max-height: 2.8em;
}

.apilist_box .api_item .api_desc {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-height: 1.4;
    max-height: 4.2em;
}
