* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #4f6ef7; --primary-dark: #3b55d9; --bg: #f2f4f9; --card: #ffffff;
  --text: #1f2430; --muted: #8a90a3; --border: #e6e9f2; --green: #22b07d; --red: #ef5b6b; --orange: #f5a623;
}
body { font-family: "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); }
input, select, textarea, button { font-family: inherit; font-size: 14px; }
button { cursor: pointer; }

.btn { border: none; border-radius: 8px; padding: 9px 18px; background: var(--primary); color: #fff; transition: .15s; }
.btn:hover { background: var(--primary-dark); }
.btn.sm { padding: 5px 12px; font-size: 13px; border-radius: 6px; }
.btn.ghost { background: #eef1fb; color: var(--primary); }
.btn.ghost:hover { background: #dde4fa; }
.btn.danger { background: var(--red); }
.btn.green { background: var(--green); }

.inp, select.inp, textarea.inp { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; outline: none; background: #fff; }
.inp:focus { border-color: var(--primary); }

.card { background: var(--card); border-radius: 14px; padding: 20px; box-shadow: 0 2px 12px rgba(30, 45, 90, .06); }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; }
.tag.green { background: #e3f7ef; color: var(--green); }
.tag.orange { background: #fdf1dc; color: var(--orange); }
.tag.red { background: #fde6e9; color: var(--red); }
.tag.blue { background: #e8ecfe; color: var(--primary); }

/* ---------- 登录首页 ---------- */
.portal { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #4f6ef7 0%, #7b5ff0 55%, #b15ff0 100%); padding: 20px; }
.portal-box { width: 420px; max-width: 100%; }
.portal-logo { text-align: center; color: #fff; margin-bottom: 28px; }
.portal-logo .icon { width: 64px; height: 64px; border-radius: 18px; background: rgba(255,255,255,.18); display: inline-flex; align-items: center; justify-content: center; font-size: 32px; margin-bottom: 12px; }
.portal-logo h1 { font-size: 26px; letter-spacing: 2px; }
.portal-logo p { opacity: .8; margin-top: 6px; font-size: 13px; }
.login-card { background: #fff; border-radius: 18px; padding: 30px; box-shadow: 0 18px 50px rgba(20, 30, 80, .3); }
.login-card h2 { font-size: 18px; margin-bottom: 18px; }
.form-item { margin-bottom: 14px; }
.form-item label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.login-tip { font-size: 12px; color: var(--muted); background: #f6f8fd; border-radius: 8px; padding: 8px 12px; margin: 12px 0; }
.version-select { display: flex; gap: 12px; margin-top: 16px; }
.version-select a { flex: 1; text-align: center; text-decoration: none; padding: 16px 10px; border-radius: 12px; border: 2px solid var(--border); color: var(--text); transition: .15s; }
.version-select a:hover { border-color: var(--primary); box-shadow: 0 6px 18px rgba(79,110,247,.18); }
.version-select a .ico { font-size: 30px; display: block; margin-bottom: 6px; }
.version-select a b { font-size: 15px; }
.version-select a span { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.login-err { color: var(--red); font-size: 13px; min-height: 18px; margin-top: 6px; }

/* ---------- 电脑版 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #1d2333; color: #aeb6cc; display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar .brand { padding: 22px 20px; color: #fff; font-size: 17px; font-weight: 600; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .brand small { display: block; font-weight: 400; font-size: 11px; color: #7d86a3; margin-top: 4px; }
.nav { padding: 14px 0; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 12px 20px; cursor: pointer; font-size: 14px; color: #aeb6cc; border-left: 3px solid transparent; }
.nav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-item.active { background: rgba(79,110,247,.16); color: #fff; border-left-color: var(--primary); }
.sidebar .foot { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px; }
.sidebar .foot .who { color: #fff; margin-bottom: 8px; }
.main { flex: 1; padding: 24px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.topbar h2 { font-size: 20px; }
.campus-filter select { min-width: 160px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 14px; padding: 18px 20px; box-shadow: 0 2px 12px rgba(30,45,90,.06); }
.stat-card .t { font-size: 13px; color: var(--muted); }
.stat-card .v { font-size: 26px; font-weight: 700; margin-top: 6px; }
.stat-card .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.toolbar .spacer { flex: 1; }
table.tb { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 12px rgba(30,45,90,.06); }
.tb th { text-align: left; padding: 12px 14px; background: #f7f9fd; color: var(--muted); font-size: 13px; font-weight: 500; white-space: nowrap; }
.tb td { padding: 12px 14px; border-top: 1px solid var(--border); font-size: 14px; }
.tb tr:hover td { background: #fafbff; }
.progress { height: 6px; background: #eef1f8; border-radius: 99px; overflow: hidden; min-width: 90px; }
.progress i { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.chart-row { display: flex; gap: 16px; }
.chart-row .card { flex: 1; }
.bar-item { display: flex; align-items: center; gap: 10px; margin: 10px 0; font-size: 13px; }
.bar-item .name { width: 110px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-item .bar { flex: 1; height: 10px; background: #eef1f8; border-radius: 99px; overflow: hidden; }
.bar-item .bar i { display: block; height: 100%; background: linear-gradient(90deg, #4f6ef7, #8b6ff0); border-radius: 99px; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(20,25,45,.45); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: #fff; border-radius: 16px; width: 480px; max-width: 92vw; max-height: 88vh; overflow: auto; padding: 24px; }
.modal h3 { font-size: 17px; margin-bottom: 16px; }
.modal .m-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }

/* ---------- 手机版 ---------- */
.m-shell { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; }
.m-header { background: linear-gradient(135deg, #4f6ef7, #8b5ff0); color: #fff; padding: 16px; border-radius: 0 0 18px 18px; position: sticky; top: 0; z-index: 10; }
.m-header h1 { font-size: 18px; }
.m-header .sub { font-size: 12px; opacity: .85; margin-top: 3px; }
.m-body { flex: 1; padding: 14px; padding-bottom: 74px; }
.m-tabs { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; display: flex; border-top: 1px solid var(--border); z-index: 20; }
.m-shell .m-tabs { position: sticky; }
.m-tab { flex: 1; text-align: center; padding: 9px 0 8px; font-size: 11px; color: var(--muted); cursor: pointer; }
.m-tab .ico { font-size: 20px; display: block; margin-bottom: 2px; }
.m-tab.active { color: var(--primary); font-weight: 600; }
.m-card { background: #fff; border-radius: 14px; padding: 14px; margin-bottom: 12px; box-shadow: 0 2px 10px rgba(30,45,90,.05); }
.m-card .row1 { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.m-card .row1 b { font-size: 15px; }
.m-card .meta { font-size: 12.5px; color: var(--muted); line-height: 1.8; }
.m-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.m-stat { background: #fff; border-radius: 14px; padding: 14px; }
.m-stat .t { font-size: 12px; color: var(--muted); }
.m-stat .v { font-size: 22px; font-weight: 700; margin-top: 4px; }
.m-toolbar { display: flex; gap: 8px; margin-bottom: 12px; }
.m-toolbar .inp { flex: 1; }
.m-fab { position: fixed; right: 18px; bottom: 84px; width: 52px; height: 52px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 26px; border: none; box-shadow: 0 6px 16px rgba(79,110,247,.4); z-index: 30; }
.m-modal-mask { position: fixed; inset: 0; background: rgba(20,25,45,.45); z-index: 100; display: flex; align-items: flex-end; }
.m-modal { background: #fff; width: 100%; max-height: 85vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 18px; }
.m-modal h3 { margin-bottom: 14px; font-size: 16px; }
.m-modal .form-item { margin-bottom: 12px; }
.empty-tip { text-align: center; color: var(--muted); padding: 40px 0; font-size: 14px; }
