/* 단어 공부 학생 화면 — 북퀴즈(quiz.user.css)의 .qz 토큰·버튼·카드를 그대로 쓰고, 단어 학습 전용만 여기 */

/* 레슨 목록 */
.vc-lessons { display: flex; flex-direction: column; gap: 12px; }
.vc-lesson { border: 1px solid var(--qz-line); border-radius: 18px; padding: 16px 18px; background: #fff; }
.vc-lesson-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.vc-lesson-head b { font-size: 1.05rem; }
.vc-lesson-head .qz-muted { font-size: .85rem; }
.vc-steps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-bottom: 14px; }
.vc-step { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 12px; background: var(--qz-soft); color: var(--qz-sub); font-size: .78rem; font-weight: 600; line-height: 1.2; text-align: center; }
.vc-step .ic { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #fff; color: #a3a9b6; font-size: .75rem; font-weight: 800; }
.vc-step.done { background: #eef2ff; color: var(--qz-ac); }
.vc-step.done .ic { background: linear-gradient(135deg, var(--qz-ac), var(--qz-ac2)); color: #fff; }
.vc-step .sc { font-size: .72rem; color: var(--qz-sub); font-weight: 500; }
.vc-lesson-btns { display: flex; gap: 8px; }
.vc-lesson-btns .qz-btn { flex: 1; }

/* 학습 화면 상단: 단계 표시 + 시간 + 진행 */
.vc-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.vc-top .lesson { font-weight: 700; margin-right: auto; }
.vc-top .meta { display: inline-flex; gap: 12px; align-items: center; font-size: .9rem; color: var(--qz-sub); font-variant-numeric: tabular-nums; }
.vc-top .meta b { color: var(--qz-ink); }
.vc-stepper { display: flex; gap: 6px; margin: 12px 0 4px; overflow-x: auto; }
.vc-stepper button { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 12px; border: 1px solid var(--qz-line); border-radius: 999px; background: #fff; font: inherit; font-size: .85rem; font-weight: 600; color: var(--qz-sub); cursor: pointer; white-space: nowrap; }
.vc-stepper button .n { width: 20px; height: 20px; border-radius: 50%; background: var(--qz-soft); display: inline-flex; align-items: center; justify-content: center; font-size: .72rem; }
.vc-stepper button.done .n { background: #dcfce7; color: var(--qz-ok); }
.vc-stepper button.on { border-color: transparent; background: linear-gradient(135deg, var(--qz-ac), var(--qz-ac2)); color: #fff; }
.vc-stepper button.on .n { background: rgba(255,255,255,.25); color: #fff; }

/* 단계 시작 안내 */
.vc-intro { text-align: center; padding: 26px 10px 10px; }
.vc-intro .badge { display: inline-flex; width: 64px; height: 64px; border-radius: 20px; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--qz-ac), var(--qz-ac2)); color: #fff; font-size: 1.6rem; font-weight: 800; margin-bottom: 14px; }
.vc-intro h2 { margin: 0 0 6px; font-size: 1.4rem; font-weight: 800; }
.vc-intro p { margin: 0 0 20px; color: var(--qz-sub); }

/* 문항 */
.vc-ask { margin: 6px 0 14px; font-size: .95rem; color: var(--qz-sub); font-weight: 600; }
.vc-stage { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 12px 22px; margin-bottom: 18px; border-radius: 18px; background: var(--qz-soft); text-align: center; }
.vc-stage .img { width: 150px; height: 110px; object-fit: contain; border-radius: 12px; background: #fff; }
.vc-word-row { display: inline-flex; align-items: center; gap: 12px; }
.vc-word { font-size: clamp(2rem, 6vw, 3rem); font-weight: 800; letter-spacing: -.01em; line-height: 1.15; }
.vc-mean { font-size: clamp(1.3rem, 4vw, 1.8rem); font-weight: 700; }
.vc-ko { font-size: .95rem; color: var(--qz-sub); }
.vc-sent { font-size: clamp(1.15rem, 3.4vw, 1.5rem); font-weight: 600; line-height: 1.6; }
.vc-blank { display: inline-block; min-width: 4.5em; border-bottom: 3px solid var(--qz-ac); color: var(--qz-ac); padding: 0 4px; }
.vc-def { font-size: .85rem; color: var(--qz-sub); font-style: italic; }

/* 단어 카드 (Vocabulary — 문제 전 학습, 누르면 뒤집혀 뜻) */
.vc-flip { perspective: 1200px; width: min(440px, 100%); height: 300px; margin: 4px auto 18px; cursor: pointer; outline: none; }
.vc-flip-in { position: relative; width: 100%; height: 100%; transition: transform .6s cubic-bezier(.3,.7,.3,1); transform-style: preserve-3d; }
.vc-flip.on .vc-flip-in { transform: rotateY(180deg); }
.vc-face { position: absolute; inset: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; border-radius: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 22px; text-align: center; box-shadow: 0 10px 30px rgba(17,24,39,.10); }
.vc-face.front { background: #fff; border: 1px solid var(--qz-line); }
.vc-face.back { transform: rotateY(180deg); background: linear-gradient(135deg, #eef2ff, #f5f3ff); border: 1px solid #c7d2fe; }
.vc-face .img { width: 150px; height: 110px; object-fit: contain; }
.vc-tap { font-size: .8rem; color: var(--qz-sub); }
.vc-ex { font-size: 1.05rem; color: var(--qz-sub); line-height: 1.5; }
.vc-card-btns { display: flex; align-items: center; justify-content: center; gap: 12px; }
@media (prefers-reduced-motion: reduce) { .vc-flip-in { transition: none; } }

/* 보기 상태 */
.qz-choice.ok { border-color: var(--qz-ok); background: #f0fdf4; }
.qz-choice.ok .n { background: var(--qz-ok); color: #fff; }
.qz-choice.ng { border-color: var(--qz-ng); background: #fef2f2; opacity: .7; animation: vc-shake .3s; }
.qz-choice.ng .n { background: var(--qz-ng); color: #fff; }
.qz-choice:disabled { cursor: default; }
@keyframes vc-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* 철자 */
.vc-type { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
.vc-type input { width: min(420px, 100%); height: 58px; padding: 0 18px; border: 2px solid var(--qz-line); border-radius: 14px; font: inherit; font-size: 1.5rem; font-weight: 700; text-align: center; letter-spacing: .04em; outline: none; background: #fff; }
.vc-type input:focus { border-color: var(--qz-ac); box-shadow: 0 0 0 4px rgba(99,102,241,.12); }
.vc-type input.ok { border-color: var(--qz-ok); background: #f0fdf4; }
.vc-type input.ng { border-color: var(--qz-ng); background: #fef2f2; animation: vc-shake .3s; }
.vc-tiles { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.vc-tiles button { min-width: 46px; height: 46px; padding: 0 10px; border: 1px solid var(--qz-line); border-radius: 12px; background: #fff; font: inherit; font-size: 1.3rem; font-weight: 700; cursor: pointer; box-shadow: 0 2px 0 rgba(17,24,39,.06); }
.vc-tiles button:hover { border-color: #c7d2fe; background: #fafbff; }
.vc-tiles button:disabled { opacity: .25; cursor: default; }
.vc-hint { margin-top: 12px; font-size: 1.05rem; color: var(--qz-ng); font-weight: 700; min-height: 1.4em; text-align: center; }
.vc-hint.ok { color: var(--qz-ok); }

/* 하단 */
.vc-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; }
.vc-foot .qz-btn.primary[hidden] { display: none; }

/* 단계 결과 */
.vc-result-table { width: 100%; max-width: 620px; margin: 0 auto 20px; border-collapse: collapse; font-size: .92rem; }
.vc-result-table th { color: var(--qz-sub); font-weight: 600; font-size: .8rem; padding: 8px; border-bottom: 1px solid var(--qz-line); }
.vc-result-table td { padding: 10px 8px; border-bottom: 1px solid var(--qz-line); text-align: center; font-weight: 700; }
.vc-result-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* 인쇄 (print.blade / report.blade) */
body.vc-print-body { margin: 0; background: #f4f5fb; font-family: "Pretendard", -apple-system, "Malgun Gothic", sans-serif; }
.vc-print { --qz-ac: #6366f1; --qz-ac2: #8b5cf6; --qz-ink: #1f2430; --qz-soft: #f4f5fb; --qz-ok: #16a34a; --qz-ng: #dc2626; max-width: 860px; margin: 24px auto; background: #fff; border-radius: 22px; box-shadow: 0 2px 12px rgba(17,24,39,.08); padding: 32px 36px; color: #1f2430; }
.vc-print h1 { margin: 0 0 4px; font-size: 24px; text-align: center; }
.vc-print .info { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: #5b6373; font-size: 13px; line-height: 1.7; margin: 14px 0 16px; }
.vc-print table { width: 100%; border-collapse: collapse; font-size: 14px; }
.vc-print th { background: #f4f5fb; color: #5b6373; font-weight: 600; font-size: 12px; padding: 8px; border: 1px solid rgba(31,36,48,.1); }
.vc-print td { padding: 10px 8px; border: 1px solid rgba(31,36,48,.1); vertical-align: top; }
.vc-print td.w { font-weight: 800; font-size: 15px; }
.vc-print .def { color: #5b6373; font-size: 12px; font-style: italic; }
.vc-print .foot { display: flex; justify-content: center; gap: 10px; margin-top: 24px; }
@media print {
  body.vc-print-body { background: #fff; }
  .vc-print { box-shadow: none; margin: 0; padding: 0; border-radius: 0; }
  .vc-print .foot { display: none; }
}

@media (max-width: 860px) {
  .vc-steps { gap: 4px; }
  .vc-step { font-size: .7rem; }
  .vc-stepper button .t { display: none; }
}
.vc-intro .badge svg { width: 30px; height: 30px; }

/* Listening (2단계) — 글자 없이 큰 스피커, 맞히면 그림·단어·뜻 공개 */
.vc-listen-big { display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 150px; }
.vc-listen-btn { width: 96px; height: 96px; border-radius: 50%; border: none; background: linear-gradient(135deg, var(--qz-ac), var(--qz-ac2)); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 10px 26px rgba(99,102,241,.35); transition: transform .12s; }
.vc-listen-btn:hover { transform: scale(1.05); }
.vc-listen-btn:active { transform: scale(.97); }
.vc-reveal { display: flex; flex-direction: column; align-items: center; gap: 10px; animation: qz-pop .2s ease-out; }

/* 휴대폰 세로: 레슨 단계 6칸을 3칸 × 2줄로 (단계 이름이 겹치지 않게) */
.vc-step { min-width: 0; }
@media (max-width: 600px) {
  .vc-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .vc-step { font-size: .78rem; padding: 8px 4px; }
  .vc-lesson { padding: 14px; }
}

/* 학습 화면 단계 표시: 번호는 항상 보이고, 완료한 단계는 번호 동그라미가 초록 */
/* 휴대폰: 가로 스크롤 대신 6칸을 한 줄에 고르게 (단계 이름은 숨기고 번호만) */
@media (max-width: 860px) {
  .vc-stepper { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; overflow: visible; }
  .vc-stepper button { min-width: 0; min-height: 40px; padding: 0; }
  .vc-stepper button .n { width: 24px; height: 24px; font-size: .8rem; }
}

/* 단계 박스 높이 통일 — 점수 줄이 있는 Test 칸에 맞춰 모든 줄 같은 높이, 내용은 세로 가운데 */
.vc-steps { grid-auto-rows: 1fr; }
.vc-step { justify-content: center; }

/* 단어 카드 아래 버튼: 글자가 세로로 꺾이지 않게 (좁은 화면에선 버튼 폭을 줄임) */
.vc-card-btns .qz-btn { white-space: nowrap; }
.vc-card-listen { display: inline-flex; align-items: center; gap: 12px; }
/* 휴대폰 세로: 이퀄라이저·스피커는 윗줄 가운데, 이전·다음 카드는 아랫줄 반반 */
@media (max-width: 600px) {
  .vc-card-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .vc-card-btns .vc-card-listen { grid-column: 1 / -1; order: -1; justify-content: center; }
  .vc-card-btns .qz-btn.lg { min-height: 50px; padding: 0 12px; }
}

/* 학습 화면 하단(레슨 목록·다음)과 문제 영역 사이 구분선 */
.vc-foot { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--qz-line); }

/* 휴대폰 세로: 하단 버튼(레슨 목록·다음)은 항상 가운데 정렬 */
@media (max-width: 600px) {
  .vc-foot { justify-content: center; }
}

/* 공부하는 중에는 레슨 목록 버튼을 숨김 — 하단 버튼이 하나도 없으면 줄(구분선)도 숨김 */
.vc-foot .qz-btn[hidden] { display: none; }
.vc-foot:has(#vc-back[hidden]):has(#vc-next[hidden]):has(#vc-pause[hidden]) { display: none; }

/* 단어 카드: 읽기·뒤집기가 끝나면 "다음 카드" 버튼에 은은한 강조 (스페이스로 넘어갈 수 있다는 표시) */
.vc-card-btns .qz-btn.vc-ready { box-shadow: 0 0 0 3px rgba(99,102,241,.35); color: var(--qz-ac); animation: vc-ready-pulse 1.6s ease-in-out infinite; }
.vc-card-btns .qz-btn.primary.vc-ready { color: #fff; }
@keyframes vc-ready-pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(99,102,241,.35); } 50% { box-shadow: 0 0 0 6px rgba(99,102,241,.15); } }
@media (prefers-reduced-motion: reduce) { .vc-card-btns .qz-btn.vc-ready { animation: none; } }

/* 하단 버튼은 PC 에서도 가운데 (공부 중에는 "다음"만, 안내·결과 화면에서는 "레슨 목록"만 보이므로) */
.vc-foot { justify-content: center; }

/* Listening 스피커: 조금 작게 (96 → 76px), 회색 영역 높이도 낮춤 */
.vc-listen-big { min-height: 120px; }
.vc-listen-btn { width: 76px; height: 76px; box-shadow: 0 8px 20px rgba(99,102,241,.3); }
.vc-listen-btn svg { width: 34px; height: 34px; }

/* Listening: 스피커 옆 이퀄라이저를 크게 (소리에 집중하는 단계) */
.vc-listen-big { gap: 20px; }
.vc-listen-big .qz-eq { height: 44px; gap: 5px; }
.vc-listen-big .qz-eq i { width: 7px; height: 10px; border-radius: 4px; }
.vc-listen-big .qz-eq.on i { animation-name: vc-eq-big; }
@keyframes vc-eq-big { 0%, 100% { height: 10px; } 50% { height: 44px; } }
@media (prefers-reduced-motion: reduce) { .vc-listen-big .qz-eq.on i { animation: none; height: 30px; } }

/* 그림: 불러오는 동안 흰 칸 대신 투명하게, 다 받으면 부드럽게 나타남 */
.vc-stage .img, .vc-face .img, .vc-reveal .img { background: transparent; }

/* 휴대폰 세로: 결과 버튼 3개 — "다음 단계"는 윗줄 전체, "레슨 목록·다시 하기"는 아랫줄 반반 */
@media (max-width: 600px) {
  .vc-result-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .vc-result-btns .qz-btn.primary { grid-column: 1 / -1; order: -1; }
}

/* 휴대폰 세로: Application 예문은 한 줄 전체, 이퀄라이저·스피커는 다음 줄 가운데 */
@media (max-width: 600px) {
  .vc-word-row:has(.vc-sent) { display: flex; flex-wrap: wrap; justify-content: center; width: 100%; row-gap: 8px; }
  .vc-word-row .vc-sent { flex: 0 0 100%; }
}

/* 휴대폰 세로: 뜻(Spelling) 줄도 예문처럼 — 뜻은 한 줄 전체, 이퀄라이저·스피커는 다음 줄 가운데 */
@media (max-width: 600px) {
  .vc-word-row:has(.vc-mean) { display: flex; flex-wrap: wrap; justify-content: center; width: 100%; row-gap: 8px; }
  .vc-word-row .vc-mean { flex: 0 0 100%; }
}

/* 단계 시작 안내의 [처음부터] [이어서 하기] — 항상 한 줄에 나란히 (휴대폰 세로는 반반) */
.vc-intro-btns { display: flex; gap: 10px; justify-content: center; }
@media (max-width: 600px) {
  .vc-intro-btns .qz-btn.lg { flex: 1 1 0; min-width: 0; }
}

/* 하단 "다음"·"레슨 목록" 버튼 폭을 넉넉하게 (가운데 정렬이라 폭이 좁으면 빈약해 보임) */
.vc-foot .qz-btn.lg { min-width: 200px; }
@media (max-width: 600px) {
  .vc-foot .qz-btn.lg { min-width: 0; width: 70%; }
}

/* ---- 2026-11-13 모바일 일괄 점검 ---- */
.vc-word, .vc-mean, .vc-print td { overflow-wrap: anywhere; }
@media (max-width: 600px) {
  /* 단어 인쇄·Test 리포트 팝업: 화면 꽉 채우고 표 글자 작게 */
  .vc-print { margin: 0; padding: 20px 14px; border-radius: 0; box-shadow: none; }
  .vc-print h1 { font-size: 20px; }
  .vc-print .info { font-size: 12px; }
  .vc-print table { font-size: 13px; }
  .vc-print th, .vc-print td { padding: 7px 5px; }
  .vc-print td.w { font-size: 14px; }
  /* Test 결과 표 */
  .vc-result-table { font-size: .8rem; }
  .vc-result-table th, .vc-result-table td { padding: 8px 4px; }
  /* 레슨 카드 머리글이 길 때 */
  .vc-lesson-head { flex-wrap: wrap; }
}

/* 브라우저 TTS 로 읽었을 때 듣기 버튼 오른쪽 아래 작은 t */
#vc-listen { position: relative; }
#vc-listen.is-tts::after { content: "t"; position: absolute; right: 8px; bottom: 6px; font-size: 11px; font-weight: 700; line-height: 1; color: currentColor; opacity: .8; }
.vc-listen-btn#vc-listen.is-tts::after { right: 22px; bottom: 20px; font-size: 14px; }

/* App: 듣기·TTS 버튼은 안내 문구 줄 오른쪽 (상자 안 문장은 가운데 유지)
   모바일은 문구가 두 줄로 접히고 버튼은 오른쪽에 그대로 */
.vc-ask-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; min-height: 44px; } /* 듣기 버튼(44px) 있을 때·없을 때 줄 높이 같게 */
.vc-ask-row > span:first-child { flex: 1 1 auto; min-width: 0; }
.vc-tools { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; }

/* 그림 없는 단어: 그림 자리만큼 옅은 회색 칸 (카드 높이 고정) */
.img.img-empty { display: block; background: #eef0f5 !important; border-radius: 12px; }

/* TTS 비교 버튼(임시)은 듣기 버튼에 바짝 (간격 약 4px) */
.vc-tools #vc-listen + #vc-tts { margin-left: -4px; }
.vc-word-row #vc-listen + #vc-tts { margin-left: -8px; }
.vc-listen-big #vc-listen + #vc-tts { margin-left: -10px; }

/* [다음] = 회색 문제 상자 아래 테두리 오른쪽에 걸친 부드러운 삼각형 (상자와 보기 사이, 문장 안 가림) */
.vc-stage { position: relative; }
.vc-stage:has(.vc-next-arrow) { margin-bottom: 40px; }
.vc-next-arrow { position: absolute; right: 18px; bottom: -32px; width: 64px; height: 64px; border: none; border-radius: 50%; padding: 0; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: linear-gradient(135deg, var(--qz-ac), var(--qz-ac2)); box-shadow: 0 8px 22px rgba(99,102,241,.35); cursor: pointer; transition: transform .12s, box-shadow .12s; animation: vc-next-in .25s ease-out; }
.vc-next-arrow[hidden] { display: none; }
.vc-next-arrow:hover { transform: scale(1.06); box-shadow: 0 10px 26px rgba(99,102,241,.45); }
.vc-next-arrow:active { transform: scale(.96); }
@keyframes vc-next-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) {
  .vc-stage:has(.vc-next-arrow) { margin-bottom: 30px; }
  .vc-next-arrow { right: 10px; bottom: -24px; width: 48px; height: 48px; }
  .vc-next-arrow svg { width: 24px; height: 24px; }
}

/* Listening: 소리만 나올 때(큰 스피커)와 정답 공개(그림+단어+뜻) 때 상자 높이를 같게
   = 그림 110 + 간격 10x2 + 단어(.vc-word 크기x1.15) + 뜻 한 줄 */
#vc-reveal { min-height: calc(110px + 20px + clamp(2rem, 6vw, 3rem) * 1.15 + 1.6rem); justify-content: center; }

/* 레슨 목록(중간 화면): 위 안내 + 멈춘 단계 표시 */
.vc-home-head { padding-top: 6px; }
.vc-home-head p { word-break: keep-all; }
.vc-home-head p b { color: var(--qz-ac); }
.vc-step.cur { background: #fff7e6; color: #b45309; box-shadow: inset 0 0 0 2px #fcd34d; }
.vc-step.cur .sc { color: #b45309; font-weight: 700; }

/* 레슨 목록 단계 칸: 눌러서 그 단계로 */
button.vc-step { border: none; font: inherit; cursor: pointer; transition: transform .12s, box-shadow .12s; }
button.vc-step:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(99,102,241,.18); }
button.vc-step:disabled { cursor: default; }

/* 학습 화면 단계 탭: 보기 전용 (지금 단계·완료 표시만, 눌러도 이동 안 함) */
.vc-stepper button { cursor: default; pointer-events: none; }

/* 하단 버튼 줄: 보이는 버튼이 없으면 줄(구분선)째 숨김 */
.vc-foot:not(:has(> .qz-btn:not([hidden]))) { display: none; }
.vc-foot .qz-btn[hidden] { display: none; }
/* [잠시 멈춤]이 보일 때는 왼쪽 아래에 */
.vc-foot:has(#vc-pause:not([hidden])) { justify-content: flex-start; }
