/* 新版布局：左侧模块树 + 右侧工作区（复用 style.css 里的卡片/表格/标签样式） */

#app{height:100%;display:flex;flex-direction:row;overflow:hidden}

/* ---------- 左侧栏 ---------- */
.side{width:206px;flex:none;background:#fff;border-right:1px solid var(--line);display:flex;flex-direction:column;height:100%}
.side-brand{display:flex;align-items:center;gap:8px;padding:14px 16px 12px;font-size:14.5px;font-weight:800;letter-spacing:-.2px}
.side-brand i{width:26px;height:26px;border-radius:8px;background:linear-gradient(135deg,#0d9488,#10b981);color:#fff;display:flex;align-items:center;justify-content:center;font-style:normal;font-size:12px;font-weight:800}
.side-nav{flex:1;overflow-y:auto;padding:4px 8px 12px}
.side-nav::-webkit-scrollbar{width:6px}
.side-nav::-webkit-scrollbar-thumb{background:#e2e8f0;border-radius:6px}
.sg{margin-top:10px}
.sg-t{font-size:10px;color:#a8b4c4;font-weight:700;letter-spacing:.4px;padding:6px 10px 4px}
.si{display:flex;align-items:center;gap:8px;padding:7px 10px;border-radius:9px;font-size:12.5px;color:var(--ink2);cursor:pointer;line-height:1.2}
.si:hover{background:#f6f8fb}
.si.on{background:#ecfdf5;color:#0f766e;font-weight:700}
.si .ico{width:14px;text-align:center;font-size:11px;color:#9aa8b8}
.si.on .ico{color:#0d9488}
.si .bdg{margin-left:auto;font-size:10px;background:#eef2f7;color:#64748b;border-radius:20px;padding:1px 6px;font-weight:700}
.si .bdg.warn{background:#fffbeb;color:#b45309}
.si .bdg.bad{background:#fef2f2;color:#b91c1c}
.si.locked{color:#c8d2dd;cursor:not-allowed}

.side-foot{flex:none;border-top:1px solid var(--line);padding:9px 12px 11px;display:flex;flex-direction:column;gap:8px}
.sf-row{display:flex;align-items:center;gap:7px;font-size:11px;color:var(--mut)}
.sf-row.who2{background:#f6f8fb;border-radius:12px;padding:6px 8px}
.who-t{display:flex;flex-direction:column;line-height:1.25}
.who-t b{font-size:11.5px;color:var(--ink)}
.who-t span{font-size:10px;color:var(--mut2)}

/* ---------- 右侧工作区 ---------- */
.main{flex:1;min-width:0;display:flex;flex-direction:column;height:100%;background:var(--bg)}
.phead{flex:none;padding:14px 22px 10px;display:flex;align-items:flex-end;gap:16px}
.phead h1{font-size:19px;font-weight:800;letter-spacing:-.5px;line-height:1.2}
.psub{font-size:11.5px;color:var(--mut);margin-top:4px;line-height:1.5}
.pact{margin-left:auto;display:flex;align-items:center;gap:8px;padding-bottom:2px}
.view{flex:1;overflow-y:auto;padding:4px 22px 22px}
.view::-webkit-scrollbar{width:8px}
.view::-webkit-scrollbar-thumb{background:#dde5ee;border-radius:8px}

/* 页面通用块 */
.card{background:#fff;border:1px solid var(--line);border-radius:14px}
.card-h{display:flex;align-items:center;gap:8px;padding:12px 15px;border-bottom:1px solid var(--line);font-size:12.5px;font-weight:700}
.card-h .hint{margin-left:0}
.card-h .r{margin-left:auto;display:flex;gap:6px;align-items:center}
.card-b{padding:12px 15px}
.grid2{display:grid;grid-template-columns:1fr 340px;gap:12px;align-items:stretch}
.grid2b{display:grid;grid-template-columns:340px 1fr;gap:12px;align-items:stretch}
.grid2>.card,.grid2b>.card{height:100%}
.stack{display:flex;flex-direction:column;gap:12px}
.row2{display:grid;grid-template-columns:1fr 1fr;gap:12px}

/* 顶部小工具条 */
.toolbar{display:flex;align-items:center;gap:8px;margin-bottom:10px;flex-wrap:wrap}
.toolbar select,.toolbar input{height:30px;border:1px solid var(--line);border-radius:9px;background:#fff;font-size:12px;padding:0 9px;color:var(--ink2);outline:none}
.toolbar input{width:190px}
.toolbar .sp{flex:1}

/* 空态 / 离线提示 */
.offline{background:#fff7ed;border:1px solid #fed7aa;color:#9a3412;border-radius:12px;padding:10px 14px;font-size:12px;margin-bottom:10px;display:flex;gap:8px;align-items:center}
.offline b{font-weight:700}
.tip{font-size:11px;color:var(--mut2);margin-top:6px}

/* 简单进度条 */
.pb{height:6px;background:#eef2f7;border-radius:6px;overflow:hidden;min-width:60px}
.pb i{display:block;height:100%;background:linear-gradient(90deg,#0d9488,#10b981);border-radius:6px}
.pb.warn i{background:linear-gradient(90deg,#f59e0b,#d97706)}
.pb.bad i{background:linear-gradient(90deg,#ef4444,#dc2626)}

/* 小徽标 */
.tag{display:inline-flex;align-items:center;gap:4px;font-size:10.5px;border-radius:6px;padding:2px 7px;background:#f1f5f9;color:#475569;font-weight:600}
.tag.ok{background:#ecfdf5;color:#0f766e}
.tag.warn{background:#fffbeb;color:#b45309}
.tag.bad{background:#fef2f2;color:#b91c1c}
.tag.info{background:#eff6ff;color:#1d4ed8}

/* 总览补充样式（沿用 style.css 的 .todo 结构） */
.hello{display:flex;align-items:baseline;gap:12px;padding:4px 2px 14px}
.hello h2{font-size:21px;letter-spacing:-.4px;font-weight:700}
.hello h2 b{color:#0d9488;font-size:25px;margin:0 2px}
.hello .hd{font-size:11.5px;color:#94a3b8}
.todo .ta{display:flex;align-items:center;padding:12px 16px 12px 0}
.todo .ta .btn{white-space:nowrap}
.todo+.todo{margin-top:9px}
.hrow{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:12px;color:#475569;padding:2px 0}
.hrow .dot{margin-left:14px}
.hrow .dot:first-child{margin-left:0}

/* 页面补充：柱状图 / 日志框 / 引擎条 / 锁定条 / 键值网格 */
.bars{display:flex;align-items:flex-end;gap:10px;height:150px;padding:6px 2px 0}
.bcol{flex:1;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:6px;height:100%}
.bcol i{display:block;width:60%;max-width:34px;border-radius:6px 6px 2px 2px;background:linear-gradient(180deg,#10b981,#0d9488);min-height:3px}
.bcol b{font-size:10px;color:#94a3b8;font-weight:600}
.logbox{max-height:560px;overflow:auto;background:#0b1220;color:#c7d2e0;border-radius:12px;padding:12px 14px;font:12px/1.65 Consolas,monospace}
.logbox div{white-space:pre-wrap;word-break:break-all}
.mono{font-family:Consolas,monospace;font-size:11.5px}
.engine{display:flex;align-items:center;gap:10px;background:#fff;border:1px solid var(--line,#e9eef5);border-radius:14px;padding:12px 16px;margin-bottom:12px}
.engine .en{flex:1;min-width:0}
.engine .en b{display:block;font-size:13.5px}
.engine .en span{font-size:11.5px;color:#94a3b8}
.engine .dot{width:8px;height:8px;border-radius:50%;background:#cbd5e1}
.engine .dot.ok{background:#10b981}
.lockbar{background:#0b1220;color:#fff;border-radius:12px;padding:11px 16px;font-size:11.5px;margin-bottom:12px;display:flex;gap:10px;align-items:center}
.lockbar .who{margin-left:auto;background:#1f2a3c;padding:4px 10px;border-radius:20px;font-size:11px}
.kv-grid{display:grid;gap:12px}
.kv-i .k{font-size:11px;color:#94a3b8}
.kv-i .v{font-size:13.5px;font-weight:600;margin-top:3px}
.form-row{display:flex;align-items:center;gap:10px;margin-bottom:9px}
.form-row label{width:80px;font-size:12px;color:#64748b}
.inp{height:34px;border:1px solid var(--line,#e9eef5);border-radius:9px;padding:0 11px;font-size:13px;font-family:inherit;outline:none;background:#fff}
.inp:focus{border-color:#10b981}
.inp.sm{height:28px;font-size:12px}
.hint{font-size:11.5px;color:#94a3b8;margin-top:10px;line-height:1.7}

/* 驾驶舱 hero：左绿卡 + 右四格 KPI */
.hero{display:grid;grid-template-columns:1fr 380px;gap:14px;margin-bottom:12px}
.hero-l{background:linear-gradient(135deg,#0d9488,#10b981);border-radius:18px;padding:16px 18px;color:#fff;display:flex;flex-direction:column;gap:8px;min-height:176px}
.hero-l .hl{font-size:12px;opacity:.92;display:flex;align-items:center;gap:8px}
.hero-l .hl span{background:rgba(255,255,255,.2);border-radius:20px;padding:2px 9px;font-size:10.5px}
.hero-l .hv{font-size:36px;font-weight:800;letter-spacing:-1px;line-height:1.1}
.hero-l .hv small{font-size:13px;margin-left:5px;font-weight:600;opacity:.9}
.hero-l .hbar{display:flex;align-items:center;gap:9px;font-size:11px}
.hero-l .hbar .pb,.hero-l .hbar .bar{flex:1;background:rgba(255,255,255,.28);height:7px;border-radius:5px;margin:0}
.hero-l .hbar .pb i,.hero-l .hbar .bar i{background:#fff;height:100%;border-radius:5px}
.hero-btns{display:flex;gap:8px;margin-top:2px}
.hero-btns .btn{background:#0b1220;border-color:#0b1220;color:#fff;font-weight:600}
.hero-btns .btn.ghost{background:rgba(255,255,255,.18);border-color:rgba(255,255,255,.3);color:#fff}
.hero-foot{display:flex;justify-content:space-between;font-size:11px;opacity:.86;margin-top:auto}
.hero-r{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:minmax(min-content,1fr) minmax(min-content,1fr);gap:12px;height:100%}
.hero-r .kpi{
  display:flex;flex-direction:column;justify-content:center;
  background:#fff;border:1px solid #eef2f8;border-radius:16px;padding:13px 16px;
  box-shadow:0 1px 3px rgba(15,23,42,.04),0 6px 18px -12px rgba(15,23,42,.08);
}
.hero-r .kpi .l{font-size:11.5px;color:#64748b;white-space:nowrap}
.hero-r .kpi .v{font-size:26px;font-weight:800;letter-spacing:-.8px;margin-top:4px;color:#0b1220;line-height:1.1}
.hero-r .kpi .v small{font-size:11px;color:#94a3b8;font-weight:600;margin-left:3px}
.hero-r .kpi .d{font-size:10.5px;color:#94a3b8;margin-top:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hero-r .kpi-empty{color:#cbd5e1;font-weight:600}
.mut{color:#94a3b8}
.n{font-variant-numeric:tabular-nums;font-weight:700}
.n-gray{color:#94a3b8;font-weight:600}
.row2{display:flex;gap:8px;align-items:center}
.row2 .inp{flex:1}
.pb{height:7px;background:#eef2f7;border-radius:5px;overflow:hidden}
.pb i{display:block;height:100%;background:linear-gradient(90deg,#0d9488,#10b981);border-radius:5px}
.pb.warn i{background:linear-gradient(90deg,#f59e0b,#fbbf24)}
.pb.bad i{background:linear-gradient(90deg,#dc2626,#f87171)}

/* 统一确认弹窗（SA.ask） */
.sa-mask{position:fixed;inset:0;background:rgba(11,18,32,.34);display:flex;align-items:center;justify-content:center;z-index:9000;padding:20px}
.sa-dlg{width:432px;max-width:100%;background:#fff;border:1px solid var(--line);border-radius:13px;box-shadow:0 16px 44px rgba(11,18,32,.18);overflow:hidden;animation:sa-dlg-in .14s ease-out}
@keyframes sa-dlg-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.sa-dlg-h{padding:15px 18px 0;font-size:13.5px;font-weight:800;color:var(--ink)}
.sa-dlg-b{padding:9px 18px 17px;font-size:12.5px;color:var(--ink2);line-height:1.8}
.sa-dlg-b b{font-weight:700;color:var(--ink)}
.sa-dlg-f{display:flex;justify-content:flex-end;gap:8px;padding:11px 18px;border-top:1px solid var(--line);background:#fbfcfe}
.btn.dan{background:var(--danger);border-color:var(--danger);color:#fff;font-weight:600}
.btn.dan:hover{background:#b91c1c;border-color:#b91c1c}

/* ── 跨两栏的整宽卡片（口径提醒之类不该只占左半栏） ── */
.fullrow{grid-column:1/-1;min-width:0}
.warnlist{display:flex;flex-direction:column}
.warnrow{display:grid;grid-template-columns:118px minmax(0,1fr);gap:4px 12px;padding:8px 0;border-top:1px solid #f4f7fb;font-size:12.5px;line-height:1.7}
.warnrow:first-child{border-top:0;padding-top:2px}
.warnrow .wr-t{font-weight:700;color:#b45309;white-space:nowrap}
.warnrow .wr-d{color:#334155;min-width:0;overflow:hidden;text-overflow:ellipsis}
.warnrow .wr-h{grid-column:2;color:#94a3b8;font-size:11.5px}

/* ── 设置中心：开关区 / 行内字段 / 高级操作分组 ── */
.swwrap{display:flex;flex-wrap:wrap;gap:14px 26px}
.inline-fld{display:inline-flex;align-items:center;gap:8px;font-size:12.5px;color:#475569}
/* 一行内「标签 + 输入 + 按钮」：form-row 是 grid，会把每个控件拉到独占一列，这里用 flex */
.inlinerow{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:14px}
.inlinerow .mut{font-size:12px;color:#64748b;white-space:nowrap}
.inlinerow .inp{height:34px;flex:none}
.oprows{display:flex;flex-direction:column}
.oprow{display:grid;grid-template-columns:64px minmax(0,1fr);gap:10px;align-items:center;padding:9px 0;border-top:1px solid #f4f7fb}
.oprow:first-child{border-top:0;padding-top:2px}
.opk{font-size:12px;color:#94a3b8;font-weight:600}
.opbtns{display:flex;flex-wrap:wrap;gap:8px}
