/* 全局样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
}

/* 导航栏样式 */
.navbar-brand {
    font-weight: 600;
}

/* 主内容区域 */
@media (min-width: 992px) {
    .main-content {
        display: flex;
        gap: 20px;
        align-items: flex-start;
    }
    
    /* 树状结构区域 - 桌面端固定宽度 */
    .tree-column {
        flex: 0 0 320px;
        position: sticky;
        top: 90px;
        max-height: calc(100vh - 150px);
        overflow-y: auto;
    }
    
    /* 内容区域 - 桌面端自适应 */
    .content-column {
        flex: 1;
        min-width: 0; /* 防止内容溢出 */
    }
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 20px;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.card-header {
    border-radius: 10px 10px 0 0 !important;
    font-weight: 600;
    padding: 15px 20px;
}

/* 树形结构样式 */
.file-tree {
    padding: 15px;
    font-size: 15px;
}

.file-tree ul {
    list-style-type: none;
    padding-left: 0;
    margin-bottom: 0;
}

.file-tree li {
    position: relative;
    padding: 5px 0;
    margin: 3px 0;
}

/* 文件夹样式 */
.btn-toggle {
    padding: 6px 10px;
    margin: 2px 0;
    background-color: rgba(13, 110, 253, 0.08);
    color: #0d6efd;
    font-weight: 500;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
}

.btn-toggle:hover {
    background-color: rgba(13, 110, 253, 0.15);
    color: #0a58ca;
}

.btn-toggle:focus {
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

.btn-toggle i {
    margin-right: 8px;
    transition: transform 0.3s ease;
}

.btn-toggle[aria-expanded="true"] i.bi-folder {
    transform: rotate(0deg);
}

.btn-toggle[aria-expanded="false"] i.bi-folder {
    transform: rotate(0deg);
}

/* 文件链接样式 */
.file-tree a {
    padding: 6px 10px 6px 30px;
    margin: 2px 0;
    display: block;
    color: #495057;
    border-radius: 5px;
    transition: all 0.2s ease;
    text-decoration: none;
    position: relative;
}

.file-tree a:hover {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.file-tree a i {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
}

/* 折叠内容样式 */
.collapse {
    padding-left: 20px;
    transition: height 0.3s ease;
}

/* 响应式调整 */
@media (max-width: 991px) {
    .tree-column {
        max-height: 400px;
        overflow-y: auto;
        margin-bottom: 20px;
    }
}

@media (max-width: 768px) {
    .card {
        margin-bottom: 15px;
    }
    
    .file-tree {
        padding: 10px;
        font-size: 14px;
    }
    
    .btn-toggle, .file-tree a {
        padding: 8px 10px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.collapse.show {
    animation: fadeIn 0.3s ease;
}

/* 文件夹打开/关闭图标动画 */
.bi-folder, .bi-folder2-open {
    transition: transform 0.2s ease;
}

/* 页脚样式 */
footer {
    margin-top: 40px;
    border-top: 1px solid #e9ecef;
}

/* 文件查看时的布局优化 */
.file-viewing .tree-column {
    display: block !important;
}

/* 确保在文件查看时树状结构仍然可见 */
@media (min-width: 992px) {
    .file-viewing .content-column {
        flex: 1;
        min-width: 0;
    }
}