/**
 * 文件管理样式模块
 * 包含：上传区、文件信息卡片、表格预览、工作表选择、拖拽蒙版
 */

/* ==================== 上传区样式 ==================== */

.upload-section {
    margin-bottom: 20px;
}

.upload-area {
    border: 2px dashed #dcdfe6;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background-color: #fafbfc;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: #409eff;
    background-color: #ecf5ff;
}

.upload-area.drag-over {
    border-color: #409eff;
    background-color: #ecf5ff;
    border-style: solid;
}

.upload-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.upload-text {
    margin-bottom: 20px;
}

.upload-title {
    font-size: 16px;
    color: #303133;
    font-weight: 500;
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 13px;
    color: #909399;
}

.btn-upload {
    padding: 10px 24px;
    background-color: #409eff;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-upload:hover {
    background-color: #66b1ff;
}

/* ==================== 文件信息卡片 ==================== */

.file-info {
    border: 1px solid #e4e7ed;
    border-radius: 8px;
    padding: 16px;
    background-color: #ffffff;
}

.file-info-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 16px;
}

.file-icon {
    font-size: 36px;
    margin-right: 12px;
}

.file-details {
    flex: 1;
}

.file-name {
    font-size: 15px;
    font-weight: 600;
    color: #303133;
    margin-bottom: 4px;
    word-break: break-all;
}

.file-meta {
    font-size: 13px;
    color: #909399;
}

.file-actions {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* ==================== 预览区域 ==================== */

/* 区块标题 */
.section-header {
    padding: 12px 0;
    border-bottom: 1px solid #e4e7ed;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #303133;
    margin: 0;
}

.preview-section,
.logs-section {
    margin-top: 20px;
}

/* 工作表选择器 */
.sheet-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sheet-selector label {
    font-size: 13px;
    color: #606266;
    white-space: nowrap;
}

.sheet-select {
    padding: 4px 8px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    font-size: 13px;
    color: #606266;
    background-color: #ffffff;
    cursor: pointer;
    transition: border-color 0.3s;
}

.sheet-select:hover {
    border-color: #c0c4cc;
}

.sheet-select:focus {
    outline: none;
    border-color: #409eff;
}

/* 预览信息 */
.preview-info {
    padding: 8px 0;
    margin-bottom: 12px;
    font-size: 13px;
    color: #909399;
}

/* 预览内容区域 */
.preview-content {
    position: relative;
    min-height: 200px;
}

/* ==================== 预览状态 ==================== */

/* 加载状态 */
.preview-loading {
    text-align: center;
    padding: 60px 20px;
    color: #909399;
}

.loading-spinner {
    font-size: 48px;
    margin-bottom: 12px;
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 错误状态 */
.preview-error {
    text-align: center;
    padding: 60px 20px;
    color: #f56c6c;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* 空状态 */
.preview-empty {
    text-align: center;
    padding: 60px 20px;
}

/* ==================== 表格样式 ==================== */

/* 表格容器 */
.table-wrapper {
    overflow: auto;
    max-height: 500px;
    border: 1px solid #e4e7ed;
    border-radius: 4px;
}

/* 表格样式 */
.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background-color: #ffffff;
}

.preview-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #f5f7fa;
}

.preview-table th {
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    color: #303133;
    border-bottom: 2px solid #e4e7ed;
    border-right: 1px solid #e4e7ed;
    white-space: nowrap;
    background-color: #f5f7fa;
}

.preview-table th:last-child {
    border-right: none;
}

.preview-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #e4e7ed;
    border-right: 1px solid #e4e7ed;
    color: #606266;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-table td:last-child {
    border-right: none;
}

.preview-table tbody tr:hover {
    background-color: #f5f7fa;
}

.preview-table tbody tr:last-child td {
    border-bottom: none;
}

/* ==================== 全局拖拽蒙版 ==================== */

.drag-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(64, 158, 255, 0.1);
    backdrop-filter: blur(2px);
    z-index: 999;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.drag-overlay.show {
    display: flex;
}

.drag-overlay-content {
    background-color: rgba(64, 158, 255, 0.95);
    color: #ffffff;
    padding: 40px 60px;
    border-radius: 12px;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.drag-overlay-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

/* ==================== 对话区内的上传引导卡片 ==================== */

.upload-guide-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    margin: 80px auto;
    max-width: 500px;
    border: 2px dashed #dcdfe6;
    border-radius: 12px;
    background-color: #fafbfc;
    text-align: center;
    transition: all 0.3s;
}

.upload-guide-card:hover {
    border-color: #409eff;
    background-color: #ecf5ff;
}

.upload-guide-icon {
    font-size: 80px;
    margin-bottom: 24px;
    opacity: 0.6;
}

.upload-guide-title {
    font-size: 20px;
    font-weight: 600;
    color: #303133;
    margin-bottom: 12px;
}

.upload-guide-hint {
    font-size: 14px;
    color: #909399;
    margin-bottom: 24px;
}

.btn-upload-guide {
    padding: 12px 32px;
    background-color: #409eff;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(64, 158, 255, 0.3);
}

.btn-upload-guide:hover {
    background-color: #66b1ff;
    box-shadow: 0 4px 12px rgba(64, 158, 255, 0.4);
    transform: translateY(-2px);
}

.btn-upload-guide:active {
    transform: translateY(0);
}

.upload-guide-format {
    font-size: 13px;
    color: #c0c4cc;
    margin-top: 16px;
}

/* 🆕 阶段6.3：单文件限制提示 */
.upload-guide-limit {
    font-size: 12px;
    color: #909399;
    margin-top: 8px;
    font-style: italic;
}

/* ==================== 对话区内的文件预览卡片 ==================== */

.file-preview-card {
    border: 1px solid #e4e7ed;
    border-radius: 8px;
    background-color: #ffffff;
    margin: 20px auto;
    max-width: 90%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.file-preview-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e4e7ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.file-preview-info {
    flex: 1;
    min-width: 0;
}

.file-preview-name {
    font-size: 16px;
    font-weight: 600;
    color: #303133;
    margin-bottom: 8px;
    word-break: break-all;
}

.file-preview-status {
    font-size: 14px;
    color: #67c23a;
    display: flex;
    align-items: center;
    gap: 6px;
}

.file-preview-status.loading {
    color: #409eff;
}

.file-preview-status.error {
    color: #f56c6c;
}

.file-preview-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-preview-action {
    padding: 6px 12px;
    font-size: 13px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    background-color: #ffffff;
    color: #606266;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-preview-action:hover {
    color: #409eff;
    border-color: #c6e2ff;
    background-color: #ecf5ff;
}

.btn-preview-action.btn-danger {
    color: #f56c6c;
}

.btn-preview-action.btn-danger:hover {
    color: #ffffff;
    background-color: #f56c6c;
    border-color: #f56c6c;
}

.file-preview-table-wrapper {
    padding: 16px;
}

.file-preview-table-container {
    max-height: 400px;
    overflow: auto;
    border: 1px solid #e4e7ed;
    border-radius: 4px;
    margin-bottom: 12px;
}

.file-preview-table-container.collapsed {
    max-height: 300px;
}

.btn-expand-table {
    width: 100%;
    padding: 8px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    background-color: #ffffff;
    color: #606266;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-expand-table:hover {
    color: #409eff;
    border-color: #c6e2ff;
    background-color: #ecf5ff;
}

