* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
    padding: 20px;
}
.container { max-width: 1400px; margin: 0 auto; }
.header { text-align: center; padding: 30px 0; }
.header h1 { color: #1a1a2e; font-size: 28px; margin-bottom: 8px; }
.header p { color: #666; font-size: 14px; }

/* 流程步骤指示器 */
.flow-steps {
    display: flex; justify-content: center; gap: 0; margin-bottom: 24px;
}
.flow-step {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 20px; font-size: 14px; color: #999;
}
.flow-step .flow-num {
    width: 28px; height: 28px; border-radius: 50%;
    background: #ddd; color: white; display: flex;
    align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px;
}
.flow-step.active { color: #4472C4; font-weight: 600; }
.flow-step.active .flow-num { background: #4472C4; }
.flow-step.done { color: #2e7d32; }
.flow-step.done .flow-num { background: #2e7d32; }
.flow-arrow { color: #ccc; font-size: 20px; margin: 0 4px; }

.card {
    background: white; border-radius: 12px; padding: 32px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08); margin-bottom: 20px;
}
.card-title { font-size: 18px; font-weight: 600; color: #1a1a2e; margin-bottom: 16px; }
.upload-row { display: flex; gap: 20px; margin-bottom: 20px; }
.upload-box {
    flex: 1; border: 2px dashed #d0d0d0; border-radius: 8px; padding: 24px;
    text-align: center; transition: border-color 0.3s; cursor: pointer; position: relative;
}
.upload-box:hover { border-color: #4472C4; }
.upload-box.dragover { border-color: #4472C4; background: #f0f4ff; }
.upload-box .icon { font-size: 36px; margin-bottom: 8px; }
.upload-box .label { font-size: 15px; font-weight: 600; color: #333; margin-bottom: 4px; }
.upload-box .hint { font-size: 12px; color: #999; }
.upload-box .filename {
    margin-top: 8px; font-size: 13px; color: #4472C4;
    font-weight: 500; word-break: break-all;
}
.upload-box input[type="file"] {
    position: absolute; width: 100%; height: 100%; top: 0; left: 0; opacity: 0; cursor: pointer;
}
.btn {
    display: inline-block; padding: 12px 32px; border: none; border-radius: 8px;
    font-size: 15px; font-weight: 600; cursor: pointer; transition: background 0.3s;
}
.btn-primary { background: #4472C4; color: white; }
.btn-primary:hover { background: #365A9E; }
.btn-primary:disabled { background: #ccc; cursor: not-allowed; }
.btn-success { background: #2e7d32; color: white; }
.btn-success:hover { background: #1B5E20; }
.btn-success:disabled { background: #ccc; cursor: not-allowed; }
.btn-warning { background: #f57c00; color: white; }
.btn-warning:hover { background: #e65100; }
.btn-sm { padding: 6px 16px; font-size: 13px; }
.btn-block { display: block; width: 100%; padding: 14px; }

.error-msg {
    display: none; background: #fce4ec; color: #c62828;
    padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px;
}

/* 可编辑表格 — 直观多列模式 */
.edit-toolbar {
    display: flex; gap: 12px; align-items: center; margin-bottom: 12px; flex-wrap: wrap;
}
.edit-toolbar .search-box {
    flex: 1; min-width: 200px; padding: 8px 12px; border: 1px solid #d0d0d0;
    border-radius: 6px; font-size: 13px;
}
.edit-toolbar .filter-btn {
    padding: 6px 14px; border: 1px solid #d0d0d0; border-radius: 6px;
    font-size: 13px; cursor: pointer; background: white; color: #555;
}
.edit-toolbar .filter-btn.active { background: #4472C4; color: white; border-color: #4472C4; }
.edit-table-wrapper { max-height: 700px; overflow: auto; border: 1px solid #e0e0e0; border-radius: 8px; }
table.edit-table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
table.edit-table th {
    background: #4472C4; color: white; padding: 8px 6px;
    text-align: center; font-weight: 600; white-space: nowrap;
    position: sticky; top: 0; z-index: 10;
}
table.edit-table td { padding: 2px; border: 1px solid #e0e0e0; vertical-align: top; }
table.edit-table tr.row-warning { background: #fffde7; }
table.edit-table tr.row-ok { background: white; }
table.edit-table tr.row-manual { background: #e8f5e9; }
table.edit-table tr.row-hidden { display: none; }
table.edit-table td.cell-edit { min-width: 140px; }
table.edit-table td.cell-narrow { width: 60px; }
.row-btn {
    border: 1px solid #4472C4; background: white; color: #4472C4;
    border-radius: 4px; padding: 2px 7px; font-size: 12px;
    cursor: pointer; margin: 0 1px; line-height: 1.4;
}
.row-btn:hover { background: #4472C4; color: white; }
.row-btn-del { border-color: #e53935; color: #e53935; }
.row-btn-del:hover { background: #e53935; color: white; }
table.edit-table textarea {
    width: 100%; border: 1px solid transparent; border-radius: 4px;
    padding: 4px 6px; font-size: 13px; font-family: inherit;
    background: transparent; resize: none; overflow: visible;
    line-height: 1.5; min-height: 60px; transition: min-height 0.15s;
}
table.edit-table textarea:hover {
    border-color: #ccc; background: #fafafa;
}
/* 点击聚焦时放大输入框——不使用position/zIndex避免覆盖相邻列 */
table.edit-table textarea:focus {
    border-color: #4472C4; background: white; outline: none;
    min-height: 120px; resize: vertical; overflow: auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
/* 表格滚动时不误选文字 */
table.edit-table {
    -webkit-user-select: none; -moz-user-select: none; user-select: none;
}
table.edit-table textarea {
    -webkit-user-select: text; -moz-user-select: text; user-select: text;
}
.warning-badge {
    display: inline-block; background: #fff3e0; color: #e65100;
    border: 1px solid #ffb74d; border-radius: 4px;
    padding: 1px 6px; font-size: 10px; margin: 1px; line-height: 1.4;
}
.edit-hint-row {
    font-size: 12px; color: #999; margin-bottom: 8px;
}

.stats-row { display: flex; gap: 16px; margin-bottom: 20px; }
.stat-box { flex: 1; text-align: center; padding: 16px; border-radius: 8px; }
.stat-box.total { background: #e8eaf6; }
.stat-box.fixed { background: #e8f5e9; }
.stat-box.unfixed { background: #fce4ec; }
.stat-box.warning { background: #fff9c4; }
.stat-box .num { font-size: 28px; font-weight: 700; }
.stat-box .label { font-size: 13px; color: #555; margin-top: 4px; }
.stat-box.total .num { color: #3f51b5; }
.stat-box.fixed .num { color: #2e7d32; }
.stat-box.unfixed .num { color: #c62828; }
.stat-box.warning .num { color: #e65100; }

.result-table-wrapper { overflow-x: auto; }
table.result-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.result-table th {
    background: #4472C4; color: white; padding: 10px 12px;
    text-align: center; font-weight: 600; white-space: nowrap;
}
table.result-table td { padding: 8px 12px; border-bottom: 1px solid #e0e0e0; vertical-align: top; }
table.result-table tr:nth-child(even) { background: #fafafa; }
.badge {
    display: inline-block; padding: 2px 10px; border-radius: 12px;
    font-size: 12px; font-weight: 600;
}
.badge-fixed { background: #c8e6c9; color: #2e7d32; }
.badge-unfixed { background: #ffcdd2; color: #c62828; }
.col-seq { width: 50px; text-align: center; }
.col-result { width: 80px; text-align: center; }

/* 进度条遮罩 */
.loading-overlay {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.95); z-index: 9999;
    text-align: center; padding-top: 120px;
}
.loading-content { max-width: 500px; margin: 0 auto; padding: 0 20px; }
.spinner {
    border: 4px solid #e0e0e0; border-top: 4px solid #4472C4;
    border-radius: 50%; width: 48px; height: 48px;
    animation: spin 1s linear infinite; margin: 0 auto 16px;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.loading-text { color: #1a1a2e; font-size: 18px; font-weight: 600; margin-bottom: 24px; }
.progress-bar-container {
    width: 100%; height: 24px; background: #e0e0e0;
    border-radius: 12px; overflow: hidden; margin-bottom: 8px;
}
.progress-bar-fill {
    height: 100%; background: linear-gradient(90deg, #4472C4, #5b9bd5);
    border-radius: 12px; transition: width 0.5s ease;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 12px; font-weight: 600; min-width: 36px;
}
.progress-info { display: flex; justify-content: space-between; font-size: 13px; color: #666; }
.progress-percent { font-weight: 600; color: #4472C4; }
.countdown { color: #999; }
.step-list { text-align: left; margin: 16px 0; }
.step-item {
    display: flex; align-items: center; padding: 6px 0;
    font-size: 14px; color: #999;
}
.step-item.active { color: #4472C4; font-weight: 600; }
.step-item.done { color: #2e7d32; }
.step-item .step-icon { margin-right: 8px; width: 20px; text-align: center; }
.step-item.active .step-icon::before { content: '⟳'; animation: spin 1s linear infinite; display: inline-block; }
.step-item.done .step-icon::before { content: '✓'; }
