* { box-sizing: border-box; }
body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; margin: 0; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); min-height: 100vh; color: #333; }
.site-header { background: rgba(0,0,0,0.2); color: #fff; padding: 12px 24px; display: flex; align-items: center; gap: 16px; }
.site-header a { color: #fff; text-decoration: none; }
.site-header a:hover { text-decoration: underline; }
.site-main { max-width: 720px; margin: 24px auto; padding: 0 16px 40px; }
.site-main h1 { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.2); margin-bottom: 8px; }
.site-main > p { color: rgba(255,255,255,0.95); margin-bottom: 24px; }

.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-box { background: #fff; padding: 32px; border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.2); width: 340px; }
.auth-box h1 { margin-top: 0; color: #333; }
.auth-box label { display: block; margin: 14px 0; }
.auth-box input { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 6px; }
.auth-box button { width: 100%; padding: 12px; margin-top: 12px; background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; border: none; border-radius: 6px; cursor: pointer; font-size: 16px; }
.auth-box .error { color: #c0392b; margin-bottom: 8px; }
.auth-box p { margin: 16px 0 0; text-align: center; }
.auth-box p a { color: #667eea; }

.subject-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card { background: #fff; border-radius: 12px; padding: 24px; text-decoration: none; color: #333; box-shadow: 0 4px 16px rgba(0,0,0,0.1); transition: transform 0.2s, box-shadow 0.2s; display: block; }
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.15); }
.subject-card { display: block; }
.subject-card:hover { transform: none; box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.subject-card .card-links {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.subject-card .card-links a,
.subject-card .card-links .link-disabled {
  display: block;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 0.98rem;
  line-height: 1.2;
  text-align: center;
}
.subject-card .card-links a {
  color: #fff;
  background: rgba(102, 126, 234, 0.95);
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.subject-card .card-links a:hover {
  opacity: 0.95;
}
.subject-card .card-links .link-disabled {
  color: #999;
  background: rgba(255, 255, 255, 0.7);
  cursor: not-allowed;
}
.card-title { display: block; font-size: 1.25rem; font-weight: bold; margin-bottom: 8px; }
.card-meta { font-size: 0.9rem; color: #666; }
.mode-cards { display: flex; flex-direction: column; gap: 12px; max-width: 480px; }
.mode-card .card-desc { font-size: 0.9rem; color: #666; display: block; margin-top: 4px; }
.mode-card.disabled { opacity: 0.7; pointer-events: none; cursor: default; }

.exam-main { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
.exam-main h1 { color: #333; text-shadow: none; }
.question-block { margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid #eee; }
.question-block:last-of-type { border-bottom: none; }
.q-stem { margin: 0 0 12px; line-height: 1.6; }

/* 试卷中的图片：单独占一行，按原尺寸显示，
   若超过内容区域宽度则等比例缩小到宽度 100% */
.q-img,
.opt-img {
  display: block;
  max-width: 100%;
  height: auto;
  border: solid 5px #bcb8b8;
  padding: 5px;
  margin: 12px 0 4px;
}
.options label {
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;        /* 允许图片换到下一行 */
  align-items: flex-start;
  gap: 8px;
}
.options .opt-img {
  border: solid 5px #bcb8b8;
  padding: 5px;
  margin-top: 4px;
}
.options label.option-correct {
  color: #2e7d32;
  font-weight: 600;
}
.options label.option-wrong {
  color: #c62828;
}
.options label.option-reveal {
  color: #2e7d32;
  font-weight: 700;
}
.answer-feedback {
  margin-left: 8px;
  font-size: 0.9rem;
}
.answer-feedback.correct {
  color: #2e7d32;
}
.answer-feedback.wrong {
  color: #c62828;
}
.study-actions {
  margin-top: 8px;
}
.study-actions .btn-show-answer {
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid #667eea;
  background: #fff;
  color: #667eea;
  cursor: pointer;
  font-size: 0.9rem;
}

.options { list-style: none; padding: 0; margin: 0; }
.options li { margin: 8px 0; }
.options input { margin-top: 4px; }
.submit-row { margin-top: 24px; }
.btn-submit { padding: 12px 32px; background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; border: none; border-radius: 8px; font-size: 16px; cursor: pointer; }
.btn-submit:hover { opacity: 0.95; }

.result-main { text-align: center; }
.result-card { background: #fff; border-radius: 12px; padding: 32px; margin: 24px 0; box-shadow: 0 4px 20px rgba(0,0,0,0.1); display: inline-block; min-width: 260px; }
.result-score, .result-rate { margin: 12px 0; font-size: 1.1rem; }
.result-score strong, .result-rate strong { color: #667eea; font-size: 1.4rem; }
.btn-primary { display: inline-block; padding: 12px 24px; background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; text-decoration: none; border-radius: 8px; margin-top: 16px; }
.btn-primary:hover { opacity: 0.95; }
