/* 学生端样式 — 简洁卡片式，移动端友好 */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #222;
  font-size: 15px;
  line-height: 1.6;
}
.wrap {
  max-width: 880px; margin: 24px auto; padding: 0 16px;
}
.card {
  background: #fff; border-radius: 14px; padding: 28px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
  margin-bottom: 20px;
}
h1 { font-size: 26px; margin-bottom: 6px; color: #1a1a1a; }
h2 { font-size: 20px; margin-bottom: 12px; color: #1a1a1a; }
.subtitle { color: #777; font-size: 13px; margin-bottom: 18px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }
label { display: block; font-size: 13px; color: #555; margin-bottom: 4px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #d0d4dd;
  border-radius: 8px; font-size: 15px; background: #fafbfd;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus { outline: none; border-color: #667eea; box-shadow: 0 0 0 3px rgba(102,126,234,0.18); }
button {
  padding: 11px 22px; border: 0; border-radius: 8px; cursor: pointer;
  font-size: 15px; font-weight: 600; transition: all 0.18s;
}
.btn-primary { background: #667eea; color: #fff; }
.btn-primary:hover { background: #5469d4; }
.btn-ghost { background: transparent; color: #667eea; border: 1px solid #667eea; }
.btn-ghost:hover { background: #667eea; color: #fff; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.error { background: #fff1f0; color: #c0392b; padding: 10px 14px; border-radius: 8px; margin: 10px 0; border-left: 4px solid #e74c3c; }
.info { background: #f0f8ff; color: #1a73c1; padding: 10px 14px; border-radius: 8px; margin: 10px 0; border-left: 4px solid #4a90e2; }
.ok { background: #e8f7ee; color: #1f8a3e; padding: 10px 14px; border-radius: 8px; margin: 10px 0; border-left: 4px solid #27ae60; }

/* 题目卡 */
.qcard { background: #fff; border-radius: 14px; padding: 22px; margin-bottom: 14px; box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.qcard .meta { display: flex; justify-content: space-between; font-size: 13px; color: #888; margin-bottom: 8px; }
.qcard .meta .article { background: #667eea; color: #fff; padding: 2px 10px; border-radius: 10px; }
.qcard .stem { font-size: 16px; color: #1a1a1a; margin-bottom: 12px; font-weight: 500; }
.qcard .opts { display: flex; flex-direction: column; gap: 8px; }
.qcard .opts label {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px; border: 1px solid #e2e6ef; border-radius: 10px;
  cursor: pointer; background: #fafbfd; transition: all 0.15s;
}
.qcard .opts label:hover { background: #eef2ff; border-color: #667eea; }
.qcard .opts input[type=radio],
.qcard .opts input[type=checkbox] { width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; }
.qcard .opts label.sel { background: #eef2ff; border-color: #667eea; }
.qcard .opts .text { flex: 1; min-width: 0; }

/* 翻页条 */
.qbar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.qbar .dot {
  width: 30px; height: 30px; line-height: 30px; text-align: center;
  border-radius: 50%; background: #f0f2f7; color: #555; font-size: 13px;
  cursor: pointer; transition: all 0.15s;
}
.qbar .dot.done { background: #27ae60; color: #fff; }
.qbar .dot.curr { background: #667eea; color: #fff; outline: 3px solid #c2cff8; }

/* 成绩页 */
.score-big { font-size: 64px; font-weight: 700; text-align: center; margin: 16px 0; }
.score-pass { color: #27ae60; }
.score-fail { color: #e74c3c; }
.grade-list { font-size: 14px; }
.grade-list .row2 { padding: 8px 12px; border-bottom: 1px solid #eee; display: flex; gap: 10px; align-items: flex-start; }
.grade-list .row2.right { background: #f0f9f3; }
.grade-list .row2.wrong { background: #fdf2f2; }
.grade-list .row2 .qnum { flex-shrink: 0; width: 26px; height: 26px; line-height: 26px; border-radius: 50%; background: #aaa; color: #fff; text-align: center; font-size: 12px; }
.grade-list .row2.right .qnum { background: #27ae60; }
.grade-list .row2.wrong .qnum { background: #e74c3c; }
.grade-list .row2 .stem { flex: 1; }
.grade-list .row2 .ans { font-size: 12px; color: #888; }

/* 用户栏 */
.user-bar {
  display: flex; justify-content: space-between; align-items: center;
  background: #fff; padding: 12px 20px; border-radius: 12px; margin-bottom: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06); flex-wrap: wrap; gap: 10px;
}
.user-bar .me { font-size: 14px; color: #555; }
.user-bar .me b { color: #1a1a1a; }
.user-bar .actions { display: flex; gap: 8px; }
.user-bar button { padding: 6px 14px; font-size: 13px; }

.tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 2px solid #eee; }
.tabs .tab {
  padding: 10px 18px; cursor: pointer; color: #777; font-weight: 500;
  border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.tabs .tab.active { color: #667eea; border-color: #667eea; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #eee; }
th { background: #f7f9fc; color: #555; font-weight: 600; }
tr:hover { background: #fafbfd; }

/* 表格横向滚动容器（手机查看历史记录等） */
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.scroll-x table { min-width: 560px; }   /* 宽表格时手机可左右滑动 */

/* ---------- 移动端适配 ---------- */
@media (max-width: 820px) {
  body { font-size: 15px; }
  .wrap { padding: 0 12px; margin-top: 12px; }
  .card { padding: 18px; }
  .qcard { padding: 16px; }
  /* 大一点的行高便于触屏 */
  .qcard .opts label { padding: 13px 12px; }
  .qcard .opts label:active { background: #e8edff; }
  .user-bar { padding: 10px 14px; }
  /* 模态框贴边 */
  .modal-card { padding: 18px; max-width: 96vw; }
  h1 { font-size: 22px; }
  h2 { font-size: 18px; }
}

@media (max-width: 520px) {
  h1 { font-size: 20px; }
  h2 { font-size: 17px; }
  .card, .qcard { padding: 14px; }
  .wrap { padding: 0 8px; }
  /* iOS 上输入框字号 ≥16px 防止聚焦自动放大 */
  input, select, textarea { font-size: 16px; }
  /* 题目正文与选项放大到易读字号 */
  .qcard .stem { font-size: 17px; line-height: 1.7; }
  .qcard .opts .text { font-size: 16px; line-height: 1.6; }
  /* 题目导航圆点紧凑化 */
  .qbar { gap: 4px; }
  .qbar .dot { width: 26px; height: 26px; line-height: 26px; font-size: 12px; }
  /* 用户栏竖排换行 */
  .user-bar { flex-direction: column; align-items: stretch; }
  .user-bar .actions { flex-wrap: wrap; }
  .user-bar .actions button { flex: 1; min-width: 92px; text-align: center; }
  /* 答题详情行自适应 */
  .grade-list .row2 { flex-wrap: wrap; }
  .grade-list .row2 .qnum { width: 22px; height: 22px; line-height: 22px; font-size: 11px; }
  .score-big { font-size: 46px; }
  /* 考试须知列表留白 */
  .card ul { padding-left: 4px; }
  /* 防止与 iOS 底部横条重叠 */
  body { padding-bottom: env(safe-area-inset-bottom); }
}

@media (max-width: 600px) {
  .card, .qcard { padding: 16px; }
  .qbar .dot { width: 26px; height: 26px; line-height: 26px; font-size: 12px; }
  h1 { font-size: 22px; }
  .score-big { font-size: 48px; }
}

/* 修改密码模态框 */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 16px;
}
.modal-card {
  background: #fff; border-radius: 10px; padding: 24px;
  width: 100%; max-width: 420px; box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.modal-card h3 { margin-bottom: 14px; }
.modal-card label { display: block; margin-top: 10px; font-size: 13px; color: #555; }
.modal-card input { width: 100%; padding: 8px 10px; margin-top: 4px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; }
.modal-card .err { background:#fee; color:#c00; padding:8px 10px; border-radius:4px; margin:8px 0; font-size:13px; }

/* 考试页反截图细纹遮罩（全屏、不可点击；极浅噪点干扰 OCR/AI 识图，肉眼几乎无感） */
.anti-shot {
  position: fixed; inset: 0; pointer-events: none; z-index: 900;
  background-image:
    repeating-linear-gradient(0deg,  transparent 0 2px, rgba(0,0,0,0.025) 2px 3px),
    repeating-linear-gradient(90deg, transparent 0 3px, rgba(0,0,0,0.02)  3px 4px),
    repeating-linear-gradient(45deg, transparent 0 5px, rgba(0,0,0,0.015) 5px 6px);
}

/* 考试页警示弹窗（切屏/截图/粘贴图片） */
.exam-alert-backdrop { z-index: 950; animation: eaFade .15s; }
.exam-alert-card {
  border-top: 5px solid #c0392b;
  background: linear-gradient(180deg, #fff8f8 0%, #ffffff 60%);
  animation: eaPop .2s;
}
.exam-alert-card h3 { color: #c0392b; margin-bottom: 8px; font-size: 18px; }
.exam-alert-card p { color: #555; line-height: 1.6; }
@keyframes eaFade { from { opacity: 0 } to { opacity: 1 } }
@keyframes eaPop { from { transform: scale(0.92); opacity: 0 } to { transform: scale(1); opacity: 1 } }
}