/* 板块 9 · 练习页的语音作答：作答方式切换、收音状态、正在听到的话、按钮；只用设计令牌 */
.p-mode { display: grid; gap: var(--sp-2); }
.p-mode__switch { display: inline-flex; justify-self: start; padding: 3px; gap: 3px; border-radius: var(--r-full); background: var(--surface-2); border: 1px solid var(--border); }
.p-mode__switch button { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 var(--sp-4); border: 0; border-radius: var(--r-full); background: transparent; color: var(--text-2); font: inherit; font-size: var(--fs-md); font-weight: 600; cursor: pointer; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.p-mode__switch button[aria-pressed="true"] { background: var(--surface); color: var(--primary); box-shadow: var(--sh-sm); }
.p-mode__switch button:disabled { opacity: .45; cursor: not-allowed; }
.p-mode__switch button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.p-mode__switch button.is-suggested:not([aria-pressed="true"]) { color: var(--primary); }
.p-mode__why { margin: 0; font-size: var(--fs-sm); }
.p-mode__why[hidden] { display: none; }

.p-voice { display: grid; gap: var(--sp-3); padding: var(--sp-4); border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface-2); }
.p-voice[hidden] { display: none; }
.p-voice > p { margin: 0; }
.p-voice__tip { display: flex; gap: 6px; align-items: flex-start; font-size: var(--fs-sm); }
.p-voice__tip .ico { margin-top: 2px; flex: none; color: var(--primary); }
.p-voice__status { display: flex; align-items: center; gap: var(--sp-2); font-weight: 600; font-size: var(--fs-md); color: var(--text); }
.p-voice__dot { width: 10px; height: 10px; border-radius: var(--r-full); background: var(--text-3); flex: none; }
.p-voice__dot.is-on { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.p-voice__dot.is-talk { background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); animation: p-voice-pulse 1.2s var(--ease) infinite; }
.p-voice__dot.is-wait { background: var(--warn); }
.p-voice__dot.is-pause { background: var(--text-3); }
@keyframes p-voice-pulse { 50% { box-shadow: 0 0 0 7px var(--primary-soft); } }
@media (prefers-reduced-motion: reduce) { .p-voice__dot.is-talk { animation: none; } }
.p-voice__meter { margin-left: auto; width: 88px; height: 6px; border-radius: var(--r-full); background: var(--border); overflow: hidden; flex: none; }
.p-voice__meter i { display: block; height: 100%; width: 0; background: var(--ok); transition: width 90ms linear; }
.p-voice__heard { min-height: 3em; margin: 0; padding: var(--sp-3); border-radius: var(--r-md); background: var(--surface); border: 1px dashed var(--border-strong); line-height: var(--lh); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.p-voice__heard:empty::before, .p-voice__heard.is-empty::before { content: "…"; color: var(--text-3); }
.p-voice__bar { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.p-voice__bar [hidden] { display: none; }
.p-voice__err { margin: 0; color: var(--danger); font-size: var(--fs-sm); }
.p-voice__err[hidden] { display: none; }
.p-answer[hidden] { display: none; }
@media (max-width: 640px) {
  .p-mode__switch { justify-self: stretch; }
  .p-mode__switch button { flex: 1; justify-content: center; }
  .p-voice { padding: var(--sp-3); }
}

/* ================= 板块 13b · 视觉改版：语音陪练 =================
   中间一个圆：大小跟着音量（voice.js 写 --lvl，0 到 1），颜色跟着状态（is-on 在听、is-talk 考官在说、is-wait 连接中） */
.p-voice { justify-items: stretch; padding: var(--sp-6) var(--sp-5); background: var(--bg-2); position: relative; overflow: hidden; isolation: isolate; }
.p-voice::before { content: ""; position: absolute; left: 50%; top: 0; width: 520px; height: 320px; transform: translate(-50%, -30%); z-index: -1; background: radial-gradient(closest-side, var(--hero-glow), transparent); pointer-events: none; }
.p-orb { --lvl: 0; position: relative; justify-self: center; width: 132px; height: 132px; display: grid; place-items: center; margin: var(--sp-2) 0 var(--sp-1); }
.p-orb i { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--brand-glow) 55%, transparent), color-mix(in srgb, var(--primary) 18%, transparent) 62%, transparent 72%); transform: scale(calc(.72 + var(--lvl) * .38)); transition: transform 90ms linear; }
.p-orb i + i { inset: 18px; background: radial-gradient(circle at 40% 35%, color-mix(in srgb, var(--brand-glow) 80%, #fff), var(--primary) 75%); box-shadow: 0 0 40px -6px color-mix(in srgb, var(--brand-glow) 70%, transparent), inset 0 1px 0 rgba(255, 255, 255, .35); transform: scale(calc(.92 + var(--lvl) * .14)); }
.p-orb b { position: relative; color: var(--primary-fg); display: grid; place-items: center; }
.p-orb.is-talk i { animation: p-orb-talk 1.6s var(--ease) infinite; }
.p-orb.is-wait i, .p-orb.is-pause i { filter: grayscale(.8); opacity: .55; }
@keyframes p-orb-talk { 50% { transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .p-orb i { transition: none; } .p-orb.is-talk i { animation: none; } }
.p-voice__status { justify-content: center; }
.p-voice__meter { display: none; }
.p-voice__heard { background: var(--surface); border-style: solid; border-color: var(--border); text-align: center; font-size: var(--fs-base); }
.p-voice__bar { justify-content: center; }
.p-voice__tip { justify-content: center; }
