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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 20px;
}

/* 标题 */
.header {
    text-align: center;
    margin-bottom: 32px;
}

.header h1 {
    font-size: 28px;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.header .subtitle {
    color: #666;
    font-size: 15px;
}

/* 上传区域 */
.upload-section {
    margin-bottom: 32px;
}

.upload-zone {
    border: 2px dashed #c0c4cc;
    border-radius: 12px;
    padding: 48px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: #5470c6;
    background: #f0f5ff;
}

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

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

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

/* 上传状态 */
.upload-status[hidden] {
    display: none !important;
}

.upload-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    margin-top: 16px;
    background: #e6f7ff;
    border-radius: 8px;
    color: #1890ff;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #1890ff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* 错误信息 */
.error-msg[hidden] {
    display: none !important;
}

.error-msg {
    margin-top: 16px;
    padding: 12px 16px;
    background: #fff2f0;
    border: 1px solid #ffccc7;
    border-radius: 8px;
    color: #cf1322;
    font-size: 14px;
}

/* 统计卡片 */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.stats-cards.centered {
    grid-template-columns: repeat(3, 1fr);
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.card-label {
    font-size: 13px;
    color: #888;
    margin-bottom: 8px;
}

.card-value {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
    white-space: nowrap;
}


/* 图表区域 */
.charts-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 32px;
}

.chart-wrapper {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.chart-wrapper h3 {
    font-size: 15px;
    color: #333;
    margin-bottom: 12px;
}

.chart {
    width: 100%;
    height: 320px;
}

/* 表格区域 */
.table-section {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 32px;
}

.table-section h3 {
    font-size: 15px;
    color: #333;
    margin-bottom: 16px;
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    table-layout: fixed;
}

thead th {
    background: #f8f9fa;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #e8e8e8;
    white-space: nowrap;
}

thead th:nth-child(1) {
    width: 25%;
}

thead th:nth-child(2) {
    width: 30%;
}

thead th:nth-child(3),
thead th:nth-child(4) {
    width: 22.5%;
    text-align: right;
}

tbody td,
tfoot td {
    padding: 10px 16px;
    border-bottom: 1px solid #f0f0f0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

tbody tr:hover {
    background: #f8faff;
}

td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

tfoot .total-row {
    background: #f0f5ff;
}

tfoot .total-row td {
    border-bottom: none;
    border-top: 2px solid #5470c6;
}

/* 下载按钮 */
.download-section {
    text-align: center;
    margin-bottom: 40px;
}

.btn-download {
    display: inline-block;
    padding: 14px 32px;
    background: #5470c6;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    transition: background 0.3s;
}

.btn-download:hover {
    background: #3e5bb5;
}

/* 响应式 */
@media (max-width: 768px) {
    .charts-section {
        grid-template-columns: 1fr;
    }

    .stats-cards {
        grid-template-columns: repeat(3, 1fr);
    }


    .chart {
        height: 260px;
    }

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

@media (max-width: 480px) {
    .stats-cards {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 16px 12px;
    }
}

/* ===== 合并到日报表页面样式 ===== */

.back-link {
    display: inline-block;
    margin-top: 12px;
    color: #5470c6;
    text-decoration: none;
    font-size: 14px;
}

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

/* 合并上传区域 */
.merge-section {
    margin-bottom: 32px;
    text-align: center;
}

.merge-uploads {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.merge-uploads.merge-uploads-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.merge-upload-box {
    border: 2px dashed #c0c4cc;
    border-radius: 12px;
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    position: relative;
}

.merge-upload-box:hover,
.merge-upload-box.dragover {
    border-color: #5470c6;
    background: #f0f5ff;
}

.merge-upload-box.has-file {
    border-color: #52c41a;
    background: #f6ffed;
}

.merge-upload-box .upload-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.merge-upload-box .upload-text {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
}

.merge-upload-box .upload-hint {
    font-size: 12px;
    color: #999;
}

/* 已选文件显示 */
.file-selected {
    margin-top: 12px;
    padding: 8px 12px;
    background: #e6f7e6;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.file-selected[hidden] {
    display: none !important;
}

.file-name-text {
    font-size: 13px;
    color: #333;
    word-break: break-all;
}

.file-remove {
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
}

.file-remove:hover {
    background: #ffd6d6;
    color: #cf1322;
}

/* 合并按钮 */
.btn-merge {
    padding: 14px 48px;
    font-size: 16px;
    font-weight: 500;
    background: #5470c6;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-merge:hover:not(:disabled) {
    background: #3e5bb5;
}

.btn-merge:disabled {
    background: #c0c4cc;
    cursor: not-allowed;
}

/* 状态徽章 */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.success {
    background: #e6f7e6;
    color: #389e0d;
}

.status-badge.id-match {
    background: #e6f0ff;
    color: #1d39c4;
}

.status-badge.fuzzy-match {
    background: #fff7e6;
    color: #d46b08;
}

/* 成功/警告卡片 */
.success-card .card-value {
    color: #389e0d;
}

.warning-card .card-value {
    color: #cf1322;
}

/* 未匹配列表 */
.unmatched-list {
    list-style: none;
    padding: 0;
}

.unmatched-list li {
    padding: 8px 12px;
    background: #fffbe6;
    border: 1px solid #ffe58f;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #614700;
}

/* 合并页面匹配明细表 */
#mergeResultSection table {
    table-layout: auto;
}

#mergeResultSection thead th {
    width: auto;
    text-align: left;
}

#mergeResultSection tbody td {
    text-align: left;
}

/* 合并页面响应式 */
@media (max-width: 768px) {
    .merge-uploads,
    .merge-uploads.merge-uploads-3 {
        grid-template-columns: 1fr;
    }
}
