:root{--bg:#eef3f9;--panel:#fff;--panel-soft:#f7f9fc;--line:#dfe6f0;--text:#1d2a3a;--muted:#6e7c8e;--blue:#3e73bb;--blue-soft:#eaf2ff;--blue-strong:#285caa;--orange:#e78545;--orange-soft:#fff2e9;--green:#3b9b7c;--red:#d85f5f;--shadow:0 10px 30px rgba(38,64,100,.09);--radius:12px;font-family:"Microsoft YaHei","Segoe UI",sans-serif;color:var(--text);background:var(--bg)}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text)}body{font-size:13px;overflow:hidden}button,input,select{font:inherit}button{border:1px solid var(--line);background:var(--panel);color:var(--text);border-radius:7px;padding:7px 12px;cursor:pointer;transition:.15s ease}button:hover{border-color:#a9bdd8;background:#f7faff}button:active{transform:translateY(1px)}button.primary{color:white;background:var(--blue);border-color:var(--blue)}button.primary:hover{background:var(--blue-strong)}.icon-btn{font-size:16px;width:32px;padding:5px}.toolbar{height:auto;min-height:58px;background:var(--panel);border-bottom:1px solid var(--line);display:flex;align-items:center;padding:0 20px;gap:18px;box-shadow:0 2px 8px rgba(20,40,70,.04)}.brand{display:flex;align-items:center;gap:9px;font-size:16px;font-weight:700;letter-spacing:.2px;white-space:nowrap}.brand small{font-size:9px;color:var(--muted);font-weight:600;letter-spacing:1.3px;margin-left:2px}.brand-mark{display:grid;place-items:center;width:30px;height:30px;border-radius:8px;background:linear-gradient(135deg,#4b81c9,#73b0e9);color:white;font-size:18px}.toolbar-actions{display:flex;align-items:center;gap:7px;margin-left:auto;flex-wrap:wrap}.toolbar-actions button{font-size:12px;padding:6px 10px;white-space:nowrap}.sep{width:1px;height:24px;background:var(--line);margin:0 4px}.statusbar{height:30px;display:flex;align-items:center;padding:0 20px;background:#f8fafd;border-bottom:1px solid var(--line);font-size:11px;color:var(--muted);gap:7px}.status-dot{width:7px;height:7px;background:var(--green);border-radius:50%;display:inline-block}.status-spacer{flex:1}.workspace{height:calc(100vh - 88px);display:grid;grid-template-columns:300px minmax(500px,1fr) 354px;gap:12px;padding:12px;max-width:1800px;margin:auto}.panel-scroll{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);overflow:auto}.left-panel{padding:18px 16px 22px}.right-panel{padding:0}.panel-title{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:16px}.eyebrow{font-size:9px;color:var(--blue);font-weight:700;letter-spacing:1.3px}.panel-title h2,.canvas-head h1{font-size:19px;margin:3px 0 0;letter-spacing:-.3px}.pill{font-size:10px;padding:4px 8px;border-radius:20px;font-weight:600}.pill.blue{background:var(--blue-soft);color:var(--blue)}.field{display:block;margin:0 0 11px}.field>span{display:flex;align-items:baseline;gap:4px;margin-bottom:5px;color:#526173;font-size:11px}.field i{font-style:normal;color:#9aa6b5;font-size:10px}.field input,.field select{width:100%;border:1px solid #d6dfeb;border-radius:6px;height:31px;padding:0 9px;background:#fbfcfe;color:var(--text);outline:0}.field input:focus,.field select:focus{border-color:#7ca2d4;box-shadow:0 0 0 3px rgba(62,115,187,.12)}.two-col{display:grid;grid-template-columns:1fr 1fr;gap:9px}.project-name{margin-bottom:15px}.input-section{border-top:1px solid #edf1f6;padding-top:14px;margin-top:14px}.section-head{display:flex;gap:9px;align-items:center;margin-bottom:12px}.section-head b{display:block;font-size:12px}.section-head small{color:#a0adbd;font-size:10px}.section-index{font-size:10px;color:var(--blue);font-weight:800;background:var(--blue-soft);border-radius:6px;padding:4px 6px}.hint{font-size:10px;color:var(--muted);line-height:1.5;margin:2px 0 11px;padding:7px 8px;background:#f7f9fc;border-left:2px solid #c8d7eb}.check-row{display:flex;gap:7px;align-items:center;margin:3px 0;color:#59687b;font-size:11px}.check-row input{accent-color:var(--blue)}.left-actions{display:flex;gap:8px;margin:18px 0 13px}.left-actions button{flex:1}.source-note{font-size:10px;line-height:1.65;color:#8794a5;border-top:1px solid #edf1f6;padding-top:11px}.source-note b{color:#64748a}.canvas-panel{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);display:flex;flex-direction:column;min-width:0;overflow:hidden}.canvas-head{height:66px;display:flex;align-items:center;padding:0 21px;border-bottom:1px solid var(--line)}.canvas-head h1{font-size:17px}.canvas-tools{margin-left:auto;display:flex;gap:5px;align-items:center}.canvas-tools button{padding:5px 9px;font-size:11px}.canvas-tools span{width:45px;text-align:center;color:var(--muted);font-size:11px}.diagram-wrap{position:relative;flex:1;min-height:350px;background:#fbfcfe;overflow:hidden}.diagram-wrap svg{width:100%;height:100%;display:block}.diagram-legend{position:absolute;bottom:15px;left:20px;display:flex;gap:8px;flex-wrap:wrap;font-size:10px;color:#78869a;background:rgba(255,255,255,.88);padding:7px 10px;border-radius:6px;border:1px solid #e8edf3}.legend-dot{display:inline-block;width:7px;height:7px;border-radius:50%;margin-right:4px}.legend-dot.blue{background:#5b84c4}.legend-dot.orange{background:#ed8b4b}.legend-dot.gray{background:#8c99aa}.canvas-foot{height:34px;border-top:1px solid var(--line);padding:0 18px;display:flex;align-items:center;justify-content:space-between;font-size:10px;color:var(--muted)}#diagram .edge{fill:none;stroke:#5b84c4;stroke-width:3;marker-end:url(#arrow)}#diagram .edge.warm{stroke:#ed8b4b;marker-end:url(#arrowWarm)}#diagram .edge.dashed{stroke-dasharray:7 6;stroke:#a7b2c1;marker-end:none}.node{cursor:grab}.node:active{cursor:grabbing}.node-card{fill:white;stroke:#cdd8e7;stroke-width:1.5}.node-card.active{stroke:#5b84c4;stroke-width:2}.node-card.warm{stroke:#ecb28b}.node-title{font-size:14px;font-weight:700;fill:#26384d}.node-sub{font-size:10px;fill:#7a899d}.node-value{font-size:11px;fill:#4777b7}.node-value.warm{fill:#d6753e}.node-icon{fill:#eaf2ff;stroke:#6c93c7;stroke-width:1.5}.node-icon.warm{fill:#fff0e5;stroke:#de9563}.node-badge{font-size:9px;fill:#5b84c4}.flow-label{font-size:10px;fill:#8190a3}.flow-label.warm{fill:#d8814e}.right-panel .tabs{height:49px;display:flex;align-items:stretch;border-bottom:1px solid var(--line);padding:0 8px;overflow-x:auto}.tab{flex:1 0 auto;min-width:45px;border:0;border-radius:0;background:transparent;font-size:11px;color:#7b8899;padding:0 5px;position:relative}.tab:hover{background:#f8faff;border:0}.tab.active{color:var(--blue);font-weight:700}.tab.active:after{content:"";position:absolute;bottom:-1px;left:14px;right:14px;height:2px;background:var(--blue);border-radius:2px}.tab-content{display:none;padding:15px 16px 22px}.tab-content.active{display:block}.result-hero{border-radius:10px;background:linear-gradient(135deg,#eaf3ff,#f5f9ff);padding:14px 15px;margin-bottom:13px;border:1px solid #d7e7fb}.result-hero .label{font-size:11px;color:#5f7592}.result-hero .value{font-size:30px;line-height:1.1;font-weight:800;color:#315f9e;margin:5px 0}.result-hero .unit{font-size:11px;color:#6e82a0}.result-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:13px}.metric{padding:10px 10px;border:1px solid #e2e8f0;border-radius:8px;background:#fcfdff}.metric .metric-label{font-size:10px;color:#8290a1;line-height:1.4}.metric .metric-value{font-size:17px;font-weight:700;color:#2f4055;margin-top:4px}.metric .metric-unit{font-size:10px;color:#8390a0;margin-left:2px}.subhead{font-size:11px;font-weight:700;color:#53657b;margin:14px 0 7px;display:flex;align-items:center;gap:6px}.subhead:before{content:"";width:3px;height:13px;background:var(--blue);border-radius:2px}.zone-card{padding:10px 11px;border-radius:8px;background:#f6f9fd;border:1px solid #e2ebf6;font-size:11px;line-height:1.5}.zone-card.warn{background:#fff8ed;border-color:#f4d6b7}.zone-card.danger{background:#fff1f1;border-color:#efc2c2}.zone-title{font-weight:700;color:#3e5d83;margin-bottom:3px}.mini-table{width:100%;border-collapse:collapse;font-size:10px}.mini-table td{padding:6px 4px;border-bottom:1px solid #edf1f5}.mini-table td:last-child{text-align:right;color:#314f75;font-weight:600}.report-toolbar{display:flex;gap:6px;margin-bottom:10px}.report-toolbar button{font-size:10px;padding:5px 8px}.report-pre{white-space:pre-wrap;overflow:auto;background:#f8fafc;border:1px solid #e5eaf1;border-radius:7px;padding:10px;font:10px/1.55 Consolas,"Courier New",monospace;max-height:calc(100vh - 180px);color:#405168}.check-item{display:flex;gap:8px;padding:10px 0;border-bottom:1px solid #edf1f5;font-size:11px;line-height:1.45}.check-icon{width:18px;height:18px;border-radius:50%;display:grid;place-items:center;font-weight:700;font-size:11px;flex:none}.check-item.ok .check-icon{color:#2f8f70;background:#e3f5ed}.check-item.warn .check-icon{color:#b97724;background:#fff0d9}.check-item.error .check-icon{color:#bf4a4a;background:#ffe6e6}.check-title{font-weight:700;margin-bottom:2px}.check-detail{color:#758398}.scan-table{width:100%;border-collapse:collapse;font-size:10px}.scan-table th{background:#f3f7fc;color:#66768c;text-align:left;padding:7px 4px;font-weight:600}.scan-table td{padding:7px 4px;border-bottom:1px solid #edf1f5}.scan-table td:not(:first-child),.scan-table th:not(:first-child){text-align:right}.scan-table tr.recommended{background:#eef6ff;color:#315f9e;font-weight:700}.muted{color:var(--muted)}.toast{position:fixed;left:50%;bottom:24px;transform:translate(-50%,20px);opacity:0;pointer-events:none;background:#24364e;color:white;border-radius:8px;padding:9px 15px;box-shadow:0 8px 22px rgba(0,0,0,.18);font-size:12px;transition:.22s}.toast.show{opacity:1;transform:translate(-50%,0)}dialog{border:0;border-radius:12px;box-shadow:0 20px 60px rgba(25,44,75,.25);padding:24px;width:min(430px,calc(100vw - 40px));color:var(--text)}dialog::backdrop{background:rgba(28,46,70,.3)}dialog h2{margin:0 0 13px;font-size:18px}dialog p{font-size:12px;line-height:1.7;color:#66758a}.dialog-close{position:absolute;right:12px;top:10px;border:0;background:none;font-size:22px;color:#8491a1;padding:2px 6px}@media(max-width:1200px){.workspace{grid-template-columns:280px minmax(420px,1fr) 320px}.toolbar-actions button:nth-child(5),.toolbar-actions button:nth-child(6){display:none}}@media(max-width:900px){body{overflow:auto}.workspace{height:auto;display:flex;flex-direction:column}.left-panel,.right-panel{max-height:none}.canvas-panel{height:620px;order:-1}.toolbar{height:auto;min-height:58px;flex-wrap:wrap;padding:10px}.toolbar-actions{overflow:auto}.statusbar{padding:0 10px}.right-panel{min-height:420px}}

html[data-theme="dark"]{--bg:#17202d;--panel:#202c3b;--panel-soft:#253346;--line:#344356;--text:#e6edf5;--muted:#a3afbf;--blue-soft:#263e5e;--blue:#76a9ec;--blue-strong:#8bb9f2;--orange-soft:#4a3427}html[data-theme="dark"] .statusbar,html[data-theme="dark"] .diagram-wrap{background:#1b2635}html[data-theme="dark"] .field input,html[data-theme="dark"] .field select,html[data-theme="dark"] .hint,html[data-theme="dark"] .metric,html[data-theme="dark"] .zone-card,html[data-theme="dark"] .report-pre{background:#1b2635;color:var(--text);border-color:#3a4b60}html[data-theme="dark"] .diagram-legend{background:rgba(32,44,59,.9);border-color:#3a4b60}html[data-theme="dark"] .node-card{fill:#243346;stroke:#52657e}html[data-theme="dark"] .node-title{fill:#e5eef8}html[data-theme="dark"] .node-sub,html[data-theme="dark"] .flow-label{fill:#aebbd0}html[data-theme="dark"] .source-note,html[data-theme="dark"] .input-section{border-color:#334356}

.symbol-section{border-top:1px solid #edf1f6;padding-top:14px;margin-top:14px}.symbol-tip{font-size:10px;color:var(--muted);line-height:1.5;margin:-3px 0 9px;padding:7px 8px;background:#f7f9fc;border-left:2px solid #c8d7eb}.template-palette{margin:0 0 8px}.template-item{display:flex;align-items:center;gap:8px;width:100%;min-height:48px;border:1px solid #bcd2ec;border-radius:8px;background:linear-gradient(135deg,#f4f8ff,#fbfdff);padding:6px 8px;text-align:left;color:#3f6592;cursor:grab}.template-item:hover{border-color:#6d9bd3;background:#edf5ff}.template-item:active{cursor:grabbing}.template-item svg{width:68px;height:32px;flex:none}.template-item b{display:block;font-size:11px}.template-item small{display:block;color:#8092a8;font-size:9px;margin-top:2px}.legend-palette{display:block}.legend-item{display:flex;align-items:center;gap:6px;min-height:40px;border:1px solid #e1e8f0;border-radius:7px;background:#fbfcfe;padding:5px 6px;text-align:left;color:#53657b;cursor:grab}.legend-item:hover{border-color:#9db7db;background:#f4f8ff}.legend-item:active{cursor:grabbing}.legend-item svg{width:46px;height:25px;flex:none;overflow:visible}.legend-item b{font-size:10px;font-weight:600;line-height:1.25}.legend-item small{display:block;color:#9aa6b5;font-size:9px;margin-top:1px}.symbol-hit{fill:rgba(255,255,255,.82);stroke:#c9d5e4;stroke-width:1.3;stroke-dasharray:3 2}.symbol-hit.selected{stroke:#4e82c5;stroke-width:2}.symbol-label{font-size:12px;fill:#354457}.symbol-code{font-size:10px;font-weight:700;fill:#3d6595}.symbol-line{stroke:#40536b;stroke-width:2;fill:none;stroke-linecap:butt}.symbol-line.thin{stroke-width:1.5}.symbol-line.dashed{stroke-dasharray:6 4;stroke-width:2}.symbol-stroke{stroke:#40536b;stroke-width:1.6;fill:white}.symbol-fill{fill:#40536b;stroke:#40536b;stroke-width:1.5}.diagram-wrap.drop-active{outline:2px dashed #6f9ed8;outline-offset:-6px;background:#f0f6ff}.canvas-foot .symbol-state{color:#4e82c5;font-weight:600}html[data-theme="dark"] .symbol-tip,html[data-theme="dark"] .legend-item,html[data-theme="dark"] .template-item{background:#1b2635;border-color:#3a4b60}html[data-theme="dark"] .legend-item,html[data-theme="dark"] .template-item{color:#c6d3e4}html[data-theme="dark"] .symbol-line,html[data-theme="dark"] .symbol-stroke{stroke:#c6d3e4}html[data-theme="dark"] .symbol-stroke{fill:#243346}html[data-theme="dark"] .symbol-code,html[data-theme="dark"] .symbol-label{fill:#bcd2f0}
.inspector-head{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:14px}.inspector-head h3{font-size:18px;margin:4px 0 0;overflow-wrap:anywhere}.inspector-head+.field{margin-top:0}.tab-content textarea{resize:vertical;outline:0}.tab-content textarea:focus{border-color:#7ca2d4;box-shadow:0 0 0 3px rgba(62,115,187,.12)}.inspector-meta{display:grid;grid-template-columns:70px 1fr;gap:8px;padding:10px;background:#f7f9fc;border:1px solid #e4eaf2;border-radius:7px;color:#718096;font-size:10px;line-height:1.45}.inspector-meta b,.inspector-meta code{color:#3f5e84;font-size:10px;overflow-wrap:anywhere}.inspector-actions{display:flex;gap:8px;margin-top:14px;flex-wrap:wrap}.inspector-actions button{flex:1;font-size:11px}.inspector-empty{display:flex;flex-direction:column;gap:8px;padding:28px 8px;color:#7c8b9e;font-size:11px;line-height:1.6}.inspector-empty b{font-size:14px;color:#53657b}html[data-theme="dark"] .inspector-meta{background:#1b2635;border-color:#3a4b60;color:var(--muted)}html[data-theme="dark"] .inspector-empty b{color:#c6d3e4}
.project-pipe{cursor:pointer}.project-pipe-line{fill:none;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}.project-pipe-label{font-size:11px;fill:#354457;text-anchor:middle;pointer-events:none;paint-order:stroke;stroke:#fbfcfe;stroke-width:5;stroke-linejoin:round}.port{fill:#fff;stroke:#3e73bb;stroke-width:1.5;cursor:crosshair;opacity:0;transition:opacity .15s}.port:hover{fill:#dcecff;stroke-width:3}.port-label{font-size:8px;fill:#71849a;pointer-events:none}.pipe-preview{fill:none;stroke:#3e73bb;stroke-width:2;stroke-dasharray:6 4}
.pipe-hit{fill:none;stroke:transparent;stroke-width:16;pointer-events:stroke}.project-pipe.selected .project-pipe-line{stroke:#3e73bb!important;stroke-width:5}.node.selected .node-card,.legend-symbol.selected .symbol-hit{stroke:#3e73bb;stroke-width:3}.control-pipe .project-pipe-line{stroke-width:1.5;stroke-dasharray:7 5}.pipe-preview{pointer-events:none}.node text,.legend-symbol text{user-select:none;pointer-events:none}#diagram{touch-action:none}.diagram-legend label{display:flex;align-items:center;gap:3px}.diagram-legend input{margin:0;width:12px;height:12px}.advanced-settings summary{cursor:pointer;font-size:12px;font-weight:700;color:var(--blue);margin-bottom:12px}.field textarea{width:100%;min-height:70px;border:1px solid #d6dfeb;border-radius:6px;background:#fbfcfe;color:var(--text);padding:8px;font:11px/1.5 Consolas,"Microsoft YaHei",monospace}.table-scroll{overflow:auto;margin-top:12px}.scan-table td button,.check-locate{font-size:10px;padding:3px 5px}.check-locate{margin-top:5px}html[data-theme="dark"] .field textarea{background:#1b2635;border-color:#3a4b60;color:var(--text)}

/* 参考图的设备线绘与阀表图例，共用唯一系统图画布。 */
.equipment-body{fill:#fff;stroke:#354457;stroke-width:1.8}.equipment-line,.equipment-coil{fill:none;stroke:#354457;stroke-width:1.8;stroke-linejoin:round}.equipment-coil{stroke-width:2.4}.fan-grille{stroke:#66778c;stroke-width:.65;fill:none}.equipment-solid{fill:#354457;stroke:#354457;stroke-width:1}.equipment-label{fill:#354457;font-size:13px}.equipment-value{fill:#65788e;font-size:11px}.node .equipment-hit,.legend-symbol .symbol-hit{fill:transparent;stroke:transparent;pointer-events:all}.node.selected .equipment-hit,.legend-symbol.selected .symbol-hit{fill:rgba(62,115,187,.05);stroke:#3e73bb;stroke-width:1;stroke-dasharray:4 4}.pipe-spec{font-size:9px;fill:#6c7e92}.node:hover .port,.legend-symbol:hover .port,.node.selected .port,.legend-symbol.selected .port,#diagram.connecting .port{opacity:1}.drawing-heading{font-size:13px;fill:#53677e;letter-spacing:1px}.drawing-rule{fill:none;stroke:#dce5ef;stroke-width:1}.drawing-note{font-size:11px;fill:#7d8c9d}.diagram-wrap svg{background:#fbfcfe}html[data-theme="dark"] .equipment-body{fill:#243346;stroke:#c6d3e4}html[data-theme="dark"] .equipment-line,html[data-theme="dark"] .equipment-coil{stroke:#c6d3e4}html[data-theme="dark"] .equipment-solid,html[data-theme="dark"] .symbol-fill{fill:#c6d3e4;stroke:#c6d3e4}html[data-theme="dark"] .equipment-label,html[data-theme="dark"] .symbol-label,html[data-theme="dark"] .project-pipe-label{fill:#d5e1ef}html[data-theme="dark"] .equipment-value{fill:#a3b8d0}html[data-theme="dark"] .project-pipe-label{stroke:#1b2635}html[data-theme="dark"] .diagram-wrap svg{background:#1b2635}

#drawingGrid{opacity:.55}html[data-theme="dark"] #drawingGrid{opacity:.08}html[data-theme="dark"] .node .equipment-hit{fill:transparent;stroke:transparent}html[data-theme="dark"] .node.selected .equipment-hit{fill:rgba(118,169,236,.06);stroke:#76a9ec}html[data-theme="dark"] .drawing-heading,html[data-theme="dark"] .drawing-note,html[data-theme="dark"] .pipe-spec{fill:#a3b8d0}

.object-group{margin-bottom:14px}.object-group>b,.object-annotations>summary{display:block;font-size:11px;color:var(--muted);margin:8px 0}.object-annotations>summary{cursor:pointer}.object-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px}.legend-item.tool-active{border-color:var(--blue);background:var(--blue-soft)}.pump-path-options{border:1px solid var(--line);border-radius:6px;max-height:180px;overflow:auto;margin:8px 0 12px;padding:8px}.pump-path-options legend{font-size:10px;color:var(--muted)}.pump-path-options label{font-size:10px;line-height:1.4}.mounted-symbol .symbol-label{font-size:10px;paint-order:stroke;stroke:var(--panel);stroke-width:3}.mounted-symbol .symbol-hit{stroke-dasharray:3 3}

.table-scroll table{min-width:680px}.table-scroll th,.table-scroll td button{white-space:nowrap}.table-scroll td:nth-child(2){min-width:110px}.table-scroll td:nth-child(3){min-width:130px}

.table-scroll table.hydraulic-table{min-width:0;width:100%;table-layout:fixed}.hydraulic-table th:first-child{width:48%}.hydraulic-table td:nth-child(2),.hydraulic-table td:nth-child(3){min-width:0}.pipe-caption{display:block;color:var(--muted);font-size:9px;line-height:1.5;margin-top:4px;overflow-wrap:anywhere}.hydraulic-table td{vertical-align:top}
.wp-handle{cursor:move;fill:rgba(62,115,187,.85);stroke:white;stroke-width:1.5}
.wp-handle.wp-add{fill:rgba(59,155,124,.9)}
.wp-handle:hover{fill:#285caa}
