/* 组织结构图工具面板 */
.org-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;
}

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

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

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

.org-title i { color: #8b5cf6; }

.org-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    background: rgba(139, 92, 246, 0.1);
    color: #7c3aed;
}

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

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

.org-btn:hover {
    border-color: #8b5cf6;
    color: #7c3aed;
}

.org-btn-primary {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border-color: transparent;
    color: #fff !important;
}

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

.org-canvas-wrap {
    flex: 1;
    overflow: auto;
    padding: 24px 16px;
    background-color: #f5f5f7;
    background-image: radial-gradient(circle, #d1d5db 1px, transparent 1px);
    background-size: 20px 20px;
    min-height: 520px;
}

.org-board {
    position: relative;
    min-width: 960px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 12px 24px;
}

.org-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

.org-chart {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.org-level-root {
    display: flex;
    justify-content: center;
    margin-bottom: 36px;
}

.org-level-branches {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    width: 100%;
}

.org-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 0;
    max-width: 220px;
}

.org-teams {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: 100%;
    margin-top: 28px;
}

/* 节点卡片 */
.org-node {
    background: #fefefe;
    border: 1.5px solid #d1d1f7;
    border-radius: 12px;
    padding: 12px 14px;
    text-align: center;
    box-shadow: 0 1px 6px rgba(99, 102, 241, 0.06);
    width: 100%;
    box-sizing: border-box;
}

.org-node-root {
    min-width: 180px;
    max-width: 220px;
    padding: 16px 18px 14px;
}

.org-node-dept {
    min-height: 118px;
}

.org-node-team {
    padding: 10px 12px;
    border-radius: 10px;
    background: #fafafe;
}

/* 头像 */
.org-avatar {
    width: 48px;
    height: 48px;
    margin: 0 auto 8px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.org-avatar-lg {
    width: 56px;
    height: 56px;
    margin-bottom: 10px;
}

.org-avatar-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    border-radius: 50%;
    outline: none;
    cursor: text;
    user-select: text;
}

.org-avatar-inner:focus {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 0 0 4px rgba(139, 92, 246, 0.45);
}

.org-avatar-lg .org-avatar-inner {
    font-size: 1.25rem;
}

.org-av-purple { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.org-av-blue   { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.org-av-green  { background: linear-gradient(135deg, #34d399, #059669); }
.org-av-orange { background: linear-gradient(135deg, #fb923c, #ea580c); }
.org-av-teal   { background: linear-gradient(135deg, #2dd4bf, #0d9488); }

/* 可编辑文字 */
.org-name,
.org-title,
.org-dept,
.org-team {
    outline: none;
    word-break: break-word;
    cursor: text;
    line-height: 1.4;
}

.org-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 2px;
}

.org-node-root .org-name {
    font-size: 1rem;
}

.org-title {
    font-size: 0.74rem;
    color: #777;
}

.org-dept,
.org-team {
    font-size: 0.68rem;
    color: #94a3b8;
    margin-top: 4px;
}

.org-name:empty::before,
.org-title:empty::before,
.org-dept:empty::before,
.org-team:empty::before {
    content: attr(data-placeholder);
    color: #cbd5e1;
}

.org-name:focus,
.org-title:focus,
.org-dept:focus,
.org-team:focus {
    background: rgba(139, 92, 246, 0.06);
    border-radius: 4px;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.25);
}
@media (max-width: 768px) {
    .org-board {
        min-width: 880px;
    }

    .org-level-branches {
        gap: 12px;
    }
}
