/* 口服产品卡片 - 美观简洁版 */
.mop-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid #f0f0f0;
    position: relative;
}

.mop-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(24, 144, 255, 0.12);
    border-color: #e6f7ff;
}

/* 顶部装饰条 */
.mop-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1890ff, #52c41a);
    z-index: 1;
}

/* 图片区域 - 完美居中 */
.mop-card__image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    aspect-ratio: 2/1;
    overflow: hidden;
    position: relative;
    padding: 8px;
    box-sizing: border-box;
}

.mop-card__image a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.mop-card__image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
    border-radius: 4px;
}

.mop-card:hover .mop-card__image img {
    transform: scale(1.05);
}

/* 内容区域 */
.mop-card__content {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 标题区域 */
.mop-card__header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.mop-card__origin {
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 500;
    color: #1890ff;
    background: #f0f7ff;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
    border: 1px solid #d6e4ff;
}

.mop-card__title {
    margin: 0;
    font-size: 1.125rem;
    line-height: 1.4;
    font-weight: 600;
    color: #1a1a1a;
    flex: 1;
}

.mop-card__title a {
    color: inherit;
    text-decoration: none;
    display: block;
}

.mop-card__title a:hover {
    color: #1890ff;
}

/* 类型和形态 */
.mop-card__type-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.mop-card__type {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1890ff;
}

.mop-card__form {
    font-size: 0.8125rem;
    color: #52c41a;
    background: #f6ffed;
    padding: 4px 8px;
    border-radius: 12px;
    border: 1px solid #b7eb8f;
}

/* 统计数据 */
.mop-card__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 8px 0;
}

.stat-item {
    background: #fafafa;
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    transition: all 0.2s ease;
}

.stat-item:hover {
    background: #f0f0f0;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 2px;
}

.stat-value {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #333;
}

/* 成分信息 */
.mop-card__ingredients {
    padding: 12px 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}

.ingredient-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 0.875rem;
}

.ingredient-item:last-child {
    margin-bottom: 0;
}

.ingredient-name {
    color: #595959;
    font-weight: 500;
}

.ingredient-dosage {
    color: #1890ff;
    font-weight: 600;
}

/* 操作按钮 */
.mop-card__actions {
    margin-top: auto;
    width: 100%;
    display: flex;
    gap: 10px;
    min-width: 0;
    /* ✅ 添加这3行关键代码 */
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}




.mop-card__view-details:hover {
    background: #096dd9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.3);
}

.mop-card__view-details,
.mop-card__compare-btn {
    /* ✅ 添加这一行关键代码 */
    flex: 1; /* 让两个按钮平分宽度 */
    
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-size: 0.8125rem;
    white-space: nowrap;
    /* ✅ 添加文本溢出处理 */
    text-overflow: ellipsis;
    overflow: hidden;
    /* ✅ 确保盒子模型正确 */
    box-sizing: border-box;
}



/* ✅ 添加按钮背景色 */
.mop-card__view-details {
    background: linear-gradient(135deg, #1890ff, #096dd9);
    border: none;
}

.mop-card__compare-btn {
    background: linear-gradient(135deg, #722ed1, #531dab);
    border: none;
    font-family: inherit;
    cursor: pointer;
    line-height: normal;
    text-align: center;
}

.mop-card__compare-btn:hover {
    background: #531dab;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(114, 46, 209, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .mop-card__image {
        aspect-ratio: 16/9;
        padding: 12px;
    }
    
    .mop-card__content {
        padding: 12px;
        gap: 10px;
    }
    
    .mop-card__title {
        font-size: 1rem;
    }
    
    .mop-card__stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .mop-card__actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .mop-card__view-details,
    .mop-card__compare-btn {
        padding: 10px;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .mop-card__image {
        aspect-ratio: 3/2;
    }
    
    .mop-card__stats {
        grid-template-columns: 1fr;
    }
    
    
    
    .mop-card__form {
        align-self: flex-start;
    }
}

/* 无障碍访问优化 */
.mop-card__title a:focus,
.mop-card__view-details:focus,
.mop-card__compare-btn:focus {
    outline: 2px solid #1890ff;
    outline-offset: 2px;
}

/* 加载优化 */
.mop-card__image img[loading="lazy"] {
    background: #f5f5f5;
}