:root {
  --bg: #0f1115;
  --card: #171a21;
  --card-2: #1d222b;
  --line: #262c37;
  --text: #e6e9ef;
  --muted: #8b93a3;
  --accent: #3ddc97;
  --accent-dim: #1f8f63;
  --danger: #ff6b6b;
  --warn: #ffc65c;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(1200px 700px at 15% -10%, #17202a 0%, var(--bg) 60%);
  color: var(--text);
  font: 14px/1.6 -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
}

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 24px;
  padding: 14px 28px;
  background: rgba(15, 17, 21, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 12px var(--accent); }
.brand-title { font-size: 17px; font-weight: 650; letter-spacing: .3px; }
.brand-sub { font-size: 12px; color: var(--muted); }

.tabs { display: flex; gap: 6px; }
.tab {
  background: transparent; border: 1px solid transparent; color: var(--muted);
  padding: 7px 14px; border-radius: 999px; cursor: pointer; font-size: 13px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); background: var(--card-2); border-color: var(--line); }

.badges { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.badge {
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); background: var(--card);
}
.badge.ok { color: var(--accent); border-color: rgba(61, 220, 151, .35); }
.badge.no { color: var(--warn); border-color: rgba(255, 198, 92, .35); }

main { max-width: 1280px; margin: 0 auto; padding: 26px 24px 80px; }
.view { display: block; }
.hidden { display: none !important; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; margin-bottom: 18px;
}
.card h2 { margin: 0 0 8px; font-size: 16px; font-weight: 600; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.card-head h2 { margin: 0; }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 16px; }

label { display: block; margin-bottom: 14px; font-size: 13px; color: var(--muted); }
label.inline { display: inline-flex; align-items: center; gap: 8px; margin: 0; }

input[type=text], input[type=number], textarea, select {
  width: 100%; margin-top: 6px; padding: 10px 12px;
  background: var(--card-2); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); font: inherit; outline: none;
}
textarea { resize: vertical; line-height: 1.7; font-family: inherit; }
input:focus, textarea:focus, select:focus { border-color: var(--accent-dim); }
label.inline select, label.inline input { width: auto; margin-top: 0; }

.row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
button.primary {
  margin-left: auto; background: linear-gradient(180deg, #43e7a1, #2fbf83);
  color: #08130e; border: 0; padding: 10px 22px; border-radius: 10px;
  font-weight: 650; cursor: pointer;
}
button.primary:disabled { opacity: .45; cursor: not-allowed; }
button.ghost {
  background: transparent; border: 1px solid var(--line); color: var(--text);
  padding: 6px 14px; border-radius: 9px; cursor: pointer; font-size: 13px;
}
button.ghost:hover { border-color: var(--accent-dim); color: var(--accent); }

.notice { margin-top: 12px; font-size: 13px; color: var(--muted); min-height: 20px; }
.notice.err { color: var(--danger); }
.notice.ok { color: var(--accent); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid rgba(38, 44, 55, .6); }
tr:hover td { background: rgba(29, 34, 43, .55); }
.link { color: var(--accent); cursor: pointer; text-decoration: none; }

.pill {
  display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted);
}
.pill.done { color: var(--accent); border-color: rgba(61,220,151,.4); }
.pill.running, .pill.queued { color: #7cc4ff; border-color: rgba(124,196,255,.4); }
.pill.failed, .pill.cancelled { color: var(--danger); border-color: rgba(255,107,107,.4); }

.progress { height: 6px; border-radius: 999px; background: var(--card-2); overflow: hidden; margin: 14px 0 10px; }
.progress .bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-dim), var(--accent)); transition: width .4s ease; }
.stage { font-size: 13px; color: var(--muted); }
.meta { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px 18px; font-size: 13px; color: var(--muted); }
.meta b { color: var(--text); font-weight: 500; }

.detail-grid { display: grid; grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); gap: 18px; align-items: start; }

.events {
  max-height: 340px; overflow-y: auto; font: 12px/1.6 "SFMono-Regular", Consolas, monospace;
  background: #101319; border: 1px solid var(--line); border-radius: 10px; padding: 12px;
  white-space: pre-wrap; word-break: break-all; color: #b9c1cf;
}
.events .e-error { color: var(--danger); }
.events .e-success { color: var(--accent); }
.events .e-warn { color: var(--warn); }

.scene-title { font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
.shot {
  display: grid; grid-template-columns: 56px 1fr 88px; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px;
  background: var(--card-2);
}
.shot .sid { font-weight: 600; color: var(--text); }
.shot .desc { font-size: 13px; color: #c7cedb; }
.shot .desc small { display: block; color: var(--muted); margin-top: 3px; }
.shot.done { border-color: rgba(61,220,151,.35); }
.shot.running { border-color: rgba(124,196,255,.4); }
.shot.failed { border-color: rgba(255,107,107,.4); }
.shot .st { text-align: right; font-size: 12px; }

.artifacts { display: flex; flex-direction: column; gap: 10px; }
.artifact {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card-2);
}
.artifact .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.artifact .n { font-size: 13px; }
.artifact .s { margin-left: auto; font-size: 12px; color: var(--muted); }
.artifact a { color: var(--accent); font-size: 13px; text-decoration: none; }
video { width: 100%; margin-top: 12px; border-radius: 12px; background: #000; }
.tiny { font-size: 12px; color: var(--muted); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
  .badges { width: 100%; order: 3; }
  .topbar { flex-wrap: wrap; }
}
