:root {
  --brand: #5B5BD6;
  --brand-2: #4343B8;
  --bg: #F6F5F2;
  --surface: #fff;
  --line: #ECEAE4;
  --text: #1B1B21;
  --muted: #6B6B76;
  --ok: #12B76A;
  --bad: #F04438;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
.hidden { display: none !important; }

/* 登录 */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card {
  width: 100%; max-width: 340px; background: #fff; border-radius: 18px;
  padding: 32px 28px; box-shadow: 0 10px 40px rgba(27,27,33,.08); text-align: center;
}
.login-card h1 { margin: 0; font-size: 20px; }
.login-sub { color: var(--muted); font-size: 13px; margin: 6px 0 22px; }
.login-card input {
  width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 15px; margin-bottom: 12px;
}
.login-card input:focus { outline: none; border-color: var(--brand); }
.login-card button {
  width: 100%; height: 44px; border: 0; border-radius: 10px;
  background: var(--brand); color: #fff; font-size: 15px; cursor: pointer;
}
.login-card button:hover { background: var(--brand-2); }
.err { color: var(--bad); font-size: 13px; height: 18px; margin-top: 10px; }

.cap-row { display: flex; gap: 10px; margin-bottom: 12px; }
.cap-row input { flex: 1; margin-bottom: 0 !important; }
.cap-img {
  width: 120px; height: 44px; flex-shrink: 0; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.cap-img svg { display: block; width: 100%; height: 100%; }

/* 布局 */
.app { display: flex; min-height: 100vh; }
.side {
  width: 200px; background: #fff; border-right: 1px solid var(--line);
  padding: 24px 16px; display: flex; flex-direction: column; flex-shrink: 0;
}
.brand { font-weight: 600; font-size: 16px; padding: 0 8px 20px; color: var(--brand-2); }
.nav {
  display: block; padding: 10px 12px; border-radius: 10px; color: var(--muted);
  text-decoration: none; cursor: pointer; margin-bottom: 4px;
}
.nav:hover { background: var(--bg); }
.nav.on { background: #EEEEFB; color: var(--brand-2); font-weight: 600; }
.logout { margin-top: auto; font-size: 13px; color: var(--muted); cursor: pointer; padding: 10px 12px; }
.logout:hover { color: var(--bad); }

.main { flex: 1; padding: 28px 32px; max-width: 1100px; }
h2 { font-size: 15px; margin: 26px 0 12px; font-weight: 600; }
h2:first-child { margin-top: 0; }

/* 卡片 */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.card { background: #fff; border-radius: 14px; padding: 16px 18px; border: 1px solid var(--line); }
.card .k { font-size: 12px; color: var(--muted); }
.card .v { font-size: 26px; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; }

/* 图表 */
.chart { display: flex; align-items: flex-end; gap: 10px; height: 150px; background: #fff;
  border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px 10px; }
.bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bar { width: 100%; max-width: 46px; background: linear-gradient(180deg, #7C7CE8, #5B5BD6); border-radius: 6px 6px 0 0; min-height: 2px; }
.bar-n { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.bar-d { font-size: 11px; color: var(--muted); margin-top: 6px; }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* 列表 */
.list { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.list-item { display: flex; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.list-item:last-child { border-bottom: 0; }
.list-item .n { color: var(--muted); }

.todo { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; font-size: 13px; }
.todo .row { display: flex; justify-content: space-between; padding: 8px 0; }
.todo .num { color: var(--brand); font-weight: 600; }

/* 留言 */
.filters { display: flex; gap: 8px; margin-bottom: 14px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 6px 14px; font-size: 13px; cursor: pointer; color: var(--muted); }
.chip.on { background: #EEEEFB; border-color: var(--brand); color: var(--brand-2); font-weight: 600; }
.comments { display: flex; flex-direction: column; gap: 12px; }
.cmt { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.cmt-top { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
.cmt-nick { color: var(--brand-2); font-weight: 600; font-size: 13px; }
.cmt-body { margin: 10px 0; font-size: 14px; line-height: 1.7; }
.cmt-qid { font-size: 12px; color: var(--muted); }
.cmt-actions { display: flex; gap: 8px; margin-top: 10px; }
.cmt-actions button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 14px; font-size: 13px; cursor: pointer; }
.cmt-actions button.ok { border-color: var(--ok); color: var(--ok); }
.cmt-actions button.no { border-color: var(--bad); color: var(--bad); }
.cmt-actions button:hover { opacity: .8; }
.empty { color: var(--muted); text-align: center; padding: 40px; font-size: 13px; }

@media (max-width: 720px) {
  .app { flex-direction: column; }
  .side { width: 100%; flex-direction: row; align-items: center; padding: 12px; }
  .brand { padding: 0 12px 0 0; }
  nav { display: flex; gap: 6px; }
  .logout { margin: 0 0 0 auto; }
  .main { padding: 16px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .two { grid-template-columns: 1fr; }
}

/* 题库管理 */
.bank-bar { display: flex; gap: 10px; margin-bottom: 12px; }
.bank-bar select, .bank-bar input {
  height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px;
  font-size: 14px; background: #fff;
}
.bank-bar select { min-width: 220px; }
.bank-bar input { flex: 1; }
.bank-bar button {
  height: 40px; padding: 0 20px; border: 0; border-radius: 10px;
  background: var(--brand); color: #fff; font-size: 14px; cursor: pointer;
}
.bank-info { font-size: 13px; color: var(--muted); margin-bottom: 12px; }

.qlist { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.qrow { display: flex; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.qrow:last-child { border-bottom: 0; }
.qno { width: 44px; color: var(--muted); font-size: 13px; flex-shrink: 0; }
.qmain { flex: 1; min-width: 0; }
.qstem { font-size: 14px; line-height: 1.6; }
.qmeta { font-size: 12px; color: var(--muted); margin-top: 6px; }
.qans { color: var(--ok); font-weight: 600; }
.qops { display: flex; gap: 8px; margin-top: 10px; }
.qops button {
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 4px 12px; font-size: 13px; cursor: pointer; color: var(--muted);
}
.qops button.del { color: var(--bad); border-color: #FBD5D2; }
.qops button:hover { opacity: .75; }

.pager { display: flex; gap: 8px; justify-content: center; margin-top: 16px; align-items: center; }
.pager button {
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 6px 14px; font-size: 13px; cursor: pointer;
}
.pager button:disabled { opacity: .4; cursor: default; }
.pager span { font-size: 13px; color: var(--muted); }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto;
  background: #fff; border-radius: 16px; padding: 24px;
}
.modal h3 { margin: 0 0 16px; font-size: 16px; }
.modal-sub { color: var(--muted); font-weight: 400; font-size: 13px; }
.modal label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
.modal input, .modal textarea, .modal select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 14px; font-family: inherit;
}
.modal textarea { resize: vertical; line-height: 1.6; }
.modal-btns { display: flex; gap: 10px; margin-top: 20px; }
.modal-btns button {
  flex: 1; height: 42px; border: 1px solid var(--line); background: #fff;
  border-radius: 10px; font-size: 14px; cursor: pointer;
}
.modal-btns button.primary { background: var(--brand); color: #fff; border-color: var(--brand); }

/* 导入 */
.bank-bar button.ghost { background: #EEEEFB; color: var(--brand-2); }
.radios { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.radios label { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--text); }
.radios input[type=radio] { width: auto; margin: 0; }
.hint { font-size: 12px; color: var(--muted); line-height: 1.8; margin-top: 12px; background: var(--bg); padding: 10px 12px; border-radius: 10px; }
.imp-msg { font-size: 13px; margin-top: 12px; min-height: 18px; }
.imp-msg.ok { color: var(--ok); }
.imp-msg.err { color: var(--bad); }

.tab-tip { font-size: 13px; color: var(--muted); margin: -6px 0 14px; line-height: 1.7; }

/* 通知推送 */
.notice-form {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
}
.notice-form label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 12px 0 6px;
}
.notice-form label:first-child { margin-top: 0; }
.notice-form input, .notice-form textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
}
.notice-form textarea { resize: vertical; line-height: 1.7; }
.notice-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}
.primary-btn {
  height: 40px;
  padding: 0 24px;
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}
.primary-btn:hover { opacity: .9; }

/* 导入/编辑弹窗里的章节套卷选择 */
.chk {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-size: 14px !important;
  color: var(--text) !important;
  margin-top: 14px !important;
}
.chk input[type=checkbox] { width: auto; margin: 0; }
.q-flag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  background: #FEF3E2;
  color: #B26A00;
  margin-left: 8px;
}
.qops button.flag { color: #B26A00; border-color: #F0D8AE; }
.qops button.flag.on { background: #FEF3E2; }
