/* ==================== 可解释性分析样式 ==================== */

/* 可解释性分析区域 */
.explainability-section {
    margin-top: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.05) 0%, rgba(9, 9, 121, 0.05) 100%);
    border-radius: 15px;
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.section-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.3), transparent);
    margin: 2rem 0 1rem 0;
}

.explainability-hint {
    margin: 1rem 0 1.5rem 0;
    padding: 0.75rem 1rem;
    background: rgba(0, 212, 255, 0.08);
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 0.95rem;
}

.explainability-hint i {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

/* 药物选择面板 */
.drug-selection-panel .panel-header h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.selection-hint {
    margin: 1rem 0;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 152, 0, 0.1) 100%);
    border-left: 4px solid #FFC107;
    border-radius: 8px;
    color: var(--text-color);
    font-size: 0.95rem;
}

.selection-hint i {
    color: #FFC107;
    margin-right: 0.5rem;
}

.selection-hint strong {
    color: #FFC107;
    font-weight: 600;
}

/* 药物网格 */
.drug-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

/* 药物卡片 */
.drug-card {
    background: var(--card-bg);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.drug-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.drug-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 212, 255, 0.2);
}

.drug-card:hover::before {
    opacity: 1;
}

.drug-card.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.08) 0%, rgba(9, 9, 121, 0.08) 100%);
}

.drug-card.selected::before {
    opacity: 1;
}

.drug-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.drug-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
}

.drug-checkbox {
    position: relative;
}

.drug-checkbox input[type="checkbox"] {
    display: none;
}

.drug-checkbox label {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.drug-checkbox input[type="checkbox"]:checked + label {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.drug-checkbox input[type="checkbox"]:checked + label::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.drug-card-body {
    padding-top: 0.5rem;
}

.drug-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.drug-score {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 212, 255, 0.08);
    border-radius: 8px;
}

.score-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.score-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* 选择操作按钮 */
.selection-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.selection-actions button {
    min-width: 150px;
}

.selection-actions button i {
    margin-right: 0.5rem;
}

/* 可解释性分析进度步骤 */
#explainabilityProgressPanel .progress-step {
    /* 继承主样式 */
}

/* 可解释性报告 */
.explainability-report-content {
    /* 继承报告样式 */
}

/* 移动端适配 */
@media (max-width: 768px) {
    .drug-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .selection-actions {
        flex-direction: column;
    }

    .selection-actions button {
        width: 100%;
    }

    .explainability-section {
        padding: 1.5rem;
    }
}

/* 动画效果 */
@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.drug-card {
    animation: cardFadeIn 0.3s ease forwards;
}

.drug-card:nth-child(1) { animation-delay: 0.05s; }
.drug-card:nth-child(2) { animation-delay: 0.1s; }
.drug-card:nth-child(3) { animation-delay: 0.15s; }
.drug-card:nth-child(4) { animation-delay: 0.2s; }
.drug-card:nth-child(5) { animation-delay: 0.25s; }
.drug-card:nth-child(6) { animation-delay: 0.3s; }
.drug-card:nth-child(7) { animation-delay: 0.35s; }
.drug-card:nth-child(8) { animation-delay: 0.4s; }

/* 加载状态 */
.drug-card.loading {
    pointer-events: none;
    opacity: 0.6;
}

/* 按钮悬停效果 */
.btn-secondary {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.9) 0%, rgba(73, 80, 87, 0.9) 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, rgba(108, 117, 125, 1) 0%, rgba(73, 80, 87, 1) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}
