/* ===== 联盟卡片样式 ===== */

/* 外层卡片 - 灰底圆角 */
.ug-card-wrapper {
    width: 80%;
    max-width: 800px;
    margin: 16px auto;
    background: #f8f9fa;
    border-radius: 16px;
    padding: 8px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
    text-decoration: none;
    display: block;
    color: inherit;
}

.ug-card-wrapper:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px rgba(0,0,0,0.1);
}

/* 内层卡片 - 白底 */
.ug-card {
    display: flex;
    gap: 16px;
    border-radius: 12px;
    padding: 12px;
    background: #fff;
    align-items: center;
    min-height: 140px;      /* 改这里：height → min-height */
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    overflow: hidden;
}
/* 左边图片 */
.ug-left {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    background: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* 右边内容 */
.ug-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    overflow: hidden;
}

/* 标题区域 */
.ug-title-section {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* 主标题 - 不加粗，两行显示 */
.ug-title {
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
    color: #1a1a1a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 45px;
}

/* 副标题 */
.ug-subtitle {
    font-size: 12px;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* ===== 标签样式 ===== */
.ug-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 2px 0;
}

.ug-tag {
    display: inline-block;
    font-size: 11px;
    padding: 2px 12px;
    background: #f0f0f0;
    color: #555;
    border-radius: 20px;
    border: 1px solid #e8e8e8;
    white-space: nowrap;
    line-height: 1.6;
    font-weight: 400;
}

/* ===== 底部价格区域 ===== */
.ug-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    width: 100%;
}

.ug-price-section {
    display: flex;
    align-items: baseline;
    gap: 4px;
    line-height: 1;
}

.ug-price-label {
    font-size: 11px;
    color: #999;
    white-space: nowrap;
}

.ug-price {
    color: #e4393c;
    font-size: 18px;
    font-weight: 500;
    white-space: nowrap;
}

.ug-original-price {
    font-size: 11px;
    color: #999;
    text-decoration: line-through;
    margin-left: 4px;
    white-space: nowrap;
}


/* 按钮 - 基础样式 */
.ug-btn {
    background: #e4393c;
    color: #fff;
    padding: 4px 14px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    transition: background 0.2s ease, transform 0.15s ease;
    white-space: nowrap;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    pointer-events: auto;
    cursor: pointer;
}

/* 京东按钮悬停 */
.ug-btn:hover {
    background: #c92a2a;
    transform: scale(1.03);
    box-shadow: 0 2px 8px rgba(228, 57, 60, 0.35);
}

/* 淘宝特有样式 */
.ug-tb .ug-price {
    color: #ff5000;
}

.ug-tb .ug-btn {
    background: #ff5000;
}

/* 淘宝按钮悬停 */
.ug-tb .ug-btn:hover {
    background: #e64500;
    box-shadow: 0 2px 8px rgba(255, 80, 0, 0.35);
}

/* 链接样式 */
.ug-card-wrapper:link,
.ug-card-wrapper:visited,
.ug-card-wrapper:hover,
.ug-card-wrapper:active {
    text-decoration: none;
    color: inherit;
}

/* 列表模式间距 */
.ugm-product-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 20px 0;
}

/* 响应式 */
@media (max-width: 600px) {
    .ug-card-wrapper {
        width: 95%;
    }
    
    .ug-card {
        height: auto;
        min-height: 130px;
        padding: 10px;
        gap: 10px;
    }
    
    .ug-left {
        width: 80px;
        height: 80px;
    }
    
    .ug-price {
        font-size: 16px;
    }
    
    .ug-btn {
        padding: 4px 10px;
        font-size: 12px;
    }
}
/* ===== 标签固定颜色方案 ===== */
/* 第1个标签：橙色 */
.ug-tag:nth-child(1) {
    background: #fff3e0;
    border-color: #ffb74d;
    color: #e65100;
}

/* 第2个标签：蓝色 */
.ug-tag:nth-child(2) {
    background: #e3f2fd;
    border-color: #64b5f6;
    color: #0d47a1;
}

/* 第3个标签：绿色 */
.ug-tag:nth-child(3) {
    background: #e8f5e9;
    border-color: #81c784;
    color: #1b5e20;
}

/* 第4个标签：紫色 */
.ug-tag:nth-child(4) {
    background: #f3e5f5;
    border-color: #ba68c8;
    color: #4a148c;
}

/* 第5个标签：粉色 */
.ug-tag:nth-child(5) {
    background: #fce4ec;
    border-color: #ef9a9a;
    color: #880e4f;
}

/* 第6个标签：青色 */
.ug-tag:nth-child(6) {
    background: #e0f7fa;
    border-color: #4dd0e1;
    color: #00695c;
}

/* 第7个标签：黄色 */
.ug-tag:nth-child(7) {
    background: #fffde7;
    border-color: #ffd54f;
    color: #f57f17;
}

/* 第8个标签：灰色 */
.ug-tag:nth-child(8) {
    background: #f5f5f5;
    border-color: #bdbdbd;
    color: #424242;
}