/**
 * 上传页面专属样式
 * 包含本页面特有的样式和组件
 */

/* ===== 页面布局 ===== */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px;
}

/* ===== 头部横幅 ===== */
.header-banner {
    background: linear-gradient(to right, #2563eb, #1d4ed8);
    border-radius: 16px 16px 0 0;
    padding: 32px;
    text-align: center;
}

.header-banner h1 {
    color: white;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.header-banner p {
    color: #bfdbfe;
    font-size: 14px;
}

/* ===== 内容区域 ===== */
.content-area {
    background: white;
    border-radius: 0 0 16px 16px;
    padding: 32px 40px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* ===== 步骤指示器 ===== */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
}

.step {
    display: flex;
    align-items: center;
}

.step-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.step-dot.active {
    background-color: #2563eb;
    color: white;
}

.step-dot.inactive {
    background-color: #e2e8f0;
    color: #64748b;
}

.step-line {
    width: 64px;
    height: 4px;
    margin: 0 16px;
    background-color: #e2e8f0;
}

.step-line.active {
    background-color: #2563eb;
}

.step-label {
    margin-left: 8px;
    font-size: 14px;
    font-weight: 500;
}

.step-label.active {
    color: #1e40af;
}

.step-label.inactive {
    color: #94a3b8;
}

/* ===== 区块标题 ===== */
.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.section-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #dbeafe;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.section-hint {
    font-size: 12px;
    color: #94a3b8;
}

/* ===== 上传卡片 ===== */
.upload-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    background: white;
    transition: box-shadow 0.2s ease;
}

.upload-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.upload-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.upload-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background-color: #dbeafe;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.upload-card-icon svg {
    width: 20px;
    height: 20px;
    color: #2563eb;
}

.upload-card-title {
    font-weight: 600;
    color: #1e293b;
}

.upload-card-hint {
    font-size: 12px;
    color: #94a3b8;
    margin-left: 48px;
}

/* ===== 上传区域 ===== */
.upload-dropzone {
    margin-top: 16px;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    background-color: #f8fafc;
    padding: 28px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-dropzone:hover {
    border-color: #2563eb;
    background-color: rgba(37, 99, 246, 0.02);
}

.upload-dropzone svg {
    width: 36px;
    height: 36px;
    color: #60a5fa;
    margin: 0 auto;
}

.upload-dropzone p {
    margin-top: 8px;
    font-size: 14px;
    color: #475569;
    font-weight: 500;
}

/* ===== 文件列表项 ===== */
.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-top: 8px;
}

.file-item-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.file-item-icon {
    width: 16px;
    height: 16px;
    color: #64748b;
    flex-shrink: 0;
}

.file-item-name {
    font-size: 13px;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-item-size {
    font-size: 12px;
    color: #94a3b8;
    flex-shrink: 0;
}

.file-item-action {
    margin-left: 8px;
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.2s ease;
}

.file-item-action:hover {
    color: #ef4444;
}

.file-item-action button {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.2s ease;
}

.file-item-action button:hover {
    color: #ef4444;
}

/* 文件处理中状态 */
.file-processing-text {
    font-size: 12px;
    color: #3b82f6;
    flex-shrink: 0;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 文件提取成功信息 */
.file-item-extract {
    font-size: 12px;
    color: #10b981;
    flex-shrink: 0;
    font-weight: 500;
}

/* 文件提取失败信息 */
.file-item-error {
    font-size: 12px;
    color: #ef4444;
    flex-shrink: 0;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== 文件上传进度条 ===== */
.file-progress-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    min-width: 200px;
}

.file-progress-bar {
    flex: 1;
    height: 6px;
    background-color: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    min-width: 80px;
}

.file-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    border-radius: 3px;
    width: 0%;
    transition: width 0.6s ease-out;
    position: relative;
    overflow: hidden;
}

/* 进度条流光效果 */
.file-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: progress-shimmer 2s ease-in-out infinite;
}

@keyframes progress-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.file-progress-fill.complete {
    background: linear-gradient(90deg, #10b981, #059669);
}

.file-progress-fill.complete::after {
    display: none;
}

.file-progress-fill.error {
    background: #ef4444;
}

.file-progress-text {
    font-size: 11px;
    color: #3b82f6;
    font-weight: 600;
    min-width: 36px;
    text-align: right;
}

.file-progress-text.complete {
    color: #10b981;
}

.file-progress-text.error {
    color: #ef4444;
}

/* 识别中动画指示器 */
.file-progress-recognizing {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 11px;
    color: #3b82f6;
    font-weight: 500;
    white-space: nowrap;
    animation: recognizing-pulse 2s ease-in-out infinite;
}

.file-progress-recognizing.hidden {
    display: none;
}

.recognizing-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background-color: #3b82f6;
    animation: recognizing-bounce 1.4s ease-in-out infinite;
}

.recognizing-dot:nth-child(2) {
    animation-delay: 0.16s;
}

.recognizing-dot:nth-child(3) {
    animation-delay: 0.32s;
}

@keyframes recognizing-bounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

@keyframes recognizing-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* 预览文件列表中的进度条 */
.preview-file-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.preview-file-progress .file-progress-bar {
    min-width: 60px;
}

.preview-file-progress .file-progress-text {
    font-size: 11px;
    min-width: auto;
}

/* ===== AI 解析进度 ===== */
.ai-progress-box {
    margin-top: 20px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
}

.ai-progress-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-progress-icon {
    width: 24px;
    height: 24px;
    color: #3b82f6;
}

.ai-progress-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
}

.ai-progress-bar {
    width: 100%;
    height: 6px;
    background-color: #e2e8f0;
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}

.ai-progress-fill {
    height: 100%;
    background-color: #2563eb;
    transition: width 0.3s ease;
}

/* ===== 证据清单表格 ===== */
.evidence-table {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.evidence-header {
    display: grid;
    grid-template-columns: 48px 1fr 1fr 1fr 80px 100px;
    gap: 8px;
    padding: 12px 16px;
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.evidence-row {
    display: grid;
    grid-template-columns: 48px 1fr 1fr 1fr 80px 100px;
    gap: 8px;
    padding: 16px;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s ease;
}

.evidence-row:hover {
    background-color: #f8fafc;
}

.evidence-row:last-child {
    border-bottom: none;
}

.evidence-index {
    text-align: center;
}

.evidence-index-badge {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    background-color: #f1f5f9;
    color: #475569;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 600;
}

.evidence-name {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    display: block;
}

.evidence-scene {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    display: block;
}

.evidence-format {
    font-size: 12px;
    color: #64748b;
    display: block;
    margin-top: 4px;
}

/* 证据行中的文件处理状态 */
.evidence-file-status {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    font-size: 11px;
    font-weight: 500;
}

.evidence-file-status.processing {
    color: #3b82f6;
}

.evidence-file-status.processing .spin {
    animation: spin 1s linear infinite;
}

.evidence-file-status.done {
    color: #10b981;
}

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

.evidence-desc {
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
}

.evidence-extract {
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
}

.evidence-extract-empty {
    font-size: 12px;
    color: #94a3b8;
}

.evidence-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.evidence-action button {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-upload {
    background-color: #2563eb;
    color: white;
}

.btn-upload:hover {
    background-color: #1d4ed8;
}

.btn-reupload {
    background-color: #f1f5f9;
    color: #334155;
    border-color: #cbd5e1;
}

.btn-reupload:hover {
    background-color: #e2e8f0;
}

.btn-preview {
    background-color: #f8fafc;
    color: #475569;
    border-color: #cbd5e1;
}

.btn-preview:hover {
    background-color: #f1f5f9;
}

.btn-delete {
    background-color: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.btn-delete:hover {
    background-color: #fee2e2;
}

/* ===== 系统核查清单 ===== */
.system-check-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 2px dashed #cbd5e1;
}

.system-check-box {
    background-color: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.system-check-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #4338ca;
}

.system-check-table {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.system-check-grid {
    display: grid;
    grid-template-columns: 48px 1fr 2fr;
    gap: 8px 16px;
    padding: 8px 16px;
    min-width: 600px;
}

.system-check-header {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding-bottom: 6px;
    border-bottom: 1px solid #e2e8f0;
}

.system-check-item {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    padding: 6px 0;
    border-bottom: 1px solid #f1f5f9;
    line-height: 1.4;
}

.system-check-item:last-child {
    border-bottom: none;
}

.system-check-desc {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 400;
}

/* ===== 底部按钮 ===== */
.footer-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-top: 24px;
    border-top: 1px solid #f1f5f9;
}

/* ===== 保存状态 ===== */
.save-status {
    text-align: right;
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 12px;
}

/* ===== 模态框 ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 512px;
    width: 100%;
    padding: 24px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.modal-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #64748b;
}

.modal-close:hover {
    color: #1e293b;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .header-banner {
        padding: 20px 16px;
    }

    .header-banner h1 {
        font-size: 22px;
    }

    .content-area {
        padding: 20px 16px;
    }

    .section-header {
        flex-wrap: wrap;
    }

    .evidence-header,
    .evidence-row {
        grid-template-columns: 40px 1fr;
    }

    .evidence-header > div:nth-child(3),
    .evidence-header > div:nth-child(4),
    .evidence-row > div:nth-child(3),
    .evidence-row > div:nth-child(4) {
        display: none;
    }
}
