/* === PDF 학습 모드 === */

.pdf-study-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* PDF 읽기 모드: 좌우 패딩 제거 (PDF 꽉 차게) */
.pdf-study-container.pdf-reading-section {
  padding: 0;
}
.main-content:has(.pdf-reading-section) {
  padding-left: 0;
  padding-right: 0;
}

/* --- upload 단계 --- */
.pdf-upload-section {
  animation: fadeInPdf 0.3s ease;
}

@keyframes fadeInPdf {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.pdf-upload-area {
  display: block;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(11, 16, 38, 0.90);
}

.pdf-upload-area:hover,
.pdf-upload-area.drag-over {
  border-color: var(--gold);
  background: rgba(244, 197, 66, 0.05);
}

.pdf-upload-area.drag-over {
  border-style: solid;
  box-shadow: 0 0 20px rgba(244, 197, 66, 0.15);
}

.pdf-upload-area.has-file {
  border-color: var(--sage);
  background: rgba(123, 198, 126, 0.05);
}

.pdf-upload-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.pdf-upload-spinner {
  margin-bottom: 0.75rem;
}

.pdf-upload-text {
  font-size: 0.9rem;
  color: var(--sand);
  margin-bottom: 0.5rem;
}

.pdf-upload-hint {
  font-size: 0.75rem;
  color: var(--sand-dark);
}

.pdf-file-name {
  font-size: 0.9rem;
  color: var(--sage);
  font-weight: 600;
  margin-top: 0.5rem;
}

.pdf-page-info {
  font-size: 0.8rem;
  color: var(--sand-dark);
  margin-top: 0.3rem;
}

/* 페이지 범위 설정 */
.pdf-range-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.pdf-range-group input[type="number"] {
  width: 80px;
  text-align: center;
}

.pdf-range-sep {
  color: var(--sand-dark);
  font-size: 0.9rem;
}

/* 페이지 범위 미리보기 */
.pdf-range-preview {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
}

.pdf-range-preview-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.pdf-range-preview-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--sand-dark);
}

.pdf-range-preview-canvas {
  max-width: 160px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  background: rgba(11, 16, 38, 0.90);
}

/* 문제 수 슬라이더 */
.pdf-question-count {
  margin-top: 1rem;
}

.pdf-question-count label {
  font-size: 0.85rem;
  color: var(--sand);
}

.pdf-question-count strong {
  color: var(--gold);
}

/* PDF 페이지 표시 */
.pdf-vision-area {
  position: relative;
  overflow: hidden;
  padding: 0;
  touch-action: none;
  user-select: none;
}

.pdf-canvas-wrapper {
  display: flex;
  justify-content: center;
  transform-origin: center center;
  transition: transform 0.1s ease;
  padding: 0;
}

.pdf-canvas-wrapper canvas {
  display: block;
  border-radius: var(--radius-sm);
  max-width: 100%;
  height: auto;
}

/* 확대/축소 컨트롤 */
.pdf-zoom-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.pdf-zoom-value {
  font-size: 0.8rem;
  color: var(--sand-dark);
  min-width: 3rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* 시작 버튼 */
.pdf-start-btn {
  width: 100%;
  margin-top: 1.5rem;
}

/* 페이지 건너뛰기 안내 */
.pdf-skip-notice {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(11, 16, 38, 0.95);
  border: 1px solid var(--gold);
  color: var(--sand);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  z-index: 8000;
  animation: fadeIn 0.3s ease;
  white-space: nowrap;
}

/* --- reading 단계 --- */
.pdf-reading-section {
  animation: fadeIn 0.3s ease;
}

/* 상단 툴바 */
.pdf-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  gap: 0.5rem;
  min-height: 44px;
  flex-wrap: nowrap;
  overflow-x: auto;
}

.pdf-toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.pdf-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pdf-file-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gold);
  opacity: 0.85;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 진행률 바 */
.pdf-progress-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.pdf-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--sage));
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* 텍스트 영역 - reader-view 스타일 재사용 */
.pdf-text-area {
  position: relative;
  background: rgba(11, 16, 38, 0.93);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2.5rem;
  min-height: 380px;
  max-height: 65vh;
  overflow-y: auto;
}

.pdf-text-area::-webkit-scrollbar {
  width: 6px;
}

.pdf-text-area::-webkit-scrollbar-track {
  background: transparent;
}

.pdf-text-area::-webkit-scrollbar-thumb {
  background: rgba(244, 197, 66, 0.3);
  border-radius: 3px;
}

.pdf-text-area::-webkit-scrollbar-thumb:hover {
  background: rgba(244, 197, 66, 0.5);
}

.pdf-text-content {
  font-family: var(--font-reader);
  font-size: 18px;
  line-height: 1.85;
  color: var(--sand);
  text-align: justify;
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* 하단 네비게이션 */
.pdf-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.pdf-page-indicator {
  font-size: 0.85rem;
  color: var(--sand-dark);
  font-variant-numeric: tabular-nums;
}

/* 빈 텍스트 안내 */
.pdf-empty-notice {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--sand-dark);
}

.pdf-empty-notice-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.pdf-empty-notice-text {
  font-size: 0.9rem;
  line-height: 1.6;
}

/* --- quiz 모달 --- */
.pdf-quiz-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 24, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.pdf-quiz-modal {
  width: 90%;
  max-width: 550px;
  background: rgba(11, 16, 38, 0.98);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  max-height: 85vh;
  overflow-y: auto;
}

.pdf-quiz-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

/* 다시 풀기 X 버튼 */
.pdf-retry-close-btn {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(37, 48, 82, 0.90);
  color: var(--sand-muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.pdf-retry-close-btn:hover {
  background: rgba(232, 93, 117, 0.2);
  border-color: var(--rose);
  color: var(--rose);
}

/* 복습 졸음감지 토글 */
.retry-drowsy-toggle {
  position: absolute;
  top: -0.5rem;
  left: -0.5rem;
  width: auto;
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  background: rgba(21, 32, 66, 0.85);
  color: var(--sand-muted);
  cursor: pointer;
  transition: all 0.2s;
  z-index: 2;
}

.retry-drowsy-toggle.active {
  background: rgba(96, 165, 96, 0.15);
  border-color: var(--sage);
  color: var(--sage);
}

.retry-drowsy-toggle:hover {
  background: rgba(96, 165, 96, 0.1);
  border-color: var(--sage);
}

.pdf-quiz-counter {
  font-size: 0.8rem;
  color: var(--sand-muted);
  margin-bottom: 0.3rem;
}

.pdf-quiz-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
}

/* 빈칸 문장 */
.pdf-quiz-sentence {
  font-family: var(--font-reader);
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--sand);
  background: rgba(37, 48, 82, 0.85);
  border-radius: var(--radius-sm);
  padding: 1.2rem 1rem;
  margin: 0 auto 1.5rem;
  max-width: 480px;
  text-align: center;
  word-break: keep-all;
}

/* 입력 영역 */
.pdf-quiz-input-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.pdf-quiz-input {
  flex: 1;
  font-family: var(--font-main);
  font-size: 1rem;
  padding: 0.7rem 1rem;
  background: rgba(11, 16, 38, 0.92);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--sand);
  outline: none;
  transition: border-color 0.2s ease;
}

.pdf-quiz-input:focus {
  border-color: var(--gold);
}

.pdf-quiz-input::placeholder {
  color: var(--sand-muted);
}

.pdf-quiz-submit {
  min-width: 80px;
}

/* 결과 피드백 */
.pdf-quiz-feedback {
  padding: 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  animation: fadeIn 0.2s ease;
}

.pdf-quiz-feedback.correct {
  background: rgba(123, 198, 126, 0.15);
  border: 1px solid rgba(123, 198, 126, 0.4);
  color: var(--sage);
}

.pdf-quiz-feedback.wrong {
  background: rgba(232, 93, 117, 0.15);
  border: 1px solid rgba(232, 93, 117, 0.4);
  color: var(--rose);
}

.pdf-quiz-feedback .correct-answer {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--sand-dark);
}

/* 오답 시 확인 버튼 */
.pdf-quiz-confirm-btn {
  display: block;
  margin: 0.75rem auto 0;
  min-width: 100px;
}

/* 퀴즈 완료 */
.pdf-quiz-complete {
  text-align: center;
  padding: 1rem 0;
  animation: fadeIn 0.3s ease;
}

.pdf-quiz-complete-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.pdf-quiz-complete-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.pdf-quiz-complete-title.success {
  color: var(--sage);
}

.pdf-quiz-complete-title.retry {
  color: var(--rose);
}

.pdf-quiz-score {
  font-size: 0.9rem;
  color: var(--sand);
  margin-bottom: 1.5rem;
}

/* 로딩 표시 */
.pdf-quiz-loading {
  text-align: center;
  padding: 2rem;
}

.pdf-quiz-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.pdf-quiz-loading-text {
  font-size: 0.9rem;
  color: var(--sand);
}

/* --- review (오답노트) --- */
.pdf-review-section {
  animation: fadeIn 0.3s ease;
}

.pdf-review-topbar {
  margin-bottom: 1rem;
}

.pdf-review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.pdf-review-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
}

.pdf-review-count {
  font-size: 0.8rem;
  color: var(--sand-muted);
}

/* 오답 항목 */
.pdf-wrong-item {
  background: rgba(11, 16, 38, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--card-padding);
  margin-bottom: 0.75rem;
}

.pdf-wrong-item-page {
  font-size: 0.78rem;
  color: var(--sand-muted);
  margin-bottom: 0.4rem;
}

.pdf-wrong-item-sentence {
  font-family: var(--font-reader);
  font-size: 0.92rem;
  color: var(--sand);
  line-height: 1.6;
  margin-bottom: 0.6rem;
}

.pdf-wrong-item-answers {
  display: flex;
  gap: 1rem;
  font-size: 0.82rem;
  flex-wrap: wrap;
}

.pdf-wrong-my-answer {
  color: var(--rose);
}

.pdf-wrong-correct-answer {
  color: var(--sage);
}

/* 오답 없음 */
.pdf-review-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--sand-dark);
}

.pdf-review-empty-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.pdf-review-empty-text {
  font-size: 0.9rem;
}

/* 학습 완료 화면 */
.pdf-complete-section {
  text-align: center;
  padding: 2rem 0;
  animation: fadeIn 0.3s ease;
}

.pdf-complete-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.pdf-complete-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.pdf-complete-stats {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.pdf-complete-stat {
  text-align: center;
}

.pdf-complete-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
}

.pdf-complete-stat-label {
  font-size: 0.75rem;
  color: var(--sand-dark);
  margin-top: 0.2rem;
}

.pdf-complete-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* --- 반응형 --- */
@media (max-width: 768px) {
  .pdf-text-area {
    padding: 1.5rem;
    min-height: 300px;
  }

  .pdf-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .pdf-toolbar-left,
  .pdf-toolbar-right {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .pdf-study-container {
    padding: 0 0.5rem;
  }

  .pdf-text-area {
    padding: 1rem 0.8rem;
    min-height: 250px;
  }

  .pdf-text-content {
    font-size: 16px;
  }

  .pdf-quiz-modal {
    padding: 1.5rem 1rem;
  }

  .pdf-quiz-sentence {
    font-size: 0.95rem;
    padding: 1rem 0.8rem;
  }

  .pdf-nav {
    gap: 0.75rem;
  }

  .pdf-upload-area {
    padding: 1.5rem 1rem;
  }

  .pdf-range-group {
    flex-wrap: wrap;
    justify-content: center;
  }

  .pdf-range-preview-canvas {
    max-width: 120px;
  }
}

/* === 다중 빈칸 입력 === */
.pdf-quiz-inputs-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.pdf-quiz-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pdf-quiz-blank-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold);
  min-width: 1.5rem;
  text-align: center;
}

/* 개별 채점 색상 */
.pdf-quiz-input.input-correct {
  border-color: var(--sage) !important;
  background: rgba(123, 198, 126, 0.1);
}

.pdf-quiz-input.input-wrong {
  border-color: var(--rose) !important;
  background: rgba(232, 93, 117, 0.1);
}

/* === 오답노트 탭 === */
.pdf-review-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.pdf-review-tab {
  flex: 1;
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--sand-dark);
  cursor: pointer;
  transition: all 0.2s ease;
}

.pdf-review-tab:hover {
  border-color: var(--gold);
  color: var(--sand);
}

.pdf-review-tab.active {
  background: rgba(244, 197, 66, 0.12);
  border-color: var(--gold);
  color: var(--gold);
}

/* === 날짜 그룹 === */
.pdf-review-date-group {
  margin-bottom: 1.25rem;
}

.pdf-review-date-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--gold);
}

.pdf-review-date-count {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--sand-muted);
}

.pdf-retry-date-btn {
  margin-left: auto;
  font-size: 0.72rem;
}

/* === 세션 카드 아코디언 === */
.pdf-session-card {
  background: rgba(11, 16, 38, 0.88);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.pdf-session-card.expanded {
  border-color: rgba(244, 197, 66, 0.3);
}

.pdf-session-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
  gap: 0.75rem;
  -webkit-tap-highlight-color: rgba(244, 197, 66, 0.1);
  user-select: none;
}

.pdf-session-card-header:hover {
  background: rgba(244, 197, 66, 0.06);
}

.pdf-session-card-info {
  flex: 1;
  min-width: 0;
}

.pdf-session-card-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--sand);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdf-session-card-meta {
  font-size: 0.75rem;
  color: var(--sand-muted);
  margin-top: 0.15rem;
}

.pdf-session-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.pdf-session-card-toggle {
  font-size: 0.7rem;
  color: var(--sand-dark);
  transition: transform 0.2s ease;
  width: 1rem;
  text-align: center;
}

.pdf-session-card.expanded .pdf-session-card-toggle {
  color: var(--gold);
}

.pdf-session-card-body {
  padding: 0 1rem 0.75rem;
  border-top: 1px solid var(--border);
}

.pdf-session-card-body .pdf-wrong-item:first-child {
  margin-top: 0.5rem;
}

/* === 오답 항목 상단 행 === */
.pdf-wrong-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.pdf-wrong-item-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* 삭제 버튼 */
.pdf-wrong-delete-btn {
  font-size: 0.75rem;
  color: var(--sand-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.1rem 0.35rem;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
}

.pdf-wrong-delete-btn:hover {
  color: var(--rose);
  border-color: var(--rose);
  background: rgba(232, 93, 117, 0.1);
}

/* 해결됨 뱃지 */
.pdf-wrong-resolved-badge {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--sage);
  background: rgba(123, 198, 126, 0.15);
  border: 1px solid rgba(123, 198, 126, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.1rem 0.4rem;
}

/* 해결된 오답 항목 */
.pdf-wrong-item.resolved {
  opacity: 0.6;
  border-color: rgba(123, 198, 126, 0.2);
}

/* 전체 삭제 버튼 */
.pdf-clear-all-btn {
  width: 100%;
  margin-bottom: 1rem;
  color: var(--rose);
  border-color: rgba(232, 93, 117, 0.3);
}

.pdf-clear-all-btn:hover {
  background: rgba(232, 93, 117, 0.1);
  border-color: var(--rose);
}

/* === 다중 빈칸 오답 상세 === */
.pdf-wrong-multi-answer {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.82rem;
}

.pdf-wrong-answer-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.pdf-wrong-my-answer.was-correct {
  color: var(--sage);
  text-decoration: line-through;
  opacity: 0.7;
}

/* === 졸음 감지 토글 버튼 === */
.btn-gold-toggle {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(244, 197, 66, 0.1);
}

.btn-gold-toggle:hover {
  background: rgba(244, 197, 66, 0.2);
}

/* === 플로팅 어린 왕자 아바타 === */
.pdf-little-prince {
  position: fixed;
  bottom: 6rem;
  right: 1.5rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  pointer-events: none;
}

.pdf-lp-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid var(--sage);
  overflow: hidden;
  background: rgba(11, 16, 38, 0.92);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.pdf-lp-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pdf-lp-avatar.lp-warning {
  border-color: var(--amber, #f0a030);
  box-shadow: 0 0 16px rgba(240, 160, 48, 0.4);
  animation: lpPulse 1.5s ease-in-out infinite;
}

.pdf-lp-avatar.lp-alarm {
  border-color: var(--rose);
  box-shadow: 0 0 24px rgba(232, 93, 117, 0.4);
  animation: lpShake 0.3s ease-in-out infinite;
}

@keyframes lpPulse {
  0%, 100% { box-shadow: 0 0 16px rgba(240, 160, 48, 0.3); }
  50% { box-shadow: 0 0 28px rgba(240, 160, 48, 0.6); }
}

@keyframes lpShake {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  25% { transform: translateX(-6px) rotate(-3deg); }
  75% { transform: translateX(6px) rotate(3deg); }
}

.pdf-lp-message {
  font-size: 0.72rem;
  color: var(--sand);
  background: rgba(11, 16, 38, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.5rem;
  white-space: nowrap;
  text-align: center;
}

/* === 수면 알람 오버레이 === */
.pdf-sleep-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(6, 10, 24, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.pdf-sleep-overlay-content {
  text-align: center;
  max-width: 400px;
  padding: 2rem;
}

.pdf-sleep-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  animation: lpShake 0.5s ease-in-out infinite;
}

.pdf-sleep-message {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--rose);
  margin-bottom: 1rem;
}

.pdf-sleep-hint {
  font-size: 0.9rem;
  color: var(--sand-dark);
}

/* === 반응형 === */
@media (max-width: 768px) {
  .pdf-little-prince {
    bottom: 5rem;
    right: 1rem;
  }

  .pdf-lp-avatar {
    width: 52px;
    height: 52px;
  }

  .pdf-lp-message {
    font-size: 0.65rem;
  }
}

/* ══════════════════════════════════════
   모의고사 시스템
   ══════════════════════════════════════ */

/* 모의고사 설정 모달 */
.mock-exam-setup {
  text-align: left;
}

.mock-exam-setup .form-group {
  margin-bottom: 1.2rem;
}

.mock-exam-setup label {
  display: block;
  font-size: 0.85rem;
  color: var(--sand);
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.mock-exam-range-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mock-exam-range-row input[type="number"] {
  width: 80px;
  text-align: center;
}

.mock-exam-count-value {
  color: var(--gold);
  font-weight: 700;
  font-size: 1.1rem;
  margin-left: 0.5rem;
}

/* 모의고사 진행 화면 */
.mock-exam-container {
  max-width: 750px;
  margin: 0 auto;
  padding: 1rem;
  animation: fadeIn 0.3s ease;
}

.mock-exam-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.mock-exam-header-left {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gold);
}

.mock-exam-timer {
  font-size: 0.85rem;
  color: var(--sand-dark);
  font-variant-numeric: tabular-nums;
}

.mock-exam-progress {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  margin-bottom: 1rem;
  overflow: hidden;
}

.mock-exam-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--sage));
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* 문제 번호 그리드 */
.mock-exam-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.2rem;
  justify-content: center;
}

.mock-exam-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  color: var(--sand-dark);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.mock-exam-nav-btn.nav-answered {
  background: rgba(100, 160, 255, 0.2);
  border-color: rgba(100, 160, 255, 0.6);
  color: #8ec5ff;
}

.mock-exam-nav-btn.nav-current {
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 8px rgba(244, 197, 66, 0.3);
}

.mock-exam-nav-btn.nav-unanswered {
  border-color: var(--border);
  color: var(--sand-muted);
}

/* 문제 영역 */
.mock-exam-question {
  background: rgba(11, 16, 38, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  min-height: 200px;
}

.mock-exam-q-number {
  font-size: 0.8rem;
  color: var(--sand-muted);
  margin-bottom: 0.5rem;
}

.mock-exam-q-type-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  margin-left: 0.5rem;
}

.mock-exam-q-type-badge.type-mc { background: rgba(100, 160, 255, 0.15); color: #8ec5ff; }
.mock-exam-q-type-badge.type-blank { background: rgba(244, 197, 66, 0.15); color: var(--gold); }
.mock-exam-q-type-badge.type-short { background: rgba(123, 198, 126, 0.15); color: var(--sage); }
.mock-exam-q-type-badge.type-essay { background: rgba(200, 140, 255, 0.15); color: #c88cff; }

.mock-exam-q-text {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--sand);
  margin-bottom: 1rem;
  word-break: keep-all;
}

/* 객관식 선택지 */
.mock-exam-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mock-exam-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.92rem;
  color: var(--sand);
}

.mock-exam-option:hover {
  border-color: var(--gold);
  background: rgba(244, 197, 66, 0.05);
}

.mock-exam-option.option-selected {
  border-color: var(--gold);
  background: rgba(244, 197, 66, 0.12);
  color: var(--gold);
}

.mock-exam-option-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  transition: all 0.2s ease;
  position: relative;
}

.mock-exam-option.option-selected .mock-exam-option-radio {
  border-color: var(--gold);
}

.mock-exam-option.option-selected .mock-exam-option-radio::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
}

/* 빈칸/단답형 입력 */
.mock-exam-input {
  width: 100%;
  font-family: var(--font-main);
  font-size: 0.95rem;
  padding: 0.7rem 1rem;
  background: rgba(11, 16, 38, 0.92);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--sand);
  outline: none;
  transition: border-color 0.2s ease;
}

.mock-exam-input:focus {
  border-color: var(--gold);
}

/* 서술형 텍스트 영역 */
.mock-exam-textarea {
  width: 100%;
  min-height: 120px;
  font-family: var(--font-main);
  font-size: 0.92rem;
  line-height: 1.6;
  padding: 0.8rem 1rem;
  background: rgba(11, 16, 38, 0.92);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--sand);
  outline: none;
  resize: vertical;
  transition: border-color 0.2s ease;
}

.mock-exam-textarea:focus {
  border-color: var(--gold);
}

.mock-exam-char-count {
  font-size: 0.75rem;
  color: var(--sand-muted);
  text-align: right;
  margin-top: 0.3rem;
}

/* 이전/다음 화살표 버튼 — 노란색 */
.mock-exam-nav-arrow {
  background: var(--gold, #f0a030) !important;
  color: #1a1a2e !important;
  border: none !important;
  font-weight: 700;
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-sm, 6px);
  transition: background 0.15s, transform 0.1s;
}
.mock-exam-nav-arrow:hover:not(:disabled) {
  background: #e6960a !important;
  transform: translateY(-1px);
}
.mock-exam-nav-arrow:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* 제출 영역 (문제 위쪽) */
.mock-exam-submit-area {
  text-align: center;
  margin-bottom: 0.75rem;
}
.mock-exam-submit-area.mock-exam-submit-complete {
  background: rgba(123, 198, 126, 0.12);
  border: 1px solid rgba(123, 198, 126, 0.4);
  border-radius: var(--radius-sm, 6px);
  padding: 0.75rem 1rem;
  animation: fadeIn 0.3s ease;
}
.mock-exam-complete-msg {
  font-weight: 600;
  color: var(--sage, #7bc67e);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

/* 하단 버튼 */
.mock-exam-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

/* 결과 화면 */
.mock-exam-result {
  text-align: center;
  padding: 1.5rem 0;
  animation: fadeIn 0.3s ease;
}

.mock-exam-score {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
  margin: 0.75rem 0 0.25rem;
}

.mock-exam-score-sub {
  font-size: 0.9rem;
  color: var(--sand-dark);
  margin-bottom: 1.5rem;
}

.mock-exam-breakdown {
  width: 100%;
  max-width: 400px;
  margin: 0 auto 1.5rem;
  text-align: left;
}

.mock-exam-breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.88rem;
}

.mock-exam-breakdown-label {
  color: var(--sand);
}

.mock-exam-breakdown-value {
  color: var(--gold);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* 오답 확인 항목 */
.mock-exam-wrong-item {
  background: rgba(11, 16, 38, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--card-padding);
  margin-bottom: 0.75rem;
  text-align: left;
}

.mock-exam-wrong-type {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--sand-muted);
  margin-bottom: 0.4rem;
}

.mock-exam-wrong-q {
  font-size: 0.92rem;
  color: var(--sand);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.mock-exam-wrong-detail {
  font-size: 0.82rem;
  line-height: 1.5;
}

.mock-exam-wrong-detail .my-answer {
  color: var(--rose);
}

.mock-exam-wrong-detail .correct-answer {
  color: var(--sage);
}

.mock-exam-wrong-detail .ai-feedback {
  color: var(--sand-dark);
  font-style: italic;
  margin-top: 0.3rem;
}

/* 준비중 뱃지 */
.mock-exam-badge {
  display: inline-block;
  animation: mockExamPulse 1.5s ease-in-out infinite;
}

@keyframes mockExamPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* 채점 중 오버레이 */
.mock-exam-grading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 24, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.mock-exam-grading-text {
  font-size: 1rem;
  color: var(--sand);
  margin-top: 1rem;
}

/* 빈칸 문장 (모의고사 내) */
.mock-exam-blank-sentence {
  font-family: var(--font-reader);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--sand);
  background: rgba(37, 48, 82, 0.3);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1rem;
  word-break: keep-all;
}

/* 반응형 */
@media (max-width: 768px) {
  .mock-exam-container {
    padding: 0.5rem;
  }

  .mock-exam-question {
    padding: 1rem;
  }

  .mock-exam-nav-btn {
    width: 28px;
    height: 28px;
    font-size: 0.65rem;
  }

  .mock-exam-footer {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .mock-exam-score {
    font-size: 1.6rem;
  }

  .mock-exam-option {
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
  }
}

/* === 인라인 스타일 대체 클래스 === */

.pdf-upload-card { margin-bottom: 1rem; }
.pdf-upload-desc { font-size: 0.85rem; line-height: 1.5; margin-bottom: 1rem; }
.pdf-range-form-group { margin-top: 1rem; }
.btn-full-width { width: 100%; }
.pdf-upload-bottom-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.pdf-upload-bottom-actions .btn { flex: 1; }
.pdf-quiz-submit-full { width: 100%; margin-bottom: 1rem; }
.pdf-quiz-btn-full { width: 100%; }
.pdf-quiz-btn-mb { margin-bottom: 0.5rem; }
.pdf-quiz-hint-text {
  font-size: 0.85rem;
  color: var(--sand-dark);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}
.pdf-quiz-header-relative { position: relative; }

/* 객관식 라디오 옵션 */
.pdf-quiz-options-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.pdf-quiz-option-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  font-size: 0.9rem;
  color: var(--sand);
}
.pdf-quiz-option-label:hover {
  background: rgba(244, 197, 66, 0.06);
  border-color: var(--amber);
}
.pdf-quiz-radio {
  accent-color: var(--amber);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.pdf-quiz-option-text { flex: 1; }

/* 서술형 자기채점 */
.retry-self-grade {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--sand-muted);
}
.pdf-quiz-feedback.info {
  background: rgba(244, 197, 66, 0.08);
  border-color: rgba(244, 197, 66, 0.3);
  color: var(--sand);
}
.mock-exam-result-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 0.5rem;
}
.mock-exam-breakdown-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--sand);
  margin-bottom: 0.5rem;
}
.mock-exam-wrong-section {
  max-width: 600px;
  margin: 0 auto;
}
.mock-exam-wrong-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--rose);
  margin-bottom: 0.75rem;
  text-align: left;
}
.mock-exam-ai-score {
  color: var(--gold);
  font-size: 0.8rem;
}
.pdf-complete-wrong-card {
  text-align: left;
  margin-bottom: 1rem;
}

/* === 오답노트 모바일 최적화 === */
@media (max-width: 768px) {
  .pdf-review-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
  }

  .pdf-review-tabs {
    gap: 0.4rem;
  }

  .pdf-review-tab {
    padding: 0.55rem 0.5rem;
    font-size: 0.8rem;
    min-height: 44px;
  }

  .pdf-session-card-header {
    padding: 0.65rem 0.75rem;
    min-height: 44px;
  }

  .pdf-session-card-title {
    font-size: 0.84rem;
  }

  .pdf-session-card-meta {
    font-size: 0.72rem;
  }

  .pdf-session-card-body {
    padding: 0 0.75rem 0.6rem;
  }

  .pdf-session-card-body .pdf-wrong-item {
    padding: 0.75rem;
  }

  .pdf-review-date-header {
    font-size: 0.82rem;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .pdf-retry-date-btn,
  .pdf-retry-session-btn {
    min-height: 36px;
    min-width: 44px;
    font-size: 0.72rem;
  }
}

@media (max-width: 480px) {
  .pdf-review-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
  }

  .pdf-review-tab {
    padding: 0.5rem 0.4rem;
    font-size: 0.76rem;
  }

  .pdf-session-card {
    margin-bottom: 0.6rem;
    border-radius: 8px;
  }

  .pdf-session-card-header {
    padding: 0.6rem 0.65rem;
    gap: 0.5rem;
  }

  .pdf-session-card-title {
    font-size: 0.8rem;
  }

  .pdf-session-card-meta {
    font-size: 0.68rem;
  }

  .pdf-session-card-actions {
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .pdf-session-card-body {
    padding: 0 0.5rem 0.5rem;
  }

  .pdf-session-card-body .pdf-wrong-item {
    padding: 0.6rem 0.5rem;
    margin-bottom: 0.5rem;
  }

  .pdf-session-card-body .pdf-wrong-item-page {
    font-size: 0.72rem;
  }

  .pdf-session-card-body .pdf-wrong-item-sentence {
    font-size: 0.85rem;
  }

  .pdf-wrong-resolved-badge {
    font-size: 0.62rem;
    padding: 0.08rem 0.3rem;
  }

  .pdf-wrong-delete-btn {
    min-width: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .pdf-review-date-header {
    font-size: 0.78rem;
    padding: 0.4rem 0;
  }

  .pdf-review-date-count {
    font-size: 0.68rem;
  }

  .pdf-wrong-item-answers,
  .pdf-wrong-multi-answer {
    font-size: 0.78rem;
  }

  .pdf-wrong-answer-row {
    gap: 0.4rem;
  }
}

/* === 시험 연결 영역 (업로드 단계) === */
.pdf-exam-link-section {
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  background: rgba(123, 198, 126, 0.06);
  border: 1px solid rgba(123, 198, 126, 0.2);
  border-radius: var(--radius);
}

.pdf-exam-link-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.pdf-exam-link-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--sage);
}

.pdf-exam-link-empty {
  font-size: 0.78rem;
  color: var(--sand-dark);
  line-height: 1.6;
  padding: 0.3rem 0;
}

.pdf-exam-link-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.pdf-exam-link-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--sand);
  cursor: pointer;
  padding: 0.25rem 0;
}

.pdf-exam-link-check {
  accent-color: var(--sage);
}

/* === 간격 반복 복습 탭 === */
.pdf-spaced-meta {
  font-size: 0.75rem;
  color: var(--sage);
  font-weight: 500;
}

.pdf-spaced-review-actions {
  margin-top: 1rem;
  text-align: center;
}

/* 시험별 진행률 바 (복습 탭) */
.pdf-spaced-exam-stats {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.3rem 0.8rem 0.5rem;
}

.pdf-spaced-exam-bar {
  flex: 1;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.pdf-spaced-exam-bar-fill {
  height: 100%;
  background: var(--sage);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.pdf-spaced-exam-stat-text {
  font-size: 0.72rem;
  color: var(--sand-dark);
  white-space: nowrap;
}

/* === 간격복습 결과 상세 === */
.sr-result-summary {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin: 0.5rem 0;
}

.sr-result-stat {
  font-size: 0.9rem;
  color: var(--sand-muted);
}

.sr-stat-correct {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--sage);
  margin-right: 0.2rem;
}

.sr-stat-wrong {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--rose, #e74c6f);
  margin-right: 0.2rem;
}

.sr-result-list-wrap {
  margin-top: 0.5rem;
  text-align: center;
}

.sr-result-toggle {
  font-size: 0.78rem;
}

.sr-result-list {
  margin-top: 0.5rem;
  max-height: 40vh;
  overflow-y: auto;
  text-align: left;
}

.sr-result-item {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sr-result-item.sr-result-wrong {
  background: rgba(231, 76, 111, 0.05);
}

.sr-result-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
}

.sr-result-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.sr-result-icon.sr-correct {
  background: rgba(123, 198, 126, 0.2);
  color: var(--sage);
}

.sr-result-icon.sr-wrong {
  background: rgba(231, 76, 111, 0.2);
  color: var(--rose, #e74c6f);
}

.sr-result-num {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--sand-muted);
}

.sr-result-file {
  font-size: 0.68rem;
  color: var(--sand-muted);
  margin-left: auto;
  max-width: 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sr-result-question {
  font-size: 0.8rem;
  color: var(--sand-light);
  line-height: 1.4;
}

.sr-result-answer {
  font-size: 0.78rem;
  color: var(--sage);
  margin-top: 0.2rem;
}

/* === 시험오답 버튼 === */
.pdf-review-header-left {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.paper-exam-btn {
  white-space: nowrap;
  font-size: 0.78rem;
}

/* === 시험오답 오버레이 === */
.paper-exam-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  padding: 1rem;
}

.paper-exam-modal {
  background: var(--card-bg, #141a3a);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.paper-exam-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.paper-exam-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
}

.paper-exam-close-btn {
  background: none;
  border: none;
  color: var(--sand-muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}
.paper-exam-close-btn:hover { color: var(--text); }

.paper-exam-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
}

/* Step 1: 업로드 영역 */
.paper-exam-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.paper-exam-upload-area:hover,
.paper-exam-upload-area.dragover {
  border-color: var(--gold);
  background: rgba(240, 160, 48, 0.05);
}

.paper-exam-upload-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.paper-exam-upload-text {
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.paper-exam-upload-hint {
  font-size: 0.75rem;
  color: var(--sand-muted);
}

/* Step 2: 파싱 진행 */
.paper-exam-loading {
  text-align: center;
  padding: 2rem 0;
}

.paper-exam-loading-text {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--sand-muted);
}

.paper-exam-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(11, 16, 38, 0.92);
  border-radius: var(--radius-sm);
}

.paper-exam-file-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.paper-exam-page-count {
  font-size: 0.78rem;
  color: var(--sand-muted);
}

.paper-exam-progress-section {
  margin-top: 0.5rem;
}

.paper-exam-progress-label {
  font-size: 0.8rem;
  color: var(--sand-muted);
  margin-bottom: 0.5rem;
}

.paper-exam-progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.paper-exam-progress-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* 에러 */
.paper-exam-error {
  text-align: center;
  padding: 2rem 0;
  color: var(--sand-muted);
}

.paper-exam-error-hint {
  font-size: 0.78rem;
  margin: 0.5rem 0 1rem;
  color: var(--sand-muted);
}

/* Step 3: 문제 목록 */
.paper-exam-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.paper-exam-result-count {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.paper-exam-select-all {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--sand-muted);
  cursor: pointer;
}

.paper-exam-question-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 50vh;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.paper-exam-question-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem;
  background: rgba(11, 16, 38, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s;
}
.paper-exam-question-item:hover {
  border-color: var(--gold);
}

.paper-exam-question-item input[type="checkbox"] {
  margin-top: 0.15rem;
  flex-shrink: 0;
  accent-color: var(--gold);
}

.paper-exam-question-content {
  flex: 1;
  min-width: 0;
}

.paper-exam-question-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
}

.paper-exam-q-num {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold);
}

.paper-exam-q-type {
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  background: rgba(240, 160, 48, 0.15);
  color: var(--gold);
  border-radius: 4px;
}

.paper-exam-q-page {
  font-size: 0.7rem;
  color: var(--sand-muted);
}

.paper-exam-question-text {
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.4;
  word-break: break-word;
}

.paper-exam-options-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.8rem;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--sand-muted);
}

.paper-exam-answer-preview {
  margin-top: 0.3rem;
  font-size: 0.75rem;
  color: var(--sage);
}

/* Step 4: 저장 */
.paper-exam-actions {
  margin-top: 1rem;
  text-align: center;
}

.paper-exam-save-btn {
  width: 100%;
  padding: 0.65rem;
}

/* === 교과서 회독 === */

/* upload 단계 — 교과서 선택 */
.pdf-textbook-section {
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  background: rgba(240, 160, 48, 0.06);
  border: 1px solid rgba(240, 160, 48, 0.2);
  border-radius: var(--radius);
}

.pdf-textbook-header {
  margin-bottom: 0.5rem;
}

.pdf-textbook-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--amber);
}

.pdf-textbook-select-group select {
  width: 100%;
  font-size: 0.85rem;
}

/* 교과서 정보 카드 */
.tb-info-card {
  margin-top: 0.6rem;
  padding: 0.6rem 0.8rem;
  background: rgba(240, 160, 48, 0.08);
  border-radius: calc(var(--radius) - 2px);
}

.tb-info-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.tb-info-subject {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--amber);
  background: rgba(240, 160, 48, 0.15);
  padding: 0.1rem 0.5rem;
  border-radius: 10px;
}

.tb-info-count {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--amber);
}

/* 마일스톤 뱃지 */
.tb-info-milestones {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.tb-milestone {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--sand-dark);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s;
}

.tb-milestone--cleared {
  background: rgba(240, 160, 48, 0.2);
  color: var(--amber);
  border-color: var(--amber);
}

.tb-milestone--sm {
  font-size: 0.65rem;
  padding: 0.08rem 0.35rem;
}

/* 프로그레스 바 */
.tb-info-progress {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tb-info-progress-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.tb-info-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--amber), #f0c060);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.tb-info-remaining {
  font-size: 0.72rem;
  color: var(--sand-dark);
  white-space: nowrap;
}

.tb-info-remaining--done {
  color: var(--amber);
  font-weight: 600;
}

/* 완료 화면 — 회독 카드 */
.tb-complete-card {
  margin-bottom: 1rem;
  border: 1px solid rgba(240, 160, 48, 0.25);
  background: rgba(240, 160, 48, 0.06);
}

.tb-complete-card--milestone {
  border-color: var(--amber);
  background: rgba(240, 160, 48, 0.12);
  animation: tbCelebrate 0.6s ease;
}

@keyframes tbCelebrate {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); opacity: 1; }
}

.tb-milestone-celebrate {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--amber);
  margin-bottom: 0.5rem;
  animation: tbCelebratePulse 1.5s ease infinite;
}

@keyframes tbCelebratePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; transform: scale(1.03); }
}

.tb-complete-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.tb-complete-name {
  flex: 1;
  font-size: 0.88rem;
  color: var(--sand);
}

/* === 회독 인정 힌트 === */
.tb-info-reading-hint {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  line-height: 1.4;
}

.tb-reading-hint--ok {
  color: var(--sage);
  background: rgba(123, 198, 126, 0.08);
}

.tb-reading-hint--warn {
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.08);
  font-weight: 600;
}

/* === 회독 미인정 카드 === */
.tb-complete-card--denied {
  border-color: rgba(231, 76, 60, 0.3);
  background: rgba(231, 76, 60, 0.06);
  text-align: center;
  padding: 1rem;
}

.tb-denied-icon {
  font-size: 1.5rem;
  margin-bottom: 0.3rem;
}

.tb-denied-text {
  font-size: 0.9rem;
  font-weight: 700;
  color: #e74c3c;
  margin-bottom: 0.2rem;
}

.tb-denied-detail {
  font-size: 0.78rem;
  color: var(--sand-dark);
}

/* === 오픈북 정답 하이라이트 === */
.pdf-quiz-sentence-highlight {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--sand);
  background: rgba(255, 255, 255, 0.04);
  border-left: 2px solid rgba(244, 197, 66, 0.3);
  border-radius: 0 4px 4px 0;
}

.answer-sparkle {
  background: none;
  color: var(--gold);
  font-weight: 700;
  text-shadow: 0 0 8px rgba(244, 197, 66, 0.6), 0 0 16px rgba(244, 197, 66, 0.3);
  animation: sparkle-pulse 1.5s ease-in-out infinite;
  border-radius: 2px;
  padding: 0 2px;
}

@keyframes sparkle-pulse {
  0%, 100% { text-shadow: 0 0 8px rgba(244, 197, 66, 0.6), 0 0 16px rgba(244, 197, 66, 0.3); }
  50% { text-shadow: 0 0 16px rgba(244, 197, 66, 0.9), 0 0 32px rgba(244, 197, 66, 0.5), 0 0 48px rgba(244, 197, 66, 0.2); }
}

.answer-sparkle--correct {
  color: var(--sage);
  text-shadow: 0 0 6px rgba(123, 198, 126, 0.4);
  animation: none;
}

/* === 오답 피드백 카드 === */
.quiz-feedback-card {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm, 8px);
  border-left: 3px solid var(--rose);
  background: rgba(232, 93, 117, 0.08);
}
.quiz-feedback-card.correct {
  border-left-color: var(--sage);
  background: rgba(123, 198, 126, 0.08);
}
.feedback-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--sand);
  margin-bottom: 0.5rem;
}
.feedback-icon { font-size: 1.1rem; }
.feedback-answer {
  font-size: 0.85rem;
  color: var(--sand);
  margin-bottom: 0.5rem;
  line-height: 1.6;
}
.my-answer { color: var(--rose); }
.correct-answer { color: var(--sage); }
.feedback-explain {
  font-size: 0.82rem;
  color: rgba(236, 232, 225, 0.7);
  line-height: 1.6;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.feedback-loading {
  color: rgba(236, 232, 225, 0.5);
  font-style: italic;
}
.feedback-explain-text {
  white-space: pre-wrap;
}
.feedback-reason,
.feedback-concept,
.feedback-tip {
  margin-bottom: 0.4rem;
  line-height: 1.6;
}
.feedback-reason strong,
.feedback-concept strong,
.feedback-tip strong {
  color: var(--sand);
}
.feedback-reason { color: var(--rose); }
.feedback-concept { color: rgba(236, 232, 225, 0.8); }
.feedback-tip { color: var(--gold); }

/* === 퀴즈 결과 요약 원형 차트 === */
.quiz-result-summary {
  text-align: center;
  padding: 1rem 0.5rem;
}
.result-score-circle {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 1rem;
}
.result-score-circle svg {
  width: 100%;
  height: 100%;
}
.result-circle-progress {
  transition: stroke-dasharray 0.8s ease;
}
.result-score-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
}
.result-details {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
  font-size: 0.82rem;
}
.result-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}
.result-row span { color: rgba(236, 232, 225, 0.5); }
.result-row strong { color: var(--sand); font-size: 1rem; }
.result-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* === 오답 목록 (퀴즈 결과 하단) === */
.quiz-wrong-list {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: var(--night-card-70);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: left;
  max-height: 200px;
  overflow-y: auto;
}
.wrong-list-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--rose);
  margin-bottom: 0.5rem;
}
.wrong-item {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 0.82rem;
}
.wrong-item:last-child { border-bottom: none; }
.wrong-q { color: var(--sand); margin-bottom: 0.25rem; }
.wrong-a { line-height: 1.5; }
.wrong-a .wrong { color: var(--rose); text-decoration: line-through; opacity: 0.8; }
.wrong-a .correct { color: var(--sage); font-weight: 600; }

/* === AI 오답 분석 피드백 카드 === */
.wrong-feedback-card {
  margin-top: 0.75rem;
  padding: 1rem;
  background: rgba(244, 197, 66, 0.06);
  border: 1px solid rgba(244, 197, 66, 0.2);
  border-radius: var(--radius-sm, 8px);
}
.wrong-feedback-card strong {
  color: var(--gold);
  font-size: 0.82rem;
}
.wrong-feedback-card p {
  color: var(--sand);
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 0.3rem 0 0.8rem;
}
.wrong-feedback-loading {
  color: var(--sand-muted, rgba(236, 232, 225, 0.5));
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem;
}
.study-tip {
  background: rgba(123, 198, 126, 0.08);
  border-radius: var(--radius-xs, 4px);
  padding: 0.5rem 0.75rem;
}
.study-tip strong { color: var(--sage); }
.ai-analyze-btn {
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  background: rgba(244, 197, 66, 0.1);
  border: 1px solid rgba(244, 197, 66, 0.3);
  color: var(--gold);
  border-radius: var(--radius-xs, 4px);
  cursor: pointer;
  font-family: var(--font-main);
  transition: background 0.2s;
  margin-top: 0.5rem;
}
.ai-analyze-btn:hover { background: rgba(244, 197, 66, 0.2); }
.ai-analyze-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* === reduced-motion === */
@media (prefers-reduced-motion: reduce) {
  .pdf-lp-avatar.lp-warning,
  .pdf-lp-avatar.lp-alarm,
  .pdf-sleep-icon,
  .mock-exam-badge,
  .tb-complete-card--milestone,
  .tb-milestone-celebrate,
  .answer-sparkle,
  .result-circle-progress {
    animation: none;
    transition: none;
  }
}
