* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f5f6f8; --card: #fff; --border: #e2e5ea; --text: #1a1d24;
  --muted: #6b7280; --brand: #ff6a2b; --brand-d: #e85a1f;
  --ok: #16a34a; --err: #dc2626; --warn: #d97706;
}
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6;
}
.hidden { display: none !important; }
button {
  font: inherit; cursor: pointer; border: none; border-radius: 8px;
  padding: 9px 16px; background: var(--brand); color: #fff; font-weight: 600;
  transition: background .15s;
}
button:hover { background: var(--brand-d); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.ghost { background: #eef0f3; color: var(--text); }
button.ghost:hover { background: #e2e5ea; }
button.danger { background: var(--err); }
button.sm { padding: 5px 11px; font-size: 13px; }
input, textarea, select {
  font: inherit; width: 100%; padding: 9px 11px; border: 1px solid var(--border);
  border-radius: 8px; background: #fff; color: var(--text);
}
textarea { resize: vertical; min-height: 90px; }
label { display: block; font-weight: 600; margin: 14px 0 6px; }
label.inline { display: inline; font-weight: 400; margin: 0 14px 0 5px; }
.hint { color: var(--muted); font-size: 12.5px; font-weight: 400; }

/* 登录 */
#login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
}
#login .box {
  background: var(--card); padding: 36px 32px; border-radius: 14px; width: 340px;
  box-shadow: 0 8px 30px rgba(0,0,0,.08);
}
#login h1 { font-size: 20px; margin-bottom: 4px; }
#login .sub { color: var(--muted); margin-bottom: 22px; font-size: 13px; }
#login button { width: 100%; margin-top: 20px; padding: 11px; }
#loginErr { color: var(--err); margin-top: 12px; font-size: 13px; min-height: 18px; }

/* 主体 */
header {
  background: var(--card); border-bottom: 1px solid var(--border);
  padding: 12px 24px; display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 10;
}
header h1 { font-size: 17px; }
header .spacer { flex: 1; }
header .user { color: var(--muted); font-size: 13px; }
.workspace-link { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px;
  border: 1px solid #cbd7ff; border-radius: 8px; color: #27459b; background: #eef3ff;
  font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.workspace-link:hover { border-color: #9eb3f4; background: #e4ebff; }
.tabs { display: flex; gap: 4px; padding: 0 16px; background: var(--card);
  border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab {
  padding: 12px 18px; cursor: pointer; color: var(--muted); font-weight: 600;
  border-bottom: 2px solid transparent;
}
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
main { max-width: 1100px; margin: 0 auto; padding: 22px 20px 60px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 820px) { .grid { grid-template-columns: 1fr; } }
@media (max-width: 680px) {
  header { padding: 10px 14px; gap: 10px; }
  header h1 { font-size: 14px; }
  .workspace-link { padding: 7px 9px; font-size: 12px; }
  header .user, header #pwBtn { display: none; }
}
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 20px;
}
.card h2 { font-size: 15px; margin-bottom: 4px; }
.radio-row { display: flex; gap: 20px; margin: 6px 0; }
.status-bar {
  font-size: 12.5px; color: var(--muted); padding: 8px 24px; background: #fbfbfc;
  border-bottom: 1px solid var(--border);
}
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin: 0 3px 0 10px; }
.dot.on { background: var(--ok); } .dot.off { background: var(--err); }

/* 进度/日志 */
.log {
  background: #0f1115; color: #d6dae0; font-family: ui-monospace, Menlo, monospace;
  font-size: 12.5px; border-radius: 8px; padding: 12px; height: 260px;
  overflow-y: auto; white-space: pre-wrap; line-height: 1.5;
}
video { width: 100%; border-radius: 8px; background: #000; margin-top: 12px; }
audio { width: 100%; margin-top: 10px; }

/* 表格 */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border);
  font-size: 13px; }
th { color: var(--muted); font-weight: 600; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: #fafbfc; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 12px; font-weight: 600; }
.badge.queued { background: #fef3c7; color: var(--warn); }
.badge.running { background: #dbeafe; color: #2563eb; }
.badge.done { background: #dcfce7; color: var(--ok); }
.badge.failed { background: #fee2e2; color: var(--err); }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #1a1d24; color: #fff; padding: 11px 20px; border-radius: 8px;
  font-size: 13.5px; z-index: 100; opacity: 0; transition: opacity .2s;
  max-width: 80%;
}
.toast.show { opacity: 1; }
.toast.err { background: var(--err); }
.row { display: flex; gap: 10px; align-items: center; }
.mt { margin-top: 14px; }

/* 历史:任务详情内联展开 */
tr.job-detail > td { background: #fbfbfc; padding: 0; border-bottom: 1px solid var(--border); }
.jd-body { padding: 16px 12px; }
.jd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 820px) { .jd-grid { grid-template-columns: 1fr; } }
.jd-h { font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.jd-field { margin-bottom: 12px; }
.jd-k { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.jd-v { font-size: 13px; }
.jd-pre { white-space: pre-wrap; background: #fff; border: 1px solid var(--border);
  border-radius: 6px; padding: 8px 10px; max-height: 180px; overflow-y: auto; }
.jd-img { max-width: 100%; border-radius: 8px; margin-top: 4px; display: block; }
tr.job-detail video, tr.job-detail audio { margin-top: 4px; }
