/* 控制台公共样式（学生中心 / 管理后台共用）：顶栏 + 左侧菜单 + 内容区 */
:root {
  --blue: #1d4ed8;
  --blue-d: #123a8f;
  --blue-top: #16418c;
  --bg: #eef2f7;
  --line: #e2e8f0;
  --txt: #1e293b;
  --muted: #64748b;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #d97706;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--txt); font-size: 14px;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; }
[hidden] { display: none !important; }

/* ===== 顶栏 ===== */
.topbar {
  height: 54px; background: var(--blue-top); color: #fff;
  display: flex; align-items: center; padding: 0 18px; gap: 14px;
  position: sticky; top: 0; z-index: 60;
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; letter-spacing: 1px; }
.topbar .brand img { height: 32px; background: #fff; border-radius: 6px; padding: 2px; }
.topbar .env { background: rgba(255,255,255,.18); border-radius: 20px; padding: 3px 12px; font-size: 12.5px; }
.topbar .sp { flex: 1; }
.topbar .who { font-size: 13px; opacity: .95; display: flex; align-items: center; gap: 8px; }
.topbar .who b { font-weight: 600; }
.topbar .tbtn {
  background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.35);
  border-radius: 6px; padding: 5px 12px; font-size: 12.5px; cursor: pointer; white-space: nowrap;
}
.topbar .tbtn:hover { background: rgba(255,255,255,.26); }
.topbar .burger { display: none; background: none; border: 0; cursor: pointer; padding: 6px; }
.topbar .burger span { display: block; width: 20px; height: 2px; background: #fff; margin: 4px 0; border-radius: 2px; }

/* ===== 布局 ===== */
.console { display: flex; min-height: calc(100vh - 54px); }
.sidebar {
  width: 208px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--line);
  padding: 10px 0 30px; overflow-y: auto;
}
.sidebar .nav-group { margin-bottom: 4px; }
.sidebar .nav-title {
  font-size: 12px; color: #94a3b8; padding: 12px 18px 5px; letter-spacing: 1px;
}
.sidebar .nav-item {
  display: block; padding: 9px 18px; font-size: 13.5px; color: #334155;
  border-left: 3px solid transparent; cursor: pointer;
}
.sidebar .nav-item:hover { background: #f1f5f9; }
.sidebar .nav-item.on {
  background: #e8f0fe; color: var(--blue); border-left-color: var(--blue); font-weight: 600;
}
.main { flex: 1; padding: 20px 22px 50px; min-width: 0; }
.page-head { margin-bottom: 14px; }
.page-head h2 { font-size: 19px; color: var(--blue-d); padding-bottom: 10px; border-bottom: 2px solid var(--blue-d); }

/* ===== 卡片 / 表格 / 表单 ===== */
.card { background: #fff; border-radius: 10px; padding: 18px 20px; margin-bottom: 18px; box-shadow: 0 1px 3px rgba(15,23,42,.06); }
.card > h3 { font-size: 15px; color: var(--blue-d); border-left: 4px solid var(--blue); padding-left: 10px; margin-bottom: 14px; }
table.tb { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tb th, table.tb td { border-bottom: 1px solid var(--line); padding: 10px 10px; text-align: left; vertical-align: middle; }
table.tb th { background: #f8fafc; color: #475569; font-weight: 600; white-space: nowrap; }
table.tb tr:hover td { background: #f8fbff; }
table.tb .op { white-space: nowrap; }
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 13px; color: #475569; margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid #cbd5e1; border-radius: 7px; padding: 8px 11px; font-size: 13.5px; outline: none; background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(29,78,216,.12); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 18px; }
.btn {
  display: inline-block; background: var(--blue); color: #fff; border: 0; border-radius: 7px;
  padding: 8px 18px; font-size: 13.5px; cursor: pointer;
}
.btn:hover { background: #1e40af; }
.btn.ghost { background: #fff; color: var(--blue); border: 1px solid var(--blue); }
.btn.gray { background: #eef2f7; color: #475569; border: 1px solid #d7dee8; }
.btn.green { background: var(--green); }
.btn.red { background: var(--red); }
.btn.sm { padding: 4px 10px; font-size: 12.5px; border-radius: 6px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.tag { display: inline-block; border-radius: 20px; padding: 2px 10px; font-size: 12px; background: #e8f0fe; color: var(--blue); white-space: nowrap; }
.tag.green { background: #dcfce7; color: var(--green); }
.tag.red { background: #fee2e2; color: var(--red); }
.tag.amber { background: #fef3c7; color: var(--amber); }
.tag.gray { background: #f1f5f9; color: #64748b; }
.tag.purple { background: #ede9fe; color: #7c3aed; }
.empty { text-align: center; color: #94a3b8; padding: 28px 0; font-size: 13px; }
.pager { display: flex; gap: 8px; align-items: center; margin-top: 14px; font-size: 13px; color: var(--muted); }
.pager button { border: 1px solid #cbd5e1; background: #fff; border-radius: 6px; padding: 4px 12px; cursor: pointer; font-size: 12.5px; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

/* ===== 弹窗 / 提示 ===== */
.modal { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal[hidden] { display: none !important; }
.mbox { background: #fff; border-radius: 12px; padding: 22px 24px; width: 100%; max-width: 560px; max-height: 86vh; overflow: auto; }
.mbox h3 { font-size: 16px; color: var(--blue-d); margin-bottom: 14px; }
#toast {
  position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%) translateY(20px);
  background: rgba(15,23,42,.88); color: #fff; border-radius: 8px; padding: 10px 22px; font-size: 13.5px;
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 200; max-width: 86vw;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== 流程时间线 ===== */
.flow { position: relative; padding-left: 26px; }
.flow::before { content: ""; position: absolute; left: 8px; top: 8px; bottom: 8px; width: 2px; background: #dbe4f0; }
.fnode { position: relative; padding: 0 0 18px 14px; }
.fnode .dot {
  position: absolute; left: -26px; top: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 3px solid #cbd5e1; z-index: 1;
}
.fnode.passed .dot { border-color: var(--green); background: var(--green); }
.fnode.current .dot { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 4px rgba(29,78,216,.15); }
.fnode.failed .dot { border-color: var(--red); background: var(--red); }
.fnode .fh { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fnode .fh b { font-size: 14.5px; }
.fnode .fmeta { font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.7; }
.fnode .fbody { margin-top: 8px; font-size: 13px; }
.fnode.current .fh b { color: var(--blue); }

/* ===== 看板统计 ===== */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { background: #fff; border-radius: 10px; padding: 16px 18px; box-shadow: 0 1px 3px rgba(15,23,42,.06); }
.stat b { display: block; font-size: 26px; color: var(--blue-d); }
.stat span { font-size: 12.5px; color: var(--muted); }

/* ===== 管理后台登录罩层 ===== */
.admin-login {
  position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: linear-gradient(140deg, #0c2f8e 0%, #1d4ed8 55%, #0ea5e9 100%);
}
.admin-login[hidden] { display: none !important; }
.admin-login .box { background: #fff; border-radius: 14px; padding: 30px 32px; width: min(430px, 94vw); box-shadow: 0 24px 70px rgba(0,0,0,.3); }
.admin-login .lg-brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; color: var(--blue-d); margin-bottom: 6px; }
.admin-login .lg-brand img { height: 34px; }
.admin-login .lg-tip { font-size: 12.5px; color: #64748b; margin-bottom: 16px; line-height: 1.7; }
.admin-login .err { background: #fee2e2; color: #dc2626; border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-bottom: 12px; }
.admin-login a { color: var(--blue); }

/* ===== 移动端 ===== */
@media (max-width: 900px) {
  .topbar .burger { display: block; }
  .topbar .env { display: none; }
  .sidebar {
    position: fixed; left: 0; top: 54px; bottom: 0; z-index: 55; transform: translateX(-100%);
    transition: transform .25s; box-shadow: 4px 0 18px rgba(15,23,42,.12); width: 230px;
  }
  .sidebar.open { transform: translateX(0); }
  .main { padding: 14px 12px 40px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .card { padding: 14px; overflow-x: auto; }
  table.tb { min-width: 560px; }
}
