:root {
	--bg: #0f1115;
	--panel: #1a1d24;
	--panel2: #22262f;
	--border: #2c313c;
	--text: #e6e8ec;
	--muted: #8b93a1;
	--accent: #4f8cff;
	--accent2: #3a6fd8;
	--ok: #34c759;
	--warn: #ff9f0a;
	--err: #ff4d4f;
	--run: #4f8cff;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
	background: var(--bg);
	color: var(--text);
	font-size: 14px;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.err { color: var(--err); min-height: 18px; margin-top: 8px; font-size: 13px; }

/* 登录 */
.login {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
}
.login-box {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 32px;
	width: 320px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.login-box h1 { margin: 0; font-size: 24px; }
.login-box p { margin: 0 0 8px; }

/* 布局 */
header {
	display: flex;
	align-items: center;
	gap: 20px;
	padding: 12px 24px;
	background: var(--panel);
	border-bottom: 1px solid var(--border);
	position: sticky;
	top: 0;
	z-index: 10;
}
.brand { font-weight: 700; font-size: 18px; color: var(--accent); }
nav { display: flex; gap: 4px; flex: 1; }
nav a {
	color: var(--muted);
	text-decoration: none;
	padding: 6px 14px;
	border-radius: 8px;
}
nav a:hover { background: var(--panel2); color: var(--text); }
nav a.active { background: var(--accent); color: #fff; }
main { padding: 24px; max-width: 1100px; margin: 0 auto; }

/* 控件 */
input, select, button, textarea {
	font: inherit;
	color: var(--text);
	background: var(--panel2);
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 8px 12px;
	outline: none;
}
input:focus, select:focus { border-color: var(--accent); }
button {
	cursor: pointer;
	background: var(--accent);
	border-color: var(--accent);
	color: #fff;
	font-weight: 600;
}
button:hover { background: var(--accent2); }
button.ghost { background: transparent; border-color: var(--border); color: var(--muted); font-weight: 500; }
button.ghost:hover { color: var(--text); border-color: var(--muted); }
button.danger { background: var(--err); border-color: var(--err); }
button.danger:hover { filter: brightness(1.1); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
input[readonly] { color: var(--muted); }
label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 13px; }

.card {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 20px;
	margin-bottom: 20px;
}
.card h2 { margin: 0 0 16px; font-size: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.field { margin-bottom: 16px; }
.field input, .field select { width: 100%; }
.spacer { flex: 1; }

/* 表格 */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
tr.clickable:hover { background: var(--panel2); cursor: pointer; }

/* 状态徽标 */
.badge {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
}
.badge.pending { background: #33383f; color: var(--muted); }
.badge.running { background: rgba(79,140,255,0.18); color: var(--run); }
.badge.completed { background: rgba(52,199,89,0.18); color: var(--ok); }
.badge.cancelled { background: rgba(255,159,10,0.18); color: var(--warn); }
.badge.failed { background: rgba(255,77,79,0.18); color: var(--err); }

/* 测试项复选 */
.testitem {
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 14px;
	margin-bottom: 10px;
	display: flex;
	align-items: center;
	gap: 14px;
}
.testitem .name { font-weight: 600; min-width: 90px; }
.testitem .desc { color: var(--muted); font-size: 12px; flex: 1; }
.testitem input[type=number] { width: 100px; }

/* 实时指标 */
.metric {
	background: var(--panel2);
	border-radius: 10px;
	padding: 16px;
	flex: 1;
	min-width: 160px;
}
.metric .label { color: var(--muted); font-size: 12px; }
.metric .value { font-size: 22px; font-weight: 700; margin-top: 6px; }
.metric .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.metrics { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }

.toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%);
	background: var(--panel2);
	border: 1px solid var(--border);
	padding: 12px 20px;
	border-radius: 10px;
	box-shadow: 0 8px 24px rgba(0,0,0,0.4);
	z-index: 100;
}
.toast.err { color: var(--err); border-color: var(--err); }
.toast.ok { color: var(--ok); }

code.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; background: var(--panel2); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
.dl { display: grid; grid-template-columns: 120px 1fr; gap: 8px 16px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }

/* 列表结果单元格着色 */
.ok { color: var(--ok); font-weight: 600; }
.bad { color: var(--err); font-weight: 600; }
.run { color: var(--run); }
td.num { font-variant-numeric: tabular-nums; }

/* 弹窗 */
.overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 48px 16px;
	overflow-y: auto;
	z-index: 50;
	backdrop-filter: blur(2px);
}
.modal {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 14px;
	width: 100%;
	max-width: 760px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
	animation: pop 0.14s ease-out;
}
@keyframes pop { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 22px;
	border-bottom: 1px solid var(--border);
}
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-head button { padding: 4px 10px; font-size: 16px; line-height: 1; }
.modal-body { padding: 22px; }
.modal-body .card { border: none; padding: 0; margin: 0; background: transparent; }
.modal-body .card + .card { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
