/* ═══ 施工网络图（任务连线）—— 独立模块样式，全部 nw- 前缀，删除本文件即整体移除 ═══ */

/* 顶部工具区 */
.nw-tabs { display: inline-flex; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.nw-tab { padding: 6px 16px; font-size: 13px; background: #fff; border: none; cursor: pointer; color: #475569; font-weight: 500; }
.nw-tab + .nw-tab { border-left: 1px solid #e2e8f0; }
.nw-tab.active { background: #2563eb; color: #fff; }
.nw-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.nw-legend { font-size: 12px; color: #64748b; display: inline-flex; align-items: center; }
.nw-li { display: inline-block; width: 18px; height: 0; border-top: 2px solid #2563eb; margin: 0 4px 0 10px; }
.nw-li-inferred { border-top-style: dashed; border-top-color: #94a3b8; }
.nw-li-warn { border-top-color: #d97706; }
.nw-li-crit { border-top-width: 3px; border-top-color: #dc2626; }
.nw-li-node { width: 14px; height: 10px; border: 1.5px solid #2563eb; border-radius: 3px; background: #eff6ff; }

/* 换计划后的失效连线横幅 */
.nw-banner { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 10px;
  padding: 10px 14px; margin-bottom: 14px; font-size: 13px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* 画布容器（两个视图共用） */
.nw-empty { padding: 48px 20px; text-align: center; color: #94a3b8; font-size: 13px; }
.nw-scroll { overflow: auto; max-height: calc(100vh - 300px); min-height: 320px;
  border: 1px solid #eef2f7; border-radius: 10px; background: #fff; }
.nw-inner { position: relative; }

/* 时间轴（年份带 + 月份刻度），吸顶 */
.nw-axis { display: flex; height: 46px; border-bottom: 1px solid #e2e8f0;
  position: sticky; top: 0; background: #f8fafc; z-index: 6; }
.nw-axis-name { flex-shrink: 0; border-right: 1px solid #eef2f7; }
.nw-axis-lane { position: relative; flex-shrink: 0; }
.nw-years { position: relative; height: 20px; }
.nw-year { position: absolute; top: 2px; font-size: 11px; color: #475569; font-weight: 600;
  text-align: center; overflow: hidden; white-space: nowrap; border-left: 1px solid #e2e8f0; }
.nw-months { position: relative; height: 26px; }
.nw-tick { position: absolute; top: 0; bottom: 0; width: 1px; background: #e2e8f0; }
.nw-mlabel { position: absolute; top: 5px; font-size: 10px; color: #94a3b8; text-align: center;
  overflow: hidden; white-space: nowrap; }

/* 行 + 横道（连线编辑视图） */
.nw-rows { position: relative; }
.nw-row { display: flex; height: 30px; align-items: stretch; border-bottom: 1px solid #f4f6fa; }
.nw-row:hover { background: #f8fafc; }
.nw-name { width: 210px; flex-shrink: 0; font-size: 12px; color: #334155; line-height: 30px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-sizing: border-box;
  padding-right: 8px; border-right: 1px solid #eef2f7; }
.nw-sumname { font-weight: 600; color: #0f172a; cursor: pointer; user-select: none; }
.nw-caret { display: inline-block; width: 14px; font-size: 10px; color: #64748b; transition: transform .15s; }
.nw-caret.closed { transform: rotate(-90deg); }
.nw-caret-sp { display: inline-block; width: 14px; }
.nw-lane { position: relative; flex: 1; }
.nw-bar { position: absolute; top: 50%; transform: translateY(-50%); height: 14px; border-radius: 4px;
  background: linear-gradient(180deg, #60a5fa, #2563eb); z-index: 4; }
.nw-bar.nw-sum { height: 7px; border-radius: 2px; background: #94a3b8; opacity: .85; z-index: 2; }
.nw-bar.nw-target { box-shadow: 0 0 0 3px rgba(37, 99, 235, .35); }

/* 连线锚点：行悬停时浮现，从右端点拖出 */
.nw-dot { position: absolute; width: 11px; height: 11px; border-radius: 50%; background: #fff;
  border: 2px solid #2563eb; top: 50%; opacity: 0; transition: opacity .12s; box-sizing: border-box; }
.nw-dot-l { left: 0; transform: translate(-50%, -50%); }
.nw-dot-r { left: 100%; transform: translate(-50%, -50%); cursor: crosshair; }
.nw-dot-r:hover { background: #2563eb; }
.nw-row:hover .nw-dot, body.nw-dragging .nw-dot { opacity: 1; }
body.nw-dragging { user-select: none; cursor: crosshair; }

/* 网格竖线 + 今日线 */
.nw-vline { position: absolute; top: 0; bottom: 0; width: 1px; background: #f1f5f9; z-index: 1; }
.nw-today { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1.5px dashed #ef4444; z-index: 2; }

/* SVG 连线层 */
.nw-svg { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 3; overflow: visible; }
.nw-link { fill: none; stroke: #2563eb; stroke-width: 1.6; }
.nw-link.inferred { stroke: #94a3b8; stroke-dasharray: 5 4; }
.nw-link.warn { stroke: #d97706; }
.nw-link.sel { stroke-width: 2.8; filter: drop-shadow(0 0 2px rgba(37, 99, 235, .5)); }
.nw-link-hit { fill: none; stroke: transparent; stroke-width: 11; pointer-events: stroke; cursor: pointer; }
.nw-temp { fill: none; stroke: #2563eb; stroke-width: 1.6; stroke-dasharray: 4 4; }

/* 连线点击气泡 */
.nw-pop { position: fixed; z-index: 3000; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .15); padding: 12px 14px; max-width: 340px; font-size: 13px; }
.nw-pop-title { font-weight: 600; color: #0f172a; margin-bottom: 4px; word-break: break-all; }
.nw-pop-arr { color: #2563eb; margin: 0 2px; }
.nw-pop-meta { font-size: 12px; color: #64748b; margin-bottom: 8px; }
.nw-pop-warn { font-size: 12px; color: #92400e; background: #fffbeb; border: 1px solid #fde68a;
  border-radius: 8px; padding: 7px 10px; margin-bottom: 8px; line-height: 1.5; }
.nw-pop-btns { display: flex; gap: 8px; justify-content: flex-end; }

/* 新建连线确认弹窗 */
.nw-modal { position: fixed; inset: 0; z-index: 3000; background: rgba(15, 23, 42, .45);
  display: flex; align-items: center; justify-content: center; }
.nw-modal-box { background: #fff; border-radius: 12px; padding: 20px 22px; width: 430px; max-width: 92vw;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .25); font-size: 13px; }
.nw-modal-title { font-size: 15px; font-weight: 600; color: #0f172a; margin-bottom: 12px; }
.nw-modal-line { margin-bottom: 10px; color: #334155; line-height: 1.6; word-break: break-all; }
.nw-modal-line input { border: 1px solid #e2e8f0; border-radius: 6px; padding: 4px 8px; font-size: 13px; }
.nw-modal-btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }

/* 时标网络图（网络图视图） */
.nw-gnode { position: absolute; height: 34px; box-sizing: border-box; border: 1.5px solid #2563eb;
  background: #eff6ff; border-radius: 6px; padding: 1px 7px; overflow: hidden; z-index: 4; min-width: 72px; }
.nw-gnode .nm { font-size: 11px; font-weight: 600; color: #1e3a5f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nw-gnode .dt { font-size: 10px; color: #64748b; white-space: nowrap; overflow: hidden; }
.nw-gnode.crit { border-color: #dc2626; background: #fef2f2; }
.nw-gnode.crit .nm { color: #991b1b; }
.nw-glink { fill: none; stroke: #64748b; stroke-width: 1.4; }
.nw-glink.crit { stroke: #dc2626; stroke-width: 2.2; }
.nw-gnote { padding: 10px 14px; font-size: 12px; color: #64748b; border-top: 1px solid #f1f5f9; line-height: 1.6; }
