/* ============ 设计令牌 ============ */
:root {
  --brand: #2f5fe0;
  --brand-dark: #1e46b8;
  --brand-light: #eaf0ff;
  --success: #12a054;
  --success-light: #e6f7ee;
  --warning: #e08600;
  --warning-light: #fff5e2;
  --danger: #dc3545;
  --danger-light: #fdecee;
  --text-1: #16213a;
  --text-2: #55617a;
  --text-3: #8c97ac;
  --border: #e5e9f2;
  --bg: #f4f6fb;
  --card: #ffffff;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(22, 33, 58, .06), 0 8px 24px rgba(22, 33, 58, .06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-size: 14px;
  color: var(--text-1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ============ 登录页 ============ */
.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  background: var(--card);
}
.login-hero {
  background: linear-gradient(150deg, #22409a 0%, #2f5fe0 55%, #4a83ff 100%);
  color: #fff;
  padding: 64px 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.login-hero::after {
  content: "";
  position: absolute; width: 520px; height: 520px; border-radius: 50%;
  background: rgba(255,255,255,.07); right: -160px; bottom: -180px;
}
.login-hero::before {
  content: "";
  position: absolute; width: 300px; height: 300px; border-radius: 50%;
  background: rgba(255,255,255,.05); left: -110px; top: -90px;
}
.login-hero .logo { display: flex; align-items: center; gap: 12px; font-size: 17px; font-weight: 700; letter-spacing: 0; line-height: 1.4; }
.login-hero .logo .mark {
  width: 40px; height: 40px; border-radius: 10px; background: rgba(255,255,255,.18);
  display: grid; place-items: center; font-size: 20px;
}
.login-hero h1 { font-size: 34px; line-height: 1.35; font-weight: 700; margin-bottom: 18px; position: relative; z-index: 1; }
.login-hero p.sub { font-size: 15px; color: rgba(255,255,255,.82); line-height: 1.9; max-width: 430px; position: relative; z-index: 1; }
.hero-flow { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; position: relative; z-index: 1; }
.hero-flow span {
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22);
  padding: 7px 14px; border-radius: 999px; font-size: 13px;
}
.login-hero .foot { font-size: 12.5px; color: rgba(255,255,255,.6); position: relative; z-index: 1; }

.login-form-side { display: grid; place-items: center; padding: 40px; }
.login-box { width: 100%; max-width: 360px; }
.login-box h2 { font-size: 24px; margin-bottom: 6px; }
.login-box .tip { color: var(--text-3); font-size: 13px; margin-bottom: 28px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 7px; font-weight: 500; }
.field input {
  width: 100%; height: 44px; border: 1px solid var(--border); border-radius: 9px;
  padding: 0 13px; outline: none; transition: .18s; background: #fbfcfe;
}
.field input:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(47,95,224,.1); }
.btn-login {
  width: 100%; height: 46px; border: none; border-radius: 9px; color: #fff;
  background: linear-gradient(135deg, #2f5fe0, #4a83ff); font-size: 15px; font-weight: 600;
  margin-top: 8px; transition: .18s;
}
.btn-login:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-login:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.quick-login { margin-top: 28px; border-top: 1px dashed var(--border); padding-top: 20px; }
.quick-login .t { font-size: 12.5px; color: var(--text-3); margin-bottom: 10px; }
.quick-login .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-login .chips button {
  border: 1px solid var(--border); background: #fff; border-radius: 8px;
  padding: 7px 12px; font-size: 12.5px; color: var(--text-2); transition: .16s;
}
.quick-login .chips button:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }
.login-err {
  background: var(--danger-light); color: var(--danger); border-radius: 8px;
  padding: 9px 13px; font-size: 13px; margin-bottom: 14px; display: none;
}
.login-err.show { display: block; }

/* ============ 后台框架 ============ */
.layout { display: grid; grid-template-columns: 224px 1fr; min-height: 100vh; }
.sidebar { background: #1a2440; color: #fff; display: flex; flex-direction: column; }
.sidebar .brand {
  padding: 20px 20px 18px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar .brand .mark {
  width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg,#2f5fe0,#5b8cff);
  display: grid; place-items: center; font-size: 17px; flex-shrink: 0;
}
.sidebar .brand b { font-size: 14.5px; display: block; letter-spacing: .3px; }
.sidebar .brand small { font-size: 11px; color: rgba(255,255,255,.45); }
.nav { padding: 14px 12px; flex: 1; overflow-y: auto; }
.nav .group { font-size: 11px; color: rgba(255,255,255,.35); padding: 14px 10px 7px; letter-spacing: .8px; }
.nav a {
  display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.72);
  padding: 10px 11px; border-radius: 8px; font-size: 13.5px; margin-bottom: 3px; transition: .15s;
}
.nav a .ic { width: 18px; text-align: center; font-size: 15px; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.active { background: var(--brand); color: #fff; font-weight: 600; }
.sidebar .me { border-top: 1px solid rgba(255,255,255,.08); padding: 14px 16px; font-size: 12.5px; }
.sidebar .me .nm { color: #fff; font-weight: 600; }
.sidebar .me .rl { color: rgba(255,255,255,.45); margin-top: 2px; }
.sidebar .me button {
  margin-top: 10px; width: 100%; background: rgba(255,255,255,.08); border: none;
  color: rgba(255,255,255,.8); border-radius: 7px; padding: 7px; font-size: 12.5px;
}
.sidebar .me button:hover { background: rgba(255,255,255,.16); color: #fff; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 60px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
  position: sticky; top: 0; z-index: 20;
}
.topbar h2 { font-size: 17px; font-weight: 600; }
.topbar .right { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); }
.role-badge {
  padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--brand-light); color: var(--brand);
}
.role-badge.admin { background: #f3e8ff; color: #7c3aed; }
.role-badge.teacher { background: var(--brand-light); color: var(--brand); }
.role-badge.employment { background: var(--warning-light); color: var(--warning); }
.content { padding: 22px 24px 48px; flex: 1; }
.page { display: none; }
.page.active { display: block; animation: fade .22s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ============ 组件 ============ */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid rgba(229,233,242,.9); margin-bottom: 18px;
}
.card-head {
  padding: 15px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.card-head h3 { font-size: 15px; font-weight: 600; }
.card-head .desc { font-size: 12.5px; color: var(--text-3); margin-top: 3px; }
.card-body { padding: 18px 20px; }

.btn {
  border: 1px solid var(--border); background: #fff; color: var(--text-2);
  padding: 8px 15px; border-radius: 8px; font-size: 13px; transition: .16s;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 500; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(.94); color: #fff; }
.btn-danger { background: #fff; border-color: #f3c5cb; color: var(--danger); }
.btn-danger:hover { background: var(--danger-light); border-color: var(--danger); color: var(--danger); }
.btn-sm { padding: 5px 11px; font-size: 12.5px; border-radius: 7px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar input[type=text], .toolbar select {
  height: 36px; border: 1px solid var(--border); border-radius: 8px; padding: 0 11px;
  outline: none; background: #fff; color: var(--text-1); min-width: 130px;
}
.toolbar input[type=text]:focus, .toolbar select:focus { border-color: var(--brand); }
.toolbar .spacer { flex: 1; }

/* ============ 日志筛选工具栏 ============ */
.log-toolbar { padding: 14px 16px; background: #fafbff; border: 1px solid var(--border); border-radius: 10px; }
.log-toolbar .fld { display: flex; flex-direction: column; gap: 5px; }
.log-toolbar .fld > span { font-size: 12px; color: var(--text-2); font-weight: 500; }
.log-toolbar .fld input, .log-toolbar .fld select {
  height: 36px; border: 1px solid var(--border); border-radius: 8px; padding: 0 11px;
  outline: none; background: #fff; color: var(--text-1); font-size: 13px;
}
.log-toolbar .fld input:focus, .log-toolbar .fld select:focus { border-color: var(--brand); }
.log-toolbar > input[type=text] { min-width: 200px; flex: 1; }
.log-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin: -4px 0 12px; font-size: 13px; color: var(--text-2);
}
.log-bar b { color: var(--brand); }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; padding: 11px 12px; background: #f7f9fd; color: var(--text-2);
  font-weight: 600; font-size: 12.5px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
td { padding: 12px; border-bottom: 1px solid #f0f3f9; color: var(--text-1); vertical-align: middle; }
tbody tr:hover { background: #fafbff; }
tbody tr:last-child td { border-bottom: none; }
.tbl-wrap { overflow-x: auto; }

.tag {
  display: inline-block; padding: 3px 9px; border-radius: 6px; font-size: 12px;
  font-weight: 500; white-space: nowrap;
}
.tag.blue { background: var(--brand-light); color: var(--brand); }
.tag.green { background: var(--success-light); color: var(--success); }
.tag.orange { background: var(--warning-light); color: var(--warning); }
.tag.gray { background: #eef1f7; color: var(--text-2); }
.tag.red { background: var(--danger-light); color: var(--danger); }
.tag.purple { background: #f3e8ff; color: #7c3aed; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat {
  background: var(--card); border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow); border: 1px solid rgba(229,233,242,.9); position: relative; overflow: hidden;
}
.stat::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px;
  border-radius: 50%; background: var(--brand-light); opacity: .7;
}
.stat .lb { font-size: 12.5px; color: var(--text-3); position: relative; z-index: 1; }
.stat .vl { font-size: 29px; font-weight: 700; margin-top: 8px; position: relative; z-index: 1; letter-spacing: -.5px; }
.stat .ex { font-size: 12px; color: var(--text-3); margin-top: 5px; position: relative; z-index: 1; }
.stat.g::after { background: var(--success-light); }
.stat.o::after { background: var(--warning-light); }
.stat.p::after { background: #f3e8ff; }

.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 4px 2px; font-size: 13px; color: var(--text-2); }
.pager button { border: 1px solid var(--border); background: #fff; border-radius: 7px; padding: 5px 11px; font-size: 12.5px; }
.pager button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.pager button:disabled { opacity: .45; cursor: not-allowed; }

.empty { text-align: center; padding: 52px 20px; color: var(--text-3); font-size: 13.5px; }
.empty .ic { font-size: 34px; margin-bottom: 12px; opacity: .5; }

/* ============ 抽屉 / 详情 ============ */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(16, 24, 42, .42); z-index: 90;
  opacity: 0; visibility: hidden; transition: .24s;
}
.drawer-mask.show { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: 720px; max-width: 96vw;
  background: #fff; z-index: 91; transform: translateX(100%); transition: transform .28s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column; box-shadow: -10px 0 40px rgba(16,24,42,.14);
}
.drawer.show { transform: none; }
.drawer-head {
  padding: 18px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.drawer-head h3 { font-size: 16.5px; }
.drawer-head .x { border: none; background: none; font-size: 22px; color: var(--text-3); line-height: 1; }
.drawer-head .x:hover { color: var(--text-1); }
.drawer-body { padding: 20px 24px 40px; overflow-y: auto; flex: 1; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tabs button {
  border: none; background: none; padding: 10px 15px; font-size: 13.5px; color: var(--text-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500;
}
.tabs button:hover { color: var(--brand); }
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px 20px; }
.info-item { display: flex; gap: 8px; font-size: 13.5px; padding: 9px 0; border-bottom: 1px dashed #eef1f7; }
.info-item .k { color: var(--text-3); width: 88px; flex-shrink: 0; }
.info-item .v { color: var(--text-1); font-weight: 500; word-break: break-all; }
.section-title {
  font-size: 13px; font-weight: 700; color: var(--text-2); margin: 22px 0 4px;
  padding-left: 9px; border-left: 3px solid var(--brand);
}
.section-title:first-child { margin-top: 0; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-item label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.form-item label .req { color: var(--danger); }
.form-item input, .form-item select, .form-item textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px;
  outline: none; background: #fbfcfe; transition: .16s; color: var(--text-1);
}
.form-item textarea { resize: vertical; min-height: 74px; line-height: 1.6; }
.form-item input:focus, .form-item select:focus, .form-item textarea:focus {
  border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(47,95,224,.09);
}
.form-item input:disabled, .form-item select:disabled {
  background: #f2f4f8; color: var(--text-3); cursor: not-allowed;
}
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.collapse {
  border: 1px solid var(--border); border-radius: 10px; padding: 13px 16px; margin-bottom: 14px;
  background: #fafbff; font-size: 13px; color: var(--text-2); line-height: 1.75;
}
.collapse b { color: var(--text-1); }

/* ============ 面试记录时间线 ============ */
.itv-list { display: flex; flex-direction: column; gap: 10px; }
.itv-item {
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px;
  background: #fff; position: relative; transition: .16s;
}
.itv-item:hover { border-color: #c8d3e8; box-shadow: 0 2px 10px rgba(16,24,42,.05); }
.itv-item.is-last { background: #fafbff; border-color: #d8e0f2; }
.itv-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 7px; }
.itv-seq {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 42px; height: 21px; padding: 0 7px; border-radius: 11px;
  background: var(--brand-light); color: var(--brand); font-size: 11.5px; font-weight: 600;
}
.itv-company { font-weight: 600; font-size: 13.5px; color: var(--text-1); }
.itv-meta { font-size: 12px; color: var(--text-3); margin-left: auto; white-space: nowrap; }
.itv-sub { font-size: 12.5px; color: var(--text-2); line-height: 1.7; }
.itv-sub .k { color: var(--text-3); }
.itv-notes {
  margin-top: 7px; padding-top: 7px; border-top: 1px dashed var(--border);
  font-size: 12.5px; color: var(--text-2); line-height: 1.7;
}
.itv-acts { display: flex; gap: 6px; margin-top: 9px; }
.itv-empty {
  border: 1px dashed var(--border); border-radius: 10px; padding: 22px;
  text-align: center; color: var(--text-3); font-size: 13px; background: #fafbff;
}
.itv-count {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 9px;
  background: var(--brand-light); color: var(--brand); font-size: 12px; font-weight: 600;
}
.itv-hint { font-size: 12px; color: var(--text-3); margin-top: 6px; }

/* ============ 企业名称联想选择 ============ */
.cmp-wrap { position: relative; }
.cmp-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 28px rgba(16,24,42,.14); max-height: 260px; overflow-y: auto;
  display: none; padding: 4px;
}
.cmp-list.show { display: block; }
.cmp-item { padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 13px; line-height: 1.5; }
.cmp-item:hover, .cmp-item.active { background: #eef3ff; }
.cmp-item b { color: var(--text-1); }
.cmp-item .sub { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.cmp-empty { padding: 10px; font-size: 12.5px; color: var(--text-3); text-align: center; }
.cmp-tip { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.cmp-tip b { color: var(--brand); }
.cmp-link { color: var(--brand); text-decoration: none; border-bottom: 1px dashed rgba(47,95,224,.45); }
.cmp-link:hover { color: #1d47b8; border-bottom-style: solid; }

/* ============ 弹窗 ============ */
.modal-mask {
  position: fixed; inset: 0; background: rgba(16,24,42,.44); z-index: 100;
  display: none; place-items: center; padding: 20px;
}
.modal-mask.show { display: grid; }
.modal {
  background: #fff; border-radius: 14px; width: 560px; max-width: 100%; max-height: 90vh;
  display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(16,24,42,.24);
}
.modal.wide { width: 760px; }
.modal-head { padding: 17px 22px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { font-size: 15.5px; }
.modal-head .x { border: none; background: none; font-size: 21px; color: var(--text-3); line-height: 1; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ============ Toast ============ */
#toasts { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 9px; align-items: center; }
.toast {
  background: #16213a; color: #fff; padding: 10px 20px; border-radius: 9px; font-size: 13.5px;
  box-shadow: 0 8px 26px rgba(16,24,42,.26); animation: toastIn .24s ease;
}
.toast.ok { background: #12a054; }
.toast.err { background: #dc3545; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }

/* 图表 */
.bars { display: flex; flex-direction: column; gap: 13px; }
.bar-row { display: grid; grid-template-columns: 128px 1fr 54px; gap: 12px; align-items: center; font-size: 13px; }
.bar-track { height: 9px; background: #eef1f7; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg,#4a83ff,#2f5fe0); transition: width .5s; }
.bar-fill.g { background: linear-gradient(90deg,#39c37d,#12a054); }
.bar-fill.o { background: linear-gradient(90deg,#ffb648,#e08600); }
.bar-val { text-align: right; color: var(--text-2); font-weight: 600; }

.dist { display: flex; gap: 10px; align-items: flex-end; height: 140px; margin-top: 8px; }
.dist .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; justify-content: flex-end; height: 100%; }
.dist .col .b {
  width: 100%; max-width: 62px; border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg,#4a83ff,#2f5fe0); min-height: 4px; transition: height .5s;
}
.dist .col .n { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.dist .col .l { font-size: 11.5px; color: var(--text-3); }

@media (max-width: 1080px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { display: none; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -240px; top: 0; bottom: 0; width: 224px; z-index: 80; transition: left .25s; }
  .sidebar.show { left: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .menu-btn { display: inline-flex !important; }
}
.menu-btn { display: none; border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 6px 10px; }
