/* 批量对比功能样式 */

.comparison-panel {
    position: fixed;
    right: 20px;
    top: 80px;
    width: 400px;
    max-height: 80vh;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    overflow: hidden;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.comparison-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.comparison-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.btn-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.comparison-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 12px;
}

.comparison-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.comparison-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.comparison-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.comparison-item-info > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.comparison-item-info strong {
    font-size: 0.95rem;
    color: #1e293b;
}

.comparison-formula {
    font-size: 0.85rem;
    color: #64748b;
    font-family: 'Courier New', monospace;
}

.comparison-cas {
    font-size: 0.8rem;
    color: #94a3b8;
}

.btn-remove {
    background: #ef4444;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.btn-remove:hover {
    background: #dc2626;
}

.comparison-controls {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #e2e8f0;
}

.btn-primary {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e2e8f0;
    color: #475569;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: #cbd5e1;
}

.comparison-chart-container {
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #e2e8f0;
    max-height: 400px;
    overflow: auto;
}

#comparisonChart {
    max-width: 100%;
    height: 350px !important;
}

/* 添加到对比按钮样式 */
#btn-add-compare {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

#btn-add-compare:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .comparison-panel {
        right: 10px;
        left: 10px;
        width: auto;
        top: 70px;
    }

    .comparison-chart-container {
        padding: 12px;
    }

    #comparisonChart {
        height: 250px !important;
    }
}

/* 滚动条样式 */
.comparison-list::-webkit-scrollbar {
    width: 6px;
}

.comparison-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.comparison-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.comparison-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
