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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #e0e7ff 0%, #f1f5f9 50%, #ecfdf5 100%);
    min-height: 100vh;
    padding: 24px 16px 60px;
    color: #1e293b;
}

.page-wrapper {
    max-width: 880px;
    margin: 0 auto;
}

/* ========== Header ========== */
.header {
    text-align: center;
    margin-bottom: 24px;
    position: relative;
}
.header h1 {
    font-size: 1.8rem;
    color: #1e293b;
    margin-bottom: 6px;
}
.header .subtitle {
    color: #64748b;
    font-size: 0.9rem;
}
.back-link {
    position: absolute;
    left: 0;
    top: 4px;
    color: #64748b;
    text-decoration: none;
    font-size: 0.95rem;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all .2s;
}
.back-link:hover { background: rgba(59,130,246,.1); color: #3b82f6; }

/* ========== Card 通用 ========== */
.card {
    background: #fff;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 24px rgba(30,41,59,.08);
    margin-bottom: 20px;
}
.card-title {
    font-size: 1.05rem;
    margin-bottom: 16px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ========== 上传区 ========== */
.upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    background: #f8fafc;
}
.upload-area:hover { border-color: #3b82f6; background: #eff6ff; }
.upload-area.drag-over {
    border-color: #3b82f6;
    background: #dbeafe;
    transform: scale(1.01);
}
.upload-icon { font-size: 3rem; margin-bottom: 12px; }
.upload-main { font-size: 1.05rem; font-weight: 600; color: #334155; }
.upload-sub  { font-size: 0.82rem; color: #94a3b8; margin-top: 6px; }

.upload-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    gap: 12px;
    flex-wrap: wrap;
}
.upload-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    font-size: 0.88rem;
    cursor: pointer;
}
.checkbox-label input { accent-color: #3b82f6; }

/* 文件列表 */
.file-list { margin-top: 12px; }
.file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f1f5f9;
    border-radius: 10px;
    margin-bottom: 6px;
    font-size: 0.88rem;
}
.file-name { flex: 1; color: #334155; }
.file-size { color: #64748b; min-width: 70px; text-align: right; }
.file-remove {
    color: #ef4444;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 6px;
    transition: all .15s;
}
.file-remove:hover { background: #fee2e2; }

/* ========== 按钮 ========== */
.btn {
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary   { background: #3b82f6; color: #fff; }
.btn-primary:hover:not(:disabled)   { background: #2563eb; transform: translateY(-1px); }
.btn-secondary { background: #6366f1; color: #fff; }
.btn-secondary:hover:not(:disabled) { background: #4f46e5; transform: translateY(-1px); }
.btn-success   { background: #10b981; color: #fff; }
.btn-success:hover:not(:disabled)   { background: #059669; transform: translateY(-1px); }
.btn-ghost     { background: #f1f5f9; color: #475569; }
.btn-ghost:hover:not(:disabled)     { background: #e2e8f0; }
.btn-sm        { padding: 6px 12px; font-size: 0.82rem; }
.btn-full      { width: 100%; justify-content: center; padding: 12px; }

/* ========== 消息提示 ========== */
.msg { margin-top: 12px; font-size: 0.88rem; min-height: 20px; }
.msg.info    { color: #3b82f6; }
.msg.success { color: #10b981; }
.msg.error   { color: #ef4444; }

/* ========== 结果区 ========== */
.result-area { animation: fadeIn .3s ease; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ========== 统计网格 ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
@media (min-width: 640px) {
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
}
.stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 18px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 12px rgba(30,41,59,.06);
    border: 1px solid #f1f5f9;
}
.stat-card.highlight {
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    color: #fff;
    border: none;
    box-shadow: 0 8px 20px rgba(59,130,246,.25);
}
.stat-card.highlight .stat-label,
.stat-card.highlight .stat-num { color: #fff; }
.stat-icon { font-size: 1.8rem; }
.stat-body { flex: 1; min-width: 0; }
.stat-num {
    font-size: 1.7rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.1;
}
.stat-label {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 4px;
}

/* ========== 筛选区 ========== */
.filter-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}
.filter-item { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 140px; }
.filter-item label { font-size: 0.85rem; color: #64748b; }
.filter-item input[type="date"] {
    padding: 9px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: inherit;
    color: #1e293b;
    background: #f8fafc;
}
.filter-item input[type="date"]:focus {
    outline: none;
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.filter-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.export-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed #e2e8f0;
}
.export-row .checkbox-label { margin-left: auto; }

/* ========== 每日明细表格 ========== */
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid #f1f5f9; }
.daily-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.daily-table thead th {
    background: #f8fafc;
    padding: 10px 12px;
    text-align: center;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
    border-bottom: 1px solid #e2e8f0;
}
.daily-table tbody td {
    padding: 9px 12px;
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
    white-space: nowrap;
}
.daily-table tbody tr:hover { background: #f8fafc; }
.daily-table .ok  { color: #059669; font-weight: 600; }
.daily-table .bad { color: #dc2626; font-weight: 600; }

/* ========== 原始预览 ========== */
.raw-preview {
    background: #0f172a;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 12px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.78rem;
    max-height: 300px;
    overflow: auto;
    margin-top: 12px;
    white-space: pre;
}

/* ========== 底部 ========== */
.footer {
    text-align: center;
    padding: 20px 16px 10px;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    color: #94a3b8;
    font-size: 0.78rem;
}
