/**
 * 京东联盟插件样式
 */

/* 商品搜索 */
.jd-goods-search {
    padding: 15px;
}

.jd-search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.jd-search-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e4393c;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
}

.jd-search-input:focus {
    border-color: #c4161c;
}

.jd-search-btn {
    padding: 12px 25px;
    background: #e4393c;
    color: #fff;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.jd-search-btn:hover {
    background: #c4161c;
}

/* 商品网格 */
.jd-goods-grid,
.jd-goods-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

/* 商品卡片 */
.jd-goods-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.jd-goods-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.12);
}

.jd-goods-image {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
    background: #f5f5f5;
}

.jd-goods-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.jd-coupon-badge {
    position: absolute;
    top: 10px;
    left: 0;
    background: #e4393c;
    color: #fff;
    padding: 3px 10px;
    font-size: 12px;
    border-radius: 0 15px 15px 0;
}

.jd-goods-info {
    padding: 12px;
}

.jd-goods-name {
    font-size: 13px;
    line-height: 1.5;
    height: 39px;
    overflow: hidden;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.jd-goods-price {
    margin-bottom: 8px;
}

.jd-price {
    color: #e4393c;
    font-size: 18px;
    font-weight: bold;
}

.jd-original-price {
    color: #999;
    font-size: 12px;
    text-decoration: line-through;
    margin-left: 8px;
}

.jd-goods-commission {
    margin-bottom: 10px;
}

.jd-commission {
    background: #fff7f7;
    color: #e4393c;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
}

.jd-goods-actions {
    display: flex;
    gap: 8px;
}

.jd-btn-buy,
.jd-btn-share {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.jd-btn-buy {
    background: #e4393c;
    color: #fff;
}

.jd-btn-buy:hover {
    background: #c4161c;
}

.jd-btn-share {
    background: #fff;
    color: #e4393c;
    border: 1px solid #e4393c;
}

.jd-btn-share:hover {
    background: #fff7f7;
}

/* 分享弹窗 */
.jd-share-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.jd-share-modal.active {
    display: flex;
}

.jd-share-content {
    background: #fff;
    border-radius: 16px;
    padding: 25px;
    max-width: 360px;
    width: 90%;
}

.jd-share-title {
    text-align: center;
    font-size: 18px;
    margin-bottom: 15px;
}

.jd-share-goods {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 10px;
    margin-bottom: 20px;
}

.jd-share-goods img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
}

.jd-share-goods-info {
    flex: 1;
}

.jd-share-goods-name {
    font-size: 13px;
    line-height: 1.4;
    height: 36px;
    overflow: hidden;
}

.jd-share-goods-price {
    color: #e4393c;
    font-size: 16px;
    font-weight: bold;
    margin-top: 5px;
}

.jd-share-buttons {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.jd-share-btn {
    text-align: center;
    cursor: pointer;
}

.jd-share-btn-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    margin: 0 auto 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.jd-share-btn-wechat .jd-share-btn-icon { background: #07c160; }
.jd-share-btn-moments .jd-share-btn-icon { background: #07c160; }
.jd-share-btn-qq .jd-share-btn-icon { background: #12b7f5; }
.jd-share-btn-weibo .jd-share-btn-icon { background: #e6162d; }
.jd-share-btn-link .jd-share-btn-icon { background: #666; }

.jd-share-btn-label {
    font-size: 11px;
}

.jd-share-close {
    width: 100%;
    padding: 12px;
    background: #f5f5f5;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

/* 用户中心 */
.jd-user-dashboard {
    padding: 20px;
}

.jd-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.jd-stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.jd-stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #e4393c;
    margin-bottom: 5px;
}

.jd-stat-label {
    font-size: 12px;
    color: #666;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .jd-goods-grid,
    .jd-goods-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .jd-goods-name {
        font-size: 12px;
    }

    .jd-price {
        font-size: 16px;
    }

    .jd-search-input {
        padding: 10px 12px;
    }

    .jd-search-btn {
        padding: 10px 15px;
    }
}