:root {
  --brand: #1f7a6b;
  --brand-dark: #14574c;
  --brand-soft: #e6f4f1;
  --accent: #d97706;
  --bg: #f4f7f6;
  --surface: #ffffff;
  --text: #1b2a2f;
  --text-soft: #5d6f75;
  --line: #e2eae8;
  --ok: #15803d;
  --warn: #b45309;
  --danger: #b91c1c;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(20, 60, 55, .07);
  --shadow-lg: 0 12px 32px rgba(20, 60, 55, .14);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "微软雅黑", -apple-system, "Segoe UI", "PingFang SC", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

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

/* ---------- 通用布局 ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 20px; }
.wrap-narrow { max-width: 520px; margin: 0 auto; padding: 20px; }

.topbar {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: #fff;
  padding: 14px 20px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow);
  position: sticky; top: 0; z-index: 20;
}
.topbar .logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex: none;
}
.topbar .titles { flex: 1; min-width: 0; }
.topbar h1 { font-size: 16px; margin: 0; font-weight: 600; letter-spacing: .5px; }
.topbar .sub { font-size: 12px; opacity: .82; }
.topbar .who { font-size: 12px; opacity: .9; text-align: right; line-height: 1.4; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}
.card h2 { font-size: 16px; margin: 0 0 4px; font-weight: 600; }
.card .desc { font-size: 13px; color: var(--text-soft); margin: 0 0 16px; }

/* ---------- 表单 ---------- */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13px; color: var(--text-soft); margin-bottom: 6px; font-weight: 500; }
input[type=text], input[type=password], input[type=file], select, textarea {
  width: 100%; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; font-family: inherit; color: var(--text);
  background: #fbfdfc; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31,122,107,.12); background: #fff;
}
input[type=file] { padding: 9px; background: #fbfdfc; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 18px; border-radius: 10px; border: 1px solid transparent;
  background: var(--brand); color: #fff; font-size: 15px; font-family: inherit;
  font-weight: 500; cursor: pointer; transition: filter .15s, opacity .15s;
}
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--brand); border-color: var(--line); }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.danger { background: #fff; color: var(--danger); border-color: #f3cfcf; }
.btn.danger:hover { background: #fdf2f2; }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 180px; }
.row .fixed { flex: 0 0 auto; }

/* ---------- 表格 ---------- */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #f7faf9; font-weight: 600; font-size: 13px; color: var(--text-soft); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fbfdfc; }

.tag {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 12px; font-weight: 500; line-height: 1.7;
}
.tag.ok { background: #e8f6ec; color: var(--ok); }
.tag.no { background: #fdf2e9; color: var(--warn); }
.tag.grey { background: #eef2f1; color: var(--text-soft); }

/* ---------- 进度条 ---------- */
.bar { height: 8px; background: #e9efee; border-radius: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); width: 0; transition: width .2s; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 34px 16px; color: var(--text-soft); font-size: 14px; }
.empty .icon { font-size: 30px; display: block; margin-bottom: 8px; opacity: .5; }

/* ---------- 登录页 ---------- */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: linear-gradient(150deg, #eef6f4 0%, #e3efec 55%, #dcebe7 100%);
}
.auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); padding: 30px 26px; }
.auth-card .brandmark { text-align: center; margin-bottom: 20px; }
.auth-card .brandmark .ico {
  width: 54px; height: 54px; border-radius: 15px; margin: 0 auto 10px;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: #fff; font-size: 26px; display: flex; align-items: center; justify-content: center;
}
.auth-card h1 { font-size: 19px; margin: 0 0 4px; text-align: center; font-weight: 600; }
.auth-card .tip { text-align: center; font-size: 13px; color: var(--text-soft); margin-bottom: 22px; }

/* ---------- 学生端 ---------- */
.student-hero {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: #fff; padding: 26px 22px 30px; border-radius: 0 0 22px 22px;
}
.student-hero .who { font-size: 13px; opacity: .85; }
.student-hero .name { font-size: 22px; font-weight: 600; margin-top: 2px; }
.student-hero .meta { font-size: 13px; opacity: .85; margin-top: 4px; }

.mat {
  display: flex; gap: 14px; align-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.mat .fi {
  width: 44px; height: 44px; border-radius: 11px; flex: none;
  background: var(--brand-soft); color: var(--brand-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
}
.mat .info { flex: 1; min-width: 0; }
.mat .info .t { font-weight: 600; font-size: 15px; word-break: break-all; }
.mat .info .s { font-size: 12px; color: var(--text-soft); margin-top: 3px; }
.mat .act { flex: none; }

.banner {
  background: #fff8ed; border: 1px solid #f2ddbc; color: #8a5a10;
  border-radius: 10px; padding: 10px 13px; font-size: 13px; margin-bottom: 14px;
}
.banner.err { background: #fdf2f2; border-color: #f3cfcf; color: var(--danger); }
.banner.ok { background: #eef8f1; border-color: #cfe8d7; color: var(--ok); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button {
  padding: 10px 15px; border: none; background: none; cursor: pointer;
  font-size: 14px; font-family: inherit; color: var(--text-soft); font-weight: 500;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs button.on { color: var(--brand-dark); border-bottom-color: var(--brand); }

/* ---------- Toast ---------- */
#toast { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast-item {
  background: rgba(24, 40, 44, .93); color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 14px; box-shadow: var(--shadow-lg); animation: tin .25s ease;
  max-width: 86vw;
}
.toast-item.ok { background: #146c43; }
.toast-item.err { background: #a52020; }
.toast-item.out { opacity: 0; transition: opacity .3s; }
@keyframes tin { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.spin {
  display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff; border-radius: 50%; animation: sp .7s linear infinite;
}
@keyframes sp { to { transform: rotate(360deg); } }

.hide { display: none !important; }
.muted { color: var(--text-soft); font-size: 13px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Excel 花名册导入 ---------- */
.dropzone {
  border: 2px dashed #bfd8d2; border-radius: var(--radius);
  background: #fafdfc; padding: 26px 18px; text-align: center; cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-soft); }
.dropzone .dz-ico { font-size: 30px; line-height: 1; }
.dropzone .dz-main { font-size: 14px; font-weight: 600; color: var(--brand-dark); margin-top: 8px; }
.dropzone .dz-sub { font-size: 12px; color: var(--text-soft); margin-top: 4px; }
.imp-sum {
  background: var(--brand-soft); border: 1px solid #cfe7e1; border-radius: 10px;
  padding: 12px 14px; font-size: 13px; color: var(--brand-dark); margin-top: 14px;
}
.imp-sum b { font-size: 15px; }
.imp-warn {
  background: #fff8ed; border: 1px solid #f2ddbc; color: #8a5a10;
  border-radius: 10px; padding: 10px 13px; font-size: 12px; margin-top: 10px;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip {
  background: #fff; border: 1px solid #cfe7e1; border-radius: 999px;
  padding: 2px 11px; font-size: 12px; color: var(--brand-dark);
}

/* ---------- 导入进度条 ---------- */
.prog { margin-top: 16px; }
.prog-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  font-size: 13px; color: var(--text-soft); margin-bottom: 7px;
}
.prog-head #progPct, .prog-head #upProgPct { font-variant-numeric: tabular-nums; font-weight: 600; flex: none; }
.prog-track {
  height: 10px; border-radius: 999px; background: #e9f0ee; overflow: hidden;
}
.prog-track > i {
  display: block; height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), #2fa38f);
  transition: width .3s cubic-bezier(.3, .8, .4, 1);
}
.prog.done .prog-head { color: var(--ok); font-weight: 600; }
.prog.done .prog-track > i { background: linear-gradient(90deg, #15803d, #2aa35a); }
.prog.err .prog-head { color: var(--danger); font-weight: 600; }
.prog.err .prog-track > i { background: linear-gradient(90deg, #b91c1c, #dc5050); }
.prog-detail { font-size: 12.5px; color: var(--text-soft); margin-top: 9px; }
.prog.pulse .prog-track > i {
  background-image: linear-gradient(90deg, var(--brand), #2fa38f, var(--brand));
  background-size: 200% 100%;
  animation: progflow 1.1s linear infinite;
}
@keyframes progflow { from { background-position: 0 0; } to { background-position: 200% 0; } }

/* ---------- 多文件待上传列表 ---------- */
.files-head { font-size: 13px; color: var(--text-soft); margin-top: 14px; }
.files-head b { color: var(--brand-dark); }
.bad-mark { color: var(--danger); font-weight: 600; }
.file-list { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.file-item {
  display: flex; align-items: center; gap: 10px;
  background: #fafdfc; border: 1px solid #dcebe7; border-radius: 9px;
  padding: 8px 10px; font-size: 13px;
}
.file-item.bad { background: #fdf5f5; border-color: #f0d2d2; }
.file-item .fi-name {
  flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: #22403a;
}
.file-item .fi-size { flex: none; color: var(--text-soft); font-size: 12px; font-variant-numeric: tabular-nums; }
.file-item .fi-x {
  flex: none; width: 22px; height: 22px; line-height: 1; border: 0; border-radius: 6px;
  background: #eef4f2; color: #5b7a74; cursor: pointer; font-size: 15px; padding: 0;
}
.file-item .fi-x:hover { background: #fbe0e0; color: var(--danger); }

@media (max-width: 640px) {
  .wrap { padding: 14px; }
  .card { padding: 16px; }
  .topbar { padding: 12px 14px; }
  .topbar h1 { font-size: 15px; }
  .mat { flex-direction: column; align-items: stretch; }
  .mat .act .btn { width: 100%; }
}
