/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    background: #f5f7fa;
    color: #333;
    height: 100vh;
    overflow: hidden;
}

/* 工具栏 */
.toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.left-tools, .right-tools {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tool-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    color: #555;
}

.tool-btn:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.search-container {
    position: relative;
}

#search-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    width: 200px;
    transition: all 0.3s;
}

.auto-save-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 14px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

#save-icon {
    color: #2ed573;
}

/* 汉堡菜单 */
.hamburger-menu {
    position: fixed;
    top: 70px;
    right: 20px;
    width: 280px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    padding: 20px;
    display: none;
    flex-direction: column;
    gap: 15px;
    z-index: 1001;
}

.menu-section h3 {
    color: #555;
    font-size: 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-item {
    width: 100%;
    padding: 10px 15px;
    text-align: left;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
}

.menu-item:hover {
    background: #f8f9fa;
}

/* 思维导图容器 */
.mindmap-container {
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    background: #fff;
}

.connections-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.nodes-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* 节点样式 */
.mindmap-node {
    position: absolute;
    min-width: 120px;
    min-height: 40px;
    background: white;
    border: 2px solid #4dabf7;
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.mindmap-node:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-color: #339af0;
}

.node-text {
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    word-break: break-word;
    max-width: 150px;
}

/* 标记图标 */
.marker-icons {
    position: absolute;
    bottom: 5px;
    right: 5px;
    display: flex;
    gap: 3px;
}

.marker-icon {
    font-size: 12px;
    color: #ff6b6b;
}

.ending-icon {
    position: absolute;
    top: 5px;
    left: 5px;
    color: #ffd700;
}

/* 上下文菜单 */
.context-menu {
    position: fixed;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    padding: 10px 0;
    min-width: 200px;
    display: none;
    z-index: 1002;
}

.context-item {
    width: 100%;
    padding: 10px 20px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.context-item:hover {
    background: #f8f9fa;
}

.menu-header {
    padding: 10px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
}

/* 暗色主题 */
body.dark-theme {
    background: #1a1a2e;
    color: #f8f9fa;
}

body.dark-theme .toolbar {
    background: #16213e;
}

body.dark-theme .mindmap-node {
    background: #16213e;
    border-color: #0ea5e9;
    color: #f8f9fa;
}

body.dark-theme .context-menu,
body.dark-theme .hamburger-menu,
body.dark-theme .modal-content {
    background: #16213e;
    color: #f8f9fa;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .toolbar {
        padding: 10px;
    }
    
    .tool-btn {
        width: 36px;
        height: 36px;
    }
    
    #search-input {
        width: 150px;
    }
    
    .mindmap-node {
        min-width: 100px;
        min-height: 35px;
        padding: 8px;
    }
    
    .node-text {
        font-size: 13px;
        max-width: 120px;
    }
    
    .hamburger-menu {
        width: 90%;
        right: 5%;
    }
}