:root {
  --brand: #2f5bea;
  --brand-dark: #1e3fb8;
  --brand-soft: #eef2ff;
  --gold: #f5a623;
  --green: #17a673;
  --orange: #f07a2b;
  --red: #e05252;
  --ink: #1f2430;
  --muted: #6b7280;
  --line: #e6e9f0;
  --bg: #f4f6fb;
  --card: #ffffff;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(31, 45, 90, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
}
a { color: var(--brand); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; }
p { margin: 0; }
button, input, select { font-family: inherit; font-size: 14px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.nowrap { white-space: nowrap; }

/* ---------- 按钮与表单 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 42px; padding: 0 20px; border: none; border-radius: 10px;
  background: var(--brand); color: #fff; font-weight: 600; cursor: pointer;
  transition: .15s; white-space: nowrap;
}
.btn:hover { background: var(--brand-dark); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--brand); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--brand); background: var(--brand-soft); }
.btn.gold { background: var(--gold); }
.btn.gold:hover { background: #dc8f10; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.danger { background: #fff; color: var(--red); border: 1px solid #f3d4d4; }
.btn.danger:hover { background: #fdf1f1; }
.btn.link { background: none; color: var(--brand); padding: 0 4px; height: auto; font-size: 13px; }
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.input, .select {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; color: var(--ink); outline: none; transition: .15s;
}
.input:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 91, 234, .1); }
textarea.input { height: auto; min-height: 74px; padding: 10px 12px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.msg { font-size: 13px; min-height: 20px; margin-top: 8px; }
.msg.err { color: var(--red); }
.msg.ok { color: var(--green); }

/* ---------- 登录/落地页 ---------- */
.landing {
  min-height: 100vh;
  background:
    radial-gradient(900px 460px at 12% -8%, #dfe7ff 0%, rgba(223, 231, 255, 0) 62%),
    radial-gradient(720px 420px at 96% 4%, #fff1d6 0%, rgba(255, 241, 214, 0) 60%),
    var(--bg);
}
.landing-wrap { max-width: 1080px; margin: 0 auto; padding: 40px 20px 60px; }
.landing-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 46px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: .5px; }
.logo-mark {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), #6f8cff); color: #fff; font-size: 17px;
  box-shadow: 0 6px 16px rgba(47, 91, 234, .35);
}
.landing-main { display: grid; grid-template-columns: 1.15fr .85fr; gap: 44px; align-items: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
  background: #fff; border: 1px solid #e3e8ff; color: var(--brand); font-size: 13px; font-weight: 600;
  box-shadow: 0 4px 14px rgba(47, 91, 234, .08); margin-bottom: 18px;
}
.hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.hero h1 { font-size: 42px; line-height: 1.22; letter-spacing: -1px; margin-bottom: 16px; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero p.lead { font-size: 16px; color: var(--muted); max-width: 520px; margin-bottom: 26px; }
.hero-points { display: grid; gap: 12px; }
.hero-point { display: flex; gap: 12px; align-items: flex-start; }
.hero-point .ico {
  flex: 0 0 30px; height: 30px; border-radius: 9px; background: var(--brand-soft);
  color: var(--brand); display: grid; place-items: center; font-size: 15px; font-weight: 700;
}
.hero-point b { display: block; font-size: 14px; }
.hero-point span { color: var(--muted); font-size: 13px; }

.login-card {
  background: var(--card); border-radius: 20px; padding: 30px 26px; box-shadow: var(--shadow);
  border: 1px solid #fff;
}
.login-card h2 { font-size: 21px; margin-bottom: 4px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.login-card .btn { width: 100%; height: 44px; }
.login-tip { font-size: 12px; color: var(--muted); text-align: center; margin-top: 14px; line-height: 1.8; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 48px; }
.feature {
  background: rgba(255, 255, 255, .8); border: 1px solid #fff; border-radius: 16px; padding: 20px;
  box-shadow: 0 6px 20px rgba(31, 45, 90, .05);
}
.feature b { display: block; margin-bottom: 6px; font-size: 15px; }
.feature p { color: var(--muted); font-size: 13px; }
.landing-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 46px; }

/* ---------- 顶部栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.topbar-left { display: flex; align-items: center; gap: 18px; }
.topbar-nav { display: flex; gap: 6px; }
.nav-link {
  padding: 6px 12px; border-radius: 8px; color: var(--muted); font-size: 13px; font-weight: 600;
}
.nav-link.active, .nav-link:hover { background: var(--brand-soft); color: var(--brand); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.who { font-size: 13px; color: var(--muted); }
.quota-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  background: #fff7e6; color: #a86a00; font-size: 12px; font-weight: 600; border: 1px solid #ffe6b8;
}
.quota-pill.warn { background: #fdf1f1; color: var(--red); border-color: #f3d4d4; }

/* ---------- 查询页 ---------- */
.page-wrap { max-width: 1080px; margin: 0 auto; padding: 22px 18px 70px; }
.tabs { display: flex; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 5px; width: fit-content; }
.tab {
  border: none; background: none; padding: 8px 18px; border-radius: 8px; font-weight: 600;
  color: var(--muted); cursor: pointer;
}
.tab.active { background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(47, 91, 234, .28); }
.search-card { background: #fff; border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin: 18px 0 22px; }
.search-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.search-head h1 { font-size: 20px; }
.search-head p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.score-tip { font-size: 12px; color: var(--muted); margin-top: -6px; margin-bottom: 14px; }
.actions { display: flex; gap: 10px; align-items: center; margin-top: 6px; }
.result-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 22px 2px 12px; }
.result-head h2 { font-size: 17px; }
.result-count { color: var(--muted); font-size: 13px; }
.cards { display: grid; gap: 12px; }
.job-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px;
  display: grid; grid-template-columns: 1fr auto; gap: 14px; transition: .15s;
}
.job-card:hover { border-color: #c9d5ff; box-shadow: 0 8px 24px rgba(31, 45, 90, .07); }
.job-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.code-badge {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: var(--brand);
  background: var(--brand-soft); padding: 2px 8px; border-radius: 6px; cursor: pointer;
}
.job-title { font-size: 15px; font-weight: 700; }
.job-unit { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.job-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: #f2f4f8; color: #5b6472; }
.tag.blue { background: var(--brand-soft); color: var(--brand); }
.tag.gold { background: #fff6e5; color: #a86a00; }
.job-major { font-size: 12px; color: #59606d; background: #fafbfe; border: 1px dashed #e6e9f0; border-radius: 8px; padding: 8px 10px; }
.job-right { text-align: center; min-width: 112px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.prob-num { font-size: 28px; font-weight: 800; line-height: 1; color: var(--brand); }
.prob-num small { font-size: 13px; font-weight: 600; }
.prob-label { font-size: 12px; color: var(--muted); }
.band { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.band.b { background: #e8f8f1; color: var(--green); }
.band.w { background: var(--brand-soft); color: var(--brand); }
.band.c { background: #fff4e8; color: var(--orange); }
.band.x { background: #f2f4f8; color: var(--muted); }
.ref-line { font-size: 12px; color: var(--muted); }
.empty-state {
  background: #fff; border: 1px dashed #d9dfea; border-radius: 14px; padding: 44px 20px;
  text-align: center; color: var(--muted);
}
.empty-state b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 6px; }
.loading { text-align: center; padding: 26px; color: var(--muted); }
.spinner {
  width: 22px; height: 22px; border: 3px solid #e3e8f5; border-top-color: var(--brand);
  border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; vertical-align: -5px; margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 后台 ---------- */
.admin-layout { display: grid; grid-template-columns: 210px 1fr; min-height: calc(100vh - 65px); }
.sidebar {
  background: #fff; border-right: 1px solid var(--line); padding: 18px 12px;
  position: sticky; top: 65px; height: calc(100vh - 65px); overflow: auto;
}
.side-group { font-size: 11px; color: #9aa1ad; padding: 10px 12px 6px; letter-spacing: 1px; }
.side-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  color: #4b5563; font-weight: 600; cursor: pointer; margin-bottom: 2px;
}
.side-item:hover { background: #f5f7fc; }
.side-item.active { background: var(--brand-soft); color: var(--brand); }
.side-item .ico { width: 20px; text-align: center; font-size: 15px; }
.admin-main { padding: 20px 24px 60px; max-width: 1240px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 21px; }
.page-head p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.kpi .n { font-size: 26px; font-weight: 800; line-height: 1.2; }
.kpi .t { color: var(--muted); font-size: 12px; }
.kpi.accent .n { color: var(--brand); }
.kpi.green .n { color: var(--green); }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-bottom: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { font-size: 16px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar .input { width: 220px; height: 36px; }
.toolbar .btn { height: 36px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid #f0f2f7; font-size: 13px; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; background: #fafbfe; }
tr:last-child td { border-bottom: none; }
.gap-pos { color: var(--green); font-weight: 700; }
.gap-neg { color: var(--orange); font-weight: 700; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.on { background: #e8f8f1; color: var(--green); }
.badge.off { background: #f2f4f8; color: var(--muted); }
.badge.exam { background: var(--brand-soft); color: var(--brand); }
.student-row { cursor: pointer; }
.student-row:hover td { background: #fafbff; }
.spark { width: 96px; height: 30px; }
.empty { text-align: center; padding: 30px; color: var(--muted); font-size: 13px; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; }
.form-row > * { flex: 1; min-width: 150px; }
.hint-box { background: #f8f9fd; border: 1px solid #edf0f7; border-radius: 10px; padding: 12px 14px; font-size: 12px; color: var(--muted); line-height: 1.9; }
.student-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart-box { width: 100%; }
.chart-box svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.subject-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.chip { background: #f5f7fc; border-radius: 8px; padding: 6px 12px; font-size: 12px; color: #4b5563; }
.chip b { color: var(--ink); }

/* ---------- 弹窗与提示 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(20, 28, 48, .45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: #fff; border-radius: 18px; width: 100%; max-width: 520px; max-height: 88vh;
  overflow: auto; padding: 24px; box-shadow: 0 30px 80px rgba(15, 25, 50, .25);
}
.modal.wide { max-width: 860px; }
.modal h3 { font-size: 18px; margin-bottom: 4px; }
.modal .modal-sub { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; }
.toast {
  background: #1f2430; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 13px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2); animation: toastIn .2s ease;
}
.toast.err { background: #c84343; }
.toast.ok { background: #178a61; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }

@media (max-width: 900px) {
  .landing-main { grid-template-columns: 1fr; gap: 28px; }
  .hero h1 { font-size: 32px; }
  .features { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto; display: flex; gap: 6px; overflow-x: auto;
    padding: 10px 12px; border-right: none; border-bottom: 1px solid var(--line);
  }
  .side-group { display: none; }
  .side-item { white-space: nowrap; padding: 8px 12px; }
  .admin-main { padding: 16px 14px 60px; }
  .student-detail-grid { grid-template-columns: 1fr; }
  .job-card { grid-template-columns: 1fr; }
  .job-right { flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px; text-align: left; }
}
@media (max-width: 560px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .landing-wrap { padding: 24px 16px 40px; }
  .hero h1 { font-size: 27px; }
  .login-card { padding: 22px 18px; }
  .toolbar .input { width: 100%; }
  .modal { padding: 20px 16px; }
}
