/* UC-T014 frozen UI-04 /rules/:id implementation. Visual authority: frozen_ui_complete/04_可视化规则编辑器_确认母版.png */
.rule-page{display:block;max-width:1680px;margin:0 auto;padding-bottom:28px}
.rule-page[hidden]{display:none}
.rule-editor{display:grid;gap:12px}
.rule-topbar,.rule-panel,.rule-preview-shell,.rule-config-shell{border:1px solid rgba(47,126,172,.28);border-radius:10px;background:linear-gradient(155deg,rgba(3,28,55,.96),rgba(1,17,37,.94));box-shadow:0 16px 44px rgba(0,0,0,.17)}
.rule-topbar{display:grid;grid-template-columns:minmax(260px,1fr) auto;gap:16px;align-items:center;padding:13px 15px}
.rule-title-row{display:flex;align-items:center;gap:10px;min-width:0}.rule-title-row h1{font-size:18px;margin:0}.rule-title-row small{color:#6889a0;font-size:8px}
.rule-id-badge{padding:4px 7px;border:1px solid rgba(52,165,176,.34);border-radius:999px;background:rgba(9,74,78,.34);color:#6af2d0;font-size:8px;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rule-context{display:flex;gap:10px;align-items:center;color:#7898ae;font-size:8px}.rule-context strong{color:#cfe4ef}
.rule-steps{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
.rule-step{position:relative;min-height:46px;padding:7px 8px 7px 38px;border:1px solid rgba(56,120,158,.25);border-radius:7px;background:#041c36;color:#7695aa;text-align:left}
.rule-step span{position:absolute;left:9px;top:8px;width:22px;height:22px;display:grid;place-items:center;border-radius:50%;background:#0b3453;color:#83a7bd;font-size:8px}
.rule-step strong,.rule-step small{display:block}.rule-step strong{font-size:9px}.rule-step small{margin-top:2px;font-size:7px;color:#57768d}
.rule-step.active{border-color:#20cda8;background:linear-gradient(135deg,rgba(7,76,81,.52),rgba(5,41,62,.9));color:#efffff}.rule-step.active span{background:#0e725f;color:#7bffd5}
.rule-workspace{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:12px;min-height:590px}
.rule-left{display:grid;grid-template-rows:auto auto minmax(380px,1fr) auto;min-width:0}
.rule-browser-toolbar{display:grid;grid-template-columns:auto minmax(180px,1fr) auto;gap:7px;align-items:center;padding:10px;border-bottom:1px solid rgba(48,106,144,.18)}
.rule-nav-buttons{display:flex;gap:5px}.rule-nav-buttons button,.rule-device-buttons button,.rule-browser-toolbar>button{height:30px;min-width:30px;border:1px solid rgba(57,124,162,.27);border-radius:5px;background:#06223e;color:#779bb1;font-size:9px}
.rule-nav-buttons button:disabled,.rule-device-buttons button:disabled{opacity:.45;cursor:not-allowed}.rule-device-buttons button.active{border-color:#24d0a7;background:#0a4f55;color:#77f9d5}
.rule-url-wrap{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px}.rule-url-wrap input{height:31px;border:1px solid rgba(58,126,168,.32);border-radius:5px;background:#031a34;color:#dff3ff;padding:0 9px;font-size:9px}.rule-url-wrap button{height:31px;border:1px solid #16889b;border-radius:5px;background:#07374f;color:#69e8ce;font-size:8px;padding:0 10px}
.rule-view-tabs{display:flex;justify-content:space-between;gap:8px;align-items:center;padding:7px 10px;border-bottom:1px solid rgba(47,106,143,.15)}
.rule-tabset,.rule-device-buttons{display:flex;gap:5px}.rule-tabset button,.rule-side-tabs button,.rule-bottom-tabs button{border:0;background:transparent;color:#6d8ca3;font-size:8px}
.rule-tabset button{height:27px;padding:0 10px;border-radius:5px}.rule-tabset button.active{background:#0b4e62;color:#6ff4d0}
.rule-viewport{position:relative;min-height:390px;background:linear-gradient(160deg,rgba(3,26,49,.75),rgba(1,15,31,.85));overflow:hidden}
.rule-view{position:absolute;inset:0;padding:12px;overflow:auto}.rule-view[hidden]{display:none}
.rule-empty-preview{height:100%;min-height:360px;display:grid;place-items:center;text-align:center;border:1px dashed rgba(57,127,164,.28);border-radius:8px;background:radial-gradient(circle at 50% 30%,rgba(11,107,139,.08),transparent 45%)}
.rule-empty-preview>div{max-width:480px;padding:24px}.rule-empty-preview.has-screenshot{display:block;overflow:auto;text-align:left;padding:0}.rule-empty-preview.has-screenshot>div{max-width:none;padding:12px 16px;border-top:1px solid rgba(57,127,164,.2)}.rule-browser-screenshot{display:block;width:100%;height:auto;max-height:560px;object-fit:contain;background:#fff}.rule-empty-preview .preview-icon{display:inline-grid;width:48px;height:48px;place-items:center;border-radius:12px;background:#0a3b57;color:#50e2c0;font-size:20px}.rule-empty-preview h3{margin:10px 0 6px;font-size:13px}.rule-empty-preview p{margin:0;color:#6b8ca3;font-size:8px;line-height:1.65}
.rule-select-tools{display:flex;gap:6px;flex-wrap:wrap;justify-content:center;margin-top:14px}.rule-select-tools button{height:28px;padding:0 9px;border:1px solid rgba(56,122,161,.27);border-radius:5px;background:#061f3a;color:#7899ae;font-size:8px}.rule-select-tools button.active{border-color:#24d0a7;background:#0a4f55;color:#77f9d5}
.rule-code-empty{min-height:360px;display:grid;place-items:center;text-align:center;border:1px dashed rgba(57,127,164,.24);border-radius:8px;color:#64869d;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:9px;line-height:1.6;padding:24px}.rule-code-output{min-height:360px;white-space:pre-wrap;word-break:break-word;border:1px solid rgba(57,127,164,.24);border-radius:8px;background:#021429;color:#9fc3d7;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:9px;line-height:1.6;padding:16px}
.rule-local-status{padding:8px 10px;border-top:1px solid rgba(49,105,141,.15);color:#688ba2;font-size:8px;line-height:1.5}.rule-local-status.ok{color:#75dbc2}.rule-local-status.error{color:#ff9da2}
.rule-side{display:grid;grid-template-rows:auto minmax(0,1fr) auto}
.rule-side-tabs{display:grid;grid-template-columns:repeat(4,1fr);gap:2px;padding:7px;border-bottom:1px solid rgba(48,107,145,.17)}.rule-side-tabs button{min-height:35px;border-radius:5px}.rule-side-tabs button.active{background:#0b465b;color:#72f5d2}
.rule-side-content{overflow:auto;max-height:620px}.rule-pane{padding:11px}.rule-pane[hidden]{display:none}
.rule-section{padding:10px 0;border-bottom:1px solid rgba(49,108,145,.16)}.rule-section:first-child{padding-top:0}.rule-section:last-child{border-bottom:0}
.rule-section h2{font-size:10px;margin:0 0 8px}.rule-section p{color:#65869e;font-size:8px;line-height:1.55;margin:5px 0}
.rule-form-row{display:grid;gap:5px;margin-bottom:8px}.rule-form-row label{color:#91acbe;font-size:8px}.rule-form-row input,.rule-form-row select,.rule-form-row textarea{border:1px solid rgba(57,121,160,.28);border-radius:5px;background:#031a34;color:#d9ecf6;padding:0 8px;font-size:8px}.rule-form-row input,.rule-form-row select{height:31px}.rule-form-row textarea{min-height:72px;padding:8px;resize:vertical}.rule-form-row input::placeholder,.rule-form-row textarea::placeholder{color:#506f86}
.rule-form-split{display:grid;grid-template-columns:1fr 96px;gap:6px}.rule-match{min-height:29px;display:flex;align-items:center;justify-content:center;border:1px solid rgba(53,117,155,.2);border-radius:5px;background:#051f39;color:#688aa1;font-size:8px}
.rule-field-toolbar{display:flex;justify-content:space-between;gap:8px;align-items:center;margin-bottom:7px}.rule-field-toolbar span{font-size:8px;color:#7898ad}.rule-add{height:27px;border:1px solid #187c99;border-radius:5px;background:#07344c;color:#64e7c4;font-size:8px;padding:0 9px}
.rule-fields{display:grid;gap:6px}.rule-field-empty{padding:18px 8px;text-align:center;border:1px dashed rgba(56,119,157,.24);border-radius:6px;color:#5f8199;font-size:8px}
.rule-field{display:grid;grid-template-columns:22px minmax(80px,1fr) 78px 24px 24px 24px;gap:5px;align-items:center;padding:6px;border:1px solid rgba(50,111,149,.21);border-radius:6px;background:#041e38}.rule-field.dragging{opacity:.55}.rule-field-handle{cursor:grab;color:#55778f;text-align:center;font-size:11px}.rule-field input,.rule-field select{height:28px;border:1px solid rgba(56,115,152,.23);border-radius:4px;background:#03182f;color:#cfe2ed;padding:0 6px;font-size:7px;min-width:0}.rule-field button{width:23px;height:23px;border:0;border-radius:4px;background:#082943;color:#7797ab;font-size:8px}.rule-field .remove{background:rgba(92,31,40,.35);color:#ff969b}.rule-field-selector{grid-column:2/7}
.rule-toggle-row{display:flex;justify-content:space-between;align-items:center;gap:8px}.rule-toggle-row label{font-size:8px;color:#96afbf}.rule-toggle{accent-color:#27dda0}
.rule-next-list{display:grid;gap:5px}.rule-next-step{display:grid;grid-template-columns:minmax(110px,.8fr) minmax(150px,1.2fr) 24px;gap:5px}.rule-next-step input{height:29px;border:1px solid rgba(56,116,153,.23);border-radius:5px;background:#03182f;color:#cfe1eb;padding:0 7px;font-size:7px}.rule-next-step button{border:0;border-radius:5px;background:rgba(91,31,41,.36);color:#ff9aa0}
.rule-info-card{padding:10px;border:1px solid rgba(50,115,150,.2);border-radius:6px;background:#041f38;color:#7899ad;font-size:8px;line-height:1.6}.rule-info-card strong{color:#bcd4df}
.rule-action-bar{display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:10px;border-top:1px solid rgba(47,105,142,.17)}.rule-action-bar button{min-height:33px;border:1px solid rgba(56,123,160,.27);border-radius:5px;background:#06213d;color:#6f91a7;font-size:8px}.rule-action-bar .primary{border-color:#2ad59e;background:linear-gradient(135deg,#14b981,#43e979);color:#03271f;font-weight:700}.rule-action-bar button:disabled{opacity:.62;cursor:not-allowed}.rule-action-bar .full{grid-column:1/-1}
.rule-bottom{display:grid;grid-template-rows:auto minmax(110px,1fr)}.rule-bottom-tabs{display:flex;gap:6px;padding:7px 10px;border-bottom:1px solid rgba(47,106,143,.15)}.rule-bottom-tabs button{height:28px;padding:0 10px;border-radius:5px}.rule-bottom-tabs button.active{background:#0b485d;color:#70f3d0}
.rule-bottom-content{padding:10px;min-height:120px}.rule-bottom-empty{min-height:98px;display:grid;place-items:center;text-align:center;border:1px dashed rgba(54,120,157,.22);border-radius:6px;color:#64859c;font-size:8px;line-height:1.55}.rule-bottom-empty:has(.rule-sample-shell){display:block;text-align:left;border-style:solid}
.rule-sample-shell{display:grid;gap:8px;min-width:0}.rule-sample-head{display:flex;justify-content:space-between;gap:10px;align-items:center}.rule-sample-head strong,.rule-sample-head small{display:block}.rule-sample-head strong{color:#cfe3ed;font-size:9px}.rule-sample-head small{margin-top:2px;color:#698aa0;font-size:7px}.rule-sample-head button{height:28px;padding:0 9px;border:1px solid #187c99;border-radius:5px;background:#07344c;color:#64e7c4;font-size:8px}.rule-sample-head button:disabled{opacity:.55;cursor:not-allowed}
.rule-sample-quality{display:flex;gap:6px;flex-wrap:wrap}.rule-sample-quality span{padding:4px 7px;border:1px solid rgba(54,119,155,.24);border-radius:999px;background:#041d37;color:#7497ad;font-size:7px}.rule-sample-quality .good{color:#77e8bf;border-color:rgba(51,208,157,.3)}.rule-sample-quality .warning{color:#f3ce78;border-color:rgba(225,176,73,.3)}.rule-sample-quality .poor{color:#ff9b9e;border-color:rgba(255,102,108,.3)}
.rule-sample-source{display:block;color:#67d9c0;font-size:7px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rule-sample-table-wrap{overflow:auto}.rule-sample-table{width:100%;border-collapse:collapse;font-size:8px}.rule-sample-table th,.rule-sample-table td{padding:7px 8px;border:1px solid rgba(52,112,150,.2);text-align:left;vertical-align:top;max-width:220px;word-break:break-word}.rule-sample-table th{background:#06223e;color:#9db9ca;white-space:nowrap}.rule-sample-table td{background:#03182f;color:#c0d6e1}.rule-sample-empty{padding:18px 10px;text-align:center;border:1px dashed rgba(56,119,157,.24);border-radius:6px;color:#66889e}.rule-sample-warnings{display:grid;gap:4px}.rule-sample-warnings div{padding:6px 8px;border-left:2px solid #d8a84f;background:rgba(85,59,17,.24);color:#c9ad72;font-size:7px;line-height:1.45}
.rule-help-list{display:grid;gap:7px}.rule-help-list article{padding:9px;border:1px solid rgba(53,114,151,.19);border-radius:6px;background:#041e37}.rule-help-list strong{display:block;font-size:8px}.rule-help-list p{margin:3px 0 0}
@media(max-width:1220px){.rule-workspace{grid-template-columns:1fr}.rule-side-content{max-height:none}.rule-side{grid-template-rows:auto auto auto}.rule-action-bar{grid-template-columns:repeat(3,1fr)}.rule-action-bar .full{grid-column:auto}}
@media(max-width:760px){.rule-topbar{grid-template-columns:1fr}.rule-steps{grid-template-columns:1fr 1fr}.rule-browser-toolbar{grid-template-columns:1fr}.rule-nav-buttons{order:2}.rule-url-wrap{order:1}.rule-device-buttons{display:none}.rule-workspace{min-height:auto}.rule-field{grid-template-columns:22px 1fr 70px 24px}.rule-field button:nth-of-type(1),.rule-field button:nth-of-type(2){display:none}.rule-field .remove{display:block}.rule-field-selector{grid-column:2/5}}
@media(max-width:480px){.rule-steps{grid-template-columns:1fr}.rule-side-tabs{grid-template-columns:1fr 1fr}.rule-action-bar{grid-template-columns:1fr}.rule-action-bar .full{grid-column:auto}.rule-form-split{grid-template-columns:1fr}}
