/* T43 店铺利润 · 页面样式。前缀 sp-，只用公共框架主题变量，不覆盖 .btn/.chip/.panel 等公共类。 */
#sp-root { min-width: 0; max-width: 100%; padding: 8px; color: var(--text); }
#sp-root h1 { font-size: 24px; margin: 4px 0; }
#sp-root h3 { font-size: 14px; margin: 16px 0 8px; }
#sp-root button:disabled { opacity: .5; cursor: not-allowed; }
#sp-root input, #sp-root select, .sp-dialog input, .sp-dialog select { box-sizing: border-box; width: 100%; min-width: 0; padding: 8px; border: 1px solid var(--border); border-radius: 6px; color: var(--text); background: var(--bg-elev2); font: inherit; }
#sp-root input[type=checkbox] { width: auto; }
.sp-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 12px; }
.sp-shopbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.sp-shopbar label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); min-width: 180px; }
.sp-silver { margin: 0 0 10px; font-size: 13px; color: var(--text-2); }
.sp-silver[data-missing="1"] { padding: 10px 14px; border: 1px solid var(--danger); border-radius: 10px; color: var(--danger); }
.sp-warn { padding: 10px 14px; margin-bottom: 12px; border: 1px solid var(--warning, var(--accent)); border-radius: 10px; background: var(--accent-soft); font-size: 13px; line-height: 1.7; }
.sp-warn .btn { margin-left: 8px; padding: 3px 8px; }
.sp-filter { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-elev); }
.sp-filter label, .sp-form label, .sp-trial label, .sp-inline label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); }
.sp-filter .sp-check { flex-direction: row; align-items: center; gap: 6px; }
.sp-status { color: var(--text-2); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; margin: 10px 0; }
.sp-notice { padding: 12px; border: 1px dashed var(--border); border-radius: 10px; color: var(--text-2); }
.sp-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); gap: 14px; align-items: start; }
.sp-scroll { max-width: 100%; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.sp-scroll table { width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap; }
.sp-scroll th, .sp-scroll td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border-soft, var(--border)); vertical-align: top; }
.sp-scroll th { color: var(--text-2); background: var(--bg-elev); position: sticky; top: 0; }
.sp-scroll td small { display: block; color: var(--text-3); font-size: 11px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.sp-list .sp-scroll { max-height: 70vh; }
.sp-list tr[data-row] { cursor: pointer; }
.sp-list tr[data-row]:hover, .sp-list tr[data-row]:focus { background: var(--bg-hover); outline: none; }
.sp-list tr.is-selected { background: var(--accent-soft); }
.sp-neg { color: var(--danger); }
.sp-empty { padding: 32px; text-align: center; color: var(--text-2); }
.sp-pager { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 12px; }
.sp-detail { position: sticky; top: 8px; max-height: calc(100vh - 32px); overflow: auto; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-elev); min-width: 0; }
.sp-detail-head h2 { font-size: 17px; margin: 0 0 6px; overflow-wrap: anywhere; }
.sp-detail-head p { font-size: 12px; line-height: 1.6; margin: 6px 0 0; }
.sp-code { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.sp-code code { font-family: var(--mono, monospace); font-size: 13px; color: var(--text); padding: 2px 6px; border-radius: 4px; background: var(--bg-elev2); user-select: all; }
.sp-code .btn { padding: 3px 8px; }
.sp-result { margin: 12px 0; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.sp-result.is-neg { border-color: var(--danger); }
.sp-result-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.sp-result dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.sp-result dt { font-size: 11px; color: var(--text-2); }
.sp-result dd { margin: 2px 0 0; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sp-result.is-neg dd:first-of-type { color: var(--danger); }
.sp-note { font-size: 11px; color: var(--text-3); line-height: 1.6; margin: 4px 0; }
.sp-issues { margin: 6px 0 0; padding-left: 18px; font-size: 12px; color: var(--danger); line-height: 1.6; }
.sp-lines { width: 100%; border-collapse: collapse; font-size: 12px; }
.sp-lines th, .sp-lines td { padding: 5px 4px; border-bottom: 1px solid var(--border-soft, var(--border)); text-align: left; font-weight: normal; }
.sp-lines th { color: var(--text-2); width: 42%; }
.sp-lines td { font-variant-numeric: tabular-nums; }
.sp-lines small { display: block; color: var(--text-3); font-size: 11px; }
.sp-trial { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border); }
.sp-trial h3, .sp-trial-actions, #sp-trial-out { grid-column: 1 / -1; }
.sp-trial h3 small { font-weight: normal; color: var(--text-3); font-size: 11px; }
.sp-trial-actions { display: flex; gap: 8px; flex-wrap: wrap; }
#sp-trial-out .sp-result { border-style: dashed; }
.sp-override { margin-top: 14px; font-size: 12px; }
.sp-override summary { cursor: pointer; color: var(--text-2); }
.sp-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 8px; }
.sp-form .sp-note, .sp-form button { grid-column: 1 / -1; justify-self: start; }
.sp-form[hidden] { display: none; }
#sp-root .sp-form input[readonly], .sp-dialog .sp-form input[readonly] { background: transparent; border-color: transparent; padding-left: 0; font-weight: 600; color: var(--text); }
.sp-inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.sp-inline small { color: var(--text-3); }
.sp-dialog { box-sizing: border-box; width: min(900px, calc(100vw - 24px)); max-height: calc(100vh - 32px); overflow: auto; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-elev); color: var(--text); padding: 18px; }
.sp-dialog::backdrop { background: #0009; }
.sp-dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sp-dialog-head h2 { margin: 0; font-size: 18px; }
.sp-dialog table { margin: 0; }
.sp-dialog td small { display: block; color: var(--text-3); }
@media (max-width: 1100px) { .sp-main { grid-template-columns: minmax(0, 1fr); } .sp-detail { position: static; max-height: none; } }
@media (max-width: 600px) { #sp-root { padding: 0; } .sp-shopbar label { min-width: 0; flex: 1 1 100%; } .sp-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sp-trial { grid-template-columns: minmax(0, 1fr); } .sp-result dl { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sp-missing { color: var(--danger); font-weight: 600; }
.sp-missing small { display: inline; margin-left: 4px; font-weight: 400; color: var(--danger); }
/* I1 店铺品类扣点：品类树按层级缩进，数值右对齐（R08），长路径换行不挤出操作列（R07） */
.sp-tree-wrap { max-height: 46vh; }
.sp-dialog .sp-tree th.num, .sp-dialog .sp-tree td.num, .sp-dialog .sp-cm-history th.num, .sp-dialog .sp-cm-history td.num { text-align: right; font-variant-numeric: tabular-nums; }
.sp-dialog .sp-tree td.sp-path { padding-left: calc(10px + var(--lvl, 0) * 16px); white-space: normal; min-width: 160px; overflow-wrap: anywhere; }
.sp-dialog td.sp-src { white-space: normal; min-width: 160px; max-width: 320px; overflow-wrap: anywhere; }
.sp-dialog .sp-tree td.sp-path small, .sp-dialog td.sp-src small { max-width: none; white-space: normal; }
.sp-dialog .sp-cm-history tr.is-retired td { color: var(--text-3); }
.sp-dialog .sp-check { flex-direction: row; align-items: center; gap: 6px; align-self: end; min-height: 36px; }
.sp-dialog .sp-check input { width: auto; }
.sp-form .sp-form-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.sp-dialog .sp-inline label { min-width: 160px; flex: 1 1 160px; }
.sp-lines small[data-sp-commission] { overflow-wrap: anywhere; }
.sp-dialog .sp-tree td, .sp-dialog .sp-cm-history td { vertical-align: middle; }
