body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f2f5;
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    height: 100%;
}

.sidebar {
    width: 300px;
    background-color: #fff;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 10;
}

.sidebar h2 {
    margin-top: 0;
    color: #333;
    font-size: 1.2rem;
    border-bottom: 2px solid #1890ff;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.progress-wrapper {
    margin-bottom: 20px;
    padding: 10px;
    background: #e6f7ff;
    border-radius: 4px;
    border: 1px solid #91d5ff;
}

.progress-text {
    font-size: 12px;
    font-weight: bold;
    color: #0050b3;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
}

.progress-bg {
    height: 8px;
    background-color: #fff;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #91d5ff;
}

.progress-fill {
    height: 100%;
    background-color: #1890ff;
    transition: width 0.3s ease;
}

.control-group {
    margin-bottom: 20px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #e8e8e8;
}

.control-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #555;
}

.metric-item {
    background: #fff;
    padding: 8px;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 5px;
}

.metric-item label {
    font-size: 13px;
    margin-bottom: 5px;
}

.method-select {
    font-size: 12px;
    padding: 4px;
    background: #fafafa;
}

.sub-params {
    border-left: 2px solid #1890ff;
    padding-left: 8px;
    margin-top: 5px;
}

select, input[type="number"] {
    width: 100%;
    padding: 6px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    box-sizing: border-box;
}

.point-inputs {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    justify-content: space-between;
}

.point-inputs button {
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
}

.point-inputs span {
    font-size: 12px;
    color: #666;
}

.checkbox-group label {
    font-weight: normal;
    display: block;
    margin-bottom: 4px;
}

.primary-btn {
    background-color: #1890ff;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
    transition: background 0.3s;
}

.primary-btn:hover {
    background-color: #40a9ff;
}

.hidden {
    display: none;
}

#resultSection h3 {
    font-size: 1rem;
    margin-bottom: 10px;
}

.selection-methods {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.method-btn {
    width: 100%;
    padding: 8px;
    cursor: pointer;
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.3s;
}

.method-btn:hover {
    border-color: #1890ff;
    color: #1890ff;
    background: #e6f7ff;
}

.method-group {
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    padding: 5px;
}

.weight-controls {
    margin-top: 8px;
    padding: 5px;
    background: #fafafa;
    border-radius: 4px;
}

.weight-row {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    margin-bottom: 3px;
}

.weight-row input[type="range"] {
    flex: 1;
    height: 4px;
}

.weight-row span:last-child {
    width: 30px;
    text-align: right;
}

#optimalResult {
    margin-top: 10px;
    padding: 10px;
    background: #e6f7ff;
    border: 1px solid #91d5ff;
    border-radius: 4px;
    font-size: 12px;
}

.main-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: row; /* 改为横向排列 */
    gap: 20px;
    overflow: hidden; /* 防止内部滚动条冲突 */
}

.map-container {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    flex: 1; /* 路径规划占比缩小 */
    display: flex;
    flex-direction: column;
    position: relative;
    min-width: 300px;
}

.map-container h3, .chart-container h3 {
    margin-top: 0;
    color: #333;
    font-size: 1rem;
    margin-bottom: 10px;
}

#mapCanvas {
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    width: 100%;
    flex: 1; /* 让 canvas 填充容器 */
    cursor: crosshair;
}

.legend {
    margin-top: 10px;
    font-size: 11px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.dot.start { background: green; }
.dot.end { background: red; }
.line.path { 
    width: 15px; 
    height: 2px; 
    background: blue; 
    display: inline-block; 
    vertical-align: middle;
}

.chart-container {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    flex: 2; /* Pareto 前沿面占比增大 */
    display: flex;
    flex-direction: column;
}

#paretoChart {
    flex: 1;
    width: 100%;
}
