/**
 * 审核面板 - 上传弹窗兼容样式（自 style.css 迁出）
 * 含：.upload-modal、选项卡、自动重命名、进度区
 * 字体：Microsoft YaHei
 */

/* 文件上传对话框样式 */
.upload-modal {
    max-width: 520px;
    max-height: calc(85vh + 30px);
    padding: 0;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-primary);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.upload-modal-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-secondary);
}

.upload-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
}

.upload-modal-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 选项卡样式 */
.upload-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 0;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-primary);
}

.upload-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.upload-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.upload-tab.active {
    background: var(--gradient-primary);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.upload-tab .tab-icon {
    font-size: 14px;
    line-height: 1;
}

.upload-tab .tab-text {
    font-size: 13px;
}

/* 选项卡内容区域 */
.upload-tab-content {
    position: relative;
    min-height: 100px;
    flex-shrink: 0; /* 防止被压缩，确保预览文件名区域始终可见 */
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.tab-pane.active {
    display: block;
}

/* 自动重命名设置 */
.auto-rename-settings {
    background: var(--bg-hover);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 16px;
    flex-shrink: 0; /* 防止被压缩，确保设置区域完整显示 */
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.auto-rename-settings .input-group {
    margin-bottom: 0;
}

.auto-rename-settings .input-group label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
}

.auto-rename-settings .input-group input,
.auto-rename-settings .input-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    outline: none;
    transition: all 0.2s ease;
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.auto-rename-settings .input-group input:focus,
.auto-rename-settings .input-group select:focus {
    border-color: var(--border-accent);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
    background: var(--bg-card);
}

.auto-rename-settings input[readonly] {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: not-allowed;
}

.auto-rename-settings select {
    cursor: pointer;
}

.preview-filename {
    margin-top: 12px;
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-sm);
    flex-shrink: 0; /* 防止被压缩，确保预览文件名区域始终可见 */
    min-height: 60px; /* 设置最小高度，确保有足够空间显示内容 */
}

.preview-filename label {
    display: block;
    color: var(--text-accent);
    font-weight: 600;
    font-size: 12px;
    margin-bottom: 6px;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
}

.filename-preview {
    color: var(--text-primary);
    font-size: 12px;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    word-break: break-all;
    padding: 6px 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-primary);
    line-height: 1.4;
    min-height: 32px; /* 设置最小高度，确保文件名有足够显示空间 */
    display: block; /* 确保作为块级元素显示 */
}

/* 直接上传信息 */
.direct-upload-info {
    padding: 20px;
    text-align: center;
    background: var(--bg-hover);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
}

.direct-upload-info p {
    color: var(--text-secondary);
    font-size: 13px;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    margin: 0;
}

.file-upload-area {
    margin-bottom: 0;
    min-height: 100px;
    flex-shrink: 1; /* 允许收缩，但优先保证上方内容完整显示 */
}

.upload-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-primary);
    background: var(--bg-secondary);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.upload-modal-footer .btn {
    padding: 8px 20px;
    font-size: 13px;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: all 0.2s ease;
}


/* 上传进度区域样式 */
.upload-progress-section {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 0;
    margin-bottom: 0;
    border-radius: 10px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 4px;
}

.progress-text #uploadStatusText,
.progress-text #folderUploadStatusText {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
}

.progress-text #uploadPercentage,
.progress-text #folderUploadPercentage {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-accent);
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
}

.progress-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    font-size: 11px;
    color: var(--text-secondary);
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
}

.progress-bar-container {
    width: 100%;
    margin: 8px 0;
}

.progress-bar-container .progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--text-accent), #4CAF50);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.upload-file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-secondary);
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
}

.upload-file-info #currentUploadFile,
.upload-file-info #folderUploadCurrentFile {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 12px;
}

.upload-file-info #uploadFileCount,
.upload-file-info #folderUploadFileCount {
    font-weight: 500;
    color: var(--text-primary);
}
