/* ============================================================
 * 北京山丹丹随班就读教师专业培训系统——测量量表  样式
 * 浅色主题 / 响应式（电脑 + 手机）
 * ============================================================ */
:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --ink: #1f2d3d;
  --muted: #6b7a8d;
  --line: #e3e8ef;
  --brand: #c0392b;      /* 主题红（山丹丹） */
  --brand-soft: #fdecea;
  --ok: #1e8e3e;
  --warn: #d9822b;
  --primary: #2f6fed;
  --primary-soft: #eaf1ff;
  --shadow: 0 6px 24px rgba(31,45,61,.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
}
.wrap { max-width: 880px; margin: 0 auto; padding: 18px 16px 60px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 18px;
}
.hidden { display: none !important; }
.center { text-align: center; }

/* 顶部云连接状态 */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 14px; font-size: 13px; color: var(--muted);
}
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(30,142,62,.18); }
.dot.off { background: #b0b8c1; }

/* 标题 */
h1.title {
  text-align: center;
  font-size: 22px;
  line-height: 1.5;
  margin: 6px 0 18px;
  font-weight: 800;
}
.subtitle { text-align: center; color: var(--muted); margin: -8px 0 16px; font-size: 14px; }

/* 二维码区 */
.qr-box { text-align: center; margin: 16px 0; }
#qrcode { display: inline-block; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
#qrcode img, #qrcode canvas { display: block; }
.url-line { margin: 10px 0; font-size: 13px; color: var(--muted); word-break: break-all; }
.url-line b { color: var(--ink); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line);
  background: #fff; color: var(--ink);
  padding: 11px 18px; border-radius: 10px; cursor: pointer;
  font-size: 15px; font-weight: 600; transition: .15s; user-select: none;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.btn:hover { border-color: #c7d2e0; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #a93226; }
.btn.blue { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.blue:hover { background: #245bd0; }
.btn.ghost { background: transparent; }
.btn.block { display: flex; width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 14px; }

/* 危险操作按钮（永久删除单位） */
.btn.danger { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.danger:hover { background: #a93226; }
.unit-del {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 12px 0 4px; padding: 12px 14px;
  background: var(--brand-soft); border: 1px solid #f5c6c0; border-radius: 10px;
}
.unit-del .del-hint { color: #8a2a20; font-size: 14px; }
.unit-del .del-hint b { font-size: 16px; }

/* 填写须知 */
.notice {
  background: var(--brand-soft); border: 1px solid #f5c6c0; color: #8a2a20;
  border-radius: 10px; padding: 12px 16px; font-size: 14px; margin: 14px 0;
}
.footer-org {
  text-align: center; color: var(--muted); font-size: 13px; line-height: 1.9; margin-top: 22px;
}

/* 表单 */
.field { margin: 14px 0; }
.field > label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 15px; }
.field .req { color: var(--brand); margin-left: 3px; }
.field input[type=text], .field select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 16px; background: #fff; color: var(--ink);
}
.field .hint { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* 答题 */
.quiz-progress { font-size: 14px; color: var(--muted); margin-bottom: 6px; text-align: center; }
.quiz-bar { height: 8px; background: #eef1f6; border-radius: 99px; overflow: hidden; margin-bottom: 16px; }
.quiz-bar > i { display: block; height: 100%; background: linear-gradient(90deg,#2f6fed,#56b1ff); width: 0; transition: .2s; }
.q-section-tag {
  display: inline-block; font-size: 12px; color: var(--primary); background: var(--primary-soft);
  border-radius: 99px; padding: 3px 12px; margin-bottom: 10px;
}
.q-text { font-size: 18px; font-weight: 700; line-height: 1.7; margin: 8px 0 20px; }
.choices { display: flex; gap: 14px; flex-wrap: wrap; }
.choice {
  flex: 1 1 150px; text-align: center; padding: 18px; border: 2px solid var(--line); border-radius: 12px;
  cursor: pointer; font-size: 17px; font-weight: 700; background: #fff; transition: .15s;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.choice:hover { border-color: #b9c6da; }
.choice.sel { border-color: var(--brand); background: var(--brand-soft); color: #8a2a20; }
.quiz-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; }

/* 统计 / 报告 */
.section-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tab {
  padding: 9px 16px; border: 1px solid var(--line); border-radius: 99px; cursor: pointer;
  background: #fff; font-size: 14px; font-weight: 600; color: var(--muted);
}
.tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.stat-summary { display: flex; gap: 18px; flex-wrap: wrap; align-items: baseline; margin: 8px 0 16px; }
.stat-summary .big { font-size: 30px; font-weight: 800; color: var(--brand); }
.stat-summary .lab { color: var(--muted); font-size: 14px; }
.level-badge { padding: 4px 12px; border-radius: 99px; font-weight: 700; font-size: 14px; }
.level-不合格 { background: #fdecea; color: #c0392b; }
.level-合格 { background: #eaf1ff; color: #2f6fed; }
.level-良好 { background: #e7f6ec; color: #1e8e3e; }

table.tbl { border-collapse: collapse; width: 100%; font-size: 13px; margin: 2px 0 4px; }
table.tbl th, table.tbl td { border: 1px solid var(--line); padding: 7px 8px; text-align: center; }
table.tbl th { background: #f3f6fb; font-weight: 700; }
table.tbl td.lbl, table.tbl th.lbl { text-align: left; background: #fafbfd; font-weight: 700; white-space: nowrap; }
.chart-box { margin: 14px 0 6px; overflow-x: auto; }
.chart-box canvas { max-width: 100%; }
.chart-title { font-weight: 700; margin: 14px 0 4px; font-size: 15px; }

.rpt { font-family: "SimSun", "宋体", serif; }
.rpt-title { text-align: center; font-family: "SimHei", "Microsoft YaHei", sans-serif; font-size: 19px; font-weight: 800; margin: 8px 0 2px; }
.rpt-sub { text-align: center; font-family: "SimHei", "Microsoft YaHei", sans-serif; font-size: 19px; font-weight: 800; margin: 0 0 14px; }
.rpt-sub .rpt-date { font-family: "SimSun", "宋体", serif; font-size: 14px; font-weight: 400; }
.rpt-text { font-family: "SimSun", "宋体", serif; font-size: 14px; line-height: 1.9; text-indent: 2em; margin: 12px 0; }
.rpt-fig { text-align: center; margin: 16px 0; }
.rpt-fig img { display: block; margin: 0 auto; max-width: 100%; height: auto; }
.rpt-cap { text-align: center; font-family: "SimSun", "宋体", serif; font-size: 14px; margin: 6px 0 14px; }
.rpt-cap.rpt-tblcap { margin: 6px 0 2px; }
.rpt table.tbl th { font-weight: 400; background: transparent; }
.rpt-pb { page-break-before: always; }
.chart-box img { width: 100%; max-width: 600px; height: auto; }
.roster { margin-top: 10px; }
.roster table { font-size: 13px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(20,30,45,.45); display: flex; align-items: center; justify-content: center;
  z-index: 50; padding: 16px;
}
.modal {
  background: #fff; border-radius: 14px; padding: 22px; width: 100%; max-width: 360px; box-shadow: var(--shadow);
}
.modal h3 { margin: 0 0 12px; font-size: 17px; }
.modal input[type=password], .modal input[type=text] {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 16px; margin-bottom: 12px;
}
.modal .err { color: #c0392b; font-size: 13px; min-height: 18px; margin-bottom: 8px; }
.empty-tip { text-align: center; color: var(--muted); padding: 30px 0; }

/* 打印 */
@media print {
  body { background: #fff; }
  .no-print, .topbar, .btn-row, .toolbar, .section-tabs, .quiz-nav { display: none !important; }
  .wrap { max-width: 100%; padding: 0; }
  .card { box-shadow: none; border: none; padding: 0; margin: 0 0 14px; }
  table.tbl { font-size: 11px; }
}

/* 手机适配 */
@media (max-width: 560px) {
  h1.title { font-size: 18px; }
  .q-text { font-size: 16px; }
  .choice { flex: 1 1 100%; }
  .card { padding: 16px; }
  .btn { padding: 12px 14px; font-size: 14px; }
}
