/* 全局样式 */
html, body {
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.h-100 {
    height: 100vh !important;
}

/* 侧边栏样式 */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    flex-shrink: 0;
}

.sidebar-nav {
    flex-grow: 1;
}

.sidebar-footer {
    flex-shrink: 0;
    margin-top: auto;
}

/* 主内容区样式 */
.main-content {
    margin-left: 16.66667%; /* 对应col-md-2 */
    height: 100vh;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
    }
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .sidebar.show {
        transform: translateX(0);
    }
}

/* 文件网格样式 */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    padding: 1rem 0;
}

.file-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px 10px;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8f9fa;
    text-decoration: none;
    color: inherit;
}

.file-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: inherit;
}

.file-item.selected {
    background: #e3f2fd;
}

/* CMP文件特殊样式 */
.file-item.cmp-file {
    background: linear-gradient(135deg, #f8f9ff 0%, #e3f2fd 100%);
}

.file-item.cmp-file:hover {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    transform: translateY(-2px);
}

.cmp-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
}

.file-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    color: #6c757d;
}

.file-icon.folder {
    color: #ffc107;
}

.file-icon.image {
    color: #28a745;
}

.file-icon.document {
    color: #007bff;
}

.file-icon.archive {
    color: #6f42c1;
}

.file-name {
    font-size: 0.875rem;
    text-align: center;
    word-break: break-word;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.file-size {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* 列表视图样式 */
.file-list {
    display: none;
}

.file-list.active {
    display: block;
}

.file-list-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #dee2e6;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

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

.file-list-item.selected {
    background-color: #e3f2fd;
}

.file-list-icon {
    width: 40px;
    text-align: center;
    margin-right: 1rem;
    font-size: 1.5rem;
}

.file-list-info {
    flex-grow: 1;
}

.file-list-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.file-list-meta {
    font-size: 0.875rem;
    color: #6c757d;
}

.file-list-actions {
    display: flex;
    gap: 0.5rem;
}

/* 面包屑导航 */
.breadcrumb-item a {
    text-decoration: none;
    color: #000000;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

/* 上传区域 */
.upload-zone {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: all 0.2s ease;
    margin-bottom: 1rem;
}

.upload-zone.dragover {
    border-color: #007bff;
    background-color: #f0f8ff;
}

.upload-zone:hover {
    border-color: #007bff;
}

/* 右键菜单 */
.context-menu {
    position: fixed;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    min-width: 150px;
    display: none;
}

.context-menu-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f8f9fa;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.context-menu-item:last-child {
    border-bottom: none;
}

.context-menu-item.danger:hover {
    background-color: #f8d7da;
    color: #721c24;
}

/* 加载动画 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.spinner {
    width: 2rem;
    height: 2rem;
    border: 1px solid #f3f3f3;
    border-top: 1px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 进度条 */
.upload-progress {
    margin-top: 1rem;
}

.progress {
    height: 8px;
    border-radius: 4px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .file-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.75rem;
    }
    
    .file-item {
        padding: 0.75rem 0.5rem;
    }
    
    .file-icon {
        font-size: 2.5rem;
    }
    
    .file-name {
        font-size: 0.8rem;
    }
}

/* 工具提示 */
.tooltip {
    font-size: 0.875rem;
}

/* 搜索结果高亮 */
.search-highlight {
    background-color: #fff3cd;
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
}

/* 空状态样式 */
.empty-state {
    color: #6c757d;
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state i {
    opacity: 0.5;
}

/* 文件类型图标颜色 */
.file-type-pdf { color: #dc3545; }
.file-type-doc { color: #007bff; }
.file-type-xls { color: #28a745; }
.file-type-ppt { color: #fd7e14; }
.file-type-zip { color: #6f42c1; }
.file-type-image { color: #20c997; }
.file-type-video { color: #e83e8c; }
.file-type-audio { color: #6610f2; }
.file-type-code { color: #343a40; }
