:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1f2329;
  --muted: #8f959e;
  --primary: #3370ff;
  --primary-dark: #2b5fd9;
  --ok: #34c724;
  --running: #ff8800;
  --fail: #f54a45;
  --queued: #8f959e;
  --border: #e5e6eb;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
  background: var(--bg); color: var(--text); min-height: 100vh;
}

header {
  display: flex; align-items: center; gap: 24px;
  background: var(--card); padding: 0 24px; height: 56px;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10;
}
.brand { font-size: 17px; font-weight: 600; }
nav { display: flex; gap: 4px; flex: 1; }
.tab-btn {
  border: none; background: none; padding: 8px 16px; font-size: 14px;
  cursor: pointer; border-radius: 6px; color: var(--muted);
}
.tab-btn.active { background: rgba(51,112,255,.1); color: var(--primary); font-weight: 600; }
.badge {
  font-size: 12px; padding: 3px 10px; border-radius: 10px;
  background: #eee; color: var(--muted);
}
.badge.ok { background: rgba(52,199,36,.15); color: var(--ok); }
.badge.busy { background: rgba(255,136,0,.15); color: var(--running); }
.badge.err { background: rgba(245,74,69,.15); color: var(--fail); }

main { max-width: 1080px; margin: 20px auto; padding: 0 16px; }
.tab-page { display: none; }
.tab-page.active { display: block; }

.card {
  background: var(--card); border-radius: 10px; padding: 20px;
  margin-bottom: 16px; border: 1px solid var(--border);
}
.card h3 { font-size: 15px; margin-bottom: 14px; }

textarea, input, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 14px; font-family: inherit; outline: none;
}
textarea { resize: vertical; }
textarea:focus, input:focus, select:focus { border-color: var(--primary); }

.row { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 8px 18px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font-size: 14px; cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: #f2f3f5; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.small { padding: 3px 10px; font-size: 12px; }
.btn.danger { color: var(--fail); }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }

.task-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.task-table th, .task-table td {
  text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.task-table th { color: var(--muted); font-weight: 500; font-size: 12px; }
.task-table td.t-title { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-chip {
  display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px;
}
.status-chip.queued { background: #eef0f3; color: var(--queued); }
.status-chip.running { background: rgba(255,136,0,.12); color: var(--running); }
.status-chip.done { background: rgba(52,199,36,.12); color: var(--ok); }
.status-chip.failed { background: rgba(245,74,69,.12); color: var(--fail); }
.empty { padding: 32px; text-align: center; color: var(--muted); }

.form-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.form-row label { width: 150px; font-size: 14px; flex-shrink: 0; }
.form-row label.inline { width: auto; }
.form-row input[type="checkbox"] { width: auto; }
.form-row input[type="number"] { width: 90px; }

/* 初始化引导 & 弹窗 */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.setup-card, .doc-card {
  background: var(--card); border-radius: 12px; padding: 28px;
  width: min(680px, 92vw); max-height: 86vh; display: flex; flex-direction: column;
}
.setup-checks { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.setup-checks.big .check-item { font-size: 15px; padding: 10px; }
.check-item {
  display: flex; justify-content: space-between; padding: 8px 12px;
  background: var(--bg); border-radius: 6px; font-size: 14px;
}
.check-item .state { font-weight: 600; }
.check-item .state.ok { color: var(--ok); }
.check-item .state.miss { color: var(--running); }
.setup-log {
  background: #17181c; color: #9fe8a9; font-size: 12px; line-height: 1.7;
  padding: 12px; border-radius: 6px; max-height: 220px; overflow-y: auto;
  white-space: pre-wrap;
}
.doc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.doc-content {
  flex: 1; overflow-y: auto; white-space: pre-wrap; font-size: 14px; line-height: 1.9;
  padding: 12px; background: var(--bg); border-radius: 6px;
}
.doc-foot { display: flex; gap: 12px; margin-top: 12px; }
