* { box-sizing: border-box; font-family: 'Segoe UI', Roboto, sans-serif; }
body { background: #e9eff7; margin: 20px; display: flex; justify-content: center; }
.container {
    max-width: 1600px;
    width: 100%;
    background: white;
    border-radius: 32px;
    box-shadow: 0 30px 60px rgba(0,20,40,0.3);
    padding: 25px 30px;
}
h1 { font-size: 2rem; font-weight: 600; color: #002856; margin: 0 0 10px 0; display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
h1 small { font-size: 0.9rem; font-weight: 400; background: #dbeafe; padding: 4px 16px; border-radius: 60px; color: #004b8f; }

/* 登录遮罩层 */
#loginOverlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 20, 40, 0.9); backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center; z-index: 9999;
}
.login-box {
    background: white; border-radius: 40px; padding: 40px 50px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5); text-align: center; max-width: 420px; width: 90%;
}
.login-box h2 { color: #003366; margin-bottom: 25px; }
.login-box input[type="email"], .login-box input[type="password"], .login-box input[type="text"] {
    width: 100%; padding: 14px 18px; font-size: 1rem; border: 2px solid #b0cbe5;
    border-radius: 60px; margin-bottom: 18px; outline: none; box-sizing: border-box;
}
.login-box input:focus { border-color: #0077be; box-shadow: 0 0 0 3px rgba(0,119,190,0.3); }
.code-row { display: flex; gap: 10px; margin-bottom: 25px; }
.code-row input { flex: 2; margin-bottom: 0; }
.code-row button {
    flex: 1; background: #e1effa; border: 2px solid #1f6aa5; color: #1f6aa5;
    border-radius: 60px; font-weight: 600; cursor: pointer; font-size: 0.9rem; padding: 0 12px; white-space: nowrap;
}
.code-row button:disabled { background: #ccc; border-color: #999; color: #666; cursor: not-allowed; }
.login-btn {
    background: #0b3f64; color: white; border: none; padding: 14px 40px; border-radius: 60px;
    font-size: 1.2rem; font-weight: 600; cursor: pointer; width: 100%; margin-top: 10px;
}
.error-msg { color: #b13e3e; margin-top: 15px; min-height: 20px; }
.dev-mode { margin-bottom: 15px; text-align: left; display: flex; align-items: center; gap: 8px; }
.dev-mode input[type="checkbox"] { width: 18px; height: 18px; margin: 0; }
#devPasswordRow { margin-bottom: 15px; }
#mainContent { display: none; }

/* 离线激活区域样式 */
#offlineActivation {
    margin-top: 20px;
    border-top: 1px solid #ccc;
    padding-top: 15px;
}
#offlineActivation h4 {
    color: #003366;
    margin-bottom: 10px;
}
#offlineActivation .machine-code-box {
    background: #f0f0f0;
    padding: 8px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
#offlineActivation .machine-code-box span {
    font-family: monospace;
    font-size: 1.1rem;
}
#offlineActivation .copy-btn {
    background: white;
    border: 1px solid #1f6aa5;
    color: #1f6aa5;
    padding: 4px 10px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
}
#offlineActivation .copy-btn:hover {
    background: #1f6aa5;
    color: white;
}
#offlineActivation input {
    width: 100%;
    padding: 8px;
    border-radius: 30px;
    border: 1px solid #ccc;
    margin-bottom: 10px;
}
#offlineActivation .activate-btn {
    background: #0b3f64;
    color: white;
    border: none;
    padding: 10px 40px;
    border-radius: 60px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
}

.coeff-grid { display: flex; flex-wrap: wrap; gap: 8px; background: #f5faff; border-radius: 24px; padding: 15px; border: 1px solid #c2d9f0; margin-bottom: 15px; }
.coeff-item { flex: 1 1 130px; min-width: 120px; }
.coeff-item label { font-weight: 600; color: #0a3d6b; margin-bottom: 4px; display: block; font-size: 0.8rem; }
.coeff-item select { width: 100%; height: 90px; border-radius: 14px; border: 1px solid #9abde0; padding: 5px; font-size: 0.8rem; }
.select-all-btn { background: white; border: 1px solid #246ba0; color: #246ba0; border-radius: 30px; padding: 2px 10px; font-size: 0.7rem; cursor: pointer; display: inline-block; margin-top: 2px; }

.project-panel { display: flex; flex-wrap: wrap; gap: 15px; background: #f5faff; border-radius: 24px; padding: 15px; border: 1px solid #c2d9f0; margin-bottom: 15px; }
.project-item { min-width: 200px; flex: 1; }
.project-item label { font-weight: 600; color: #0a3d6b; margin-bottom: 4px; display: block; font-size: 0.8rem; }
.project-item select { width: 100%; padding: 8px 14px; border-radius: 30px; border: 1px solid #9abde0; background: white; font-size: 0.9rem; }

.param-panel { display: flex; flex-wrap: wrap; gap: 15px; background: #ffffff; border-radius: 22px; padding: 15px 18px; margin-bottom: 15px; border: 1px solid #c0d6ec; }
.param-item { min-width: 140px; flex: 1; }
.param-item label { font-weight: 600; color: #1c4f7e; font-size: 0.8rem; }
.param-item input { width: 100%; padding: 8px 14px; border-radius: 30px; border: 1px solid #b3ceec; font-size: 0.9rem; }

.quote-list { background: #ffffff; border-radius: 24px; border: 1px solid #c2d8f0; padding: 15px; margin-bottom: 15px; }
.quote-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; flex-wrap: wrap; gap: 10px; }
.quote-header h3 { font-size: 1.2rem; color: #0f4370; margin:0; }
.quote-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.quote-buttons button {
    background: white; border: 1.5px solid #1f6aa5; color: #1f6aa5; padding: 4px 14px;
    border-radius: 40px; font-weight: 600; cursor: pointer; font-size: 0.8rem;
}
.quote-buttons input[type="number"] {
    width: 70px; padding: 4px; border: 1px solid #b9d3f0; border-radius: 20px; text-align: center;
}
.quote-table { width: 100%; border-collapse: collapse; }
.quote-table th { text-align: left; padding: 6px 4px; color: #1b5380; border-bottom: 2px solid #b4d0ec; font-size: 0.8rem; }
.quote-table td { padding: 4px; border-bottom: 1px solid #e2eefc; }
.quote-table input { width: 100%; padding: 6px 10px; border: 1px solid #b9d3f0; border-radius: 30px; font-size: 0.85rem; }

.action-bar { display: flex; gap: 15px; align-items: center; margin: 15px 0; flex-wrap: wrap; }
.primary-btn {
    background: #0b3f64; border: none; color: white; padding: 10px 28px; border-radius: 50px;
    font-size: 1rem; font-weight: 600; cursor: pointer; box-shadow: 0 6px 12px rgba(0,50,100,0.2);
}
.secondary-btn { background: white; border: 1px solid #1f6aa5; color: #1f6aa5; padding: 8px 20px; border-radius: 50px; font-weight: 600; cursor: pointer; font-size: 0.9rem; }
.progress { height: 6px; background: #dae9f9; border-radius: 10px; flex: 1; min-width: 150px; }
.progress-bar { height: 100%; background: #0077be; width: 0%; border-radius: 10px; }
.badge { background: #e1effa; color: #0a3e65; padding: 4px 12px; border-radius: 40px; font-size: 0.8rem; }

.key-metrics {
    display: flex; flex-wrap: wrap; gap: 15px; background: #f0f7ff; border-radius: 20px;
    padding: 15px; margin: 15px 0; border: 1px solid #b9d6f2;
}
.metric-item {
    flex: 1 1 150px; background: white; border-radius: 16px; padding: 10px 12px;
    box-shadow: 0 2px 6px rgba(0,40,80,0.1);
}
.metric-label { font-size: 0.75rem; color: #1f5680; text-transform: uppercase; letter-spacing: 0.5px; }
.metric-value { font-size: 1.3rem; font-weight: 700; color: #003870; line-height: 1.3; word-break: break-word; }

.dashboard { display: flex; gap: 12px; margin: 15px 0; flex-wrap: wrap; }
.card { background: #f5faff; border-radius: 20px; padding: 12px 15px; flex: 1 1 160px; border: 1px solid #c1daf5; box-shadow: 0 4px 8px rgba(0,40,80,0.05); }
.card-title { font-size: 0.8rem; color: #2a5f8a; text-transform: uppercase; letter-spacing: 0.5px; }
.card-value { font-size: 1.6rem; font-weight: 700; color: #003870; line-height: 1.2; }
.card-note { font-size: 0.7rem; color: #3d6790; }

.chart-row-single { display: block; margin-bottom: 20px; }
.chart-box {
    width: 100%; background: white; border-radius: 24px; padding: 15px;
    border: 1px solid #c3daf2; height: 400px; display: flex; flex-direction: column;
}
.chart-box h3 { margin: 0 0 8px 0; color: #003366; font-weight: 500; font-size: 1rem; }
.chart-box canvas { flex: 1; max-height: 340px; width: 100% !important; }

/* 概率分布表容器 - 纵向滚动 + 横向滚动 */
.stats {
    background: #f5faff;
    border-radius: 24px;
    padding: 15px;
    border: 1px solid #b9d6f2;
    margin-bottom: 20px;
    overflow-x: auto;
    max-height: 600px;
    overflow-y: auto;
}

/* 排序按钮容器 - 固定在顶部 */
.sort-buttons {
    margin-bottom: 10px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    background: #f5faff;
    z-index: 3;
    padding: 8px 0;
    border-bottom: 1px solid #b9d6f2;
}

.sort-btn {
    background: white;
    border: 1px solid #1f6aa5;
    color: #1f6aa5;
    padding: 4px 12px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.8rem;
}
.sort-btn.active {
    background: #1f6aa5;
    color: white;
}

/* 表格宽度保持最小宽度 */
.stats table {
    width: 100%;
    border-collapse: collapse;
    /*min-width: 1700px;*/
}
.stats table td, .stats table th {
    word-break: break-word;
    white-space: normal;
}

/* 表头固定 - 注意 top 值需避开按钮区域 */
.stats th {
    text-align: left;
    padding: 8px 6px;
    color: #05345c;
    border-bottom: 2px solid #a3c5e9;
    font-size: 0.85rem;
    position: sticky;
    top: 60px;
    background: #f5faff;
    z-index: 2;
}

.stats td {
    padding: 6px 6px;
    border-bottom: 1px solid #cee2fa;
    font-size: 0.85rem;
}
.invalid-quote { background-color: #ffe6e6 !important; }
.below-reasonable { background-color: #fff9e6 !important; }
.highlight-row { background-color: #ffff99 !important; }
.hover-row { background-color: #e0f0ff !important; }

.color-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 10px;
    padding: 10px 15px;
    background: #ffffff;
    border-radius: 30px;
    border: 1px solid #d9e6f5;
    font-size: 0.85rem;
}
.legend-item { display: flex; align-items: center; gap: 8px; }
.color-box { width: 20px; height: 20px; border-radius: 4px; border: 1px solid #ccc; }
.color-box.invalid { background-color: #ffe6e6; }
.color-box.below { background-color: #fff9e6; }
.color-box.highlight { background-color: #ffff99; }
.color-box.hover { background-color: #e0f0ff; }

.distrib-btn { background: #d9eaff; border: none; border-radius: 30px; padding: 2px 10px; font-weight: 600; color: #0b3f64; cursor: pointer; font-size: 0.75rem; }

.optimize-row {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.optimize-panel {
    flex: 1 1 45%;
    background: #e3f0fc;
    border-radius: 28px;
    padding: 20px;
    border: 1px solid #90b9e0;
}
.opt-params { display: flex; flex-wrap: wrap; gap: 10px; background: #ffffffdb; padding: 15px; border-radius: 24px; margin-bottom: 15px; }
.opt-item { min-width: 110px; flex: 1; }
.opt-item label { font-weight: 600; color: #1c5583; font-size: 0.75rem; }
.opt-item input { width: 100%; padding: 6px 12px; border-radius: 40px; border: 1px solid #719fcb; font-size: 0.8rem; }
.best-badge { background: #004b8f; color: white; padding: 6px 20px; border-radius: 60px; font-size: 1.1rem; display: inline-block; margin: 5px 0; }
.opt-interval { font-size: 1rem; font-weight: 600; background: #d5e8ff; padding: 6px 16px; border-radius: 60px; margin: 8px 0; text-align: center; }

.opt-result { margin-top: 15px; max-height: 200px; overflow: auto; background: white; border-radius: 20px; padding: 10px; }
.opt-result table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.opt-result th { background: #daeaf9; padding: 6px; position: sticky; top:0; }
.opt-result td { padding: 4px; }

.report-bar { display: flex; justify-content: flex-end; gap: 12px; margin-top: 20px; }
.report-btn { background: #2d6a4f; border: none; color: white; padding: 10px 28px; border-radius: 50px; font-size: 1rem; font-weight: 600; cursor: pointer; }

.footnote { color: #3d6b97; margin-top: 10px; font-size: 0.8rem; }

.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}
.modal-content {
    background: white;
    border-radius: 24px;
    padding: 25px;
    width: 80%;
    max-width: 800px;
    max-height: 80%;
    overflow: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.modal-header h3 {
    margin: 0;
    color: #003366;
}
.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}
.close-btn:hover { color: #000; }
.impact-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}
.impact-table th {
    background: #daeaf9;
    padding: 8px;
    text-align: left;
}
.impact-table td {
    padding: 6px;
    border-bottom: 1px solid #cee2fa;
}
.impact-chart-container {
    height: 300px;
    margin-top: 20px;
}

/* 陪标报价表格样式 */
.collusion-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}
.collusion-table th,
.collusion-table td {
    border: 1px dashed #ccc;
    padding: 8px;
    text-align: left;
}
.collusion-table th {
    background-color: #e3f0fc;
    font-weight: 600;
}
/* 确保父容器横向滚动 */
#collusionResult {
    overflow-x: auto;
}

/* 响应式调整：小屏幕下减少边距 */
@media (max-width: 768px) {
    body {
        margin: 10px;
    }
    .container {
        padding: 15px 15px;
    }
    h1 {
        font-size: 1.5rem;
    }
}
.chart-card {
    background: white;
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0,40,80,0.1);
    border: 1px solid #c1daf5;
    height: 300px; /* 固定高度，可根据需要调整 */
    display: flex;
    flex-direction: column;
}

.chart-card h3 {
    margin: 0 0 10px 0;
    color: #003366;
    font-size: 1rem;
    flex-shrink: 0;
}

.chart-card canvas {
    flex: 1;
    width: 100% !important;
    height: 100% !important; /* 确保 canvas 占满剩余高度 */
}
.upload-area {
    cursor: pointer;
    position: relative;
    z-index: 10;
}
.highlight-row {
    background-color: #ffff99 !important;
}
/* 页脚版权信息 */
/*.footer {*/
/*    margin-top: 30px;*/
/*    padding: 10px;*/
/*    text-align: center;*/
/*    border-top: 1px solid #b9d6f2;*/
/*    color: #1f6aa5;*/
/*    font-size: 0.9rem;*/
/*}*/