:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --line: #e5e9f2;
  --text: #1c2434;
  --muted: #6b768c;
  --primary: #2557d6;
  --primary-soft: #eaf0ff;
  --green: #157a53;
  --green-soft: #e6f5ee;
  --red: #c53b3b;
  --red-soft: #fdecec;
  --amber: #9a6510;
  --amber-soft: #fdf3df;
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; }
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar-in {
  max-width: 1120px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.brand { font-size: 16px; font-weight: 600; margin-right: auto; display: flex; align-items: center; gap: 9px; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); display: inline-block; }
.brand small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav a { padding: 6px 11px; border-radius: 8px; color: var(--muted); font-size: 13px; }
.nav a:hover, .nav a.on { background: var(--primary-soft); color: var(--primary); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 24px 20px 60px; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
}
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h2 { font-size: 16px; margin: 0; font-weight: 600; }
.card-head .spacer { flex: 1; }
h1 { font-size: 22px; margin: 0 0 8px; font-weight: 600; }
h3 { font-size: 14px; margin: 0 0 10px; font-weight: 600; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hero { background: linear-gradient(0deg, #fff, #fff); border-left: 4px solid var(--primary); }
.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; margin-bottom: 6px; color: #39435a; }
.field .req { color: var(--red); }
input[type=text], input[type=password], input[type=datetime-local], input[type=file], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--text); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea { resize: vertical; min-height: 70px; }
input[type=file] { padding: 8px; background: #fafbff; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 15px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--text); cursor: pointer; font-size: 13px; white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { opacity: .9; color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--primary); }
.btn.danger { color: var(--red); border-color: #f3c9c9; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs button {
  border: 0; background: transparent; padding: 9px 14px; cursor: pointer;
  color: var(--muted); border-bottom: 2px solid transparent; font-size: 13px;
}
.tabs button.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; line-height: 20px; }
.badge.pending { background: var(--amber-soft); color: var(--amber); }
.badge.approved { background: var(--green-soft); color: var(--green); }
.badge.rejected { background: var(--red-soft); color: var(--red); }
.badge.none { background: #eef0f5; color: var(--muted); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat b { display: block; font-size: 26px; font-weight: 600; line-height: 1.3; }
.stat span { color: var(--muted); font-size: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 12px; white-space: nowrap; }
.table-scroll { overflow-x: auto; }
.track {
  border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 12px; background: #fcfdff;
}
.track .head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.track .head b { font-size: 14px; }
audio { width: 100%; height: 38px; margin-top: 8px; }
.preview-img {
  display: block; max-width: 100%; max-height: 420px; margin-top: 8px;
  border: 1px solid var(--line); border-radius: 8px; background: #f7f9fd; object-fit: contain;
}
.file-preview { margin-top: 8px; }
.var-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.var-chip {
  border: 1px solid var(--line); background: #f7f9fd; color: #3a4a6b;
  border-radius: 99px; padding: 4px 10px; font-size: 12px; cursor: pointer;
}
.var-chip:hover { border-color: var(--primary); color: var(--primary); }
.tpl-preview {
  background: #f7f9fd; border: 1px dashed var(--line); border-radius: 8px;
  padding: 9px 12px; font-size: 13px; color: #23479c; word-break: break-all; margin-bottom: 10px;
}
.tpl-preview b { color: #1c3f8f; }
.note { background: var(--amber-soft); color: #744d0f; padding: 9px 12px; border-radius: 8px; margin: 8px 0; font-size: 13px; }
.hint { background: var(--primary-soft); color: #23479c; padding: 10px 13px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; line-height: 1.9; }
.hint code { background: #fff; border: 1px solid #cfdcfb; border-radius: 4px; padding: 1px 5px; margin-right: 3px; font-size: 12px; color: #1c3f8f; white-space: nowrap; }
.import-preview { background: #f7f9fd; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; margin: -2px 0 14px; line-height: 1.7; }
.import-preview b { color: var(--primary); }
.import-preview.err { background: #fff5f4; border-color: #f4cfcb; color: #b42318; }
.sub-batch { border-left: 3px solid var(--primary); }
.sub-batch + .sub-batch { margin-top: 14px; }
.empty { text-align: center; color: var(--muted); padding: 34px 12px; }
.linkbox {
  display: flex; align-items: center; gap: 8px; background: #f7f9fd; border: 1px dashed var(--line);
  border-radius: 8px; padding: 7px 10px; font-size: 12px; word-break: break-all; margin-bottom: 8px;
}
.linkbox code { flex: 1; color: #3a4a6b; }
.grade-block { margin-bottom: 18px; }
.grade-title { font-size: 13px; color: var(--muted); margin: 0 0 8px; font-weight: 600; }
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.class-tile {
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; background: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 13px;
}
.class-tile:hover { border-color: var(--primary); }
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%);
  background: #202a3d; color: #fff; padding: 11px 20px; border-radius: 9px;
  font-size: 13px; z-index: 100; max-width: 90vw; box-shadow: 0 6px 24px rgba(0,0,0,.16);
}
.toast.bad { background: var(--red); }
.progress { height: 6px; background: #edf0f6; border-radius: 99px; overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; background: var(--primary); }
.field-row { display: grid; grid-template-columns: 1fr 1fr 70px; gap: 8px; align-items: end; }
.hidden { display: none !important; }
.time-edit-row > td { background: var(--primary-soft); }
.time-edit-row form { padding: 10px 2px; }
.time-edit-row .field { margin-bottom: 0; }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 10px 0 30px; }
@media (max-width: 640px) {
  .wrap { padding: 16px 12px 40px; }
  .card { padding: 15px; }
  .field-row { grid-template-columns: 1fr; }
  .brand small { display: none; }
}
