/* 拾景作业流水：浅色阶段列表与任务进度表。
 * 仅覆盖插件日志容器和页面内注入面板，不改变日志数据与导出逻辑。 */
:is(.log-wrap, #__sucai_fill_panel) {
  --lv-bg: #ffffff;
  --lv-head: #fafafa;
  --lv-text: #18181b;
  --lv-muted: #71717a;
  --lv-line: #d4d4d8;
  --lv-brand: #18181b;
  --lv-ok: #18794e;
  --lv-ok-bg: #eef8f2;
  --lv-error: #b42318;
  --lv-error-bg: #fff1f0;
  --lv-warn: #a15c00;
  --lv-warn-bg: #fff7e8;
  color: var(--lv-text);
  min-width: 0;
}

:is(.log-wrap, #__sucai_fill_panel) .lv-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 3px 12px;
  padding: 9px 11px;
  color: var(--lv-text);
  background: var(--lv-head);
  border: 1px solid var(--lv-line);
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  font: 12px/1.5 "Microsoft YaHei UI", "PingFang SC", sans-serif;
}

:is(.log-wrap, #__sucai_fill_panel) .lv-head strong { font-weight: 700; }
:is(.log-wrap, #__sucai_fill_panel) .lv-head span {
  color: var(--lv-muted);
  font: 10px/1.5 Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.log-wrap #logArea.log-area {
  padding: 0 9px;
  color: var(--lv-text);
  background: var(--lv-bg);
  border-color: var(--lv-line);
  border-radius: 0 0 9px 9px;
}

:is(.log-wrap, #__sucai_fill_panel) .lv-row {
  display: grid;
  grid-template-columns: 50px minmax(48px, auto) minmax(0, 1fr);
  gap: 3px 8px;
  margin: 0 -4px;
  padding: 8px 6px;
  color: var(--lv-text);
  border-bottom: 1px solid #e4e4e7;
  border-radius: 4px;
  font: 12px/1.6 "Microsoft YaHei UI", "PingFang SC", sans-serif;
  overflow-wrap: anywhere;
}

:is(.log-wrap, #__sucai_fill_panel) .lv-row:last-child { border-bottom-color: transparent; }
:is(.log-wrap, #__sucai_fill_panel) .lv-time {
  grid-column: 1;
  color: var(--lv-muted);
  font: 10px/1.95 Consolas, monospace;
  font-variant-numeric: tabular-nums;
}
:is(.log-wrap, #__sucai_fill_panel) .lv-stage {
  grid-column: 2;
  color: #3f3f46;
  font-weight: 700;
}
:is(.log-wrap, #__sucai_fill_panel) .lv-pid {
  grid-column: 3;
  min-width: 0;
  color: var(--lv-muted);
  font: 10px/1.9 Consolas, monospace;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
:is(.log-wrap, #__sucai_fill_panel) .lv-message {
  grid-column: 2 / -1;
  min-width: 0;
  white-space: pre-wrap;
}

:is(.log-wrap, #__sucai_fill_panel) .lv-error {
  background: var(--lv-error-bg);
  box-shadow: inset 3px 0 0 var(--lv-error);
}
:is(.log-wrap, #__sucai_fill_panel) .lv-warn {
  background: var(--lv-warn-bg);
  box-shadow: inset 3px 0 0 var(--lv-warn);
}
:is(.log-wrap, #__sucai_fill_panel) .lv-ok { box-shadow: inset 3px 0 0 var(--lv-ok); }
:is(.log-wrap, #__sucai_fill_panel) .lv-error .lv-stage,
:is(.log-wrap, #__sucai_fill_panel) .lv-error .lv-message { color: var(--lv-error); }
:is(.log-wrap, #__sucai_fill_panel) .lv-warn .lv-stage { color: var(--lv-warn); }
:is(.log-wrap, #__sucai_fill_panel) .lv-ok .lv-stage { color: var(--lv-ok); }

:is(.log-wrap, #__sucai_fill_panel) .lv-row:focus-visible,
:is(.log-wrap, #__sucai_fill_panel) button:focus-visible {
  outline: 2px solid var(--lv-brand);
  outline-offset: -2px;
}

/* 进度表与常规日志共用纸白表面；仅表内横滚，不扩宽插件窗口。 */
.log-wrap .progress-panel,
.log-wrap .failed-id-panel {
  min-width: 0;
  color: var(--lv-text);
  background: var(--lv-bg);
  border-color: var(--lv-line);
  border-radius: 0 0 9px 9px;
}
.log-wrap .progress-panel {
  padding: 8px 10px;
  scrollbar-color: #a1a1aa var(--lv-bg);
}
.log-wrap .bpp-table { font-size: 11px; }
.log-wrap .bpp-table th {
  padding: 7px 6px;
  color: var(--lv-muted);
  background: #fafafa;
  border-color: var(--lv-line);
}
.log-wrap .bpp-table td { padding: 7px 6px; border-color: var(--lv-line); }
.log-wrap .bpp-id { color: var(--lv-text); font-family: Consolas, monospace; }
.log-wrap .bpp-cell.bpp-wait,
.log-wrap .bpp-cell.bpp-saved,
.log-wrap .pp-empty,
.log-wrap .pp-ids .pp-task { color: var(--lv-muted); }
.log-wrap .bpp-cell.bpp-doing { color: var(--lv-brand); }
.log-wrap .bpp-cell.bpp-done { color: var(--lv-ok); }
.log-wrap .bpp-cell.bpp-fail { color: var(--lv-error); }
.log-wrap .bpp-cell.bpp-partial,
.log-wrap .bpp-cell.bpp-skip { color: var(--lv-warn); }

/* 页面内补漏面板会带旧内联皮肤，在此定点覆盖。 */
#__sucai_fill_panel {
  color: var(--lv-text) !important;
  background: var(--lv-bg) !important;
  border-color: var(--lv-line) !important;
  box-shadow: 0 12px 32px rgba(24, 24, 27, .18) !important;
}
#__sucai_fill_panel > .lv-head { border: 0; border-bottom: 1px solid var(--lv-line); }
#__sucai_fill_panel > .lv-head + div { background: var(--lv-head) !important; }
#__sucai_fill_panel_stats,
#__sucai_fill_panel_live { color: var(--lv-muted) !important; }
#__sucai_fill_panel button {
  min-height: 30px;
  color: var(--lv-text) !important;
  background: #ffffff !important;
  border-color: var(--lv-line) !important;
  border-radius: 6px !important;
}
#__sucai_fill_panel button:hover {
  color: #ffffff !important;
  border-color: #18181b !important;
  background: #18181b !important;
}

@media (max-width: 380px) {
  :is(.log-wrap, #__sucai_fill_panel) .lv-row {
    grid-template-columns: 46px minmax(44px, auto) minmax(0, 1fr);
    gap: 3px 5px;
  }
  :is(.log-wrap, #__sucai_fill_panel) .lv-pid { font-size: 9px; }
}
