/* ========== mindmap.css ========== */
/**
 * 思维导图模块样式 - Nebula 设计语言
 * 玻璃拟态 · 紫靛渐变 · 微光发光 · 高级质感
 */

/* 导图头部 */
.mindmap-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.mindmap-header h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.02em;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.inspector-shortcuts {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 7px 9px;
    margin-top: 14px;
    color: var(--text-muted);
    font-size: 11px;
}

.inspector-shortcuts span {
    min-width: 42px;
    padding: 3px 6px;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--bg-input);
    color: var(--text-secondary);
    text-align: center;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.btn-new-map {
    padding: 12px 24px;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-glow);
}

.btn-new-map:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow), 0 8px 28px var(--border-glow);
}

/* 导图列表网格 */
.mindmaps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.mindmap-card {
    position: relative;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition);
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-card);
}

.mindmap-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition);
}

.mindmap-card:hover {
    transform: translateY(-6px);
    background: var(--bg-hover);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-card), var(--shadow-glow);
}

.mindmap-card:hover::before {
    opacity: 1;
}

.mm-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

.mm-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.mm-nodes {
    display: flex;
    align-items: center;
}

.mm-node {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    margin-left: -8px;
    border: 2px solid var(--bg-secondary);
}

.mm-node:first-child {
    margin-left: 0;
    background: var(--gradient-primary);
    color: var(--text-primary);
    font-weight: 600;
}

.mm-node:nth-child(2) { background: var(--primary); color: var(--text-primary); }
.mm-node:nth-child(3) { background: var(--primary-light); color: var(--text-primary); }
.mm-node:nth-child(4) { background: var(--accent); color: var(--text-primary); }

.mm-more {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--text-secondary);
    margin-left: -8px;
}

.mm-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

.mm-date {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mm-actions {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.mindmap-card:hover .mm-actions {
    opacity: 1;
}

.mm-action-btn {
    width: 32px;
    height: 32px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    transition: all var(--transition-fast);
    backdrop-filter: blur(8px);
}

.mm-action-btn:hover {
    background: var(--border-glow);
    color: var(--primary-light);
}

.mm-action-btn.delete:hover {
    background: rgba(244, 63, 94, 0.3);
    color: var(--error);
}

/* 空状态 */
.mindmaps-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.mindmaps-empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.mindmaps-empty h3 {
    font-size: 20px;
    color: var(--text-secondary);
    margin: 0 0 10px 0;
}

.mindmaps-empty p {
    font-size: 14px;
    color: var(--text-muted);
}

/* 导图编辑器 */
.mindmap-editor {
    height: calc(100vh - 180px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-card);
}

.editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--bg-glass);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
}

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

.toolbar-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.toolbar-title input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
    width: 200px;
}

.toolbar-title input:focus {
    outline: none;
}

.toolbar-actions {
    display: flex;
    gap: 10px;
}

.toolbar-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    transition: all var(--transition-fast);
}

.toolbar-btn:hover {
    background: var(--bg-hover);
    color: var(--primary-light);
    border-color: var(--border-glow);
}

.btn-save-map {
    padding: 8px 18px;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-glow);
}

.btn-save-map:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow), 0 6px 20px var(--border-glow);
}

/* 画布 */
.mindmap-canvas {
    width: 100%;
    height: calc(100% - 60px);
    background:
        radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.04) 0%, transparent 50%),
        linear-gradient(var(--bg-glass) 1px, transparent 1px),
        linear-gradient(90deg, var(--bg-glass) 1px, transparent 1px);
    background-size: 100% 100%, 20px 20px, 20px 20px;
    position: relative;
    cursor: grab;
}

.mindmap-canvas:active {
    cursor: grabbing;
}

/* 节点样式 */
.mm-node-item {
    position: absolute;
    padding: 10px 18px;
    background: var(--bg-hover);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    cursor: move;
    transition: box-shadow var(--transition-fast);
    user-select: none;
    backdrop-filter: blur(8px);
}

.mm-node-item:hover {
    box-shadow: var(--shadow-glow);
}

.mm-node-item.root {
    background: var(--gradient-primary);
    border: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 15px;
    padding: 14px 24px;
    box-shadow: var(--shadow-glow), 0 4px 20px var(--border-glow);
}

/* 连接线 */
.mm-connection {
    position: absolute;
    pointer-events: none;
}

.mm-connection line {
    stroke: var(--border-glow);
    stroke-width: 2;
    fill: none;
}

/* 右键菜单 */
.mm-context-menu {
    position: fixed;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 8px 0;
    min-width: 160px;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    z-index: 1000;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.context-item {
    padding: 10px 18px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: background var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 10px;
}

.context-item:hover {
    background: var(--bg-hover);
}

.context-item.danger {
    color: var(--error);
}

.context-item.danger:hover {
    background: rgba(244, 63, 94, 0.15);
}


/* ============================================================
   mindmap 触控修正 + 移动端响应式（原文件无 @media）
   ============================================================ */
.mm-action-btn, .mm-more { width: 40px; height: 40px; min-width: 40px; min-height: 40px; }
.toolbar-btn { width: 40px; height: 40px; min-width: 40px; min-height: 40px; }

@media (max-width: 768px) {
    .mindmaps-grid { grid-template-columns: 1fr; }
    .mindmap-editor { height: calc(100vh - 140px); }
    .editor-toolbar { flex-wrap: wrap; gap: var(--space-2); }
}
