/* ============================================================
   增值评价分析系统 - 科任老师版
   样式：沿用同级 HeadTeacher（班主任版）的设计（弹窗、视图卡片、
   图标、重点列着色等），保持两版界面风格一致。
   ============================================================ */
* {
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, 'Microsoft YaHei', sans-serif;
}
body {
    background: #f0f4f9;
    margin: 20px;
    display: flex;
    justify-content: center;
}
.container {
    max-width: 98vw;
    width: 100%;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.07);
    padding: 30px 35px;
    overflow-x: hidden;
}
h1 {
    font-size: 32px;
    font-family: 'Georgia', 'Times New Roman', serif;
    color: #1a2639;
    margin: 0 0 6px 0;
    text-align: center;
    letter-spacing: 2px;
    border-bottom: 3px solid #4a90d9;
    padding-bottom: 12px;
    width: 80%;
    margin-left: auto;
    margin-right: auto;
}
.subtitle {
    color: #2c3e50;
    font-size: 15px;
    margin-bottom: 25px;
    padding: 14px 20px;
    background: #f0f6fd;
    border-radius: 8px;
    line-height: 1.8;
    text-align: center;
}
.subtitle .source {
    font-weight: 500;
    color: #1a3a5a;
}
.subtitle .source span {
    background: #e6edf6;
    padding: 2px 12px;
    border-radius: 30px;
    font-weight: 600;
    color: #004080;
}
.upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}
.upload-card {
    background: #f9fbfd;
    border: 2px dashed #d6e0ea;
    border-radius: 14px;
    padding: 22px 18px;
    text-align: center;
    transition: 0.3s;
    cursor: pointer;
}
.upload-card.has-file {
    border-color: #28a745;
    background: #eafaf1;
}
.upload-card.has-file .file-status {
    background: #28a745;
    color: #fff;
}
.upload-card:hover {
    border-color: #4a90d9;
    background: #f2f8ff;
}
.upload-card .label {
    font-weight: 600;
    color: #1f2a3a;
    font-size: 16px;
}
.upload-card .hint {
    color: #8a9aa8;
    font-size: 13px;
    margin-top: 4px;
}
.upload-card input[type="file"] {
    display: none;
}
.upload-card .file-status {
    margin-top: 12px;
    font-size: 14px;
    background: #eef2f6;
    padding: 6px 14px;
    border-radius: 30px;
    display: inline-block;
    color: #8a9aa8;
}
.control-area {
    background: #f9fbfd;
    border-radius: 12px;
    padding: 16px 22px;
    margin: 12px 0 18px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 20px;
    border: 1px solid #dce3ec;
}
.control-area .info-group {
    display: flex;
    flex-wrap: wrap;
    gap: 20px 40px;
    font-size: 14px;
    color: #1f2a3a;
}
.control-area .info-group strong {
    color: #0b1a2b;
}
.control-area .info-group .status-ok {
    color: #28a745;
    font-weight: 600;
}
.control-area .layer-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.control-area .layer-group label {
    font-weight: 600;
    color: #1f2a3a;
    font-size: 15px;
}
.control-area .layer-group input {
    padding: 6px 12px;
    border: 1px solid #c8d6e5;
    border-radius: 30px;
    font-size: 15px;
    width: 80px;
    text-align: center;
}
.control-area .layer-group .suggest {
    color: #3a6a8a;
    background: #e6edf6;
    padding: 4px 16px;
    border-radius: 30px;
    font-size: 14px;
}
.control-area .layer-group .suggest span {
    font-weight: 700;
    color: #1a4a7a;
}
.btn-primary {
    background: #4a90d9;
    color: #fff;
    border: none;
    padding: 14px 38px;
    border-radius: 40px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    width: 100%;
    margin-top: 6px;
}
.btn-primary:hover {
    background: #3a78c0;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(74, 144, 217, 0.3);
}
.btn-primary:disabled {
    opacity: 0.5;
    pointer-events: none;
    transform: none;
}
.btn-success {
    background: #28a745;
    color: #fff;
    border: none;
    padding: 12px 32px;
    border-radius: 40px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}
.btn-success:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}
.btn-outline {
    background: transparent;
    color: #4a6a8a;
    border: 1.5px solid #c8d6e5;
    padding: 12px 32px;
    border-radius: 40px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
}
.btn-outline:hover {
    background: #f0f4fa;
    border-color: #8aa3c0;
}
.btn-sm {
    padding: 5px 14px;
    font-size: 13px;
    border-radius: 30px;
    border: 1px solid #c8d6e5;
    background: #f8fafc;
    cursor: pointer;
    transition: 0.2s;
}
.btn-sm:hover {
    background: #e6edf6;
}
.btn-sm.active {
    background: #4a90d9;
    color: #fff;
    border-color: #4a90d9;
}
.action-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 16px;
    justify-content: center;
}
.action-row .btn-success,
.action-row .btn-outline {
    flex: 1;
    min-width: 160px;
    text-align: center;
}
.result-area,
.regression-area {
    border: 1px solid #dce3ec;
    border-radius: 14px;
    padding: 18px 20px 20px 20px;
    margin-top: 25px;
    background: #ffffff;
}
.result-area {
    margin-top: 28px;
    display: none;
}
.result-area .headline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.result-area .headline h3 {
    margin: 0;
    color: #1a2639;
    font-weight: 600;
    font-size: 18px;
}
.filter-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 8px;
}
.filter-row .filter-label {
    font-weight: 600;
    color: #1f2a3a;
    font-size: 14px;
    min-width: 60px;
}
.filter-row .btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.filter-row .btn-group .btn-sm {
    padding: 4px 14px;
}
.filter-row .btn-group .btn-sm.active {
    background: #4a90d9;
    color: #fff;
    border-color: #4a90d9;
}
.filter-row .download-wrap {
    margin-left: auto;
}
.table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    max-height: 600px;
    overflow-y: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: fixed;
    min-width: 1000px;
}
th, td {
    padding: 6px 4px;
    text-align: center;
    border-bottom: 1px solid #eaedf2;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    line-height: 1.3;
}
th {
    background: #f1f6fb;
    color: #1a2a3a;
    font-weight: 600;
    border-bottom: 2px solid #d0d9e4;
    position: sticky;
    top: 0;
    z-index: 2;
}
tr:hover td {
    background: #f8fafd;
}
.col-id { width: 6%; }
.col-name { width: 8%; }
.col-class { width: 6%; }
.col-raw { width: 6%; }
.col-rank { width: 6%; }
.col-percentile { width: 8%; }
.col-std { width: 8%; }
.col-layer { width: 7%; }
.col-pred { width: 8%; }
.col-residual { width: 8%; }
.col-residstd { width: 8%; }
.col-tvalue { width: 7%; }
.col-flag { width: 4%; }
.log-box {
    background: #1e293b;
    color: #b9c9e0;
    padding: 12px 18px;
    border-radius: 10px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    margin-top: 16px;
    max-height: 110px;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.6;
}
.log-box .ok { color: #7ddfb0; }
.log-box .err { color: #f79b9b; }
.regression-area {
    display: none;
}
.regression-area h4 {
    margin: 0 0 12px 0;
    color: #1a2639;
}
.regression-formula {
    background: #f8fafc;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 16px;
    display: inline-block;
    margin-bottom: 15px;
    border: 1px solid #dce3ec;
}
.regression-formula code {
    font-weight: 600;
    color: #0b1a2b;
}
.plot-container {
    width: 100%;
    height: 500px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #fafcfe;
    margin: 0 auto;
}
.footer {
    margin-top: 28px;
    font-size: 13px;
    color: #7a8a9b;
    text-align: center;
    border-top: 1px solid #e2e8f0;
    padding-top: 18px;
}
@media (max-width: 680px) {
    .upload-grid { grid-template-columns: 1fr; }
    .container { padding: 18px; }
    .action-row .btn-success,
    .action-row .btn-outline { min-width: 120px; }
    .control-area { flex-direction: column; align-items: stretch; }
    .control-area .layer-group { justify-content: center; }
    .plot-container { height: 350px; }
    .filter-row { flex-direction: column; align-items: stretch; }
    .filter-row .download-wrap { margin-left: 0; }
    h1 { font-size: 24px; width: 100%; }
}

/* ===== 缺失数据提醒弹窗 ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.modal-box {
    background: #ffffff;
    border-radius: 16px;
    max-width: 640px;
    width: 100%;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}
.modal-head {
    padding: 18px 24px;
    font-size: 18px;
    font-weight: 700;
    color: #1a2639;
    border-bottom: 1px solid #e2e8f0;
    background: #f7fafd;
}
.modal-body {
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.modal-summary {
    margin: 0 0 14px 0;
    line-height: 1.7;
    color: #33415c;
    font-size: 15px;
}
.modal-summary strong {
    color: #004080;
}
.modal-list-wrap {
    overflow-y: auto;
    max-height: 40vh;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}
.modal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 0;
}
.modal-table th:first-child {
    width: 38%;
}
.modal-table th:nth-child(2) {
    width: 28%;
}
.modal-table th,
.modal-table td {
    padding: 7px 14px;
    text-align: left;
    border-bottom: 1px solid #eaedf2;
    white-space: nowrap;
}
.modal-table th {
    background: #f1f6fb;
    color: #1a2a3a;
    position: sticky;
    top: 0;
    z-index: 1;
}
.modal-table tbody tr:last-child td {
    border-bottom: none;
}
.modal-table tr:hover td {
    background: #f8fafd;
}
.modal-foot {
    padding: 14px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #fbfcfe;
}
.modal-foot .btn-sm {
    padding: 8px 22px;
    font-size: 14px;
}

/* ===== 结果表格重点列着色 ===== */
.cell-green {
    color: #28a745;
    font-weight: 700;
}
.cell-red {
    color: #e74c3c;
    font-weight: 700;
}
.cell-muted {
    color: #c0c8d0;
    font-weight: 400;
}

/* ===== 视图切换卡片（横排） ===== */
.view-cards {
    display: flex;
    gap: 12px;
    margin-top: 25px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.view-card {
    flex: 1;
    min-width: 180px;
    padding: 14px 18px;
    border: 1.5px solid #dce3ec;
    border-radius: 14px;
    background: #f9fbfd;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #4a6a8a;
    text-align: center;
    transition: 0.2s;
    white-space: nowrap;
}
.view-card:hover {
    border-color: #4a90d9;
    background: #f2f8ff;
}
.view-card.active {
    background: #4a90d9;
    color: #fff;
    border-color: #4a90d9;
    box-shadow: 0 4px 14px rgba(74, 144, 217, 0.3);
}

/* ===== 标题图标 ===== */
h1 .title-icon {
    width: 34px;
    height: 34px;
    vertical-align: -6px;
    margin-right: 2px;
}

/* ===== 重新上传按钮图标 ===== */
.btn-outline .reset-icon {
    width: 17px;
    height: 17px;
    vertical-align: -3px;
    margin-right: 3px;
}

/* ===== 对勾图标（替换 ✅） ===== */
.check-icon {
    width: 14px;
    height: 14px;
    vertical-align: -2px;
    display: inline-block;
}

/* ===== 排序筛选图标 ===== */
.filter-row .sort-icon {
    width: 17px;
    height: 17px;
    vertical-align: -3px;
    margin-right: 3px;
}

/* ===== 上传卡片文件夹图标 ===== */
.upload-card .folder-icon {
    width: 22px;
    height: 22px;
    vertical-align: -4px;
    margin-right: 4px;
}

/* ===== 开始分析按钮图标 ===== */
.btn-primary .analyze-icon {
    width: 22px;
    height: 22px;
    vertical-align: -4px;
    margin-right: 5px;
}
