/* 同小理考试抽签系统 - 公共样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #2f6fed;
  --primary-dark: #1e56c8;
  --bg: #f2f5fa;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e3e8f0;
  --green: #00a870;
  --red: #e5484d;
  --amber: #f59f00;
  --radius: 14px;
}

html, body { height: 100%; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

h1 { font-size: 26px; font-weight: 700; }

/* 校徽 logo */
.logo-chip {
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border-radius: 10px; padding: 4px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .18); flex-shrink: 0;
}
.logo { height: 30px; width: 30px; object-fit: contain; display: block; }
.logo-chip.small { padding: 2px; border-radius: 7px; }
.logo-chip.small .logo { height: 22px; width: 22px; }

.badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  background: #e8effd;
  color: var(--primary);
  white-space: nowrap;
}
.badge.green { background: #e6f7f0; color: var(--green); }
.badge.red { background: #fdebec; color: var(--red); }
.badge.amber { background: #fef3e2; color: #b97509; }

button, .btn {
  display: inline-block;
  border: none;
  border-radius: 10px;
  padding: 10px 22px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  transition: background .15s, transform .1s;
  text-decoration: none;
  line-height: 1.4;
}
button:hover, .btn:hover { background: var(--primary-dark); }
button:active, .btn:active { transform: scale(.98); }
button:disabled { opacity: .55; cursor: not-allowed; }
button.ghost { background: #fff; color: var(--text); border: 1px solid var(--border); }
button.ghost:hover { background: #f5f7fb; }
button.danger { background: var(--red); }
button.danger:hover { background: #c93338; }
button.small { padding: 5px 12px; font-size: 13px; border-radius: 8px; }

input[type=text], input[type=password], input[type=number], textarea, select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, .15);
}
label { font-size: 14px; font-weight: 600; color: var(--muted); display: block; margin-bottom: 6px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 22px;
}

.msg { margin-top: 10px; font-size: 14px; min-height: 20px; }
.msg.err { color: var(--red); }
.msg.ok { color: var(--green); }

/* 分组框（大屏与后台共用） */
.group-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-top: 6px solid var(--gc, var(--primary));
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 2px 10px rgba(31, 41, 55, .05);
}
.group-head { display: flex; justify-content: space-between; align-items: baseline; }
.group-no { font-size: 20px; font-weight: 700; color: var(--gc, var(--primary)); }
.group-count { font-size: 13px; color: var(--muted); }

.slot {
  border-radius: 10px;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 6px;
  text-align: center;
}
.slot.empty { border: 2px dashed #d4dbe7; color: #a3aec2; }
.slot-wait { font-size: 14px; }
.slot.filled { background: color-mix(in srgb, var(--gc, var(--primary)) 9%, #fff); }
.slot-name { font-size: 20px; font-weight: 700; line-height: 1.25; word-break: break-all; }
.slot-sid { font-size: 13px; color: var(--muted); word-break: break-all; }
.slot.new { animation: pop-in .6s ease; }
@keyframes pop-in {
  0% { transform: scale(.6); opacity: 0; }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

.batch { display: flex; flex-direction: column; gap: 6px; }
.batch-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--gc, var(--primary));
  background: color-mix(in srgb, var(--gc, var(--primary)) 10%, #fff);
  border-radius: 6px;
  padding: 3px 10px;
  align-self: flex-start;
}
.batch-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.single-slot .slot { min-height: 96px; }
.single-slot .slot-name { font-size: 26px; }

/* ===== 3 列大屏共享样式（大屏 / 后台结果 / 操作计时共用） ===== */
/* 第 1 列（个人）宽度为第 2、3 列（合作）的一半 */
.screen-cols { display: grid; grid-template-columns: 1fr 2fr 2fr; gap: 18px; align-items: start; }
.scol-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.scol-head h3 { font-size: 19px; color: var(--text); }
.scol-sub { font-size: 13px; color: var(--muted); }
.scol-body { min-height: 0; }
.scol-fit { display: flex; flex-direction: column; gap: 12px; }
.scol-empty { color: var(--muted); font-size: 14px; padding: 20px; text-align: center; border: 2px dashed var(--border); border-radius: 12px; }
/* 第 1 列与第 2、3 列之间的竖线 */
.scol-ind { border-right: 3px solid #c3cfe2; padding-right: 18px; }

.op-card {
  background: var(--card); border: 1px solid var(--border);
  border-top: 5px solid var(--gc, var(--primary)); border-radius: 12px;
  padding: 12px; box-shadow: 0 2px 8px rgba(31, 41, 55, .05);
}
.op-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.op-no { font-size: 18px; font-weight: 700; color: var(--gc, var(--primary)); }
.op-count { font-size: 12px; color: var(--muted); }
.op-state { font-size: 13px; font-weight: 700; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
/* 等待操作=黑色，正在操作=红色加粗，操作结束=灰色 */
.op-state.wait { background: #eef1f6; color: #1f2937; }
.op-state.run { background: #fdebec; color: #d92d20; font-weight: 800; }
.op-state.done { background: #f3f4f6; color: #9aa4b5; }
.op-times { display: flex; gap: 14px; margin-top: 8px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.op-times b { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 600; }
.coop-batch { padding-top: 8px; }
.coop-batch + .coop-batch { border-top: 1px dashed var(--border); margin-top: 10px; }
.batch-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.end-op-btn { margin-top: 8px; width: 100%; background: var(--green); }
.end-op-btn:hover { background: #008f5d; }
.end-op-btn:disabled { background: #cbd5e1; }
.op-ended-mark { margin-top: 8px; text-align: center; font-size: 13px; color: var(--green); font-weight: 600; }
.no-batch2 { font-size: 12px; color: #a3aec2; padding: 6px 2px; }

/* 考试内容（加大加粗深红色） */
.exam-content {
  font-weight: 900;
  font-size: 17px;
  line-height: 1.55;
  color: #8b0000;
  background: #fff1f0;
  border-left: 5px solid #d92d20;
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 10px;
}
.exam-content.small { font-size: 15px; padding: 6px 10px; margin: 2px 0 7px; }

@media (max-width: 1100px) {
  .screen-cols { grid-template-columns: 1fr; }
  .scol-ind { border-right: none; border-bottom: 3px solid #c3cfe2; padding-right: 0; padding-bottom: 14px; }
}
