/* AARRR 模型工具面板 */
.aarrr-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;
}

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

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

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

.aarrr-title i { color: #10b981; }

.aarrr-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

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

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

.aarrr-btn:hover {
    border-color: #10b981;
    color: #059669;
}

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

.aarrr-btn-primary:hover {
    opacity: 0.88;
    border-color: transparent !important;
}

.aarrr-canvas-wrap {
    flex: 1;
    overflow: auto;
    padding: 16px;
    background-color: #f8fafc;
    background-image: radial-gradient(circle, #e2e8f0 1px, transparent 1px);
    background-size: 24px 24px;
    min-height: 480px;
}

.aarrr-board {
    min-width: 760px;
    max-width: 1100px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    padding: 20px 24px 24px;
}

.aarrr-map-title {
    margin: 0 0 18px;
    font-size: 1.35rem;
    font-weight: 700;
    color: #1e293b;
    outline: none;
    cursor: text;
}

.aarrr-map-title:focus {
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.35);
    border-radius: 4px;
}

.aarrr-layout {
    display: flex;
    gap: 0;
    align-items: stretch;
}

/* 左侧漏斗区 */
.aarrr-funnel-side {
    display: flex;
    align-items: stretch;
    flex-shrink: 0;
    width: 200px;
    padding-right: 8px;
}

.aarrr-funnel-svg {
    width: 90px;
    height: 100%;
    min-height: 400px;
    flex-shrink: 0;
}

.aarrr-stage-labels {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 400px;
}

.aarrr-stage-label {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 2px;
    padding: 4px 0 4px 6px;
    min-height: 0;
}

.aarrr-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 2px;
}

.aarrr-letter-a1 { background: #22c55e; }
.aarrr-letter-a2 { background: #14b8a6; }
.aarrr-letter-r1 { background: #38bdf8; }
.aarrr-letter-r2 { background: #3b82f6; }
.aarrr-letter-r3 { background: #1e40af; }

.aarrr-stage-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #1e293b;
    outline: none;
    cursor: text;
}

.aarrr-stage-name:focus {
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.35);
    border-radius: 3px;
}

.aarrr-stage-en {
    font-size: 0.68rem;
    color: #94a3b8;
    font-weight: 500;
}

/* 右侧表格 */
.aarrr-table-wrap {
    flex: 1;
    min-width: 0;
}

.aarrr-table {
    display: flex;
    flex-direction: column;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    overflow: hidden;
}

.aarrr-thead,
.aarrr-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr 1fr;
}

.aarrr-thead {
    background: #475569;
}

.aarrr-th {
    padding: 10px 12px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.aarrr-th:last-child { border-right: none; }

.aarrr-row {
    border-top: 1px solid #e2e8f0;
    min-height: 80px;
}

.aarrr-row[data-aarrr-stage="acquisition"] { background: rgba(134, 239, 172, 0.08); }
.aarrr-row[data-aarrr-stage="activation"]  { background: rgba(94, 234, 212, 0.08); }
.aarrr-row[data-aarrr-stage="retention"]   { background: rgba(125, 211, 252, 0.08); }
.aarrr-row[data-aarrr-stage="revenue"]     { background: rgba(96, 165, 250, 0.08); }
.aarrr-row[data-aarrr-stage="referral"]    { background: rgba(30, 64, 175, 0.06); }

.aarrr-td {
    padding: 12px 14px;
    font-size: 0.8rem;
    line-height: 1.5;
    color: #334155;
    border-right: 1px solid #e2e8f0;
    outline: none;
    cursor: text;
    word-break: break-word;
    display: flex;
    align-items: center;
}

.aarrr-td:last-child { border-right: none; }

.aarrr-td:focus {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: inset 0 0 0 2px rgba(16, 185, 129, 0.35);
}

.aarrr-td:empty::before {
    content: '点击输入…';
    color: #94a3b8;
}
@media (max-width: 768px) {
    .aarrr-board {
        min-width: 640px;
    }

    .aarrr-funnel-side {
        width: 170px;
    }

    .aarrr-funnel-svg {
        width: 72px;
    }
}
