/* ================= 主题：教育管理平台（浅色 · 蓝色主调） ================= */
:root {
  --brand: #1a5fb4;
  --brand-dark: #13467f;
  --brand-light: #e8f1fb;
  --brand-2: #2b7cd3;
  --accent: #f2994a;
  --ok: #1f8f4e;
  --warn: #d98700;
  --danger: #d64545;
  --text: #1f2937;
  --text-2: #5b6b7f;
  --text-3: #93a1b1;
  --bg: #f2f5f9;
  --card: #ffffff;
  --line: #e3e9f0;
  --line-2: #eef2f7;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 42, 67, .06), 0 4px 14px rgba(16, 42, 67, .05);
  --shadow-lg: 0 8px 30px rgba(16, 42, 67, .14);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-2); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
input, select, textarea { font-family: inherit; }

/* ---------------- 顶部条 ---------------- */
.topbar {
  height: 62px;
  background: linear-gradient(90deg, #14417a 0%, #1a5fb4 55%, #2b7cd3 100%);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 60;
  box-shadow: 0 2px 10px rgba(16, 42, 67, .18);
}
.topbar .logo {
  width: 36px; height: 36px; border-radius: 9px;
  background: rgba(255,255,255,.16);
  display: grid; place-items: center;
  font-size: 19px; font-weight: 700; letter-spacing: -1px;
  border: 1px solid rgba(255,255,255,.28);
  margin-right: 12px;
}
.topbar .titles h1 { font-size: 18px; letter-spacing: .5px; }
.topbar .titles p { margin: 0; font-size: 12px; opacity: .82; }
.topbar .spacer { flex: 1; }
.topbar .user {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
  background: rgba(255,255,255,.12);
  padding: 6px 12px; border-radius: 20px;
}
.topbar .user b { font-weight: 600; }
.topbar a.link { color: #fff; opacity: .88; font-size: 13px; margin-left: 14px; }
.topbar a.link:hover { opacity: 1; text-decoration: underline; }

/* ---------------- 布局 ---------------- */
.layout { display: flex; min-height: calc(100vh - 62px); }
.sidebar {
  width: 216px;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 14px 0;
  flex: 0 0 216px;
  position: sticky;
  top: 62px;
  height: calc(100vh - 62px);
  overflow-y: auto;
}
.sidebar .group-title {
  font-size: 12px; color: var(--text-3);
  padding: 14px 20px 6px; letter-spacing: 1px;
}
.sidebar a.item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px;
  color: var(--text-2);
  font-size: 14px;
  border-left: 3px solid transparent;
  transition: all .15s;
}
.sidebar a.item .ico { width: 18px; text-align: center; opacity: .8; font-size: 15px; }
.sidebar a.item:hover { background: var(--brand-light); color: var(--brand); }
.sidebar a.item.active {
  background: var(--brand-light);
  color: var(--brand-dark);
  font-weight: 600;
  border-left-color: var(--brand);
}
.main { flex: 1; padding: 20px 24px 60px; min-width: 0; }

/* 顶部导航（访问端） */
.navbar {
  background: #fff; border-bottom: 1px solid var(--line);
  display: flex; gap: 4px; padding: 0 24px;
  position: sticky; top: 62px; z-index: 50;
  overflow-x: auto;
}
.navbar a {
  padding: 13px 16px; color: var(--text-2); font-size: 14px;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.navbar a:hover { color: var(--brand); }
.navbar a.active { color: var(--brand); font-weight: 600; border-bottom-color: var(--brand); }

/* ---------------- 卡片 / 区块 ---------------- */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 16px; gap: 12px; flex-wrap: wrap;
}
.page-head h2 { font-size: 20px; }
.page-head .desc { color: var(--text-3); font-size: 13px; margin-top: 2px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card > .hd {
  padding: 13px 18px;
  border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap;
}
.card > .hd h3 { font-size: 15px; }
.card > .hd .sub { color: var(--text-3); font-size: 12px; font-weight: 400; margin-left: 8px; }
.card > .bd { padding: 16px 18px; }
.card > .bd.flush { padding: 0; }

/* ---------------- 表单控件 ---------------- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label { font-size: 13px; color: var(--text-2); }
.field > label .req { color: var(--danger); }
input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: 8px 11px;
  border: 1px solid #d5dee8; border-radius: 7px;
  background: #fff; color: var(--text);
  font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(43, 124, 211, .14);
}
textarea { resize: vertical; min-height: 78px; line-height: 1.65; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.grid-form .full { grid-column: 1 / -1; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 15px; border-radius: 7px;
  border: 1px solid var(--brand); background: var(--brand); color: #fff;
  font-size: 13.5px; cursor: pointer; transition: all .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: #fff; color: var(--brand); }
.btn.ghost:hover { background: var(--brand-light); }
.btn.gray { background: #fff; color: var(--text-2); border-color: #d5dee8; }
.btn.gray:hover { background: #f2f5f9; }
.btn.danger { background: #fff; color: var(--danger); border-color: #efc2c2; }
.btn.danger:hover { background: #fdf1f1; }
.btn.ok { background: var(--ok); border-color: var(--ok); }
.btn.ok:hover { background: #27a35b; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 6px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar .grow { flex: 1; min-width: 160px; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th {
  background: #f5f8fc; color: var(--text-2); font-weight: 600;
  text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap; position: sticky; top: 0;
}
table.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); }
table.tbl tbody tr:hover { background: #f8fbfe; }
table.tbl tbody tr:nth-child(even) { background: #fcfdff; }
table.tbl tbody tr:nth-child(even):hover { background: #f8fbfe; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl td.center, table.tbl th.center { text-align: center; }
.empty { padding: 40px 16px; text-align: center; color: var(--text-3); font-size: 13.5px; }

/* ---------------- 标签 ---------------- */
.tag {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 12px; line-height: 18px; background: #eef2f7; color: var(--text-2);
  border: 1px solid var(--line);
}
.tag.blue { background: #e8f1fb; color: var(--brand-dark); border-color: #cfe0f5; }
.tag.green { background: #e7f6ec; color: var(--ok); border-color: #c6e8d2; }
.tag.orange { background: #fdf3e3; color: var(--warn); border-color: #f6e0bd; }
.tag.red { background: #fdeeee; color: var(--danger); border-color: #f7d2d2; }
.tag.gray { background: #f1f4f8; color: var(--text-3); }

/* ---------------- 统计卡片 ---------------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 17px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 14px;
}
.stat .ico {
  width: 46px; height: 46px; border-radius: 11px;
  display: grid; place-items: center; font-size: 21px; color: #fff;
  background: linear-gradient(135deg, #2b7cd3, #1a5fb4);
}
.stat .ico.g { background: linear-gradient(135deg, #34b877, #1f8f4e); }
.stat .ico.o { background: linear-gradient(135deg, #f5b04e, #e08e1a); }
.stat .ico.p { background: linear-gradient(135deg, #9b7ce0, #7a57c9); }
.stat .v { font-size: 25px; font-weight: 700; line-height: 1.1; color: var(--text); }
.stat .k { font-size: 12.5px; color: var(--text-3); margin-top: 3px; }
.stat .sub { font-size: 12px; color: var(--text-2); margin-top: 4px; }

/* ---------------- 进度条 ---------------- */
.bar { height: 8px; background: #eef2f7; border-radius: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, #2b7cd3, #1a5fb4); border-radius: 6px; }
.bar.g > i { background: linear-gradient(90deg, #34b877, #1f8f4e); }
.bar.o > i { background: linear-gradient(90deg, #f5b04e, #e08e1a); }
.bar.r > i { background: linear-gradient(90deg, #ef7a7a, #d64545); }

/* ---------------- 登录页 ---------------- */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #14417a 0%, #1a5fb4 45%, #3b8ee0 100%);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.login-box {
  width: 100%; max-width: 400px;
  background: #fff; border-radius: 14px;
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.login-box .lh {
  padding: 26px 30px 16px; text-align: center;
}
.login-box .lh .mark {
  width: 56px; height: 56px; margin: 0 auto 12px;
  border-radius: 14px; background: linear-gradient(135deg, #1a5fb4, #2b7cd3);
  color: #fff; display: grid; place-items: center; font-size: 24px; font-weight: 700;
}
.login-box .lh h2 { font-size: 19px; color: var(--text); }
.login-box .lh p { margin: 6px 0 0; font-size: 12.5px; color: var(--text-3); }
.login-box .lb { padding: 8px 30px 28px; }
.login-box .field { margin-bottom: 14px; }
.login-box .btn.big { width: 100%; justify-content: center; padding: 11px; font-size: 15px; margin-top: 6px; }
.login-box .tips {
  margin-top: 16px; padding: 12px 14px; background: #f5f8fc;
  border: 1px dashed #cfdeef; border-radius: 8px; font-size: 12.5px; color: var(--text-2); line-height: 1.9;
}
.login-box .tips b { color: var(--brand-dark); }
.role-tabs { display: flex; margin: 0 30px 4px; border-bottom: 1px solid var(--line); }
.role-tabs button {
  flex: 1; padding: 10px 0; background: none; border: none; cursor: pointer;
  font-size: 14px; color: var(--text-3); border-bottom: 2px solid transparent;
}
.role-tabs button.on { color: var(--brand); font-weight: 600; border-bottom-color: var(--brand); }

/* ---------------- 门户首页 ---------------- */
.hero {
  background: linear-gradient(120deg, #14417a, #1a5fb4 60%, #3b8ee0);
  color: #fff; padding: 46px 0 54px;
}
.hero .inner { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.hero h1 { font-size: 30px; letter-spacing: 1px; }
.hero p { margin: 12px 0 22px; opacity: .9; font-size: 14.5px; max-width: 640px; line-height: 1.9; }
.hero .btn { background: #fff; color: var(--brand-dark); border-color: #fff; font-size: 15px; padding: 11px 26px; }
.hero .btn:hover { background: #eef4fb; }
.hero .btn.ghost { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.5); }
.hero-stats { display: flex; gap: 40px; margin-top: 30px; flex-wrap: wrap; }
.hero-stats div b { display: block; font-size: 26px; }
.hero-stats div span { font-size: 12.5px; opacity: .85; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 26px 24px 60px; }
.cols { display: grid; grid-template-columns: 1fr 320px; gap: 20px; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 18px; border-bottom: 1px solid var(--line-2);
}
.list-item:last-child { border-bottom: none; }
.list-item .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); flex: 0 0 6px; }
.list-item .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.list-item .d { color: var(--text-3); font-size: 12.5px; }
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.feature {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.feature .fi { font-size: 24px; margin-bottom: 8px; }
.feature h4 { font-size: 15px; margin-bottom: 6px; }
.feature p { margin: 0; font-size: 13px; color: var(--text-2); line-height: 1.75; }
.footer {
  background: #101f33; color: #93a6bd; padding: 26px 24px; text-align: center; font-size: 12.5px;
}

/* ---------------- 课表网格 ---------------- */
.tt { width: 100%; border-collapse: collapse; font-size: 13px; }
.tt th, .tt td { border: 1px solid var(--line); padding: 6px; text-align: center; }
.tt th { background: #f5f8fc; font-weight: 600; color: var(--text-2); }
.tt td.slot { background: #fff; height: 58px; vertical-align: middle; cursor: pointer; position: relative; }
.tt td.slot:hover { background: #f0f7ff; }
.tt .cell {
  border-radius: 6px; padding: 5px 4px; font-size: 12px; line-height: 1.4;
  background: #e8f1fb; color: var(--brand-dark); border-left: 3px solid var(--brand);
}
.tt .cell small { display: block; color: var(--text-3); font-size: 11px; }
.tt .cell.empty { background: transparent; border: none; }
.tt .period-col { width: 66px; background: #fafbfd; color: var(--text-3); font-size: 12px; }

/* ---------------- 弹窗 ---------------- */
.mask {
  position: fixed; inset: 0; background: rgba(16, 32, 54, .45);
  display: flex; align-items: center; justify-content: center; z-index: 200; padding: 20px;
}
.modal {
  background: #fff; border-radius: 12px; width: 100%; max-width: 640px;
  max-height: 88vh; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg); animation: pop .16s ease-out;
}
.modal.wide { max-width: 900px; }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.modal .mh {
  padding: 15px 20px; border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: space-between;
}
.modal .mh h3 { font-size: 16px; }
.modal .mb { padding: 18px 20px; overflow-y: auto; }
.modal .mf { padding: 13px 20px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 9px; }
.close-x { background: none; border: none; font-size: 20px; color: var(--text-3); cursor: pointer; line-height: 1; }
.close-x:hover { color: var(--text); }

/* ---------------- 提示 ---------------- */
#toasts { position: fixed; top: 74px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--brand);
  border-radius: 8px; padding: 11px 16px; box-shadow: var(--shadow-lg);
  font-size: 13.5px; min-width: 220px; max-width: 380px;
  animation: slidein .18s ease-out;
}
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } }
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }

/* ---------------- 其他 ---------------- */
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; align-items: center; }
.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.mono { font-variant-numeric: tabular-nums; }
.loading { padding: 50px; text-align: center; color: var(--text-3); }
.pager { display: flex; gap: 6px; align-items: center; justify-content: flex-end; padding: 12px 18px; }
.pager button {
  padding: 5px 11px; border: 1px solid var(--line); background: #fff;
  border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--text-2);
}
.pager button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.pager button:disabled { opacity: .45; cursor: not-allowed; }
.demo-banner {
  background: #fff8e6; border: 1px solid #f6e0bd; color: #8a5b00;
  padding: 9px 18px; border-radius: 8px; font-size: 13px; margin-bottom: 14px;
}
.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 220px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
.scroll-y { max-height: 460px; overflow-y: auto; }
.notice-detail { line-height: 1.9; white-space: pre-wrap; font-size: 14px; }
/* ---------------- 移动端 ---------------- */
.menu-btn { display: none; }
.sidebar-mask { display: none; }

@media (max-width: 900px) {
  /* 分析页 / 门户首页的两列布局改单列 */
  .stat { padding: 13px 14px; gap: 11px; }
  .stat .ico { width: 40px; height: 40px; font-size: 18px; }
  .stat .v { font-size: 22px; }
}

@media (max-width: 760px) {
  /* 顶部条 */
  .topbar { padding: 0 12px; height: auto; min-height: 56px; }
  .topbar .titles h1 { font-size: 15px; }
  .topbar .titles p { display: none; }
  .topbar .user { padding: 4px 9px; font-size: 12px; gap: 6px; }
  .topbar a.link { margin-left: 8px; font-size: 12.5px; }
  .menu-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; margin-right: 8px;
    background: rgba(255,255,255,.14); color: #fff;
    border: none; border-radius: 8px; font-size: 17px; cursor: pointer;
  }

  /* 侧边栏抽屉 */
  .sidebar {
    position: fixed; left: -248px; top: 0; bottom: 0;
    width: 248px; flex: 0 0 248px; height: 100%; z-index: 210;
    transition: left .22s ease;
    box-shadow: 0 0 46px rgba(10, 30, 60, .28);
  }
  .sidebar.open { left: 0; }
  .sidebar-mask.show {
    display: block; position: fixed; inset: 0;
    background: rgba(12, 28, 50, .45); z-index: 205;
  }

  /* 主体 */
  .main { padding: 12px; }
  .page-head { align-items: flex-start; gap: 8px; }
  .page-head h2 { font-size: 18px; }
  .page-head .desc { font-size: 12.5px; }
  .card > .hd { padding: 11px 13px; }
  .card > .bd { padding: 13px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { flex-direction: column; align-items: flex-start; gap: 8px; }
  .stat .v { font-size: 20px; }

  /* 工具条：输入框与下拉换行铺满 */
  .toolbar { gap: 6px; }
  .toolbar select, .toolbar input { flex: 1 1 46%; min-width: 120px; }
  .toolbar .grow { flex: 1 1 100%; min-width: 0; }
  .btn { padding: 8px 12px; font-size: 13px; }
  .btn.sm { padding: 5px 9px; font-size: 12px; }

  /* 表格横向滚动 + 更紧凑 */
  table.tbl { font-size: 12.5px; }
  table.tbl th, table.tbl td { padding: 8px 9px; }
  .pager { padding: 10px 12px; flex-wrap: wrap; justify-content: center; }

  /* 课表网格 */
  .tt th, .tt td { min-width: 54px; font-size: 11.5px; }
  .tt .period-col { width: 52px; }

  /* 弹窗 */
  .mask { padding: 12px; align-items: flex-start; }
  .modal { max-height: 92vh; }
  .modal .mb { padding: 14px; }
  .modal .mh, .modal .mf { padding: 12px 14px; }
  .modal .mf { flex-wrap: wrap; }
  .modal .mf .btn { flex: 1; justify-content: center; }

  /* 图表 */
  .chart-box { height: 240px; }
  .chart-box.sm { height: 200px; }

  /* 防止 iOS 聚焦自动放大 */
  input[type=text], input[type=password], input[type=number], input[type=date], select, textarea { font-size: 16px; }

  /* 提示条 */
  #toasts { left: 12px; right: 12px; top: 66px; align-items: center; }
  .toast { max-width: 100%; }

  .login-box .lb, .login-box .lh { padding-left: 20px; padding-right: 20px; }
  .role-tabs { margin: 0 20px 4px; }
  .navbar { padding: 0 12px; }
  .navbar a { padding: 12px 12px; font-size: 13.5px; }
  .wrap { padding: 18px 14px 40px; }
  .hero { padding: 30px 0 34px; }
  .hero .inner { padding: 0 14px; }
}

@media (max-width: 420px) {
  .stats { grid-template-columns: 1fr; }
  .topbar .user { display: none; }
}
