/* 路由画布：候选状态徽章、落点占比条、实时指标、模拟切换与淘汰说明。 */
.route-live{display:flex;align-items:flex-start;gap:12px;padding:15px 22px;border-bottom:1px solid var(--line2)}
.live-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;flex:1;min-width:0}
.live-item{min-width:0}
.live-val{font-size:15px;font-weight:540;font-variant-numeric:tabular-nums;color:var(--text);line-height:1.25}
.live-val .live-unit{font-size:9px;font-weight:450;color:var(--muted);letter-spacing:0}
.live-val .live-sep{color:var(--muted);font-weight:450}
.live-item.warn .live-val{color:var(--warn)}
.live-item.error .live-val{color:var(--error)}
.live-label,.live-sub{display:block;font-size:9px;color:var(--muted);margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.live-sub{opacity:.85}
.live-tag{display:inline-flex;align-items:center;gap:5px;flex:none;font:9px var(--mono);color:var(--mint-text);background:var(--mint-soft);border-radius:20px;padding:4px 9px;white-space:nowrap}
.cand-live{display:flex;align-items:center;gap:8px;margin-top:6px;min-width:0}
.cand-live small{font-size:9px;color:var(--muted);flex:1 1 auto;min-width:0;max-width:100%}
.candidate.muted{opacity:.52}
.candidate.muted:hover{opacity:.75}
.candidate-tools{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-bottom:10px}
.candidate-tools .search-field{flex:1;min-width:200px;max-width:none}
.candidate-tools select{width:auto;max-width:150px}
.candidate-flags{display:flex;gap:6px;flex-wrap:wrap;margin:5px 0 2px}
.cand-share{display:flex;align-items:center;gap:8px;margin-top:6px;min-width:0}
.cand-share-bar{flex:1;min-width:24px;max-width:140px;height:3px;border-radius:2px;background:var(--line2);overflow:hidden}
.cand-share-bar i{display:block;height:100%;background:var(--mint-text);border-radius:2px}
.cand-share small{font-size:9px;color:var(--muted);white-space:nowrap;flex:none}
.cand-share.zero{opacity:.45}
.route-canvas-note{padding:10px 2px 0;margin:0}
.sim-out{font-size:11px;color:var(--warn);background:var(--warn-bg);border-radius:7px;padding:8px 10px;margin:7px 0}
.sim-out b{color:inherit}

/* 分组画布与按组编辑工作区。 */
.route-group{display:grid;gap:10px;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--panel)}
.route-group-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:12px}
.route-group-head strong{overflow-wrap:anywhere;min-width:0}.group-edit{margin-left:auto}
.route-group-list{display:grid;gap:10px;border-radius:8px;min-height:44px}
.route-group-list.drag-over{outline:2px solid var(--mint-text);outline-offset:4px;background:var(--mint-soft)}
.route-drop-zone{text-align:center;padding:10px;font-size:10px;color:var(--muted);border:1px dashed var(--line);border-radius:8px}
.group-link{text-align:center;font-size:10px;color:var(--muted);padding:4px 0}
.route-basics{margin-bottom:18px}.route-basics summary{cursor:pointer;color:var(--sub);font-size:12px;margin-bottom:14px}
.group-editor-nav{display:flex;gap:7px;flex-wrap:wrap;padding:12px 0;border-bottom:1px solid var(--line)}
.group-editor-head{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin:18px 0 12px}
.group-editor-head h3{font-size:13px}.group-editor-head .flex{flex-wrap:wrap}
.group-editor-panel>.form-grid{margin-bottom:10px}
.route-close-confirm p{margin-bottom:10px}.route-close-confirm .flex{flex-wrap:wrap}
.route-draft-note{margin:12px 20px;padding:9px 12px;background:var(--panel2);color:var(--muted);border-radius:8px;font-size:11px}
.route-draft-note[data-error="true"]{background:var(--warn-bg);color:var(--warn)}

/* 路由候选多，使用居中大工作区；其他配置继续使用原抽屉。 */
dialog.drawer.route-editor-dialog{margin:auto;width:min(1600px,calc(100vw - 48px));height:calc(100dvh - 48px);max-height:calc(100dvh - 48px);border:1px solid var(--line);border-radius:16px;animation:enter .18s ease-out}
.route-editor-dialog .drawer-head,.route-editor-dialog .drawer-footer{flex-shrink:0}
.route-editor-dialog .drawer-body{min-height:0;overscroll-behavior:contain}
.route-editor-dialog .drawer-footer{flex-wrap:wrap}
.route-editor-dialog .route-close-confirm{flex-basis:100%;margin:0;padding:12px 14px;background:var(--warn-bg);color:var(--warn)}
.route-editor-dialog .candidate-picker{grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:start}
.route-editor-dialog .candidate-picker-summary{grid-column:1/-1}
.route-editor-dialog [data-selected-panel],.route-editor-dialog [data-available-panel]{min-width:0}
.route-editor-dialog [data-selected-panel] .candidate-picker-row{flex-wrap:wrap}
.route-editor-dialog [data-selected-panel] .candidate-picker-info{flex-basis:100%}
.route-editor-dialog .candidate-picker-list{max-height:min(52dvh,560px)}

@media(max-width:1100px){
  .route-editor-dialog .candidate-picker{grid-template-columns:minmax(0,1fr)}
}

@media(max-width:1180px){
  /* 指标太多，一行放不下就折到两行 */
  .live-grid{grid-template-columns:repeat(3,minmax(0,1fr));row-gap:12px}
}

@media(max-width:700px){
  dialog.drawer.route-editor-dialog{margin:0;width:100vw;height:100dvh;max-height:100dvh;border:0;border-radius:0}
  .cand-share-bar{max-width:none}
  .candidate-flags{gap:4px}
  .route-live{padding:13px 17px}
  /* 窄屏上下堆叠：三列布局会把候选右侧的开关与排序按钮挤出卡片 */
  .route-canvas{grid-template-columns:minmax(0,1fr);gap:12px}
  .route-connector{display:none}
  .router-node{flex-direction:row;justify-content:flex-start;padding:10px 13px}
}

@media(max-width:420px){
  .candidate-info small{white-space:normal}
  .cand-share{flex-wrap:wrap}
  .cand-share-bar{max-width:none;width:100%;order:2}
  .cand-share small{order:1}
  /* 指标占半行、实时标记整行靠左，任何一列都不挤压内容 */
  .live-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 12px}
  .route-live{flex-wrap:wrap}
  .live-tag{order:-1;flex-basis:100%}
  .live-label,.live-sub{overflow:visible;text-overflow:clip;white-space:normal}
  .cand-live{flex-wrap:wrap}
  .cand-live small{overflow-wrap:anywhere}
}
