/* 用户旅程图工具面板 */
.uj-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;
}

.uj-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;
}

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

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

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

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

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

.uj-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;
}

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

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

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

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

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

.uj-map-title {
    margin: 0 0 16px 4px;
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.35;
    outline: none;
    border-radius: 4px;
    padding: 2px 4px;
}

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

/* 6×6 网格：角 + 5 阶段列 + 5 行标签 + 25 内容格 */
.uj-grid {
    display: grid;
    grid-template-columns: 88px repeat(5, minmax(0, 1fr));
    grid-template-rows: auto repeat(5, minmax(88px, auto));
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

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

.uj-stage-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 6px;
    background: #dcfce7;
    border-right: 1px solid #bbf7d0;
    border-bottom: 1px solid #bbf7d0;
    text-align: center;
    min-height: 64px;
}

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

.uj-stage-head i {
    font-size: 1.15rem;
    color: #166534;
}

.uj-stage-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: #14532d;
    outline: none;
    border-radius: 3px;
    padding: 1px 4px;
    line-height: 1.3;
}

.uj-stage-name:focus {
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 0 2px rgba(22, 101, 52, 0.2);
}

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

.uj-row-head span {
    font-size: 0.78rem;
    font-weight: 700;
    color: #5b21b6;
    line-height: 1.35;
    outline: none;
    border-radius: 3px;
    padding: 2px 4px;
}

.uj-row-head span:focus {
    background: rgba(255, 255, 255, 0.55);
    box-shadow: 0 0 0 2px rgba(91, 33, 182, 0.18);
}

.uj-cell {
    position: relative;
    padding: 8px 8px 28px;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
    min-height: 88px;
}

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

.uj-notes {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 40px;
}

.uj-note {
    font-size: 0.76rem;
    line-height: 1.45;
    padding: 6px 8px;
    border-radius: 6px;
    outline: none;
    word-break: break-word;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.uj-note:empty::before {
    content: attr(data-placeholder);
    color: #94a3b8;
}

.uj-note:focus {
    box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.28);
}

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

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

.uj-note-green {
    background: #dcfce7;
    border: 1px solid #86efac;
    color: #14532d;
}

.uj-note-purple {
    background: #f3e8ff;
    border: 1px solid #d8b4fe;
    color: #581c87;
}

.uj-note-blue {
    background: #dbeafe;
    border: 1px solid #93c5fd;
    color: #1e3a8a;
}

.uj-btn-add-note {
    position: absolute;
    right: 6px;
    bottom: 6px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #cbd5e1;
    border-radius: 4px;
    background: transparent;
    color: #94a3b8;
    font-size: 0.85rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, border-color 0.15s, color 0.15s;
}

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

.uj-btn-add-note:hover {
    border-color: #059669;
    color: #059669;
    background: rgba(5, 150, 105, 0.06);
}
@media (max-width: 900px) {
    .uj-grid {
        grid-template-columns: 72px repeat(5, minmax(100px, 1fr));
        min-width: 640px;
    }

    .uj-canvas-wrap {
        overflow-x: auto;
    }
}
