:root {
    --primary: rgb(30, 75, 105);
    --accent: rgb(70, 180, 200);
    --light-bg: #f5f7fa;
    --border: #dde2e8;
    --text: #2c3e50;
    --text-light: #6c7a89;
    --pk-color: #f59e0b;
    --fk-color: #3b82f6;
    --highlight-color: #ef4444;
    --success-color: #22c55e;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--light-bg);
    color: var(--text);
    line-height: 1.5;
}

.container {
    max-width: 820px;
    margin: 0 auto;
    padding: 24px 20px;
}

h2 { color: var(--primary); font-size: 1.5rem; margin-bottom: 4px; }
.subtitle { color: var(--text-light); font-size: 0.9rem; margin-bottom: 16px; }

/* Step Navigation */
.step-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.step-btn {
    padding: 8px 18px;
    border: 2px solid var(--border);
    border-radius: 20px;
    background: white;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.2s;
}

.step-btn:hover:not(.active) {
    background: var(--light-bg);
    border-color: var(--accent);
}

.step-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.step-arrow {
    color: var(--text-light);
    font-size: 1rem;
}

/* Canvas */
#canvas-container {
    margin-bottom: 14px;
    border-radius: var(--radius);
    overflow: hidden;
}

#canvas-container canvas { display: block; }

/* Info Row */
.info-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.nf-badge {
    display: inline-block;
    padding: 5px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
    background: var(--highlight-color);
    transition: background 0.3s;
}

.problem-badge {
    font-size: 0.82rem;
    color: var(--text-light);
    font-weight: 600;
}

/* Explanation Panel */
.explanation-panel {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: var(--shadow);
    margin-bottom: 14px;
}

.explanation-panel h4 { color: var(--primary); font-size: 0.9rem; margin-bottom: 8px; }
.explanation-panel p { font-size: 0.85rem; color: var(--text); line-height: 1.6; }

/* Anomaly Cards */
.anomaly-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.anomaly-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow);
    transition: opacity 0.3s, border-color 0.3s;
}

.anomaly-card.resolved {
    opacity: 0.5;
    border-color: var(--success-color);
}

.anomaly-card.resolved .anomaly-icon {
    opacity: 0.4;
}

.anomaly-icon { font-size: 1.2rem; margin-bottom: 4px; }
.anomaly-card h5 { font-size: 0.82rem; color: var(--primary); margin-bottom: 6px; }
.anomaly-card p { font-size: 0.75rem; color: var(--text-light); line-height: 1.4; }

/* Responsive */
@media (max-width: 600px) {
    .step-nav { gap: 4px; }
    .step-btn { padding: 6px 12px; font-size: 0.75rem; }
    .anomaly-cards { grid-template-columns: 1fr; }
}
