* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 40px 20px;
    color: #1f2937;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

.card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    padding: 40px;
    transition: transform 0.3s ease;
}

.header {
    text-align: center;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 10px;
}

.subtitle {
    color: #6b7280;
    font-size: 16px;
}

/* 上传区域 */
.upload-area {
    border: 3px dashed #d1d5db;
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f9fafb;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: #3b82f6;
    background: #eff6ff;
}

.upload-icon {
    color: #9ca3af;
    margin-bottom: 20px;
    transition: color 0.3s ease;
}

.upload-area:hover .upload-icon {
    color: #3b82f6;
}

.upload-text {
    font-size: 18px;
    color: #374151;
    margin-bottom: 8px;
}

.browse-link {
    color: #3b82f6;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.browse-link:hover {
    text-decoration: underline;
}

.upload-hint {
    font-size: 14px;
    color: #9ca3af;
}

/* 进度区域 */
.progress-section {
    padding: 30px;
}

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

.progress-title {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
}

.progress-percent {
    font-size: 16px;
    font-weight: 700;
    color: #3b82f6;
}

.progress-bar {
    height: 12px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 6px;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-log {
    font-size: 14px;
    color: #6b7280;
    font-family: 'Monaco', 'Menlo', monospace;
    background: #f3f4f6;
    padding: 12px 16px;
    border-radius: 8px;
}

/* 结果区域 */
.result-section {
    padding: 30px 0;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.result-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #10b981;
}

.result-stats {
    display: flex;
    gap: 10px;
}

.stat-badge {
    background: #e5e7eb;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
}

.stat-badge.success {
    background: #d1fae5;
    color: #059669;
}

/* 表格 */
.table-container {
    overflow-x: auto;
    margin-bottom: 25px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 600px;
}

.preview-table th {
    background: #f3f4f6;
    padding: 14px 12px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    border-bottom: 2px solid #e5e7eb;
}

.preview-table th.new-column {
    background: #dbeafe;
    color: #1d4ed8;
}

.preview-table td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    color: #4b5563;
}

.preview-table tr:hover {
    background: #f9fafb;
}

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

.preview-table .number-cell {
    font-family: 'Monaco', 'Menlo', monospace;
    text-align: right;
}

.preview-table .new-column {
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 600;
}

/* 汇总行样式 */
.preview-table tr.summary-row {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    font-weight: 700;
}

.preview-table tr.summary-row:hover {
    background: linear-gradient(135deg, #fde68a 0%, #fbbf24 100%);
}

.preview-table tr.summary-row td {
    color: #92400e;
    border-top: 3px solid #f59e0b;
    border-bottom: 3px solid #f59e0b;
}

.preview-table tr.summary-row td:first-child {
    border-left: 3px solid #f59e0b;
    border-radius: 8px 0 0 8px;
}

.preview-table tr.summary-row td:last-child {
    border-right: 3px solid #f59e0b;
    border-radius: 0 8px 8px 0;
}

/* 按钮 */
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.btn-secondary {
    background: #f3f4f6;
    color: #4b5563;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

/* 错误区域 */
.error-section {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
}

.error-content svg {
    color: #ef4444;
    margin-bottom: 15px;
}

.error-content p {
    color: #991b1b;
    font-size: 16px;
    margin-bottom: 20px;
}

/* 底部 */
.footer {
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.footer p {
    color: #9ca3af;
    font-size: 14px;
}

.footer a {
    color: #3b82f6;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* 工具类 */
.hidden {
    display: none !important;
}

/* 动画 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.processing {
    animation: pulse 1.5s ease-in-out infinite;
}

/* 响应式 */
@media (max-width: 768px) {
    body {
        padding: 20px 15px;
    }

    .card {
        padding: 25px 20px;
    }

    .header h1 {
        font-size: 24px;
    }

    .upload-area {
        padding: 40px 20px;
    }

    .upload-text {
        font-size: 16px;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}
