/**
 * Files Page Styles
 * 文件管理页面样式
 */

/* ===== 通用类 ===== */
.hidden {
    display: none !important;
}

/* ===== 用户菜单样式 ===== */
.user-dropdown {
    position: absolute;
    top: calc(100% + var(--space-2));
    right: 0;
    min-width: 240px;
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: var(--space-4);
    z-index: 1000;
    animation: fadeInDown 0.2s ease-out;
}

.user-dropdown.hidden {
    display: none;
}

.user-info {
    padding-bottom: var(--space-3);
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.user-email {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-1);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: var(--space-3) 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    font-size: 0.875rem;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
}

.dropdown-item:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.dropdown-item svg {
    opacity: 0.7;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 页面布局 ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-6);
}

/* ===== 模态框基础样式 ===== */
.modal {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000 !important;
    justify-content: center !important;
    align-items: center !important;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex !important;
    animation: fadeIn 0.3s ease-out;
}

.modal.hidden {
    display: none !important;
}

/* 文件详情模态框特定样式 */
#fileDetailsModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1001;
    justify-content: center;
    align-items: center;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

#fileDetailsModal.show {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

#fileDetailsModal.hidden {
    display: none;
}

/* 模态框动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

body.modal-open {
    overflow: hidden;
}

/* ===== 通知样式 ===== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1100;
    animation: slideInRight 0.3s ease-out;
}

.notification.success {
    background-color: var(--success);
    color: white;
}

.notification.error {
    background-color: var(--danger);
    color: white;
}
/* ===== 动画 ===== */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 模态框详细样式 ===== */
.modal-content {
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 600px;
    width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
    border: 1px solid var(--border-color);
    /* 使用简单的相对定位，依靠父级flexbox居中 */
    position: relative;
    margin: 0;
    z-index: 1002;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
}

.modal-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-body {
    padding: 2rem;
    max-height: calc(90vh - 180px);
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
}

.close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    transition: color 0.2s ease;
}

.close:hover {
    color: var(--text-primary);
}

/* ===== 文件详情样式 ===== */
.file-details-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem 2rem;
    margin-bottom: 2rem;
}

.detail-group {
    display: contents;
}

.detail-group label {
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.detail-group span {
    color: var(--text-primary);
    word-break: break-word;
}

/* ===== 状态标签样式 ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge.pending {
    background: rgba(251, 191, 36, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.status-badge.completed {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.status-badge.failed {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-badge.uploading {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* ===== 上传模态框样式 ===== */
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    background-color: var(--bg-secondary);
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 2rem;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--primary);
    background-color: rgba(99, 102, 241, 0.1);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.drop-zone i {
    font-size: 3rem;
    color: var(--primary);
}

.drop-zone h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.drop-zone p {
    margin: 0;
    color: var(--text-secondary);
}

#fileInput {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* ===== 上传队列样式 ===== */
.upload-queue {
    margin-bottom: 2rem;
}

.no-files {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    margin: 0;
}

.upload-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-primary);
    margin-bottom: 0.5rem;
}

.upload-item .file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.upload-item .file-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.upload-item .file-name {
    font-weight: 500;
    color: var(--text-primary);
}

.upload-item .file-size {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.upload-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status.pending {
    background-color: var(--warning-light);
    color: var(--warning-dark);
}

.status.uploading {
    background-color: var(--info-light);
    color: var(--info-dark);
}

.status.completed {
    background-color: var(--success-light);
    color: var(--success-dark);
}

.status.error {
    background-color: var(--danger-light);
    color: var(--danger-dark);
}

.remove-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.remove-btn:hover {
    color: var(--danger);
    background-color: var(--danger-light);
}

.progress-bar {
    width: 100%;
    height: 4px;
    background-color: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary);
    transition: width 0.3s ease;
}

/* ===== 上传选项样式 ===== */
.upload-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option-group label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.option-group select {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: white;
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.option-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    .modal-content {
        width: 95vw;
        margin: 1rem;
    }
    
    .modal-header,
    .modal-footer {
        padding: 1rem 1.5rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .file-details-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .detail-group {
        display: flex;
        justify-content: space-between;
    }
    
    .upload-options {
        grid-template-columns: 1fr;
    }
    
    .drop-zone {
        padding: 2rem 1rem;
    }
}info {
    background-color: var(--info);
    color: white;
}

.notification-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.notification-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    font-size: 1.2rem;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== 加载和空状态样式 ===== */
.loading-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.6;
}

.empty-state h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.empty-state p {
    margin: 0 0 2rem 0;
    color: var(--text-secondary);
}

/* ===== 页面头部 ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.page-title-section {
    flex: 1;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.page-icon {
    color: var(--primary);
    flex-shrink: 0;
}

.page-description {
    margin: 0;
    color: var(--text-secondary);
    font-size: 1rem;
}

.page-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* ===== 工具栏 ===== */
.files-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* 搜索框 */
.search-box {
    position: relative;
    min-width: 300px;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.625rem 0.75rem 0.625rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--background);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: var(--transition-base);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
}

.search-input::placeholder {
    color: var(--text-muted);
}

/* 下拉菜单 */
.filter-dropdown,
.sort-dropdown {
    min-width: 140px;
}

.form-select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--background);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition-base);
}

.form-select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
}

/* 视图选项 */
.view-options {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.view-btn {
    padding: 0.5rem 0.75rem;
    border: none;
    background: var(--background);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-btn:hover {
    background: var(--hover);
    color: var(--text-primary);
}

.view-btn.active {
    background: var(--primary);
    color: white;
}

.view-btn + .view-btn {
    border-left: 1px solid var(--border-color);
}

/* ===== 文件统计 ===== */
.files-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

/* ===== 批量操作 ===== */
.batch-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--primary-light);
    border: 1px solid var(--primary-border);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
}

.batch-info {
    color: var(--primary);
    font-weight: 600;
}

.batch-buttons {
    display: flex;
    gap: 0.75rem;
}

/* ===== 文件容器 ===== */
.files-container {
    position: relative;
    min-height: 400px;
}

/* 网格视图 */
.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

/* 列表视图 */
.files-grid.list-view {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* 列表样式 */
.files-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface);
}

.list-header {
    display: grid;
    grid-template-columns: 50px 1fr 100px 150px 200px;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: rgba(26, 26, 46, 0.5);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.file-row {
    display: grid;
    grid-template-columns: 50px 1fr 100px 150px 200px;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition-base);
    cursor: pointer;
}

.file-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.file-row:last-child {
    border-bottom: none;
}

.file-row.selected {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.1);
}

.file-row.selected:hover {
    background: rgba(99, 102, 241, 0.15);
}

.list-column {
    display: flex;
    align-items: center;
    min-width: 0;
}

.select-column {
    justify-content: center;
}

.name-column {
    font-weight: 500;
}

.file-name-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.file-name-container i {
    color: var(--text-secondary);
    flex-shrink: 0;
}

.file-name-container .file-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.size-column,
.date-column {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.actions-column {
    justify-content: flex-end;
    position: relative;
    z-index: 3;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: var(--transition-base);
    flex-wrap: wrap;
    justify-content: flex-end;
}

.file-row:hover .action-buttons {
    opacity: 1;
}

.action-buttons .action-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    background: var(--background);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    font-size: 12px;
    white-space: nowrap;
    min-height: 32px;
}

.action-buttons .action-btn i {
    font-size: 12px;
    flex-shrink: 0;
}

.action-buttons .action-btn .btn-text {
    font-size: 11px;
    font-weight: 500;
}

.action-buttons .action-btn:hover {
    background: var(--hover);
    color: var(--text-primary);
    border-color: var(--primary-border);
}

/* 查看按钮悬停效果 */
.action-buttons .action-btn:nth-child(1):hover {
    background: var(--info-light);
    color: var(--info);
    border-color: var(--info);
}

/* 下载按钮悬停效果 */
.action-buttons .action-btn:nth-child(2):hover {
    background: var(--success-light);
    color: var(--success);
    border-color: var(--success);
}

/* 重命名按钮悬停效果 */
.action-buttons .action-btn:nth-child(3):hover {
    background: var(--warning-light);
    color: var(--warning);
    border-color: var(--warning);
}

.action-buttons .action-btn.delete:hover {
    background: var(--danger-light);
    color: var(--danger);
    border-color: var(--danger);
}

/* ===== 文件项 ===== */
.file-item {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    cursor: pointer;
    transition: var(--transition-base);
    display: flex;
    flex-direction: column;
    min-height: 200px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.file-item:hover {
    border-color: var(--primary-border);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.file-item.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.15);
    transform: translateY(-1px);
}

.file-item.selected:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 20px rgba(99, 102, 241, 0.2);
    background: rgba(99, 102, 241, 0.15);
}

/* 列表视图的文件项 */
.files-grid.list-view .file-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
}

.file-checkbox {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
    z-index: 2;
}

.file-checkbox input[type="checkbox"] {
    opacity: 0;
    position: absolute;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
    z-index: 3;
}

.file-checkbox label {
    position: absolute;
    top: 0;
    left: 0;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--background);
    cursor: pointer;
    transition: var(--transition-base);
    z-index: 2;
}

.file-checkbox input[type="checkbox"]:checked + label {
    background: var(--primary);
    border-color: var(--primary);
}

.file-checkbox input[type="checkbox"]:checked + label::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.file-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.5rem;
    margin: 1rem auto 1rem auto;
    flex-shrink: 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.files-grid.list-view .file-icon {
    width: 40px;
    height: 40px;
    margin: 0;
    font-size: 1.25rem;
}

/* 文件类型图标颜色 */
.file-icon.pdf { background: linear-gradient(135deg, #e53e3e, #c53030); }
.file-icon.doc { background: linear-gradient(135deg, #3182ce, #2c5aa0); }
.file-icon.txt { background: linear-gradient(135deg, #38a169, #2f855a); }
.file-icon.xls { background: linear-gradient(135deg, #00b894, #00a085); }
.file-icon.default { background: linear-gradient(135deg, #718096, #4a5568); }

.file-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
}

.file-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    word-break: break-word;
    line-height: 1.4;
    text-align: center;
}

.files-grid.list-view .file-name {
    margin-bottom: 0.25rem;
    text-align: left;
}

.file-meta {
    display: flex;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    justify-content: center;
    align-items: center;
}

.files-grid.list-view .file-meta {
    margin-bottom: 0;
    justify-content: flex-start;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
    opacity: 1;
    transition: var(--transition-base);
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    z-index: 3;
    flex-wrap: wrap;
    justify-content: center;
}

.file-item:hover .file-actions,
.files-grid.list-view .file-actions {
    opacity: 1;
}

.file-action-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    background: var(--background);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 12px;
    white-space: nowrap;
    min-height: 36px;
}

.file-action-btn i {
    font-size: 14px;
    flex-shrink: 0;
}

.file-action-btn .btn-text {
    font-size: 12px;
    font-weight: 500;
}

.file-action-btn:hover {
    background: var(--hover);
    color: var(--text-primary);
    border-color: var(--primary-border);
    transform: translateY(-1px);
}

/* 查看按钮悬停效果 */
.file-action-btn:nth-child(1):hover {
    background: var(--info-light);
    color: var(--info);
    border-color: var(--info);
}

/* 下载按钮悬停效果 */
.file-action-btn:nth-child(2):hover {
    background: var(--success-light);
    color: var(--success);
    border-color: var(--success);
}

/* 重命名按钮悬停效果 */
.file-action-btn:nth-child(3):hover {
    background: var(--warning-light);
    color: var(--warning);
    border-color: var(--warning);
}

.file-action-btn.danger:hover {
    background: var(--danger-light);
    color: var(--danger);
    border-color: var(--danger);
}

/* ===== 空状态 ===== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.6;
}

.empty-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.empty-description {
    color: var(--text-secondary);
    margin: 0 0 2rem 0;
    font-size: 1rem;
}

/* ===== 加载状态 ===== */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

/* ===== 分页 ===== */
.pagination-container {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.pagination-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-base);
    font-size: 0.875rem;
    min-width: 2.5rem;
    text-align: center;
}

.pagination-btn:hover:not(.disabled) {
    background: var(--hover);
    color: var(--text-primary);
    border-color: var(--primary-border);
}

.pagination-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-ellipsis {
    padding: 0.5rem 0.25rem;
    color: var(--text-muted);
}

/* ===== 上传相关样式 ===== */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-base);
    margin-bottom: 1.5rem;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-icon {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.upload-area.drag-over .upload-icon {
    color: var(--primary);
}

.upload-text p {
    margin: 0.25rem 0;
    color: var(--text-secondary);
}

.upload-link {
    color: var(--primary);
    font-weight: 600;
}

.upload-hint {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.upload-queue {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.queue-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
}

.queue-list {
    max-height: 200px;
    overflow-y: auto;
}

.queue-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
}

.queue-item-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.queue-item-content {
    flex: 1;
    min-width: 0;
}

.queue-item-name {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item-size {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.queue-item-progress {
    width: 60px;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
}

.queue-item-progress-bar {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
}

.queue-item-remove {
    padding: 0.25rem;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition-base);
    flex-shrink: 0;
}

.queue-item-remove:hover {
    background: var(--danger-light);
    color: var(--danger);
}

/* ===== 文件详情模态框 ===== */
.modal-large {
    max-width: 800px;
}

.modal-small {
    max-width: 400px;
}

.file-details {
    display: grid;
    gap: 1.5rem;
}

.detail-section {
    padding: 1.5rem;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.detail-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.detail-value {
    color: var(--text-primary);
    font-weight: 500;
}

/* ===== 响应式设计 ===== */
@media (max-width: 1024px) {
    .files-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .files-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .toolbar-left {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        min-width: auto;
    }

    .files-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .stat-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .batch-actions {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .batch-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }

    .files-grid {
        grid-template-columns: 1fr;
    }

    .files-grid.list-view .file-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .files-grid.list-view .file-icon {
        align-self: center;
    }

    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.5rem;
    }

    .file-item {
        padding: 1rem;
    }

    .file-meta {
        flex-direction: column;
        gap: 0.25rem;
    }

    .upload-area {
        padding: 2rem 1rem;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== 动画 ===== */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-item {
    animation: fadeIn 0.3s ease-out;
}

/* ===== 辅助功能 ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .file-item {
        border-width: 2px;
    }
    
    .file-item:hover {
        border-width: 3px;
    }
    
    .btn {
        border-width: 2px;
    }
}

/* ===== 操作按钮响应式优化 ===== */
@media (max-width: 1200px) {
    .file-action-btn .btn-text,
    .action-buttons .action-btn .btn-text {
        display: none;
    }
    
    .file-action-btn,
    .action-buttons .action-btn {
        padding: 0.5rem;
        width: 36px;
        min-height: 36px;
    }
    
    .action-buttons .action-btn {
        width: 32px;
        min-height: 32px;
    }
    
    .action-buttons {
        gap: 0.25rem;
    }
    
    .file-actions {
        gap: 0.25rem;
        justify-content: space-between;
    }
    
    .list-header {
        grid-template-columns: 50px 1fr 100px 130px 160px;
    }
    
    .file-row {
        grid-template-columns: 50px 1fr 100px 130px 160px;
    }
}