:root{--ink:#17232e;--muted:#73808d;--line:#e7eaee;--bg:#f6f8fa;--green:#0d876d;--sidebar:#111c25;--accent:#d7f26a}*{box-sizing:border-box}body{margin:0;background:var(--bg);font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC",sans-serif;color:var(--ink);font-size:14px}button,input,select{font:inherit}a{color:inherit;text-decoration:none}.shell{display:flex;min-height:100vh}.sidebar{width:236px;flex-shrink:0;background:var(--sidebar);color:#e6ecef;padding:29px 18px;position:sticky;top:0;height:100vh;display:flex;flex-direction:column}.brand{display:flex;align-items:center;gap:12px;font-size:19px;font-weight:800;letter-spacing:-.8px;padding:0 8px 45px}.brandicon{width:35px;height:35px;border-radius:9px;background:var(--accent);color:#152116;display:grid;place-items:center;font-size:23px}.brand small{display:block;color:#7f929d;font-size:10px;letter-spacing:1.7px;margin-top:3px;font-weight:500}.accent{color:var(--accent)}.navlabel{font-size:10px;color:#6d828e;letter-spacing:2px;margin:3px 12px 15px}.sidebar nav a{display:flex;gap:13px;align-items:center;padding:14px 15px;border-radius:9px;color:#99a9b3;font-weight:600;margin-bottom:4px}.sidebar nav a.active{color:var(--accent);background:#26343b}.sidebar nav a:hover{background:#27333d}.sidebottom{margin-top:auto;color:#a9b6bd;font-size:11px;padding:16px 10px;border-top:1px solid #2d3a45}.pulse{display:inline-block;width:7px;height:7px;background:#7bdf91;border-radius:50%;margin-right:4px}.sidebottom form{margin-top:16px}.sidebottom .textbtn{color:#a9b6bd}.main{flex:1;min-width:0}.topbar{height:72px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 42px}.crumb{font-size:12px;color:#7b8992}.topright{font-size:12px;color:#31856f}.date{color:#9faab2;margin-left:18px}.content{max-width:1550px;margin:auto;padding:45px 42px 90px}.pagehead{display:flex;justify-content:space-between;align-items:center;gap:25px;margin-bottom:32px}.eyebrow{font-size:11px;letter-spacing:2.2px;color:#7b8d92;font-weight:700}.pagehead h1{font-size:32px;letter-spacing:-1.5px;margin:9px 0 8px}.dim{color:#bdc6cc;font-weight:400}.muted{color:var(--muted)}.pagehead p{margin:0}.btn{border:0;border-radius:8px;padding:12px 19px;font-weight:700;cursor:pointer;white-space:nowrap}.btn.primary{background:#193529;color:#e0ff99}.btn.primary:hover{background:#26503b}.btn.dark{background:var(--ink);color:white}.btn.wide{width:100%}.statgrid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:17px;margin-bottom:38px}.stat,.panel{background:#fff;border:1px solid var(--line);border-radius:13px}.stat{padding:22px 24px;min-width:0}.stat-label{display:flex;justify-content:space-between;color:#75838c;font-size:12px}.stat-label span{color:#a9b6bd;font-size:17px}.stat strong{display:block;font-size:37px;margin:14px 0 8px;letter-spacing:-1px}.stat strong small{font-size:13px;font-weight:500}.stat-foot{font-size:11px;color:#8e9ba3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.section-title{display:flex;justify-content:space-between;margin:0 0 17px}.section-title h2{font-size:19px;margin:0 0 5px}.section-title p{margin:0;font-size:12px;color:var(--muted)}.formpanel{padding:22px;margin-bottom:18px}.panel-title{font-weight:750;font-size:15px;margin-bottom:18px}.ruleform{display:grid;grid-template-columns:1fr 1.3fr 1.25fr 1.2fr 1.25fr auto;gap:12px;align-items:end}.ruleform>div{min-width:0}label{display:block;color:#596975;font-size:11px;font-weight:650;margin-bottom:8px}input,select{display:block;width:100%;padding:11px 12px;background:#fbfcfd;color:#263642;border:1px solid #e1e6e9;border-radius:7px;outline:none;height:43px}input:focus,select:focus{border-color:#83b5a0;box-shadow:0 0 0 3px #b7dfcf4d}.tablepanel{overflow:hidden}.tablewrap{overflow-x:auto}table{width:100%;border-collapse:collapse;min-width:800px}th{text-align:left;background:#fafbfc;padding:16px 20px;color:#88959e;font-size:11px;font-weight:600;border-bottom:1px solid var(--line)}td{padding:16px 20px;border-bottom:1px solid #f0f2f4;vertical-align:middle}tr:last-child td{border-bottom:0}td b{font-size:13px}td .cellsub{color:#9aa5ad;font-size:10px;margin:4px 0 0 36px}.numeric{font-variant-numeric:tabular-nums;font-weight:650}.numeric .cellsub{margin-left:0;font-weight:400}.exchange-icon{display:inline-grid;place-items:center;width:27px;height:27px;border-radius:6px;margin-right:9px;background:#20282d;color:#edeeef;font-weight:800}.exchange-icon.binance{background:#fbefc6;color:#795a05}.exchange-icon.okx{background:#111;color:#fff}.status{font-size:11px;padding:5px 8px;border-radius:6px;white-space:nowrap}.status.hit{background:#fff0e4;color:#b76424}.status.normal{background:#e9f5ee;color:#267d56}.status.waiting{background:#f0f2f4;color:#83919b}.status.error{background:#fdeaea;color:#bb4141}td code{display:inline-block;background:#f2f4f5;padding:5px 8px;border-radius:5px;margin-left:5px;white-space:nowrap}.right{text-align:right}.actions{white-space:nowrap}.actions form{display:inline}.textbtn{background:none;border:none;color:#527267;cursor:pointer;padding:4px 5px;font-size:12px}.textbtn:hover{text-decoration:underline}.textbtn.danger{color:#be5656}.empty{text-align:center;color:#a0aab2;padding:33px}.editcell{background:#f8fbf9}.editcell .ruleform{grid-template-columns:repeat(5,minmax(0,1fr)) auto}.eventhead{margin-top:40px}.preline{white-space:pre-line;line-height:1.65}.nowrap{white-space:nowrap}.small{font-size:12px}.settingsgrid{display:grid;grid-template-columns:1fr 1fr;gap:18px;align-items:start}.settingpanel{padding:26px}.settingpanel .muted{line-height:1.6;font-size:12px;margin:-5px 0 24px}.settingpanel label{margin:17px 0 8px}.hint{font-size:11px;color:#9ca6ae;margin-top:7px}.two-cols{display:grid;grid-template-columns:2fr 1fr;gap:15px}.savebar{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-top:24px;color:#7a8992;font-size:12px}.flash{padding:14px 18px;border-radius:8px;margin-bottom:18px;background:#e8f5ec;color:#21754e}.flash.error{background:#ffefee;color:#b94b4b}.login-body{background:#15232b;display:grid;place-items:center;min-height:100vh;padding:20px}.login-card{background:white;width:100%;max-width:430px;border-radius:18px;padding:40px}.login-card .brand{padding:0 0 28px;color:#18352b}.login-card .brandicon{background:#daf38b}.login-card .brand small{color:#829399}.login-card .accent{color:#658529}.login-card h1{font-size:26px;margin:6px 0}.login-card p{line-height:1.7}.login-card label{margin-top:28px}.login-card button{margin-top:20px}@media(max-width:1100px){.statgrid{grid-template-columns:repeat(2,1fr)}.ruleform{grid-template-columns:repeat(3,1fr)}.settingsgrid{grid-template-columns:1fr}}@media(max-width:720px){.shell{display:block}.sidebar{position:static;height:auto;width:auto;padding:14px 18px}.sidebar .brand{padding:0 0 12px}.sidebar nav{display:flex;gap:8px}.navlabel,.sidebottom{display:none}.sidebar nav a{padding:10px}.topbar{padding:0 18px;height:55px}.date{display:none}.content{padding:25px 16px}.pagehead{align-items:start}.pagehead h1{font-size:25px}.statgrid{gap:10px}.stat{padding:16px}.stat strong{font-size:29px}.ruleform,.editcell .ruleform{grid-template-columns:1fr 1fr}.ruleform .btn{grid-column:span 2}.settingsgrid{grid-template-columns:1fr}.savebar{align-items:stretch;flex-direction:column}}

/* 接口与通知 */
.config-source{padding:7px 11px;border:1px solid var(--line);border-radius:6px;color:#596975;font-size:12px;white-space:nowrap;background:#fff}
.source-panel{padding:24px 26px;margin-bottom:32px}
.config-section-head{display:flex;justify-content:space-between;align-items:center;gap:16px}
.config-section-head h2{font-size:17px;margin:0 0 6px}
.config-section-head p{margin:0;color:var(--muted);font-size:12px}
.config-caption{font-size:11px;color:var(--muted)}
.source-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px;margin:22px 0 0}
.source-list>div{min-width:0;display:flex;align-items:center;gap:18px;padding-top:18px;border-top:1px solid var(--line)}
.source-list dt{display:flex;align-items:center;font-weight:650;white-space:nowrap}
.source-list dd{margin:0;overflow-wrap:anywhere;color:#596975;font-size:13px;line-height:1.6}
.notification-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}
.notification-card{min-width:0;display:flex;flex-direction:column;overflow:hidden}
.notification-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:24px 22px 20px}
.notification-head h3{font-size:17px;margin:0 0 8px}
.notification-head p{font-size:12px;color:var(--muted);line-height:1.6;margin:0}
.notification-head .status{flex-shrink:0}
.notification-body{padding:0 22px 24px;flex:1}
.config-details{margin:0;border-top:1px solid var(--line);padding-top:16px}
.config-details>div{display:grid;grid-template-columns:48px minmax(0,1fr);gap:14px;margin-bottom:13px;line-height:1.7;font-size:12px}
.config-details dt{color:var(--muted)}
.config-details dd{margin:0;overflow-wrap:anywhere}
.config-port{display:inline-block;font-size:11px;color:var(--muted);margin-left:4px}
.webhook-detail>div{display:block}
.webhook-detail dt{margin-bottom:10px}
.webhook-detail dd{background:var(--bg);border-radius:6px;padding:12px;font-size:12px;line-height:1.8;color:#526574}
.config-note{margin:16px 0 0;color:var(--muted);font-size:11px;line-height:1.7}
.notification-footer{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:16px 22px;border-top:1px solid var(--line);background:#fafcfa}
.notification-footer>span{font-size:11px;color:var(--muted)}
.notification-footer form{margin:0}
.notification-test{padding:9px 12px;font-size:12px;background:#fff;color:#255942;border:1px solid #cbdcd2}
.notification-test:hover{background:#edf5ef;border-color:#8eb19c}
.notification-test:focus-visible{outline:3px solid #83b5a0;outline-offset:3px}
.config-footnote{font-size:12px;color:var(--muted);line-height:1.8;margin:22px 0 0;max-width:80ch}
@media(max-width:1250px){.notification-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.notification-card:last-child{grid-column:1/-1}.source-list>div{align-items:flex-start;flex-direction:column;gap:8px}}
@media(max-width:720px){.config-source{font-size:10px;padding:6px 8px}.source-panel{padding:20px}.source-list,.notification-grid{grid-template-columns:1fr}.source-list{gap:16px}.source-list>div{flex-direction:row;align-items:center;gap:12px}.notification-card:last-child{grid-column:auto}.notification-head{padding:20px}.notification-body{padding:0 20px 20px}.notification-footer{padding:16px 20px}.pagehead:has(.config-source){gap:12px;flex-wrap:wrap}}

/* 规则配置 */
.ruleform,.editcell .ruleform{display:block}
.rule-builder{max-width:960px}
.builder-top,.builder-condition{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}
.builder-operands{display:flex;align-items:center;gap:20px;margin:24px 0}
.builder-operands fieldset{flex:1;min-width:0;margin:0;padding:18px 20px;border:1px solid var(--line);border-radius:8px}
.builder-operands legend{padding:0 8px;font-weight:650}
.builder-operands label:not(:first-of-type){margin-top:16px}
.builder-divide{font-size:30px;color:var(--muted)}
.builder-hint{color:#596975;font-size:12px;line-height:1.8;margin:18px 0}
.builder-preview{padding:16px 18px;background:#f1f6f3;border-left:3px solid #527267;line-height:1.8;overflow-wrap:anywhere}
.builder-preview>span{display:block;font-size:11px;color:#596975;margin-bottom:4px}
.builder-preview output{font-variant-numeric:tabular-nums;font-weight:650}
.builder-actions{display:flex;gap:16px;align-items:center;margin-top:20px}
.rule-builder [hidden]{display:none!important}
.builder-actions button:focus-visible{outline:3px solid #83b5a0;outline-offset:3px}
@media(max-width:720px){.builder-operands{flex-direction:column;align-items:stretch;gap:10px}.builder-divide{text-align:center}.builder-top,.builder-condition{grid-template-columns:1fr;gap:16px}.builder-operands fieldset{padding:16px}.ruleform .btn{grid-column:auto}}

/* 新增与编辑弹窗 */
.rule-dialog{width:min(800px,calc(100% - 32px));max-height:calc(100dvh - 40px);overflow-y:auto;padding:26px;border:1px solid var(--line);border-radius:13px;color:var(--ink);background:#fff}
.rule-dialog::backdrop{background:rgb(17 28 37 / 55%)}
.dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:24px}
.dialog-heading h2{font-size:20px;margin:0}
.dialog-heading button{padding:10px;min-width:40px}
body:has(.rule-dialog[open]){overflow:hidden}
@media(max-width:720px){.rule-dialog{padding:20px;max-height:calc(100dvh - 24px)}.section-title{align-items:center;gap:12px}}

/* 品牌标识 */
img.brandicon{display:block;flex-shrink:0;object-fit:contain}
