/* 复购行为分析 */
.rbp-tool-panel {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    min-height: 0;
}

.rbp-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-muted, #f9fafb);
    flex-shrink: 0;
}

.rbp-toolbar-left { display: flex; align-items: center; gap: 8px; }

.rbp-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.rbp-title i { color: #059669; }

.rbp-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    background: rgba(5, 150, 105, 0.1);
    color: #059669;
}

.rbp-toolbar-right { display: flex; align-items: center; gap: 6px; }

.rbp-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    font-size: 0.78rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.rbp-btn:hover { border-color: #059669; color: #059669; }

.rbp-btn-primary {
    background: linear-gradient(135deg, #059669, #10b981);
    border-color: transparent;
    color: #fff !important;
}

.rbp-btn-primary:hover { opacity: 0.92; color: #fff !important; }

.rbp-canvas-wrap {
    flex: 1;
    overflow: auto;
    padding: 16px;
    background-color: #eef1f5;
    background-image: radial-gradient(circle, #c5cdd8 1px, transparent 1px);
    background-size: 18px 18px;
    min-height: 380px;
}

.rbp-board {
    max-width: 1100px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
    padding: 18px 14px 14px;
    overflow: hidden;
}

.rbp-map-header { margin-bottom: 10px; padding: 0 4px; }

.rbp-map-title {
    margin: 0 0 4px;
    font-size: 1.12rem;
    font-weight: 700;
    color: #1e293b;
    outline: none;
    border-radius: 4px;
    padding: 2px 4px;
}

.rbp-map-title:focus {
    background: rgba(5, 150, 105, 0.06);
    box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.25);
}

.rbp-map-subtitle {
    margin: 0;
    font-size: 0.8rem;
    color: #64748b;
    outline: none;
    border-radius: 4px;
    padding: 2px 4px;
}

.rbp-map-subtitle:focus {
    background: rgba(5, 150, 105, 0.05);
    box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.18);
}

.rbp-lifecycle-hint {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 2px 4px;
    margin: 0 4px 12px;
    padding: 8px 10px;
    border-radius: 8px;
    background: linear-gradient(90deg, #ecfdf5, #f0fdf4);
    border: 1px solid #bbf7d0;
    font-size: 0.72rem;
    font-weight: 600;
    color: #166534;
}

.rbp-lifecycle-hint i { font-size: 0.9rem; color: #22c55e; }

.rbp-grid {
    display: grid;
    grid-template-columns: 76px repeat(5, minmax(0, 1fr));
    grid-template-rows: auto repeat(5, minmax(72px, auto));
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
}

.rbp-corner {
    background: #f8fafc;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.rbp-stage-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 4px;
    background: linear-gradient(180deg, #d1fae5, #ecfdf5);
    border-right: 1px solid #a7f3d0;
    border-bottom: 1px solid #a7f3d0;
    text-align: center;
    min-height: 54px;
}

.rbp-stage-head:last-of-type { border-right: none; }

.rbp-stage-head i { font-size: 1rem; color: #047857; }

.rbp-stage-name {
    font-size: 0.76rem;
    font-weight: 700;
    color: #14532d;
    outline: none;
    line-height: 1.25;
}

.rbp-row-head {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 4px;
    background: #ede9fe;
    border-right: 1px solid #ddd6fe;
    border-bottom: 1px solid #ddd6fe;
    text-align: center;
}

.rbp-row-head span {
    font-size: 0.74rem;
    font-weight: 700;
    color: #5b21b6;
    outline: none;
}

.rbp-cell {
    position: relative;
    padding: 6px 6px 24px;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    min-height: 72px;
}

.rbp-cell:nth-child(6n) { border-right: none; }

.rbp-notes { display: flex; flex-direction: column; gap: 5px; }

.rbp-note {
    font-size: 0.73rem;
    line-height: 1.4;
    padding: 5px 7px;
    border-radius: 5px;
    outline: none;
    word-break: break-word;
}

.rbp-note-default {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
}

.rbp-note-warn {
    background: #fef9c3;
    border: 1px solid #fde047;
    color: #713f12;
}

.rbp-note-action {
    background: #dcfce7;
    border: 1px solid #86efac;
    color: #14532d;
    font-weight: 500;
}

.rbp-note-kpi {
    background: #dbeafe;
    border: 1px solid #93c5fd;
    color: #1e3a8a;
    font-weight: 500;
}

.rbp-btn-add-note {
    position: absolute;
    right: 5px;
    bottom: 5px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #cbd5e1;
    border-radius: 4px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
}

.rbp-cell:hover .rbp-btn-add-note { opacity: 1; }

.rbp-btn-add-note:hover {
    border-color: #059669;
    color: #059669;
}

@media (max-width: 900px) {
    .rbp-grid {
        grid-template-columns: 64px repeat(5, minmax(120px, 1fr));
        min-width: 680px;
    }
    .rbp-canvas-wrap { overflow-x: auto; }
}
