:root {
  --bg: #F6F5F1;
  --card: #FFFFFF;
  --ink: #14201C;
  --muted: #6C7A73;
  --line: #E6E5DE;
  --primary: #1B4332;
  --primary-soft: #EAF0EC;
  --amber: #B45309;
  --amber-soft: #FDF3E7;
  --danger: #B42318;
  --danger-soft: #FEF0EE;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(20, 32, 28, .04), 0 8px 28px rgba(20, 32, 28, .06);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 56px;
}
.wrap.wide { max-width: 900px; }

/* ---------- 顶部 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: .02em;
}
.brand .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}
.brand small {
  display: block;
  font-weight: 400;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.topbar .who {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar .who b { color: var(--ink); font-weight: 600; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 16px;
}
.card-body { padding: 20px; }
.card-pad { padding: 18px 20px; }

/* ---------- 活动条目 ---------- */
.ev {
  display: block;
  color: inherit;
  transition: transform .18s ease, box-shadow .18s ease;
}
.ev:active { transform: scale(.994); }
.ev-poster {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: linear-gradient(135deg, #1B4332, #2D6A4F);
}
.ev-poster-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 7;
  background: linear-gradient(135deg, #1B4332 0%, #2D6A4F 60%, #40916C 100%);
  color: rgba(255, 255, 255, .5);
  font-size: 12px;
  letter-spacing: .3em;
}
.ev-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.ev-title {
  font-size: 17px;
  font-weight: 650;
  line-height: 1.4;
  margin: 0 0 6px;
  letter-spacing: -.01em;
}
.ev-meta {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}
.ev-meta span { display: inline-flex; align-items: center; gap: 5px; }
.ev-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* ---------- 徽标 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex: 0 0 auto;
}
.badge-open { background: var(--primary-soft); color: #14532D; }
.badge-ended { background: #F1F1EE; color: #8A8F8A; }
.badge-closed { background: var(--danger-soft); color: var(--danger); }
.badge-signed { background: var(--amber-soft); color: var(--amber); }
.badge::before {
  content: "";
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor;
}

/* ---------- 标题区 ---------- */
.page-title {
  font-size: 26px;
  line-height: 1.3;
  font-weight: 680;
  letter-spacing: -.02em;
  margin: 4px 0 8px;
}
.page-sub { color: var(--muted); font-size: 14px; margin: 0; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #3C4A43;
  margin-bottom: 7px;
}
.field .hint { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 6px; }
input[type=text], input[type=tel], input[type=number], input[type=password],
input[type=datetime-local], textarea, select {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: #FBFBF9;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  transition: border-color .16s ease, background .16s ease;
  -webkit-appearance: none;
}
input:focus, textarea:focus, select:focus {
  border-color: #9CB8A8;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(27, 67, 50, .07);
}
textarea { resize: vertical; min-height: 120px; line-height: 1.7; }
input[type=file] { font-size: 13px; color: var(--muted); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 18px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, background .16s ease, opacity .16s ease;
  text-align: center;
  white-space: nowrap;
}
.btn:active { transform: scale(.975); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #14392A; }
.btn-amber { background: #F0A32A; color: #2B1B05; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: #F7F7F4; }
.btn-danger { background: #fff; color: var(--danger); border-color: #F0CBC7; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-block { display: flex; width: 100%; padding: 14px 18px; font-size: 16px; }
.btn-lg { padding: 15px 22px; font-size: 16px; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn[disabled], .btn.disabled {
  opacity: .5; cursor: not-allowed; pointer-events: none;
}

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 auto; }

/* ---------- 详情正文 ---------- */
.detail-text {
  font-size: 15px;
  line-height: 1.85;
  color: #2B3934;
  white-space: pre-wrap;
  word-break: break-word;
}
.divider { height: 1px; background: var(--line); margin: 18px 0; }

/* ---------- 信息条 ---------- */
.strip {
  display: flex;
  gap: 0;
  border-radius: 14px;
  background: #FBFBF9;
  border: 1px solid var(--line);
  overflow: hidden;
}
.strip > div {
  flex: 1;
  padding: 12px 14px;
  text-align: center;
  position: relative;
}
.strip > div + div::before {
  content: ""; position: absolute; left: 0; top: 20%; height: 60%;
  width: 1px; background: var(--line);
}
.strip .k { font-size: 11px; color: var(--muted); letter-spacing: .06em; }
.strip .v { font-size: 17px; font-weight: 650; margin-top: 2px; }
.strip .v small { font-size: 11px; font-weight: 400; color: var(--muted); margin-left: 2px; }

/* ---------- 表格 ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.list {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 620px;
}
table.list th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .04em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: #FBFBF9;
}
table.list td {
  padding: 11px 12px;
  border-bottom: 1px solid #F1F1ED;
  white-space: nowrap;
}
table.list tr:last-child td { border-bottom: none; }
table.list td.num { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- 提示 ---------- */
.alert {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  margin-bottom: 14px;
  line-height: 1.6;
}
.alert-err { background: var(--danger-soft); color: #912018; border: 1px solid #F6D5D1; }
.alert-ok { background: var(--primary-soft); color: #14532D; border: 1px solid #CFE3D6; }
.alert-info { background: var(--amber-soft); color: #7A4A0B; border: 1px solid #F5DFC2; }

.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
  font-size: 14px;
}
.empty .big { font-size: 34px; margin-bottom: 10px; opacity: .35; }

/* ---------- 登录/绑定 ---------- */
.center-box {
  min-height: 72vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.spinner {
  width: 34px; height: 34px;
  border: 3px solid var(--primary-soft);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin-bottom: 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.mark {
  width: 52px; height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1B4332, #40916C);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 22px; font-weight: 700;
  margin-bottom: 18px;
  box-shadow: 0 10px 24px rgba(27, 67, 50, .22);
}

/* ---------- 选择学生 ---------- */
.pick {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  margin-bottom: 10px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  transition: border-color .15s ease, background .15s ease;
}
.pick:hover { border-color: #9CB8A8; background: #FBFDFB; }
.pick .avatar {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 650; font-size: 15px; flex: 0 0 auto;
}
.pick .meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.pick .arrow { margin-left: auto; color: #B9C2BC; font-size: 18px; }

/* ---------- 管理端 ---------- */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 26px 0 12px;
}
.section-head h2 {
  font-size: 15px;
  font-weight: 650;
  margin: 0;
  letter-spacing: .01em;
}
.section-head .count { color: var(--muted); font-weight: 400; font-size: 13px; }

.admin-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  border-bottom: 1px solid #F1F1ED;
}
.admin-row:last-child { border-bottom: none; }
.admin-row .main { flex: 1; min-width: 0; }
.admin-row .t {
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-row .m { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.admin-row .n {
  font-size: 20px;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
  text-align: right;
  line-height: 1.1;
}
.admin-row .n small { display: block; font-size: 10.5px; color: var(--muted); font-weight: 400; }

.poster-thumb {
  width: 72px; height: 48px;
  border-radius: 8px;
  object-fit: cover;
  flex: 0 0 auto;
  border: 1px solid var(--line);
}

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 14px;
}
.nav-back:hover { color: var(--ink); }

.kv { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; font-size: 13.5px; }
.kv + .kv { border-top: 1px solid #F1F1ED; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; text-align: right; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(16px);
  background: rgba(20, 32, 28, .94);
  color: #fff;
  font-size: 14px;
  padding: 11px 20px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 99;
  max-width: 86vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.footer-note {
  text-align: center;
  color: #A8B0AB;
  font-size: 11.5px;
  margin-top: 28px;
  letter-spacing: .04em;
}

@media (max-width: 640px) {
  /* 窄屏名单：隐藏序号/学号/钉钉名，保留姓名、班级、手机号、时间 */
  .list-signups { min-width: 0; }
  .list-signups th:nth-child(1), .list-signups td:nth-child(1),
  .list-signups th:nth-child(4), .list-signups td:nth-child(4),
  .list-signups th:nth-child(6), .list-signups td:nth-child(6) { display: none; }
  .list-signups th, .list-signups td { padding: 10px 8px; }
  .list-signups td:nth-child(2) { min-width: 56px; }
}

@media (max-width: 480px) {
  .wrap { padding: 16px 14px 48px; }
  .page-title { font-size: 22px; }
  .card-body { padding: 17px; }
  .card-pad { padding: 16px 17px; }
  .strip .v { font-size: 15px; }
}
