/* v47 — study lab dialog */
html.jv-lab-open { overflow: hidden; }
.jv-lab { position: fixed; inset: 0; z-index: 14000; display: grid; place-items: center; padding: 16px; background: rgba(15,23,42,.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.jv-lab[hidden] { display: none; }
.jv-lab-card { width: min(620px, 100%); max-height: 92vh; overflow-y: auto; padding: 20px 22px 18px; border-radius: 22px; background: #fff; color: #0f172a; box-shadow: 0 30px 80px rgba(15,23,42,.35); font-family: inherit; }
.jv-lab-top { display: flex; align-items: center; justify-content: space-between; }
.jv-lab-tag { padding: 5px 12px; border-radius: 999px; background: #f5f3ff; color: #5b21b6; font-size: 13px; font-weight: 850; }
.jv-lab-close { width: 36px; height: 36px; border-radius: 50%; border: 1px solid #e2e8f0; background: #f8fafc; color: #475569; font-size: 20px; cursor: pointer; }
.jv-lab-progress { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; color: #64748b; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.jv-lab-bar { flex: 1 1 auto; height: 6px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.jv-lab-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8b5cf6, #22c55e); transition: width .25s; }
.jv-lab-score { color: #16a34a; }
.jv-lab-stage { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 170px; padding: 18px 14px; border-radius: 18px; background: linear-gradient(160deg, #f8fafc, #f5f3ff); text-align: center; }
.jv-lab-word { font-size: clamp(34px, 7vw, 56px); font-weight: 850; letter-spacing: -.02em; }
.jv-lab-word[lang="zh-CN"] { font-family: "Noto Serif SC", "Noto Sans SC", serif; letter-spacing: .02em; }
.jv-lab-pron { color: #6d28d9; font-weight: 700; }
.jv-lab-say { padding: 6px 14px; border: 1px solid #ddd6fe; border-radius: 999px; background: #fff; color: #5b21b6; font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.jv-lab-big-say { width: 92px; height: 92px; border: 0; border-radius: 50%; background: #7c3aed; color: #fff; font-size: 38px; cursor: pointer; box-shadow: 0 10px 26px rgba(124,58,237,.35); }
.jv-lab-big-say:hover { filter: brightness(1.08); }
.jv-lab-hint { color: #64748b; font-size: 13px; font-weight: 700; }
.jv-lab-quote { margin: 0; font: 650 clamp(17px, 2.6vw, 22px)/1.6 Georgia, "Noto Serif KR", serif; }
.jv-lab-quote[lang="zh-CN"] { font-family: "Noto Serif SC", serif; letter-spacing: .04em; }
.jv-lab-blank { display: inline-block; min-width: 3em; margin: 0 2px; border-bottom: 3px solid #7c3aed; color: #7c3aed; }
.jv-lab-quote-ko { color: #334155; font-size: 14.5px; }
.jv-lab-quote-src { color: #94a3b8; font-size: 12.5px; }
.jv-lab-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.jv-lab-option { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 14px; border: 1.5px solid #e2e8f0; border-radius: 14px; background: #fff; color: #0f172a; font: inherit; font-size: 15px; font-weight: 700; text-align: left; cursor: pointer; transition: border-color .12s, background .12s; }
.jv-lab-option:hover:not(:disabled) { border-color: #a78bfa; background: #faf5ff; }
.jv-lab-option kbd { flex: 0 0 auto; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: #f1f5f9; color: #64748b; font: 800 12px/1 system-ui, sans-serif; }
.jv-lab-option span { min-width: 0; overflow-wrap: anywhere; }
.jv-lab-option.is-answer { border-color: #22c55e; background: #f0fdf4; }
.jv-lab-option.is-answer kbd { background: #22c55e; color: #fff; }
.jv-lab-option.is-picked { border-color: #ef4444; background: #fef2f2; }
.jv-lab-option.is-picked kbd { background: #ef4444; color: #fff; }
.jv-lab-type { display: flex; gap: 8px; margin-top: 14px; }
.jv-lab-type input { flex: 1 1 auto; min-width: 0; height: 50px; padding: 0 16px; border: 1.5px solid #e2e8f0; border-radius: 14px; font: inherit; font-size: 18px; }
.jv-lab-type input:focus { outline: none; border-color: #a78bfa; box-shadow: 0 0 0 3px #ede9fe; }
.jv-lab-type button { padding: 0 20px; border: 0; border-radius: 14px; background: #7c3aed; color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.jv-lab-feedback { min-height: 24px; margin-top: 12px; font-size: 14.5px; font-weight: 800; }
.jv-lab-feedback span { margin-left: 6px; font-weight: 600; color: #334155; }
.jv-lab-feedback small { color: #6d28d9; }
.jv-lab-feedback em { display: block; margin-top: 2px; font-style: normal; font-size: 12.5px; color: #64748b; font-weight: 600; }
.jv-lab-feedback.is-right { color: #16a34a; }
.jv-lab-feedback.is-wrong { color: #dc2626; }
.jv-lab-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.jv-lab-next { padding: 11px 20px; border: 0; border-radius: 999px; background: #0f172a; color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.jv-lab-next[hidden] { display: none; }
.jv-lab-secondary { padding: 11px 18px; border: 1px solid #e2e8f0; border-radius: 999px; background: #fff; color: #334155; font: inherit; font-weight: 800; cursor: pointer; }
.jv-lab-result { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 0 4px; text-align: center; }
.jv-lab-ring { --p: 0; width: 120px; height: 120px; display: grid; place-items: center; align-content: center; border-radius: 50%; background: radial-gradient(closest-side, #fff 78%, transparent 79% 100%), conic-gradient(#8b5cf6 calc(var(--p) * 1%), #eef2f7 0); }
.jv-lab-ring b { font-size: 34px; line-height: 1; }
.jv-lab-ring span { color: #64748b; font-size: 13px; font-weight: 800; }
.jv-lab-result h3 { margin: 10px 0 0; font-size: 20px; }
.jv-lab-result p { margin: 0; color: #64748b; font-size: 13.5px; }
.jv-lab-wrong { width: 100%; margin-top: 12px; text-align: left; }
.jv-lab-wrong h4 { margin: 0 0 6px; font-size: 13px; color: #dc2626; }
.jv-lab-wrong ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; max-height: 220px; overflow-y: auto; }
.jv-lab-wrong li { padding: 7px 10px; border-radius: 10px; background: #fef2f2; font-size: 14px; }
.jv-lab-wrong li small { color: #6d28d9; }
.jv-lab-wrong li span { color: #475569; }
html[data-theme="dark"] .jv-lab-card { background: #0f172a; color: #e2e8f0; }
html[data-theme="dark"] .jv-lab-stage { background: linear-gradient(160deg, #111a2b, #2e1065); }
html[data-theme="dark"] .jv-lab-option, html[data-theme="dark"] .jv-lab-type input, html[data-theme="dark"] .jv-lab-secondary, html[data-theme="dark"] .jv-lab-say { background: #111a2b; color: #e2e8f0; border-color: #1f2a3c; }
html[data-theme="dark"] .jv-lab-quote-ko, html[data-theme="dark"] .jv-lab-feedback span { color: #cbd5e1; }
html[data-theme="dark"] .jv-lab-ring { background: radial-gradient(closest-side, #0f172a 78%, transparent 79% 100%), conic-gradient(#8b5cf6 calc(var(--p) * 1%), #1f2a3c 0); }
html[data-theme="dark"] .jv-lab-next { background: #e2e8f0; color: #0f172a; }
@media (max-width: 560px) {
  .jv-lab { padding: 10px; align-items: end; }
  .jv-lab-card { padding: 16px 14px 14px; border-radius: 20px 20px 16px 16px; }
  .jv-lab-options { grid-template-columns: 1fr; }
  .jv-lab-stage { min-height: 140px; }
}

/* v51 — key hints */
.jv-lab-keyhint-inline { margin-right: auto; align-self: center; font-size: 12px; color: #94a3b8; }
.jv-lab-keyhint { margin: 10px 0 0; text-align: right; font-size: 12px; color: #94a3b8; }
.jv-lab-keyhint kbd, .jv-lab-keyhint-inline kbd { display: inline-block; padding: 1px 6px; border: 1px solid rgba(148,163,184,.55); border-bottom-width: 2px; border-radius: 5px; font: 700 11px/1.4 ui-monospace, Menlo, monospace; }
@media (max-width: 640px) { .jv-lab-keyhint, .jv-lab-keyhint-inline { display: none; } }

/* v52 — voice button · combo · shake · mode switch · size · goal pop */
.jv-lab-top-tools { display: inline-flex; gap: 6px; }
.jv-lab-voice { width: 36px; height: 36px; border-radius: 50%; border: 1px solid #e2e8f0; background: #f8fafc; font-size: 15px; cursor: pointer; }
.jv-lab-combo { padding: 2px 9px; border-radius: 999px; background: #fff7ed; color: #ea580c; font-size: 12.5px; }
.jv-lab-combo[hidden] { display: none; }
.jv-lab-combo.is-pop { animation: jvComboPop .45s cubic-bezier(.3,1.6,.5,1); }
@keyframes jvComboPop { 0% { transform: scale(.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
.jv-lab-card.is-shake { animation: jvShake .42s ease; }
@keyframes jvShake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
.jv-lab-option.is-answer { animation: jvAnswerGlow .7s ease; }
@keyframes jvAnswerGlow { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.55); } 100% { box-shadow: 0 0 0 10px rgba(34,197,94,0); } }
.jv-lab-py { font-family: "Segoe UI", "Noto Sans", system-ui, sans-serif; font-weight: 800; letter-spacing: .02em; font-size: 1.08em; }
.jv-lab-best { margin-top: 2px; font-size: 13px; font-weight: 850; color: #ea580c; }
.jv-lab-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed #e2e8f0; }
.jv-lab-switch:not(:has(button)) { display: none; }
.jv-lab-switch > span { font-size: 12.5px; font-weight: 800; color: #64748b; margin-right: 2px; }
.jv-lab-switch button { padding: 6px 12px; border: 1px solid #ddd6fe; border-radius: 999px; background: #f5f3ff; color: #5b21b6; font: inherit; font-size: 12.5px; font-weight: 800; cursor: pointer; }
.jv-lab-switch button:hover { background: #ede9fe; }
.jv-lab-result-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.jv-lab-result-foot .jv-lab-keyhint { margin: 0; }
.jv-size-ctl { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 800; color: #64748b; }
.jv-size-ctl > span { margin-right: 4px; }
.jv-size-ctl button { min-width: 34px; padding: 4px 8px; border: 1px solid #e2e8f0; border-radius: 999px; background: #fff; color: #475569; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.jv-size-ctl button[aria-pressed="true"] { border-color: #7c3aed; background: #7c3aed; color: #fff; }
.jv-goal-pop { position: fixed; inset: 0; z-index: 17000; display: grid; place-items: center; pointer-events: auto; background: rgba(15,23,42,.18); animation: jvFadeIn .25s ease; transition: opacity .5s; }
.jv-goal-pop.is-out { opacity: 0; }
.jv-goal-burst { position: absolute; left: 50%; top: 50%; }
.jv-goal-burst i { position: absolute; font-style: normal; font-size: 26px; transform: translate(-50%, -50%); animation: jvBurst 1.1s cubic-bezier(.15,.8,.3,1) var(--t) both; }
@keyframes jvBurst { 0% { transform: translate(-50%, -50%) rotate(var(--a)) translateY(0) scale(.4); opacity: 0; } 30% { opacity: 1; } 100% { transform: translate(-50%, -50%) rotate(var(--a)) translateY(calc(var(--d) * -1.8)) scale(1); opacity: 0; } }
.jv-goal-msg { position: relative; display: grid; gap: 4px; padding: 20px 30px; border-radius: 20px; background: #fff; box-shadow: 0 20px 50px rgba(91,33,182,.35); text-align: center; animation: jvComboPop .5s cubic-bezier(.3,1.6,.5,1); }
.jv-goal-msg b { font-size: 20px; font-weight: 900; color: #5b21b6; }
.jv-goal-msg span { font-size: 13.5px; font-weight: 800; color: #ea580c; }
@keyframes jvFadeIn { from { opacity: 0; } to { opacity: 1; } }
html[data-theme="dark"] .jv-lab-voice, html[data-theme="dark"] .jv-size-ctl button { background: #111a2b; border-color: #1f2a3c; color: #e2e8f0; }
html[data-theme="dark"] .jv-size-ctl button[aria-pressed="true"] { background: #7c3aed; color: #fff; }
html[data-theme="dark"] .jv-lab-switch button { background: #1e1b4b; border-color: #4c1d95; color: #ddd6fe; }
html[data-theme="dark"] .jv-goal-msg { background: #111827; }
html[data-theme="dark"] .jv-goal-msg b { color: #c4b5fd; }
@media (prefers-reduced-motion: reduce) { .jv-lab-card.is-shake, .jv-lab-combo.is-pop, .jv-goal-burst i { animation: none; } }

.jv-lab-rest{font-size:12.5px;font-weight:700;color:#4b6e58;text-decoration:none;padding:6px 11px;border-radius:999px;background:#eef3ea}
.jv-lab-rest:hover{background:#e2ebdd}
html[data-theme="dark"] .jv-lab-rest{background:#17221d;color:#a3cdb0}

.jv-lab [data-say].is-playing{background:#dbeafe!important;color:#244d82!important;border-color:#81a8d8!important;box-shadow:0 0 0 3px #a7c9ef55}.jv-lab-top-tools{display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-end;gap:6px}.jv-lab-top{gap:8px}.jv-lab-card{box-sizing:border-box;max-height:calc(100dvh - 32px);overscroll-behavior:contain}.jv-lab-word{overflow-wrap:anywhere}.jv-lab-foot{flex-wrap:wrap}html[data-theme="dark"] .jv-lab [data-say].is-playing{background:#304f74!important;color:#fff!important}@media(pointer:coarse){.jv-lab button[data-say],.jv-lab button[data-answer-audio],.jv-lab-close,.jv-lab-voice{min-height:44px;min-width:44px}}

.jv-hanzi-compose{display:grid;gap:14px;margin:12px auto;max-width:480px}.jv-hanzi-slots,.jv-hanzi-bank{display:flex;flex-wrap:wrap;justify-content:center;gap:8px}.jv-hanzi-compose button{font:inherit;cursor:pointer;border:1px solid #879a94;border-radius:10px;background:transparent;color:inherit;padding:9px 15px;min-height:44px}.jv-hanzi-slots button,.jv-hanzi-bank button{font-size:clamp(23px,5vw,32px);min-width:48px;padding:6px 10px}.jv-hanzi-slots button{border:2px dashed #879a94}.jv-hanzi-bank button:disabled{opacity:.3}.jv-hanzi-actions{display:flex;justify-content:center;gap:12px}.jv-hanzi-actions [data-confirm]{background:#426747;color:white}.jv-hanzi-actions button:disabled{opacity:.4}.jv-hanzi-slots button:disabled{cursor:default}
