:root {
  --fg: #1a1a1a; --muted: #6b7280; --line: #e5e7eb; --bg: #f7f8fa;
  --card: #fff; --accent: #2563eb; --danger: #dc2626; --warn-bg: #fef3c7;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 14px/1.6 -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
}
.top {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 14px 20px; background: var(--card); border-bottom: 1px solid var(--line);
}
.top h1 { font-size: 17px; margin: 0; }
.who { color: var(--muted); font-size: 13px; }
main { max-width: 900px; margin: 0 auto; padding: 20px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 18px; margin-bottom: 16px;
}
.card h2 { font-size: 15px; margin: 0 0 10px; }
.step {
  display: inline-block; width: 20px; height: 20px; line-height: 20px;
  text-align: center; border-radius: 50%; background: var(--accent); color: #fff;
  font-size: 12px; margin-right: 6px;
}
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row-between {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 12px; flex-wrap: wrap;
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
.file { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.file input { font-size: 13px; }
button {
  font: inherit; padding: 7px 14px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--fg);
}
button:hover { border-color: #cbd5e1; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { background: #1d4ed8; }
button.danger { color: var(--danger); border-color: #fecaca; }
button:disabled { opacity: .5; cursor: not-allowed; }
textarea {
  width: 100%; font: inherit; padding: 10px; border: 1px solid var(--line);
  border-radius: 6px; resize: vertical; margin-bottom: 4px;
}
table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; }
tbody tr:hover { background: #fafbfc; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
pre {
  background: #f8fafc; border: 1px solid var(--line); border-radius: 6px;
  padding: 12px; white-space: pre-wrap; word-break: break-word; font-size: 13px;
  font-family: ui-monospace, Consolas, monospace;
}
.badge {
  display: inline-block; padding: 1px 8px; border-radius: 10px;
  font-size: 12px; background: #eef2ff; color: #3730a3;
}
.badge.done { background: #dcfce7; color: #166534; }
.badge.fail { background: #fee2e2; color: #991b1b; }
.badge.run { background: #fef3c7; color: #92400e; }
.warn {
  background: var(--warn-bg); border: 1px solid #fcd34d; border-radius: 6px;
  padding: 10px 12px; font-size: 13px; margin-top: 10px;
}
.kv { font-size: 13px; }
.kv b { display: inline-block; min-width: 9em; font-weight: 500; color: var(--muted); }
/* 技术细节（规则 JSON）降级处理：默认收起、字号更小、颜色更淡 */
details.tech { margin-top: 12px; }
details.tech summary { cursor: pointer; color: var(--muted); font-size: 12px; }
details.tech pre { font-size: 12px; background: #fbfbfc; }
h3 { font-size: 13px; margin: 14px 0 4px; color: var(--muted); font-weight: 500; }

/* 结果预览：一个学生一块，上分数下明细 */
.student { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; margin-top: 12px; }
.student-head {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.student-head .sname { font-weight: 600; }
.student-head .sxh { color: var(--muted); font-size: 12.5px; }
.student-head .smark { margin-left: auto; font-size: 17px; font-weight: 600; color: var(--accent); }
.student-head .scount { color: var(--muted); font-size: 12.5px; }
table.courses { margin-top: 4px; }
table.courses th, table.courses td { padding: 4px 8px; font-size: 12.5px; border-bottom: 1px solid #f1f3f5; }
table.courses th { font-weight: 500; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
