/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 容器样式 */
.container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* 左侧侧边栏样式 */
.sidebar {
    width: 300px;
    background-color: #fff;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.08);
}

/* 侧边栏头部样式 */
.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid #e0e0e0;
    background-color: #fafafa;
}

.sidebar-header h1 {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

/* 文件树容器样式 */
.file-tree-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
}

/* 文件树样式 */
.file-tree {
    list-style: none;
    padding: 0 16px;
}

.file-tree ul {
    list-style: none;
    padding-left: 20px;
}

.file-tree li {
    margin: 4px 0;
}

/* 节点样式 */
.tree-node {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.tree-node:hover {
    background-color: #f0f0f0;
}

.tree-node.active {
    background-color: #e3f2fd;
    color: #1976d2;
}

/* 目录节点样式 */
.directory-node {
    font-weight: 500;
}

/* 文件节点样式 */
.file-node {
    color: #666;
}

/* 展开/折叠按钮样式 */
.toggle-btn {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #999;
    transition: transform 0.2s ease;
}

.toggle-btn.expanded {
    transform: rotate(90deg);
}

/* 图标样式 */
.node-icon {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    display: inline-block;
    text-align: center;
    font-size: 12px;
}

.directory-icon::before {
    content: "📁";
}

.file-icon::before {
    content: "📄";
}

/* 右侧主内容区样式 */
.main-content {
    flex: 1;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 欢迎信息样式 */
.welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #666;
    background-color: #fafafa;
}

.welcome h2 {
    font-size: 28px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 16px;
}

.welcome p {
    font-size: 16px;
    color: #999;
}

/* Vditor容器样式 */
.vditor-container {
    flex: 1;
    overflow: hidden;
    padding: 20px;
}

/* Vditor样式 */
.vditor {
    height: 100%;
    overflow: auto;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 250px;
    }
    
    .sidebar-header h1 {
        font-size: 18px;
    }
    
    .vditor-container {
        padding: 10px;
    }
}