* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: #f5f6fa; color: #1f2430; font-size: 14px; line-height: 1.6;
}
a { color: #185fa5; text-decoration: none; }
button {
  cursor: pointer; border: none; border-radius: 8px; padding: 8px 18px;
  background: #185fa5; color: #fff; font-size: 14px;
}
button:hover { background: #0c447c; }
button.ghost { background: #fff; color: #185fa5; border: 1px solid #b5d4f4; }
button.ghost:hover { background: #e6f1fb; }
button.danger { background: #fff; color: #a32d2d; border: 1px solid #f7c1c1; }
button.danger:hover { background: #fcebeb; }
button:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea {
  border: 1px solid #d3d1c7; border-radius: 8px; padding: 8px 12px;
  font-size: 14px; font-family: inherit; background: #fff; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #378add; }

/* 登录页 */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: #10162a;
}
.login-card {
  width: 380px; background: #fff; border-radius: 16px; padding: 36px 32px;
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
}
.login-card h1 { font-size: 20px; text-align: center; margin-bottom: 6px; color: #10162a; }
.login-card .sub { text-align: center; color: #888780; font-size: 13px; margin-bottom: 24px; }
.login-card .field { margin-bottom: 14px; }
.login-card button { width: 100%; padding: 10px; margin-top: 6px; }
.login-card .err { color: #a32d2d; font-size: 13px; min-height: 20px; margin-top: 8px; text-align: center; }

/* 布局 */
.topbar {
  background: #10162a; color: #fff; padding: 0 24px; height: 52px;
  display: flex; align-items: center; justify-content: space-between;
}
.topbar .brand { font-size: 15px; font-weight: 500; }
.topbar .user-info { display: flex; align-items: center; gap: 14px; font-size: 13px; color: #b5d4f4; }
.topbar button { padding: 5px 14px; background: rgba(255,255,255,.12); }
.topbar button:hover { background: rgba(255,255,255,.22); }
.tabs { display: flex; gap: 4px; background: #fff; border-bottom: 1px solid #e5e4dc; padding: 0 24px; }
.tabs .tab {
  padding: 12px 18px; cursor: pointer; font-size: 14px; color: #5f5e5a;
  border-bottom: 2px solid transparent;
}
.tabs .tab.active { color: #185fa5; border-bottom-color: #185fa5; font-weight: 500; }
.main { max-width: 1080px; margin: 20px auto; padding: 0 20px; }
.panel {
  background: #fff; border-radius: 12px; padding: 20px; margin-bottom: 16px;
  border: 1px solid #eceadf;
}
.panel h3 { font-size: 15px; font-weight: 500; margin-bottom: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.row .grow { flex: 1; }
.muted { color: #888780; font-size: 13px; }
.stat-cards { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.stat-card {
  flex: 1; min-width: 150px; background: #fff; border: 1px solid #eceadf;
  border-radius: 12px; padding: 16px 20px;
}
.stat-card .num { font-size: 26px; font-weight: 500; color: #185fa5; }
.stat-card .label { font-size: 13px; color: #888780; }

table.list { width: 100%; border-collapse: collapse; font-size: 13px; }
table.list th, table.list td { padding: 9px 10px; border-bottom: 1px solid #efeee6; text-align: left; }
table.list th { color: #888780; font-weight: 500; background: #fafaf6; }
table.list tr:hover td { background: #f7fafd; }

/* 题目卡片 */
.q-card { background: #fff; border: 1px solid #eceadf; border-radius: 12px; padding: 18px 20px; margin-bottom: 14px; }
.q-card .q-stem { font-size: 15px; margin-bottom: 12px; }
.q-card .opt {
  display: block; padding: 9px 14px; border: 1px solid #e0dfd6; border-radius: 8px;
  margin-bottom: 8px; cursor: pointer; transition: border-color .15s, background .15s;
}
.q-card .opt:hover { border-color: #85b7eb; background: #f7fafd; }
.q-card .opt.sel { border-color: #185fa5; background: #e6f1fb; }
.q-card .opt.right { border-color: #3b6d11; background: #eaf3de; }
.q-card .opt.wrong { border-color: #a32d2d; background: #fcebeb; }
.q-card .q-meta { font-size: 12px; color: #888780; margin-top: 6px; }
.tag {
  display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px;
  background: #e6f1fb; color: #185fa5; margin-right: 6px;
}
.tag.gray { background: #f1efe8; color: #5f5e5a; }
.tag.green { background: #eaf3de; color: #3b6d11; }
.tag.red { background: #fcebeb; color: #a32d2d; }
.tag.amber { background: #faeeda; color: #854f0b; }
.tag.blue { background: #e7f0fa; color: #1d5a9e; }
pre { font-family: Consolas, 'Courier New', monospace; }
.feedback { margin-top: 10px; padding: 10px 14px; border-radius: 8px; font-size: 13px; }
.feedback.ok { background: #eaf3de; color: #27500a; }
.feedback.no { background: #fcebeb; color: #791f1f; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(16,22,42,.45); display: none;
  align-items: flex-start; justify-content: center; overflow: auto; padding: 40px 16px; z-index: 50;
}
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 12px; width: 640px; max-width: 100%; padding: 24px; }
.modal h3 { margin-bottom: 16px; }
.modal .field { margin-bottom: 12px; }
.modal .field label { display: block; font-size: 13px; color: #5f5e5a; margin-bottom: 4px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.hint { font-size: 12px; color: #888780; margin-top: 4px; }
#toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  background: #10162a; color: #fff; padding: 9px 22px; border-radius: 8px;
  font-size: 13px; display: none; z-index: 99;
}
.pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 12px; font-size: 13px; color: #5f5e5a; }

/* 分类多选标签框（组卷/题库筛选/学生练习共用） */
.tagpick {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  min-height: 38px; border: 1px solid #d3d1c7; border-radius: 8px;
  padding: 5px 8px; background: #fff; cursor: text; flex: 1;
}
.tagpick.focus { border-color: #378add; }
.tagpick-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tagpick-tag {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px;
  background: #eaf2fd; color: #1f5fa8; border-radius: 6px; padding: 2px 7px;
}
.tagpick-tag b { cursor: pointer; font-weight: 400; opacity: .65; font-size: 13px; }
.tagpick-tag b:hover { opacity: 1; color: #c0392b; }
.tagpick-input { border: none !important; outline: none; width: auto !important; flex: 1 1 96px; font-size: 13px; padding: 2px 0 !important; background: transparent; }
.tagpick-menu {
  display: none; position: absolute; left: 0; top: calc(100% + 4px); z-index: 60;
  background: #fff; border: 1px solid #e3e1d8; border-radius: 8px; min-width: 100%;
  max-height: 220px; overflow: auto; padding: 4px; box-shadow: 0 8px 22px rgba(16,22,42,.12);
}
.tagpick-menu.show { display: block; }
.tagpick-item { padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.tagpick-item:hover { background: #f2f6fd; }
.tagpick-empty { padding: 8px 10px; color: #888780; font-size: 12px; }
