/* 答题练习系统 全局样式 */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  background: #eef2f9;
  color: #2c3648;
  line-height: 1.65;
}
a { color: #2f6df6; text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 14px; }
main.wrap { padding-top: 18px; padding-bottom: 40px; min-height: 60vh; }

/* 顶栏 */
.top { background: #fff; box-shadow: 0 1px 6px rgba(30, 60, 120, .08); position: sticky; top: 0; z-index: 9; }
.top-in { display: flex; align-items: center; gap: 18px; height: 54px; }
.brand { font-weight: 700; font-size: 18px; color: #2f6df6; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.menu { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.menu a { padding: 6px 12px; border-radius: 8px; color: #4a5568; white-space: nowrap; }
.menu a:hover { background: #eef2f9; text-decoration: none; }
.menu a.on { background: #2f6df6; color: #fff; }
.who { font-size: 13px; color: #4a5568; white-space: nowrap; }
.who a { margin-left: 8px; color: #2f6df6; }
.role-teacher { background: #fff3e6; color: #d97a1a; padding: 1px 8px; border-radius: 10px; font-size: 12px; }
.role-student { background: #e7f3ff; color: #2f6df6; padding: 1px 8px; border-radius: 10px; font-size: 12px; }

h1.pg-title { font-size: 22px; margin: 6px 0 14px; }
h2.sub-title { font-size: 17px; margin: 26px 0 10px; }
.muted { color: #7a8699; font-size: 13px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

/* 提示条 */
.flash { padding: 10px 14px; border-radius: 10px; margin: 8px 0 14px; font-size: 14px; white-space: pre-wrap; word-break: break-all; }
.flash-ok { background: #e7f7ee; color: #178a4c; border: 1px solid #bfe8d2; }
.flash-err { background: #fdecea; color: #c0392b; border: 1px solid #f6c6c0; }

/* 卡片 */
.card { background: #fff; border-radius: 12px; padding: 18px; box-shadow: 0 1px 4px rgba(30, 60, 120, .06); margin-bottom: 14px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 8px 0 18px; }
.card.big { transition: transform .12s; }
.card.big:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(30, 60, 120, .12); text-decoration: none; }
.card.big h3 { margin: 0 0 6px; color: #2f6df6; font-size: 17px; }
.card.big p { margin: 0; color: #7a8699; font-size: 13px; }

.hero { background: linear-gradient(120deg, #2f6df6, #5f8dfb); color: #fff; border-radius: 14px; padding: 26px 24px; margin-bottom: 16px; }
.hero h1 { margin: 0 0 6px; font-size: 24px; }
.hero p { margin: 0 0 14px; opacity: .92; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: #fff; border-radius: 12px; padding: 14px 16px; text-align: center; box-shadow: 0 1px 4px rgba(30,60,120,.06); }
.kpi b { display: block; font-size: 24px; color: #2f6df6; }
.kpi span { font-size: 13px; color: #7a8699; }

/* 表单 */
.form-card { max-width: 760px; }
.field { display: block; margin-bottom: 12px; font-size: 14px; color: #4a5568; }
.field input[type=text], .field input[type=password], .field select, .field textarea, .filter-bar input[type=text], .filter-bar select,
.grid-3 input, .grid-3 button {
  display: block; width: 100%; margin-top: 4px; padding: 8px 10px;
  border: 1px solid #d3dcec; border-radius: 8px; font-size: 14px; font-family: inherit; background: #fff;
}
textarea { resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus, .filter-bar input:focus { outline: 2px solid #bcd2fd; border-color: #2f6df6; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 10px; align-items: end; margin-top: 10px; }

/* 按钮 */
.btn { display: inline-block; padding: 8px 18px; border-radius: 9px; border: 1px solid #d3dcec; background: #fff; color: #3d4c63; font-size: 14px; cursor: pointer; }
.btn:hover { text-decoration: none; background: #f4f7fc; }
.btn.primary { background: #2f6df6; border-color: #2f6df6; color: #fff; }
.btn.primary:hover { background: #2459d6; }
.btn.ghost { background: transparent; border-color: #2f6df6; color: #2f6df6; }
.btn.ghost:hover { background: #eef4ff; }
.btn.danger { color: #c0392b; border-color: #f1c4bd; }
.btn.danger:hover { background: #fdecea; }
.btn.block { width: 100%; padding: 11px; font-size: 15px; }
.btn.sm { padding: 3px 10px; font-size: 13px; border-radius: 7px; }
.btn.big-btn { padding: 11px 26px; font-size: 16px; }
.btn.disabled { opacity: .5; pointer-events: none; }
.pager { text-align: center; margin: 14px 0; }
.pager .pg { display: inline-block; min-width: 30px; padding: 4px 8px; margin: 0 2px; border-radius: 8px; background: #fff; color: #4a5568; }
.pager .pg.on { background: #2f6df6; color: #fff; }
.inline-form { display: inline; }
.empty { background: #fff; border-radius: 12px; padding: 40px; text-align: center; color: #7a8699; box-shadow: 0 1px 4px rgba(30,60,120,.06); }
.empty p { margin-top: 0; }

/* 登录注册 */
.auth-box { max-width: 440px; margin: 40px auto; }
.auth-box h1 { text-align: center; }
.role-tabs { display: flex; background: #eef2f9; border-radius: 10px; padding: 4px; margin-bottom: 14px; }
.role-tabs label { flex: 1; text-align: center; cursor: pointer; }
.role-tabs input { display: none; }
.role-tabs label { padding: 8px; border-radius: 8px; font-size: 15px; color: #4a5568; }
.role-tabs input:checked + * { }
.role-tabs label:has(input:checked) { background: #fff; color: #2f6df6; font-weight: 700; box-shadow: 0 1px 4px rgba(30,60,120,.15); }

/* 答题 */
.qblock { background: #fff; border-radius: 12px; padding: 16px 18px; margin-bottom: 14px; box-shadow: 0 1px 4px rgba(30,60,120,.06); border-left: 4px solid #d3dcec; }
.qblock.ok { border-left-color: #2eb872; }
.qblock.ng { border-left-color: #e74c3c; }
.qhead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.qnum { font-weight: 700; }
.qcat { color: #7a8699; font-size: 13px; flex: 1; }
.chip { padding: 0 10px; border-radius: 10px; font-size: 12px; }
.chip.single { background: #e7f3ff; color: #2f6df6; }
.chip.multi { background: #fdeef0; color: #d9534f; }
.chip.judge { background: #eef7e8; color: #4a8f2c; }
.badge { padding: 1px 10px; border-radius: 10px; font-size: 12px; }
.b-ok { background: #e7f7ee; color: #178a4c; }
.b-ng { background: #fdecea; color: #c0392b; }
.stem { margin-bottom: 10px; }
.opt-row { display: flex; gap: 8px; align-items: baseline; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.opt-row:hover { background: #f4f7fc; }
.opt-row b { min-width: 20px; }
.judge-row { display: flex; gap: 14px; margin-top: 6px; }
.judge-opt input { display: none; }
.judge-opt span { display: inline-block; padding: 10px 46px; border: 2px solid #d3dcec; border-radius: 10px; font-size: 17px; cursor: pointer; }
.judge-opt input:checked + span { border-color: #2f6df6; color: #2f6df6; font-weight: 700; background: #eef4ff; }
.ans-zone { margin: 4px 0 8px; }
.inline-opt { display: inline-flex; align-items: center; gap: 5px; margin-right: 18px; font-size: 15px; }

/* 结果 */
.result-hero { background: #fff; border-radius: 14px; padding: 22px; display: flex; gap: 20px; align-items: center; box-shadow: 0 1px 4px rgba(30,60,120,.06); margin-bottom: 16px; }
.result-hero.good { border-bottom: 4px solid #2eb872; }
.result-hero.low { border-bottom: 4px solid #e74c3c; }
.score { font-size: 54px; font-weight: 800; color: #2f6df6; min-width: 130px; text-align: center; }
.score small { font-size: 20px; }
.r-meta h2 { margin: 0 0 4px; }
.r-meta p { margin: 0; }
.qlist .opts { list-style: none; padding: 0; margin: 6px 0; }
.qlist .opts li { padding: 3px 8px; border-radius: 6px; }
.qlist .opts li.right { background: #e7f7ee; }
.qlist .opts li.wrong { background: #fdecea; }
.qlist .opts li em { float: right; font-style: normal; color: #178a4c; font-size: 12px; }
.qlist .opts li em.mine { color: #c0392b; }
.ans-line { margin-top: 8px; font-size: 14px; }
.note { background: #f7f9fd; border-radius: 8px; padding: 8px 12px; margin-top: 8px; font-size: 14px; border-left: 3px solid #2f6df6; }
.qlist .note { color: #4a5568; }
.bar { background: #eef2f9; border-radius: 8px; height: 14px; overflow: hidden; min-width: 90px; display: inline-block; vertical-align: middle; }
.bar-in { background: #2f6df6; height: 100%; display: block; }
.center.bar a { vertical-align: middle; }

/* 表格 */
.tbl { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 4px rgba(30,60,120,.06); }
.tbl th, .tbl td { padding: 8px 12px; text-align: left; font-size: 14px; border-bottom: 1px solid #eef2f9; }
.tbl th { background: #f7f9fd; color: #4a5568; font-weight: 600; white-space: nowrap; }
.stem-td { max-width: 380px; }
.filter-bar { display: flex; gap: 10px; align-items: center; }
.filter-bar select, .filter-bar input[type=text] { display: inline; width: auto; margin: 0; }
.filter-bar .btn { white-space: nowrap; }

.foot { text-align: center; color: #9aa6b6; font-size: 12px; padding: 20px 0; }
@media (max-width: 720px) {
  .top-in { flex-wrap: wrap; height: auto; padding: 8px 0; gap: 8px; }
  .filter-bar { flex-wrap: wrap; }
  .grid-3 { grid-template-columns: 1fr; }
}
