/* 학생 화면: 자가채점, 결과, 하단 네비.
   원래 style.css 한 파일이었다. base.html 의 읽는 순서를 바꾸면
   나중 규칙이 앞 규칙을 덮어쓰는 순서가 깨진다. */

/* =========================
   자가채점 화면
   ========================= */

.solve-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.solve-header h1 {
  font-size: 21px;
  margin: 0;
}

.solve-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
}

.solve-notice {
  background: var(--surface);
  box-shadow: var(--inset);
  border-radius: 16px;
  padding: 12px 16px;
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 16px;
}

.solve-summary-card {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--raised-sm);
  padding: 18px 20px;
  margin-bottom: 18px;
}

.solve-summary-card > p {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 4px;
  font-weight: 600;
}

.solve-summary-card h2 {
  font-size: 18px;
  margin: 0 0 14px;
}

.solve-summary-card h2 strong {
  color: var(--accent);
}

/* 통계 셀은 inset */
.solve-mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.solve-mini-stats > div {
  background: var(--surface);
  box-shadow: var(--inset);
  border-radius: 14px;
  padding: 10px 8px;
  text-align: center;
}

.solve-mini-stats span {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
}

.solve-mini-stats strong {
  font-size: 17px;
  font-weight: 800;
}

.solve-question-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.solve-question-card {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--raised-sm);
  padding: 15px 18px;
}

.solve-question-title {
  font-size: 15.5px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}

.question-type-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 800;
}

/* 쪽 구분 표시 (52쪽~54쪽 / 55쪽처럼 한 숙제 안에서 쪽이 나뉠 때) */
.section-tag {
  display: inline-block;
  margin-bottom: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--neutral-bg);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 800;
}

.solve-section-heading {
  margin: 18px 0 8px;
  padding: 0 4px;
  font-size: 14px;
  font-weight: 800;
  color: var(--muted);
}

.solve-section-heading:first-child {
  margin-top: 0;
}

/* ⚠️ 선택지는 뉴모피즘 금지: 플랫 + 테두리, 선택 시 파랑 채움 */
.solve-choices {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.solve-choice {
  position: relative;
  cursor: pointer;
}

.solve-choice input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.solve-choice span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 46px;
  padding: 0 12px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1.5px solid var(--choice-border);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.solve-choice input:checked + span {
  background: var(--navy);
  border-color: var(--navy);
  color: #ffffff;
}

.solve-choice.unsure span {
  font-size: 13.5px;
  color: var(--muted);
}

.solve-choice.unsure input:checked + span {
  background: var(--orange);
  border-color: var(--orange);
  color: #ffffff;
}

.teacher-check-wide {
  background: var(--surface);
  box-shadow: var(--inset);
  border-radius: 14px;
  padding: 13px 15px;
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 600;
}

.teacher-check-wide.done-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  margin: 0;
}

.teacher-check-wide.done-check input {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* 하단 고정 제출 바 */
.solve-bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-radius: 0;
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(32, 36, 58, 0.06);
  max-width: 560px;
  margin: 0 auto;
  z-index: 20;
}

.clear-btn {
  flex: 0 0 auto;
  color: var(--danger);
}

.submit-btn {
  flex: 1;
}

/* =========================
   결과 화면
   ========================= */

.result-main-card {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--raised);
  padding: 22px;
  margin-bottom: 20px;
}

.result-main-card > p {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 4px;
}

.result-main-card h2 {
  font-size: 20px;
  margin: 0 0 14px;
}

.result-main-card h2 strong {
  color: var(--accent);
}

.result-score-band {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  box-shadow: var(--inset);
  border-radius: 14px;
  padding: 11px 16px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 12px;
}

.result-score-band strong {
  color: var(--text);
  font-size: 16px;
}

.result-stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.result-stat-row > div {
  background: var(--surface);
  box-shadow: var(--inset);
  border-radius: 14px;
  padding: 10px 8px;
  text-align: center;
}

.result-stat-row span {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
}

.result-stat-row strong {
  font-size: 18px;
  font-weight: 800;
}

.result-stat-row strong.wrong {
  color: var(--danger);
}

.result-list {
  margin-bottom: 22px;
}

.result-list h2 {
  font-size: 16.5px;
  padding: 0 4px;
  margin-bottom: 12px;
}

.result-question-card {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--raised-sm);
  padding: 14px 16px;
  margin-bottom: 12px;
}

.result-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--inset);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  flex-shrink: 0;
}

.result-question-card.wrong .result-mark { color: var(--danger); }
.result-question-card.unsure .result-mark { color: var(--orange); }
.result-question-card.correct .result-mark { color: var(--green); }

.result-content {
  flex: 1;
  min-width: 0;
}

.result-content p {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 2px;
}

.result-content strong {
  font-size: 14.5px;
}

.all-answers-box {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--raised-sm);
  padding: 6px 18px;
}

.all-answers-box summary {
  cursor: pointer;
  font-weight: 800;
  font-size: 15px;
  padding: 14px 2px;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.all-answers-box .table-wrap {
  margin-bottom: 14px;
}

/* =========================
   하단 네비 (학생)
   ========================= */

.bottom-nav {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  max-width: 528px;
  margin: 0 auto;
  display: flex;
  justify-content: space-around;
  background: var(--surface);
  border-radius: 24px;
  box-shadow: var(--raised-sm);
  padding: 8px 6px;
  z-index: 20;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 6px 16px;
  min-height: 44px;
  min-width: 64px;
  border-radius: 16px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
}

.bottom-nav-item .bottom-nav-icon {
  font-size: 19px;
  line-height: 1.1;
}

.bottom-nav-item.active {
  color: var(--accent);
}


/* 단답형 입력 (v0.9)
   선택지와 마찬가지로 뉴모피즘을 쓰지 않는다: 플랫 + 테두리 */
.solve-short {
  display: flex;
  gap: 10px;
  align-items: stretch;
  flex-wrap: wrap;
}

.short-answer-input {
  flex: 1 1 180px;
  min-width: 0;
  padding: 12px 14px;
  font-size: 16px;           /* 모바일에서 자동 확대되지 않게 16px 이상 */
  font-family: inherit;
  color: var(--text);
  background: var(--surface-soft);
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: none;
}

.short-answer-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.solve-short .short-unsure {
  flex: 0 0 auto;
  align-self: center;
}


/* 소문항 묶음 카드 (v0.10)
   한 문제에 빈칸이 여러 개일 때. 예: 290번 (ㄱ)(ㄴ)(ㄷ)
   채점은 칸마다 따로 하지만 화면에서는 한 문제로 보여야 한다. */
.solve-question-set .solve-sub-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.solve-question-set .solve-sub-item:first-of-type {
  border-top: none;
  padding-top: 2px;
}

.solve-question-set .solve-sub-item:last-child {
  padding-bottom: 0;
}

.solve-sub-label {
  flex: 0 0 auto;
  min-width: 34px;
  padding-top: 10px;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--muted);
}

.solve-sub-body {
  flex: 1 1 auto;
  min-width: 0;
}

/* 묶음 안에서는 안내문을 칸마다 반복하지 않고 마지막 칸에만 남긴다 */
.solve-question-set .solve-sub-item:not(:last-child) .multi-hint {
  display: none;
}

.solve-sub-body .multi-hint {
  margin-bottom: 0;
}
