* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; background: #f1f5f9; color: #0f2a4a; }
button { cursor: pointer; font-family: inherit; }

/* ===== 顶部栏 ===== */
#topBar {
  height: 64px; background: linear-gradient(90deg,#0b2a4a,#123f6b);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; color: #fff;
}
.brand-title { font-size: 18px; font-weight: 700; }
.brand-sub { font-size: 12px; color: #93b4d9; margin-top: 2px; }
.top-right { display: flex; align-items: center; gap: 14px; }
#topInfo { font-size: 13px; color: #dbeafe; }
.nav-btn {
  background: rgba(255,255,255,.14); color: #fff; border: none;
  border-radius: 6px; padding: 7px 16px; font-size: 13px;
}
.nav-btn:hover { background: rgba(255,255,255,.24); }

/* ===== 视图 ===== */
.view { display: none; min-height: calc(100vh - 64px); }
.view.active { display: block; }
.content { max-width: 1080px; margin: 0 auto; padding: 28px 20px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.page-head h2, .h2 { font-size: 22px; font-weight: 700; }

/* ===== 登录 ===== */
.login-wrap { min-height: calc(100vh - 64px); display: flex; align-items: center; justify-content: center; background: #eef3f9; }
.login-card {
  width: 420px; background: #fff; border-radius: 14px; padding: 34px 40px 26px;
  box-shadow: 0 12px 36px rgba(11,42,74,.10); text-align: center;
}
.login-icon {
  width: 68px; height: 68px; margin: 0 auto 12px; font-size: 36px; line-height: 68px;
  background: #eef6ff; border-radius: 50%;
}
.login-title { font-size: 24px; font-weight: 700; color: #0f2a4a; }
.login-sub { font-size: 12px; color: #94a3b8; letter-spacing: 2px; margin: 6px 0 20px; }
.login-input {
  width: 100%; padding: 12px 14px; margin-bottom: 14px; border: 1px solid #d3deec;
  border-radius: 8px; font-size: 14px; outline: none;
}
.login-input:focus { border-color: #1d6fd6; box-shadow: 0 0 0 3px rgba(29,111,214,.12); }
.remember { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #475569; margin-bottom: 14px; }
.login-btn {
  width: 100%; padding: 13px; border: none; border-radius: 8px; font-size: 16px; font-weight: 700;
  background: #16a34a; color: #fff;
}
.login-btn:hover { background: #15803d; }
.link-btn { background: none; border: none; color: #1d6fd6; font-size: 13px; margin-top: 16px; }
.link-btn:hover { text-decoration: underline; }

/* ===== 卡片 / 按钮 ===== */
.card {
  background: #fff; border-radius: 12px; padding: 18px 20px;
  box-shadow: 0 2px 10px rgba(11,42,74,.05);
}
.btn-primary { background: #1d6fd6; color: #fff; border: none; border-radius: 8px; padding: 10px 22px; font-size: 14px; }
.btn-primary:hover { background: #155eb8; }
.btn-secondary { background: #e8f1fd; color: #1d6fd6; border: 1px solid #c7dcf5; border-radius: 8px; padding: 8px 16px; }
.btn-ghost { background: #fff; color: #475569; border: 1px solid #d3deec; border-radius: 8px; padding: 8px 16px; }
.btn-danger { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; border-radius: 8px; padding: 8px 16px; }
.hint-text { font-size: 13px; color: #64748b; margin-bottom: 14px; }
.center { text-align: center; margin-top: 22px; }

/* ===== 首页 ===== */
.welcome { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.home-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 20px 0; }
.stat-item { background: #fff; border-radius: 12px; padding: 20px; text-align: center; box-shadow: 0 2px 8px rgba(11,42,74,.05); }
.stat-num { font-size: 30px; font-weight: 800; color: #1d6fd6; }
.stat-label { font-size: 13px; color: #64748b; margin-top: 4px; }
.func-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.func-card {
  background: #fff; border-radius: 12px; padding: 22px; text-align: left; border: 2px solid transparent;
  box-shadow: 0 2px 8px rgba(11,42,74,.05); transition: .15s;
}
.func-card:hover { border-color: #1d6fd6; background: #f8fbff; }
.func-card .fc-name { font-size: 17px; font-weight: 700; }
.func-card .fc-desc { font-size: 13px; color: #64748b; margin-top: 8px; line-height: 1.6; }
.func-card.locked { cursor: not-allowed; opacity: .65; background: #f1f5f9; border-color: #e2e8f0; pointer-events: none; }
.func-card.locked .fc-name { color: #94a3b8; }
.func-card .fc-tip { font-size: 12px; color: #e11d48; margin-top: 8px; line-height: 1.5; }

/* 题库类目标签 */
.tag-cat { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; white-space: nowrap; }
.tag-a { background: #e3edfb; color: #1d6fd6; }
.tag-b { background: #e8f5e9; color: #2e7d32; }
.tag-gen { background: #f1f5f9; color: #64748b; }

/* ===== 考试选择 ===== */
.mode-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.mode-card { background: #fff; border: 2px solid #d3deec; border-radius: 12px; padding: 22px; }
.mode-card.sel { border-color: #1d6fd6; background: #f3f8ff; }
.mode-card .mc-name { font-size: 17px; font-weight: 700; }
.mode-card .mc-desc { font-size: 13px; color: #64748b; margin-top: 8px; }

/* ===== 考试答题 ===== */
.exam-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.timer { font-size: 20px; font-weight: 800; color: #dc2626; font-variant-numeric: tabular-nums; }
.exam-body { display: flex; gap: 16px; }
.exam-left { flex: 3; }
.exam-right { flex: 1; min-width: 200px; }
.q-index { font-size: 14px; font-weight: 700; color: #1d6fd6; margin-bottom: 12px; }
.q-text { font-size: 16px; line-height: 1.7; margin-bottom: 18px; }
.options label {
  display: block; padding: 12px 14px; margin-bottom: 10px; border: 1px solid #d3deec;
  border-radius: 8px; cursor: pointer; font-size: 14px;
}
.options label:hover { border-color: #1d6fd6; }
.options input[type=radio] { margin-right: 10px; }
.q-nav { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.palette { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.palette .pbtn { height: 40px; border: none; border-radius: 6px; background: #eef2f7; color: #475569; }
.palette .pbtn.answered { background: #1d6fd6; color: #fff; }
.palette .pbtn.current { outline: 2px solid #0f2a4a; }

/* ===== 练习 ===== */
.prac-card { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 2px 8px rgba(11,42,74,.05); }
.prac-opt { display: block; padding: 12px 14px; margin: 8px 0; border: 1px solid #d3deec; border-radius: 8px; cursor: pointer; }
.prac-opt.right { border-color: #16a34a; background: #f0fdf4; font-weight: 700; }
.prac-opt.wrong { border-color: #dc2626; background: #fef2f2; }
.feedback { margin-top: 14px; padding: 12px 14px; border-radius: 8px; font-size: 14px; }
.feedback.ok { background: #f0fdf4; color: #15803d; }
.feedback.no { background: #fef2f2; color: #b91c1c; }

/* ===== 结果 ===== */
.result-success { text-align: center; padding: 60px 0; }
.result-badge { font-size: 26px; font-weight: 800; color: #16a34a; }
.result-bless { font-size: 18px; color: #0f2a4a; margin-top: 16px; }
.score-card { display: flex; align-items: center; gap: 36px; margin-bottom: 20px; }
.big-score { font-size: 52px; font-weight: 800; color: #1d6fd6; }
.score-stats { display: flex; gap: 34px; flex-wrap: wrap; }
.score-stats .ss { text-align: center; }
.score-stats .ss .v { font-size: 20px; font-weight: 800; }
.score-stats .ss .k { font-size: 12px; color: #64748b; }
.review-item { background: #fff; border-radius: 10px; padding: 16px 18px; margin-bottom: 10px; box-shadow: 0 1px 6px rgba(11,42,74,.04); }
.review-item .ri-title { font-weight: 700; font-size: 14px; }
.review-item .ri-q { margin: 8px 0; font-size: 14px; }
.review-item .ri-a { font-size: 13px; font-weight: 600; }
.review-item .ri-analysis { font-size: 12px; color: #475569; margin-top: 6px; }

/* ===== 错题本 ===== */
.wrong-item { background: #fff; border-radius: 10px; padding: 16px 18px; margin-bottom: 10px; box-shadow: 0 1px 6px rgba(11,42,74,.04); }
.empty-tip { text-align: center; color: #94a3b8; padding: 60px 0; font-size: 16px; }

/* ===== 管理端 ===== */
.admin-layout { display: flex; gap: 20px; padding: 24px; max-width: 1200px; margin: 0 auto; }
.admin-nav { width: 190px; padding: 14px; }
.admin-nav-title { font-weight: 800; font-size: 15px; margin-bottom: 12px; padding-left: 8px; }
.admin-nav-item {
  display: block; width: 100%; text-align: left; background: none; border: none; border-radius: 8px;
  padding: 11px 14px; font-size: 14px; color: #334155; margin-bottom: 4px;
}
.admin-nav-item:hover { background: #f1f5f9; }
.admin-nav-item.active { background: #e8f1fd; color: #1d6fd6; font-weight: 700; }
.admin-main { flex: 1; min-width: 0; }
.admin-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.admin-toolbar input, .admin-toolbar select {
  padding: 8px 10px; border: 1px solid #d3deec; border-radius: 8px; font-size: 13px; outline: none;
}
.admin-toolbar input:focus, .admin-toolbar select:focus { border-color: #1d6fd6; }
table.tbl { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 6px rgba(11,42,74,.05); }
table.tbl th { background: #f8fafc; padding: 10px 12px; font-size: 13px; color: #475569; text-align: left; }
table.tbl td { padding: 9px 12px; font-size: 13px; border-top: 1px solid #eef2f7; }
table.tbl tr:hover td { background: #f8fbff; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: #475569; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #d3deec; border-radius: 8px; font-size: 14px; outline: none;
}
.field input:focus, .field select:focus { border-color: #1d6fd6; }
.field input[readonly] { background: #f1f5f9; color: #64748b; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.overview-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 18px; }
.ov-item { background: #fff; border-radius: 12px; padding: 18px; box-shadow: 0 2px 8px rgba(11,42,74,.05); }
.ov-item .ov-num { font-size: 26px; font-weight: 800; color: #1d6fd6; }
.ov-item .ov-label { font-size: 13px; color: #64748b; margin-top: 4px; }

/* ===== 弹窗 / Toast ===== */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: #fff; border-radius: 12px; width: 460px; max-width: 92vw; max-height: 86vh; overflow: auto; padding: 22px 24px; }
.modal-title { font-size: 17px; font-weight: 700; margin-bottom: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
#toast {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%); z-index: 200;
  background: #0f2a4a; color: #fff; padding: 12px 22px; border-radius: 8px; font-size: 14px;
  opacity: 0; transition: opacity .25s; pointer-events: none; max-width: 80vw;
}
#toast.show { opacity: 1; }
