/* 聽力專練（listen）樣式。自有 class 一律 ls- 前綴；顏色與圓角只用 app.css 的 token。
   版型沿用 practice.css 的 .pr-root / .pr-head / .pr-body / .pr-foot。 */

.ls-body { display: block; }
.ls-main { display: flex; flex-direction: column; gap: 14px; }
.ls-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* ---------- 票卡（題目區） ---------- */
.ls-ticket { padding: 16px 16px 18px; box-shadow: var(--shadow-1), inset 0 0 0 1px var(--border-soft); }
.ls-ticket::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--hue, var(--acc)); }
.ls-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ls-type { background: var(--acc-soft); color: var(--acc-2); font-weight: 700; box-shadow: none; }
.ls-kwchip { background: var(--warn-soft); color: var(--warn); font-weight: 700; box-shadow: none; }
.ls-count { margin-left: auto; font-size: 13px; color: var(--ink-mut); }
.ls-from { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--ink-mut); letter-spacing: .02em; }
.ls-live { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); flex: none; transition: background .2s; }
.ls-playing .ls-live { background: var(--bad); animation: ls-blink 1s steps(2, jump-none) infinite; }

/* 航班廣播感：播放鍵兩側的等化器長條＋擴散的聲波環 */
.ls-deck { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 14px 0 4px; min-height: 92px; }
.ls-eq { display: flex; align-items: center; justify-content: center; gap: 4px; height: 72px; flex: 1 1 0; min-width: 0; max-width: 128px; }
.ls-eq i {
  display: block; width: 4px; height: calc(var(--h) * 1%); border-radius: 3px;
  background: var(--border-strong); transform: scaleY(.28); transform-origin: center;
  transition: background .25s, transform .25s;
}
.ls-playing .ls-eq i {
  background: var(--acc); transform: scaleY(.85);
  animation: ls-eq .92s ease-in-out infinite; animation-delay: calc(var(--i) * -118ms);
}
.ls-play {
  position: relative; flex: none; width: 76px; height: 76px; border-radius: 50%;
  display: grid; place-items: center; border: 0;
  background: var(--acc); color: var(--acc-ink); box-shadow: var(--shadow-2);
  transition: transform .15s, background .2s;
}
.ls-play:hover { background: var(--acc-2); }
.ls-play:active { transform: scale(.94); }
.ls-play:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
.ls-play svg { display: block; }
.ls-play::before, .ls-play::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--acc); opacity: 0; pointer-events: none;
}
.ls-playing .ls-play::before { animation: ls-ring 1.7s ease-out infinite; }
.ls-playing .ls-play::after { animation: ls-ring 1.7s ease-out .85s infinite; }

.ls-meter { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 24px; font-size: 13px; color: var(--ink-mut); }
.ls-status { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ls-playing .ls-status { color: var(--acc-2); font-weight: 600; }
.ls-replays { flex: none; font-size: 12px; color: var(--ink-faint); }
.ls-skip { min-height: 44px; margin: 4px auto 0; padding: 0 16px; display: block; border-radius: 999px; color: var(--ink-mut); text-decoration: underline; font-size: 14px; }
.ls-tear { height: 0; margin: 12px -16px 14px -16px; border-top: 2px dashed var(--border-strong); opacity: .7; }
.ls-prompt { font-size: 18px; line-height: 1.4; text-wrap: balance; }
.ls-hint { margin-top: 6px; font-size: 13px; color: var(--ink-mut); line-height: 1.5; }

/* ---------- 選項 ---------- */
.ls-opts { display: flex; flex-direction: column; gap: 8px; }
.ls-opt {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 14px;
  border-radius: var(--r-md); border: 1.5px solid var(--border-soft); background: var(--card); color: var(--ink);
  text-align: left; font: inherit; cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s, opacity .2s;
}
.ls-opt:hover:not(:disabled) { border-color: var(--acc); }
.ls-opt:active:not(:disabled) { transform: scale(.99); }
.ls-opt:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
.ls-opt:disabled { cursor: default; }
.ls-opt-n {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg-soft); color: var(--ink-mut); font-size: 13px; font-weight: 700; letter-spacing: 0;
}
.ls-opt-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.ls-opt-zh { font-size: 16px; line-height: 1.45; color: var(--ink); }
.ls-opt-en { font-size: 17px; line-height: 1.35; }
.ls-opt-sub { font-size: 13px; color: var(--ink-mut); line-height: 1.4; }
.ls-opt-key { font-size: 22px; font-weight: 700; letter-spacing: .04em; color: var(--ink); }
.ls-opts-key { display: grid; grid-template-columns: 1fr 1fr; }
.ls-opts-key .ls-opt { min-height: 68px; }
.ls-opt[data-state="ok"] { border-color: var(--ok); background: var(--ok-soft); box-shadow: inset 0 0 0 1px var(--ok); }
.ls-opt[data-state="ok"] .ls-opt-n { background: var(--ok); color: var(--bg); }
.ls-opt[data-state="bad"] { border-color: var(--bad); background: var(--bad-soft); box-shadow: inset 0 0 0 1px var(--bad); }
.ls-opt[data-state="bad"] .ls-opt-n { background: var(--bad); color: var(--bg); }
.ls-opt[data-state="dim"] { opacity: .78; }
.ls-opt[data-state="ok"] .ls-opt-sub, .ls-opt[data-state="bad"] .ls-opt-sub { color: var(--ink); }

/* ---------- 答完後揭曉 ---------- */
.ls-rvbox:empty { display: none; }
.ls-reveal { padding: 16px; border-radius: var(--r-md); border: 1.5px solid var(--border-soft); background: var(--card); animation: ls-rise .3s ease both; }
.ls-reveal[data-tone="ok"] { border-color: var(--ok); }
.ls-reveal[data-tone="part"] { border-color: var(--warn); }
.ls-reveal[data-tone="bad"] { border-color: var(--bad); }
.ls-verdict { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 8px; }
.ls-vicon { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; color: var(--bg); background: var(--ink-faint); }
.ls-reveal[data-tone="ok"] .ls-verdict { color: var(--ok); }
.ls-reveal[data-tone="ok"] .ls-vicon { background: var(--ok); }
.ls-reveal[data-tone="part"] .ls-verdict { color: var(--warn); }
.ls-reveal[data-tone="part"] .ls-vicon { background: var(--warn); }
.ls-reveal[data-tone="bad"] .ls-verdict { color: var(--bad); }
.ls-reveal[data-tone="bad"] .ls-vicon { background: var(--bad); }
.ls-keyline { font-size: 13px; color: var(--ink-mut); margin-bottom: 4px; }
.ls-rv-en { font-size: clamp(19px, 5.4vw, 24px); line-height: 1.4; word-break: break-word; }
.ls-keymark { background: var(--warn-soft); color: inherit; border-radius: 4px; padding: 0 3px; box-shadow: inset 0 -2px 0 var(--warn); }
.ls-rv-zh { margin-top: 6px; font-size: 16px; }
.ls-rv-note { margin-top: 10px; }
.ls-replies { margin-top: 12px; }
.ls-replies-h { font-size: 13px; color: var(--ink-mut); margin-bottom: 4px; }
.ls-rrow {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 8px 12px;
  margin-top: 6px; border-radius: var(--r-sm); border: 1px solid var(--border-soft); background: var(--bg-soft); color: var(--ink); text-align: left;
}
.ls-rrow-t { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ls-rrow-en { font-size: 16px; }
.ls-rrow-zh { font-size: 13px; color: var(--ink-mut); }
.ls-rrow-p { flex: none; color: var(--acc-2); }
.ls-rv-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.ls-mini { min-height: 44px; padding: 0 14px; font-size: .92rem; box-shadow: inset 0 0 0 1.5px var(--border-soft); }
.ls-fav[aria-pressed="true"] { color: var(--star); box-shadow: inset 0 0 0 1.5px var(--star); }

/* ---------- 底部操作（拇指區） ---------- */
.ls-actrow { display: flex; gap: 8px; }
.ls-actrow .btn { flex: 1; box-shadow: inset 0 0 0 1.5px var(--border-soft); }
.ls-next { width: 100%; }

/* ---------- 進度點 ---------- */
.pr-dot.ls-dot-bad { background: var(--bad); }
.pr-dot.ls-dot-part { background: var(--warn); }

/* ---------- 總結與空狀態 ---------- */
.ls-summary { text-align: center; }
.ls-stamp span { letter-spacing: .2em; }
.ls-weak-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; text-align: left; }
.ls-weak-zh { font-size: 13px; color: var(--ink-mut); }
.ls-weakrow { align-items: center; }
.ls-empty { margin-top: 16px; }

/* ---------- 動畫 ---------- */
@keyframes ls-eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
@keyframes ls-ring { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(1.75); opacity: 0; } }
@keyframes ls-blink { 0% { opacity: 1; } 100% { opacity: .25; } }
@keyframes ls-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .ls-root *, .ls-root *::before, .ls-root *::after { animation: none !important; transition: none !important; }
}

/* ---------- 深色 ---------- */
[data-theme="dark"] .ls-opt[data-state="ok"] .ls-opt-n,
[data-theme="dark"] .ls-opt[data-state="bad"] .ls-opt-n { color: #0E1424; }

/* ---------- RWD ---------- */
@media (min-width: 768px) {
  .ls-ticket { padding: 22px 26px 24px; }
  .ls-tear { margin-left: -26px; margin-right: -26px; }
  .ls-prompt { font-size: 20px; }
  .ls-opt-zh { font-size: 17px; }
  .ls-opt-en { font-size: 19px; }
  .ls-play { width: 84px; height: 84px; }
  .ls-eq { height: 80px; }
}
@media (max-width: 359px) {
  .ls-eq { max-width: 84px; gap: 3px; }
  .ls-eq i { width: 3px; }
  .ls-play { width: 68px; height: 68px; }
}

/* 橫向手機：題目票卡在左、選項與揭曉在右，底部操作改一列 */
@media (max-height: 480px) and (orientation: landscape) {
  .ls-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 14px; align-items: start; }
  .ls-ticket { padding: 12px 14px; }
  .ls-from { margin-top: 6px; }
  .ls-deck { margin: 6px 0 0; min-height: 70px; gap: 8px; }
  .ls-eq { height: 52px; }
  .ls-play { width: 60px; height: 60px; }
  .ls-tear { margin: 8px -14px 8px; }
  .ls-prompt { font-size: 16px; }
  .ls-opt { min-height: 48px; padding: 6px 12px; }
  .ls-opts-key .ls-opt { min-height: 52px; }
  .ls-foot { flex-direction: row; align-items: center; gap: 12px; }
  .ls-foot .ls-actrow { flex: 1 1 0; }
  .ls-foot .ls-next { flex: 1 1 0; width: auto; min-height: 48px; }
}
