/* Card 组件样式 */
/* 文件名：card.css */


/* ===== 紧急修复：强制显示图片 ===== */
.card__image img {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.card__image {
    position: relative !important;
    overflow: hidden !important;
}

.card__image-placeholder {
    display: none !important;
}

/* 如果图片加载成功，确保占位符隐藏 */
.card__image img[src]:not([src=""]) {
    display: block !important;
}

.card__image img[src]:not([src=""]) ~ .card__image-placeholder {
    display: none !important;
}


/* 临时调试边框 */
.card__image {
    border: 2px solid red !important;
}

.card__image img {
    border: 2px solid green !important;
}

.card__image-placeholder {
    border: 2px solid blue !important;
}

/* ===== 基础卡片样式 ===== */
.card {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border-radius: 1.25rem;
    border: 1px solid #334155;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    position: relative;
}

.card:hover {
    transform: translateY(-8px);
    border-color: #60a5fa;
    box-shadow: 0 20px 40px rgba(96, 165, 250, 0.15);
}

.card__link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

/* ===== 加载和错误状态 ===== */
.card--loading {
    opacity: 0.7;
    pointer-events: none;
}

.card__loading {
    text-align: center;
    padding: 3rem 2rem;
    color: #94a3b8;
}

.card__loading-spinner {
    border: 3px solid #334155;
    border-top: 3px solid #60a5fa;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.card__error {
    text-align: center;
    padding: 3rem 2rem;
    color: #ef4444;
}

.card__retry {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    margin-top: 1rem;
    transition: background 0.3s ease;
}

.card__retry:hover {
    background: #dc2626;
}

/* ===== 产品卡片样式 ===== */
.card__layout--product {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card__image-section {
    position: relative;
    height: 180px;
    overflow: hidden;
}

/* 确保图片容器正确显示 */
.card__image {
    width: 100%;
    height: 100%;
    background: #374151;
    position: relative;
}

.card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    display: block !important; /* ✅ 强制显示 */
}

.card:hover .card__image img {
    transform: scale(1.08);
}

.card__image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #9ca3af;
    font-size: 2.5rem;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.card__type-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, #60a5fa, #4f46e5);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.card__content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card__header {
    margin-bottom: 1rem;
}

.card__brand {
    color: #60a5fa;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card__title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f1f5f9;
    line-height: 1.4;
    margin: 0;
}

.card__params {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.card__param {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #94a3b8;
    font-size: 0.875rem;
}

.card__param i {
    color: #60a5fa;
    width: 16px;
}

.card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.card__rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rating-stars {
    color: #f59e0b;
    font-size: 0.9rem;
}

.rating-text {
    color: #94a3b8;
    font-size: 0.875rem;
    font-weight: 600;
}

.card__price {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #10b981, #34d399);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== 报告卡片样式 ===== */
.card__layout--report {
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card__user-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.card__user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.card__user-info {
    flex: 1;
}

.card__user-age {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 0.25rem;
}

.card__user-condition {
    color: #94a3b8;
    font-size: 0.875rem;
}

.card__report-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.report-stat {
    text-align: center;
    padding: 0.75rem;
    background: rgba(96, 165, 250, 0.1);
    border-radius: 0.75rem;
    border: 1px solid rgba(96, 165, 250, 0.2);
}

.stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 800;
    color: #60a5fa;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: #94a3b8;
}

.card__excerpt {
    color: #94a3b8;
    line-height: 1.6;
    font-size: 0.9rem;
    margin: 1rem 0;
}

/* ===== 默认卡片样式 ===== */
.card__layout--default {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card__layout--default .card__image {
    height: 160px;
}

.card__layout--default .card__content {
    flex: 1;
}

/* ===== 动画 ===== */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    .card__content {
        padding: 1.25rem;
    }
    
    .card__title {
        font-size: 1rem;
    }
    
    .card__params {
        gap: 0.75rem;
    }
    
    .card__image-section {
        height: 140px;
    }
    
    .card__user-section {
        gap: 0.75rem;
    }
    
    .card__user-avatar {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}
/* ===== 专业评测卡片样式 ===== */
.card__layout--review {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card__expert-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.card__review-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin: 1rem 0;
}

.review-stat {
    text-align: center;
    padding: 0.75rem 0.5rem;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 0.5rem;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.review-stat .stat-value {
    display: block;
    font-size: 1rem;
    font-weight: 800;
    color: #8b5cf6;
    margin-bottom: 0.25rem;
}

.review-stat .stat-label {
    font-size: 0.7rem;
    color: #94a3b8;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .card__review-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    .review-stat {
        padding: 0.5rem 0.25rem;
    }
    
    .review-stat .stat-value {
        font-size: 0.9rem;
    }
    
    .review-stat .stat-label {
        font-size: 0.65rem;
    }
}


/* ===== 调试信息样式 ===== */
.card__debug {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    color: #10b981;
    padding: 0.75rem;
    font-size: 0.75rem;
    border-bottom: 1px solid #10b981;
    z-index: 1000;
    font-family: 'Courier New', monospace;
}

.debug-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.debug-item {
    display: flex;
    flex-direction: column;
}

.debug-item strong {
    color: #60a5fa;
    margin-bottom: 0.25rem;
    font-size: 0.7rem;
}

.debug-toggle {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    cursor: pointer;
    margin-top: 0.5rem;
}

/* 开发环境显示调试信息 */
body.debug-mode .card__debug {
    display: block !important;
}

/* 卡片调试状态样式 */
.card--debug .card__debug {
    display: block;
}

.card--debug {
    outline: 2px solid #ef4444;
    outline-offset: -2px;
}