:root {
  --primary: rgb(42, 80, 129);
  --primary-deep: #22426a;
  --primary-soft: #eef3f9;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #24303f;
  --muted: #64748b;
  --line: #e5e9f0;
  --success: #16a34a;
  --danger: #dc2626;
}

* { box-sizing: border-box; }

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

.wrap { max-width: 480px; margin: 0 auto; padding: 24px 16px 48px; }

/* 顶部标题区 */
.hero { text-align: center; padding: 28px 0 8px; }
.hero h1 { font-size: 28px; font-weight: 700; color: var(--primary); letter-spacing: 2px; margin: 0 0 6px; }
.hero p { color: var(--muted); margin: 0; font-size: 14px; }

/* 卡片 */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  margin-top: 20px;
}
.card > p { color: var(--muted); font-size: 15px; margin: 0 0 10px; }

/* 按钮 */
.btn {
  display: block; width: 100%;
  padding: 14px 16px;
  border: none; border-radius: 12px;
  font-size: 16px; font-weight: 600; font-family: inherit;
  background: var(--primary); color: #fff;
  text-align: center; text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--primary-deep); }
.btn.accent { background: var(--primary); }
.btn.light { background: var(--primary-soft); color: var(--primary); }
.btn.light:hover { background: #e0eaf4; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn:disabled:hover { background: var(--primary); }

.btn-row { display: flex; gap: 12px; margin-top: 20px; }
.btn-row .btn { flex: 1; width: auto; }

/* 表单 */
label { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin: 14px 0 6px; }
input {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px;
  font-size: 16px; font-family: inherit; color: var(--text);
  background: #fff;
  -webkit-appearance: none;
}
input:focus { outline: none; border-color: var(--primary); }
input::placeholder { color: #9aa5b4; }

/* 提示消息 */
.msg { margin-top: 16px; font-size: 15px; text-align: center; }
.msg.err { color: var(--danger); }
.msg.ok { color: var(--success); }
.msg.info { color: var(--muted); }

/* 报名成功后：卡片切换为居中布局，消息在正中央 */
.card.done { display: flex; align-items: center; justify-content: center; min-height: 96px; }
.card.done .msg { margin-top: 0; }

/* 报名确认信息 */
.confirm-box { text-align: center; padding: 14px; background: var(--primary-soft); border-radius: 12px; }
.confirm-box p { margin: 0 0 10px; color: var(--primary); font-size: 14px; font-weight: 600; }
.confirm-line { font-size: 17px; margin: 6px 0; color: var(--muted); }
.confirm-line b { color: var(--text); }

/* 查分结果 */
.score-box { text-align: center; margin-top: 8px; }
.score-num { font-size: 56px; font-weight: 800; color: var(--primary); line-height: 1.1; }
.score-sub { color: var(--muted); font-size: 14px; }
.rank-line {
  margin-top: 16px; padding: 12px;
  background: var(--primary-soft); color: var(--primary);
  border-radius: 12px; font-size: 16px; font-weight: 600; text-align: center;
}

/* 管理页 */
.stat { font-size: 13px; color: var(--muted); margin: 0 0 14px; }
.list { max-height: 60vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: none; }
.row .who { flex: 1; min-width: 0; }
.row .who .id { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .who .nm { color: var(--muted); font-size: 12px; }
.row .tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: #e7f6ec; color: #15803d; flex-shrink: 0; }
.row .tag.no { background: #f1f5f9; color: var(--muted); }
.row input { width: 84px; text-align: center; padding: 8px; flex-shrink: 0; }
.row .act { display: flex; gap: 2px; flex-shrink: 0; }
.row .op {
  border: none; background: none; padding: 6px 5px;
  font-size: 13px; font-family: inherit; color: var(--primary);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.row .op.del { color: var(--danger); }
.row .op:disabled { opacity: 0.5; cursor: default; }
/* 行内编辑态：学号姓名变输入框，隐藏标签与分数框 */
.row .who.edit { display: flex; gap: 6px; }
.row .who.edit input { width: auto; flex: 1; min-width: 0; padding: 8px 10px; font-size: 14px; }

/* Toast（无动画，直接显示/隐藏） */
.toast {
  display: none;
  position: fixed; left: 50%; bottom: 32px;
  transform: translateX(-50%);
  background: var(--text); color: #fff;
  padding: 10px 20px; border-radius: 999px;
  font-size: 14px;
}
.toast.show { display: block; }

footer { text-align: center; margin-top: 40px; font-size: 13px; }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--primary); }
