.sf-page [hidden],.sf-dialog [hidden]{display:none!important}
.sf-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px;margin-bottom:22px}
.sf-summary article{border:1px solid var(--line);background:var(--card);border-radius:12px;padding:20px 23px;display:flex;flex-direction:column;gap:8px}
.sf-summary span{color:var(--muted);font-size:12px}
.sf-summary strong{font-size:28px;color:var(--green);font-weight:650}
.sf-summary small{font-size:12px;color:var(--text-muted)}
.sf-alert{background:var(--warning-bg);color:var(--warning-fg);border:1px solid var(--warning-border);border-radius:9px;font-size:13px;padding:14px 18px;line-height:1.7;margin-bottom:20px;overflow-wrap:anywhere}
.sf-filters{display:grid;grid-template-columns:minmax(200px,1.4fr) minmax(180px,1fr) minmax(140px,.8fr) auto;gap:14px;align-items:end;margin:10px 0}
.sf-page .sf-filters label{margin:0;min-width:0}
.sf-filters input,.sf-filters select{margin-bottom:0;width:100%;min-width:0}
.sf-filters button{height:38px;margin-bottom:0}
.sf-help{font-size:12px;line-height:1.8;color:var(--text-muted);overflow-wrap:anywhere}
.sf-table{table-layout:fixed;min-width:670px}
.sf-table th:nth-child(1){width:19%}
.sf-table th:nth-child(2){width:25%}
.sf-table th:nth-child(3){width:42%}
.sf-table th:nth-child(4){width:14%}
.sf-table td{vertical-align:top;padding-top:20px;padding-bottom:20px;overflow-wrap:anywhere}
.sf-sku-code{font:600 12px/1.9 ui-monospace,SFMono-Regular,monospace}
.sf-product-cell{font-size:13px;line-height:1.9}
.sf-relation+.sf-relation{border-top:1px dashed var(--border-subtle);margin-top:13px;padding-top:13px}
.sf-relation-title{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.sf-relation-title strong{color:var(--accent);font-size:13px;font-weight:550;line-height:1.8}
.sf-relation-title .tag{font-size:11px;padding:3px 6px}
.sf-relation-detail{margin-top:7px}
.sf-relation-detail summary,.sf-group-details summary{font-size:12px;color:var(--text-muted);cursor:pointer;line-height:1.9;list-style-position:inside}
.sf-relation-detail dl,.sf-group-details dl{display:grid;grid-template-columns:74px minmax(0,1fr);gap:8px 10px;margin:11px 0;background:var(--surface-hover);border-radius:7px;padding:11px 12px;font-size:12px;line-height:1.7}
.sf-relation-detail dt,.sf-group-details dt{color:var(--text-muted)}
.sf-relation-detail dd,.sf-group-details dd{margin:0;overflow-wrap:anywhere;color:var(--text-muted);font-family:ui-monospace,SFMono-Regular,monospace}
.sf-unmapped{display:inline-block;color:var(--warning-fg);font-size:12px;background:var(--warning-bg);border-radius:5px;padding:5px 8px;margin-bottom:10px}
.sf-invalid{font-size:12px;line-height:1.8;color:var(--warning-fg);margin:7px 0}
.sf-missing-name{font-size:12px;margin:5px 0}
.sf-configure{font-size:12px;white-space:nowrap;padding:8px 11px}
.sf-pagination{display:flex;justify-content:space-between;gap:15px;align-items:center;padding-top:20px;font-size:12px;color:var(--text-muted)}
.sf-pagination>div{display:flex;gap:10px}
.sf-pagination button{font-size:12px}
.sf-page button:disabled,.sf-dialog button:disabled{opacity:.45;cursor:not-allowed}
.sf-reference{margin-top:22px}
.sf-reference>summary{display:flex;justify-content:space-between;gap:15px;align-items:center;cursor:pointer;font-size:14px;color:var(--text-muted);list-style:none}
.sf-reference>summary>span:before{content:'▸';display:inline-block;margin-right:10px}
.sf-reference[open]>summary>span:before{content:'▾'}
.sf-reference>summary small{font-size:12px;font-weight:400;color:var(--text-muted)}
.sf-reference .table-wrap{margin-top:15px}
.sf-dialog{width:610px;max-width:calc(100vw - 32px);max-height:calc(100vh - 40px);overflow:auto;border:1px solid var(--border);border-radius:15px;background:#fff;color:var(--ink);padding:28px 30px;box-shadow:var(--shadow-3)}
.sf-dialog::backdrop{background:var(--overlay)}
.sf-dialog-head{display:flex;justify-content:space-between;align-items:flex-start;gap:15px}
.sf-dialog-head small{font-size:11px;letter-spacing:.14em;color:var(--text-muted)}
.sf-dialog-head h2{font-size:21px;margin:10px 0 20px;color:var(--accent)}
.sf-close{border:0;background:transparent;color:var(--text-muted);font-size:25px;padding:0 6px;cursor:pointer}
.sf-product{background:var(--accent-soft-bg);border:1px solid var(--border-subtle);border-radius:9px;padding:16px 18px;margin-bottom:21px;display:flex;flex-direction:column;gap:7px}
.sf-product strong{font:600 16px/1.7 ui-monospace,SFMono-Regular,monospace;color:var(--accent);overflow-wrap:anywhere}
.sf-product>span{font-size:13px;color:var(--text-muted);line-height:1.8}
.sf-existing{margin-bottom:23px;max-height:220px;overflow:auto}
.sf-existing-title{display:block;font-size:12px;color:var(--text-muted);margin-bottom:13px}
.sf-existing .sf-relation{border:1px solid var(--border-subtle);border-radius:8px;padding:12px 14px;margin:8px 0}
.sf-existing .sf-remove{font-size:11px;padding:5px 8px;margin-top:7px}
.sf-dialog label{font-size:12px;color:var(--text-muted);line-height:1.8}
.sf-dialog input,.sf-dialog select{width:100%;font-size:13px;min-width:0}
.sf-group-details{border:1px solid var(--border-subtle);border-radius:8px;padding:11px 14px;margin:12px 0 17px}
.sf-group-details dl{margin-bottom:0}
.sf-confirm-label{display:flex!important;align-items:flex-start;gap:10px;line-height:1.9!important;padding:13px 14px;background:var(--accent-soft-bg);border-radius:8px}
.sf-confirm-label input{width:15px!important;height:15px;flex-shrink:0;margin:3px 0 0!important;accent-color:var(--n-500)}
.sf-confirm-label span{overflow-wrap:anywhere}
.sf-dialog-error{color:var(--warning-fg);font-size:12px;line-height:1.8;overflow-wrap:anywhere}
.sf-dialog-error:empty{display:none}
.sf-dialog-actions{display:flex;justify-content:flex-end;gap:12px;margin-top:22px}
.sf-route-factory{padding:17px 0 0}
.sf-route-factory small{font-size:11px;color:var(--text-muted)}
.sf-route-factory h3{font-size:15px;line-height:1.7;overflow-wrap:anywhere;font-weight:600;color:var(--accent);margin:7px 0 0}
.sf-route-details{margin-top:18px;border-top:1px solid var(--border-subtle);padding-top:13px}
.sf-route-details>summary{font-size:12px;color:var(--text-muted);cursor:pointer;line-height:1.8}
.sf-route-link{margin-top:12px;width:100%;font-size:12px}
.sf-page button:focus-visible,.sf-dialog button:focus-visible,.sf-page summary:focus-visible,.sf-dialog summary:focus-visible{outline:3px solid var(--border-strong);outline-offset:3px}
.sf-dialog-actions{position:sticky;bottom:-28px;z-index:1;background:#fff;padding:14px 0 20px;border-top:1px solid var(--border-subtle);box-shadow:0 -7px 12px rgba(255,255,255,.93)}
.sf-dialog .sf-existing{max-height:160px}
.sf-dialog-actions:before{content:'';position:absolute;inset:0 -8px;background:#fff;z-index:-1}
.sf-catalog>.sf-filters{margin:10px 20px}
.sf-catalog>.sf-help{margin:12px 20px}
.sf-catalog>.sf-pagination{padding:20px}
@media(max-width:1050px){.sf-filters{grid-template-columns:1.2fr 1fr}
.sf-filters button{justify-self:start;min-width:90px}
.sf-summary article{padding:17px 18px}
.sf-table th:nth-child(1){width:20%}
.sf-table th:nth-child(2){width:24%}
.sf-table th:nth-child(3){width:41%}
.sf-table th:nth-child(4){width:15%}
}
@media(max-width:650px){.sf-page .page-intro{flex-wrap:wrap;gap:14px}
.sf-page .page-intro p{font-size:12px;line-height:1.8}
.sf-summary{gap:9px}
.sf-summary article{padding:15px 12px}
.sf-summary span{font-size:11px;line-height:1.6}
.sf-summary strong{font-size:23px}
.sf-summary small{font-size:11px;line-height:1.6}
.sf-filters{grid-template-columns:1fr}
.sf-catalog{padding:19px 15px}
.sf-pagination{align-items:flex-start;flex-direction:column}
.sf-reference>summary{flex-direction:column;align-items:flex-start;gap:8px}
.sf-dialog{padding:22px 20px}
.sf-dialog-head h2{font-size:19px}
.sf-dialog-actions{gap:9px}
.sf-dialog-actions button{font-size:12px;padding:10px 13px}
}
.sf-page-actions{display:flex;gap:10px;flex-wrap:wrap}
.sf-view-switch{margin-bottom:18px}
#sf-view-factory .sf-summary{grid-template-columns:repeat(4,minmax(0,1fr))}
/* 工厂视图的筛选行比 SKU 视图多一个「转发开关」下拉。.sf-filters 是写死的四列网格，
   直接多塞一个会把「重新读取」挤到第二行去。 */
#sf-view-factory .sf-filters{grid-template-columns:minmax(200px,1.4fr) minmax(150px,1fr) minmax(150px,1fr) auto auto}
@media(max-width:1050px){#sf-view-factory .sf-filters{grid-template-columns:1fr 1fr}
}
@media(max-width:650px){#sf-view-factory .sf-filters{grid-template-columns:1fr}
}
/* 第六列：本系统的本地设置，用一条左边框和简道云那几列分开 */
.fl-block-cell{white-space:nowrap;border-left:1px solid var(--line)}
/* 转发开关下拉框：已屏蔽时换成警示色，整行也淡一档，扫一眼就知道哪些群不转 */
.fl-block-cell .fl-block-select{width:auto;min-width:168px;margin:0 0 4px;font-size:13px;padding:6px 8px}
.fl-block-cell .fl-block-select.is-blocked{color:var(--warning-fg);background:var(--warning-bg);border-color:var(--warning-border)}
#fl-table tr.fl-row-blocked td:not(.fl-block-cell){opacity:.62}
@media(max-width:1050px){#sf-view-factory .sf-summary{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:650px){.sf-page-actions{width:100%}
.sf-page-actions button{flex:1;min-width:0}
}
.sf-action-cell{white-space:nowrap}
.sf-action-cell button{display:block;width:100%;margin:0 0 8px;font-size:12px;padding:7px 10px}
.sf-action-cell button:last-child{margin-bottom:0}
.sf-pick-factory{font-size:12px;padding:7px 12px;margin-bottom:10px}
.sf-sync-progress{align-self:center;font-size:12px;color:var(--text-muted);background:var(--accent-soft-bg);border:1px solid var(--border);border-radius:7px;padding:7px 11px;line-height:1.6;max-width:420px}
.sf-hoverable{cursor:default}
#sf-sku-card{position:fixed;z-index:95;width:300px;max-width:calc(100vw - 16px);border:1px solid var(--line-strong,var(--border));border-radius:12px;padding:14px 16px;background:#fff;box-shadow:0 14px 40px rgba(21,42,32,.18);pointer-events:none}
#sf-sku-card[hidden]{display:none}
#sf-sku-card img{display:block;width:100%;max-height:200px;margin-bottom:10px;border-radius:8px;object-fit:contain;background:var(--surface-hover)}
#sf-sku-card b{display:block;font:600 13px/1.6 ui-monospace,SFMono-Regular,monospace;color:var(--accent)}
#sf-sku-card .sf-card-name{display:block;margin-top:3px;font-size:13px;line-height:1.7;color:var(--ink,var(--n-800))}
#sf-sku-card dl{display:grid;grid-template-columns:78px minmax(0,1fr);gap:6px 10px;margin:11px 0 0;font-size:12px;line-height:1.7}
#sf-sku-card dt{color:var(--text-muted)}
#sf-sku-card dd{margin:0;overflow-wrap:anywhere;color:var(--text-muted)}
#sf-sku-card .sf-card-empty{margin:10px 0 0;font-size:12px;color:var(--text-muted)}
