/* GLM-5.3 一键测试 · 网页版 */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f2f4f7; --card: #fff; --line: #dde2ea; --txt: #222;
  --muted: #888; --green: #187a2b; --red: #c0392b; --blue: #2563eb;
}
html, body { height: 100%; }
body {
  font: 14px/1.6 "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background: var(--bg); color: var(--txt);
}
.hidden { display: none !important; }
h3 { font-size: 15px; margin-bottom: 10px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.space { justify-content: space-between; }
.row.end { justify-content: flex-end; }

/* ---------- 登录 ---------- */
.login-wrap {
  position: fixed; inset: 0; display: flex;
  align-items: center; justify-content: center; background: #e8edf3;
}
.login-card {
  background: #fff; padding: 36px 40px; border-radius: 12px; width: 340px;
  box-shadow: 0 8px 40px rgba(0,0,0,.12); text-align: center;
}
.login-card h1 { font-size: 20px; }
.login-card .sub { color: var(--muted); margin: 6px 0 20px; }
.login-card input {
  width: 100%; padding: 10px 12px; margin-bottom: 12px; font-size: 14px;
  border: 1px solid var(--line); border-radius: 8px;
}
.login-card .btn { width: 100%; }
.err { color: var(--red); margin-top: 10px; min-height: 20px; font-size: 13px; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; gap: 24px; background: #fff;
  border-bottom: 1px solid var(--line); padding: 0 20px; height: 52px;
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; font-size: 15px; white-space: nowrap; }
.brand small { color: var(--muted); font-weight: 400; }
#nav { display: flex; gap: 4px; flex: 1; }
#nav button {
  border: 0; background: none; padding: 6px 18px; font-size: 14px;
  cursor: pointer; border-radius: 6px; color: #555;
}
#nav button.active { background: #e8f0fe; color: var(--blue); font-weight: 600; }
.user-box { display: flex; align-items: center; gap: 10px; color: var(--muted); }

/* ---------- 布局 ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 16px; }
.page > .card { margin-bottom: 14px; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 14px 16px;
}
.card.grow { display: flex; flex-direction: column; min-height: 320px; }

/* ---------- 按钮 ---------- */
.btn {
  border: 1px solid var(--line); background: #fff; color: var(--txt);
  padding: 7px 16px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.btn:hover { border-color: #b8c2d0; }
.btn.primary { background: #2e7d32; border-color: #2e7d32; color: #fff; font-weight: 600; }
.btn.primary:hover { background: #256b29; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.btn.ghost { border-color: transparent; color: var(--muted); }
.btn.big { font-size: 16px; padding: 12px 34px; }
.btn.small { padding: 4px 12px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- 测试页 ---------- */
.fam-btn {
  border: 1px solid var(--line); background: #fff; padding: 8px 20px;
  border-radius: 8px; cursor: pointer; font-weight: 600;
}
.fam-btn.active { background: #e8f0fe; border-color: var(--blue); color: var(--blue); }
select, input[type=text], input[type=password], input[type=number] {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; background: #fff;
}
.wide { min-width: 420px; max-width: 100%; }
.preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.preset-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 10px;
  padding: 10px 12px; text-align: left; cursor: pointer; min-height: 66px;
}
.preset-btn .nm { font-weight: 700; font-size: 14px; display: block; }
.preset-btn .ds { color: var(--muted); font-size: 12px; line-height: 1.4; }
.preset-btn.active { background: #e8f0fe; border-color: var(--blue); }
.preset-btn.active .nm { color: var(--blue); }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 22px; }
.field { display: flex; align-items: center; gap: 10px; padding: 3px 0; }
.field > label.fl { width: 190px; color: #444; flex-shrink: 0; }
.field .sub-inputs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.field input[type=number] { width: 110px; }
.field.suffix input { width: 86px; }
.field input[type=text], .field select { flex: 1; min-width: 120px; }
.field .suf { color: var(--muted); font-size: 12px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 8px; }
.start-row { display: flex; align-items: center; gap: 20px; justify-content: flex-end; }
.est { color: var(--muted); }

/* ---------- 运行页 ---------- */
.status { margin: 6px 0; min-height: 22px; }
.progress { height: 14px; background: #e6eaf0; border-radius: 7px; overflow: hidden; margin: 8px 0 14px; }
#progress-fill { height: 100%; width: 0; background: #2e7d32; transition: width .4s; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.metric {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  text-align: center; padding: 10px 4px; min-height: 68px;
}
.metric .t { color: var(--muted); font-size: 12px; }
.metric .v { font-size: 20px; font-weight: 700; margin-top: 2px; }
.log {
  flex: 1; overflow: auto; background: #1e1e1e; color: #d4d4d4;
  border-radius: 8px; padding: 10px 12px; font: 12px/1.5 Consolas, monospace;
  min-height: 260px; max-height: 520px; white-space: pre-wrap; word-break: break-all;
}

/* ---------- 表格 ---------- */
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; background: #fafbfc; }
td.ok { color: var(--green); font-weight: 600; }
td.bad { color: var(--red); font-weight: 600; }

/* ---------- 报告 ---------- */
.report-card { min-height: 70vh; }
.report-frame { flex: 1; width: 100%; border: 1px solid var(--line); border-radius: 8px; min-height: 60vh; background: #fff; }

/* ---------- 弹窗 / 提示 ---------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-card { background: #fff; border-radius: 12px; padding: 22px 24px; width: 480px; max-width: 94vw; max-height: 90vh; overflow: auto; }
.modal-form label { display: block; margin-bottom: 10px; font-size: 13px; color: #444; }
.modal-form input, .modal-form select { width: 100%; margin-top: 4px; }
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: #333; color: #fff; padding: 10px 22px; border-radius: 8px;
  z-index: 200; font-size: 14px; max-width: 80vw;
}
.toast.err { background: var(--red); }

@media (max-width: 900px) {
  .preset-grid, .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .field > label.fl { width: 130px; }
}
