/* 学习资料页面样式 */

/* 目录树样式 */
.directory-tree {
    height: 500px;
    overflow-y: auto;
}

.tree-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
}

.tree-item:hover {
    background-color: #f8f9fa;
}

.tree-item.active {
    background-color: #e9ecef;
}

.tree-item i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

.tree-item .folder-icon {
    color: #ffc107;
}

.tree-item .file-icon {
    color: #6c757d;
}

.tree-item .file-name {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tree-item .file-actions {
    display: none;
}

.tree-item:hover .file-actions {
    display: block;
}

.tree-item .btn-action {
    padding: 0.1rem 0.3rem;
    font-size: 0.7rem;
    margin-left: 0.2rem;
}

.tree-folder-content {
    margin-left: 20px;
}

/* 上传区域样式 */
.upload-area {
    margin-bottom: 20px;
}

.upload-dropzone {
    border: 2px dashed #dee2e6;
    border-radius: 5px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s;
    background-color: #f8f9fa;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
    border-color: #007bff;
    background-color: rgba(0, 123, 255, 0.05);
}

.upload-progress {
    margin: 20px 0;
}

/* 文件预览样式 */
.file-preview {
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
}

.markdown-content {
    padding: 15px;
}

.markdown-content h1, .markdown-content h2, .markdown-content h3 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.markdown-content p {
    margin-bottom: 1rem;
}

.markdown-content img {
    max-width: 100%;
    height: auto;
}

.markdown-content pre {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
}

.markdown-content code {
    background-color: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
}

.markdown-content blockquote {
    border-left: 4px solid #dee2e6;
    padding-left: 1rem;
    color: #6c757d;
}

/* Markdown编辑器样式 */
.markdown-editor {
    font-family: monospace;
    resize: none;
}

.markdown-preview {
    height: 100%;
    min-height: 400px;
    overflow-y: auto;
    background-color: #fff;
}

/* 响应式调整 */
@media (max-width: 992px) {
    .directory-tree {
        height: 300px;
    }
    
    .file-preview {
        min-height: 200px;
        max-height: 400px;
    }
}