/* 文件管理页面样式 - 使用file-前缀避免样式冲突 */

/* 文件页面容器 - 左右布局 */
.file-container {
    margin: 0 auto;
    padding: 50px 0;
    display: flex;
    gap: 30px;
    background-color: #F5F5F6;
}

/* 文件页面内部容器 */
.file-container .wrap {
    display: flex;
    width: 100%;
    margin: 0 auto;
    gap: 30px;
    align-content: flex-start;
    align-items: flex-start;
}

/* 左侧菜单栏 */
.file-sidebar {
    width: 440px;
    border-radius: 4px;
    border: 1px solid #e4e4e4;
    background-color: #fff;
    /* box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08); */
    overflow: hidden;
    flex-shrink: 0;
}

/* 侧边栏标题 */
.sidebar-title {
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    background-color: #204ecf;
    border-radius: 3px;
}

.sidebar-title h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

/* 侧边栏菜单 */
.sidebar-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    padding-bottom: 30px;
    padding-top: 10px;
}

.sidebar-menu .active span {
    font-weight: bold;
}

.menu-item {}

.menu-item:last-child {
    border-bottom: none;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 14px 24px;
    text-decoration: none;
    color: #666;
    transition: all 0.3s ease;
    position: relative;
}

.menu-link:hover {
    color: #1890ff;
    font-weight: bold;
}

.menu-item.active .menu-link {
    color: #1890ff;
    font-weight: bold;
}


.menu-icon {
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.menu-text {
    font-weight: 500;
    font-size: 16px;
}


/* 右侧内容区域 */
.file-content {
    flex: 1;
    background-color: #fff;
    border-radius: 4px;
    min-height: 600px;
    padding: 20px 40px;
    overflow: hidden;
    border: 1px solid #e4e4e4;
}

/* 文件列表头部 */
.file-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
}

.file-list-title h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #151515;
}

.file-count {
    font-size: 13px;
    color: #999;
    margin-left: 8px;
}

.file-list-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.file-search {
    display: flex;
    align-items: center;
    background-color: #f5f5f7;
    border-radius: 6px;
    padding: 6px 12px;
    width: 240px;
}

.search-input {
    border: none;
    background: #f0f0f0;
    outline: none;
    flex: 1;
    font-size: 14px;
    color: #333;
}

.search-input::placeholder {
    color: #999;
}

.search-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #fff;
    padding: 0;
    display: flex;
    align-items: center;
}

.file-operations {
    display: flex;
    gap: 12px;
}

.btn-upload,
.btn-new-folder {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-upload {
    background-color: #1890ff;
    color: white;
}

.btn-upload:hover {
    background-color: #40a9ff;
}

.btn-new-folder {
    background-color: #f0f0f0;
    color: #333;
}

.btn-new-folder:hover {
    background-color: #e0e0e0;
}

/* 文件列表 */
.file-list {
    width: 100%;
}

/* 文件列表标题栏 */
.file-list-header-row {
    display: flex;
    align-items: center;
    padding: 19px 24px;
    background-color: #EFF4FF;
    font-weight: 600;
    font-size: 16px;
    color: #333;
}

.header-icon-cell {
    width: 56px;
    /* 与图标单元格宽度一致 */
}

.header-name-cell {
    flex: 1;
    min-width: 0;
    margin-right: 16px;
}

.header-update-cell {
    width: 100px;
    text-align: center;
    margin-right: 60px;
}

.header-operation-cell {
    width: 140px;
    text-align: left;
}

/* 文件列表项 - 新样式 */
.file-list-item {
    width: 100%;
}

/* 隔行变色 */
.file-list-item:nth-child(even) {
    background-color: #fafafa;
}

.file-item-row {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    transition: background-color 0.2s;
}

.file-item-row:hover {
    background-color: #f8f9fa;
}

/* 文件图标单元格 */
.file-icon-cell {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
}

.file-type-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

/* 文件标题单元格 */
.file-title-cell {
    flex: 1;
    min-width: 0;
    margin-right: 16px;
}

.file-title {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 文件时间单元格 */
.file-time-cell {
    width: 100px;
    text-align: center;
    margin-right: 60px;
}

.file-time {
    font-size: 13px;
    color: #666;
}

/* 文件操作单元格 */
.file-actions-cell {
    display: flex;
    gap: 12px;
    width: 140px;
    justify-content: flex-start;
}

.file-action-btn {
    display: inline-block;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
}

.file-action-btn:hover {
    color: #1890ff;
    text-decoration: underline;
}

.view-btn {
    color: #204ECF;
    border-color: #204ECF;
}

.view-btn:hover {
    color: #204ECF;
    text-decoration: underline;
}

.download-btn {
    color: #204ECF;
    border-color: #204ECF;
}

.download-btn:hover {
    color: #204ECF;
    text-decoration: underline;
}

/* 文件列表项 */
.file-item {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background-color 0.2s;
}

.file-item:hover {
    background-color: #f8f9fa;
}

.file-item.selected {
    background-color: #e6f7ff;
}

.file-checkbox {
    margin-right: 12px;
}

.file-icon {
    width: 40px;
    height: 40px;
    margin-right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.file-icon.folder {
    background-color: #ffeaa7;
    color: #fdcb6e;
}

.file-icon.document {
    background-color: #dfe6e9;
    color: #74b9ff;
}

.file-icon.image {
    background-color: #fab1a0;
    color: #e17055;
}

.file-icon.video {
    background-color: #a29bfe;
    color: #6c5ce7;
}

.file-icon.other {
    background-color: #b2bec3;
    color: #636e72;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 12px;
    color: #999;
}

.file-size,
.file-date {
    white-space: nowrap;
}

.file-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.file-item:hover .file-actions {
    opacity: 1;
}

.action-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.2s;
}

.action-btn:hover {
    background-color: #f0f0f0;
    color: #1890ff;
}

/* 网格视图 */
.file-list.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
    padding: 16px;
}

.file-list.grid-view .file-item {
    flex-direction: column;
    padding: 12px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    text-align: center;
}

.file-list.grid-view .file-checkbox {
    position: absolute;
    top: 8px;
    left: 8px;
}

.file-list.grid-view .file-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
}

.file-list.grid-view .file-info {
    width: 100%;
}

.file-list.grid-view .file-name {
    text-align: center;
    margin-bottom: 8px;
}

.file-list.grid-view .file-meta {
    flex-direction: column;
    gap: 4px;
}

.file-list.grid-view .file-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 0;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    padding: 4px;
}

.file-list.grid-view .file-item {
    position: relative;
}

.file-list.grid-view .file-item:hover .file-actions {
    opacity: 1;
}

.pagination-left {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    text-transform: capitalize;
    margin-top: 20px;
    margin-bottom: 20px;
}

@media screen and (max-width: 1200px) {
    .file-container {
        padding: 40px 30px;
    }

    .file-sidebar {
        width: 260px;
    }

    .file-content {
        padding: 16px 30px;
    }

    .file-time-cell,
    .header-update-cell {
        width: 100px;
        text-align: center;
        margin-right: 20px;
    }
}

@media screen and (max-width: 991px) {
    .file-container {
        padding: 20px 16px;
    }

    .file-time-cell,
    .header-update-cell {
        width: 80px;
        text-align: center;
        margin-right: 10px;
    }


    .file-sidebar {
        width: 260px;
    }

    .file-content {
        padding: 12px 20px;
    }
}

/* 响应式设计 - 移动端适配 */
@media screen and (max-width: 768px) {

    /* 文件页面容器 - 垂直布局 */
    .file-container {
        padding: 20px 0;
    }

    .file-container .wrap {
        flex-direction: column;
        gap: 20px;
    }

    /* 左侧菜单栏 - 折叠为下拉菜单 */
    .file-sidebar {
        width: 100%;
        border-radius: 4px;
    }

    .sidebar-title {
        padding: 15px 20px;
        cursor: pointer;
        position: relative;
    }

    .sidebar-title h3 {
        font-size: 16px;
    }

    .sidebar-title::after {
        content: '+';
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 20px;
        color: #fff;
        transition: transform 0.3s;
    }

    .sidebar-title.active::after {
        transform: translateY(-50%) rotate(45deg);
    }

    .sidebar-menu {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        padding-bottom: 0;
        padding-top: 0;
    }

    .sidebar-menu.show {
        max-height: 500px;
        padding-bottom: 20px;
        padding-top: 10px;
    }

    .menu-link {
        padding: 12px 20px;
    }

    .menu-text {
        font-size: 14px;
    }

    /* 右侧内容区域 */
    .file-content {
        padding: 15px;
    }

    .file-list-title h2 {
        font-size: 16px;
    }

    .file-list-header {

        padding: 12px 10px;
    }

    /* 文件列表标题栏 - 隐藏部分列 */
    .file-list-header-row {
        padding: 12px 15px;
        font-size: 14px;
    }

    .view-btn {
        display: none;
    }

    .header-update-cell {
        display: none;
    }

    .header-operation-cell {
        width: 100px;
        text-align: right;
    }

    /* 文件列表项 - 调整布局 */
    .file-item-row {
        padding: 12px 15px;
        flex-wrap: wrap;
    }

    .file-icon-cell {
        width: 30px;
        height: 30px;
        margin-right: 12px;
    }

    .file-type-icon {
        width: 24px;
        height: 24px;
    }

    .file-title-cell {
        flex: 1;
        margin-right: 0;
        min-width: 0;
    }

    .file-title {
        font-size: 14px;
    }

    .file-time-cell {
        display: none;
    }

    .file-actions-cell {
        width: 100px;
        margin-top: 8px;
        justify-content: flex-end;
    }

    .file-action-btn {
        font-size: 12px;
        padding: 4px 8px;
    }

    /* 分页 - 调整大小 */
    .pagination {
        flex-wrap: wrap;
        gap: 5px;
    }

    .page-btn,
    .page-num {
        font-size: 12px;
        padding: 5px 8px;
        margin: 0 2px;
    }

    .page-jump {
        margin-top: 10px;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
    }

    .page-input {
        width: 40px;
        font-size: 12px;
    }
}

@media screen and (max-width: 480px) {

    /* 更小屏幕优化 */
    .file-content {
        padding: 10px;
    }

    .file-list-header-row {
        padding: 10px;
    }

    .file-item-row {
        padding: 10px;
    }

    .file-title {
        font-size: 13px;
    }

    .file-action-btn {
        font-size: 11px;
        padding: 3px 6px;
    }

    .sidebar-title {
        padding: 12px 15px;
    }

    .sidebar-title h3 {
        font-size: 14px;
    }
}