* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f0f2f5;
  color: #1f2329;
}
.topbar {
  height: 56px;
  background: #1f3a5f;
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar h1 { font-size: 17px; margin: 0; font-weight: 700; }
.topbar .sub { font-size: 12px; opacity: .7; }
.topbar .spacer { flex: 1; }
.btn {
  background: #576b95;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
}
.btn:hover { background: #6a7fb0; }
.btn.ghost { background: rgba(255,255,255,.12); }
.btn.ghost:hover { background: rgba(255,255,255,.22); }
.btn.green { background: #2e9e5b; }
.btn.green:hover { background: #36b569; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.layout { display: flex; height: calc(100vh - 56px); }
.sidebar {
  width: 240px;
  background: #fff;
  border-right: 1px solid #e6e8eb;
  overflow-y: auto;
  padding: 10px;
}
.sidebar .hint { font-size: 12px; color: #9097a3; padding: 6px 8px; }
.jobitem {
  padding: 9px 10px;
  border-radius: 7px;
  cursor: pointer;
  margin-bottom: 4px;
  border: 1px solid transparent;
}
.jobitem:hover { background: #f5f7fa; }
.jobitem.active { background: #eaf0fb; border-color: #b9cdf0; }
.jobitem .t { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jobitem .m { font-size: 11px; color: #9097a3; margin-top: 2px; }
.main { flex: 1; overflow-y: auto; padding: 18px 22px 60px; }
.jobhead { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.jobhead h2 { margin: 0; font-size: 18px; }
.pill { font-size: 11px; background: #eef0f3; color: #60656e; padding: 3px 8px; border-radius: 20px; }
.runall { margin-left: auto; }
.stages { display: flex; flex-direction: column; gap: 12px; max-width: 920px; }
.stage {
  background: #fff;
  border: 1px solid #e6e8eb;
  border-radius: 10px;
  overflow: hidden;
}
.stage .head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
}
.stage .num {
  width: 28px; height: 28px; border-radius: 50%;
  background: #dfe4ea; color: #5a6472;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.stage .name { font-weight: 600; font-size: 14px; }
.stage .desc { font-size: 11px; color: #9097a3; }
.stage .status { margin-left: auto; font-size: 12px; padding: 3px 9px; border-radius: 20px; }
.status.idle { background: #eef0f3; color: #8a909c; }
.status.running { background: #fff4e0; color: #c47f00; }
.status.done { background: #e6f7ec; color: #1f9254; }
.status.failed { background: #fdeaea; color: #d33; }
.stage .body { display: none; padding: 0 14px 14px; border-top: 1px solid #f0f2f5; }
.stage.open .body { display: block; }
.log {
  background: #1e1e1e; color: #d4d4d4;
  font-family: Consolas, Menlo, monospace;
  font-size: 12px; line-height: 1.6;
  padding: 10px 12px; border-radius: 6px;
  max-height: 240px; overflow-y: auto;
  white-space: pre-wrap; word-break: break-word;
}
.artifacts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.art {
  border: 1px solid #e6e8eb; border-radius: 8px; padding: 8px;
  width: 130px; cursor: pointer; text-align: center; background: #fafbfc;
}
.art:hover { border-color: #b9cdf0; }
.art img { width: 100%; height: 80px; object-fit: cover; border-radius: 4px; }
.art .an { font-size: 11px; color: #5a6472; margin-top: 5px; word-break: break-all; }
.actions { display: flex; gap: 8px; margin-top: 12px; align-items: center; flex-wrap: wrap; }
.pastebox { margin-top: 12px; }
.pastebox textarea {
  width: 100%; min-height: 140px; border: 1px solid #d6dae0; border-radius: 6px;
  padding: 10px; font-size: 13px; font-family: inherit; resize: vertical;
}
.pastebox input {
  width: 100%; border: 1px solid #d6dae0; border-radius: 6px; padding: 7px 10px;
  font-size: 13px; margin-top: 8px;
}
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  display: none; align-items: center; justify-content: center; z-index: 50;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff; border-radius: 10px; width: 92vw; height: 90vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.modal .mbar {
  display: flex; align-items: center; padding: 10px 14px; border-bottom: 1px solid #eee;
}
.modal .mbar .mt { font-weight: 600; }
.modal iframe { flex: 1; border: none; width: 100%; }
.modal pre.code { flex: 1; overflow: auto; margin: 0; padding: 16px; font-size: 12px; background: #1e1e1e; color: #d4d4d4; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #333; color: #fff; padding: 10px 18px; border-radius: 8px;
  font-size: 13px; opacity: 0; transition: opacity .2s; z-index: 60; pointer-events: none;
}
.toast.show { opacity: 1; }
.empty { color: #9097a3; text-align: center; margin-top: 80px; }
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 12px; color: #5a6472; margin-bottom: 4px; }
.form-row input, .form-row textarea {
  width: 100%; border: 1px solid #d6dae0; border-radius: 6px; padding: 8px 10px; font-size: 13px;
}
