/* ============================================================================
   css/v2-answer.css — MeowLab V2 答題核心（PR-V2-03）
   MC 二段確認（揀選亮框＋確認掣）與兩級題解卡（答對薄荷綠輕卡／答錯暖杏
   分段卡＋常見陷阱盒＋值日貓 teach 破框）。顏色／圓角一律用 tokens-v2.css
   變數，唔另立色值。
   ============================================================================ */

/* ---------- MC 二段確認 ---------- */
/* PR-UI-Polish 一.3：確認掣區固定高度——交卷後確認掣隱藏嗰陣唔好成行塌落去，
   令下面題解卡同底欄跳位（layout shift）；底欄同步固定最低高度等「下一題」掣出現唔推版 */
.v2-confirm-row {
  display: flex;
  justify-content: center;
  margin-top: 10px;
  min-height: 52px;
}

.arena-footer-bar {
  min-height: 60px;
  box-sizing: border-box;
}

.v2-confirm-btn {
  background: var(--brand-emerald);
  color: #fff;
  border: none;
  border-radius: var(--radius-btn);
  padding: 12px 36px;
  font-family: var(--font-app);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  min-height: 52px;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--brand-emerald-dark), var(--shadow-bento);
}

.v2-confirm-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--brand-emerald-dark);
}

/* 已揀選（未交卷）選項：翡翠亮框＋薄荷底，同 .correct/.wrong 語義色分開 */
#arena-options .craft-option-btn.v2-selected {
  background: var(--brand-mint-soft);
  outline: 3px solid var(--brand-emerald);
  outline-offset: 1px;
}

/* ---------- 題解卡 ---------- */
.v2-answer-slot {
  margin-top: 10px;
}

.v2-answer-slot:empty {
  margin-top: 0;
}

.v2-answer-card {
  position: relative;
  border-radius: var(--radius-card);
  padding: 14px 16px;
  font-family: var(--font-app);
  color: var(--text-primary);
  line-height: var(--lh-body);
  box-shadow: var(--shadow-bento);
  overflow: visible;
}

.v2-answer-card--correct {
  background: var(--brand-mint-soft);
  border: 1px solid var(--border-soft);
}

.v2-answer-card--wrong {
  background: var(--wrong-apricot-bg);
  border: 1px solid var(--wrong-apricot-border);
}

.v2-answer-card__head {
  font-size: var(--fs-card-title);
  font-weight: 800;
  color: var(--brand-emerald-dark);
  margin-bottom: 4px;
}

.v2-answer-card__explain {
  font-size: 15.5px;
}

.v2-answer-card__section {
  font-size: 15.5px;
  margin-top: 6px;
}

.v2-answer-card__section:first-of-type {
  margin-top: 0;
}

.v2-answer-card--wrong .v2-answer-card__section strong,
.v2-answer-card--wrong .v2-answer-card__trap strong {
  color: var(--wrong-text);
}

.v2-answer-card__steps {
  margin: 4px 0 0;
  padding-left: 22px;
}

.v2-answer-card__steps li {
  margin-top: 2px;
}

.v2-answer-card__trap {
  background: var(--wrong-trap-bg);
  border-radius: 14px;
  padding: 8px 12px;
  margin-top: 10px;
  font-size: 15px;
}

/* 值日貓 teach 姿勢：趴喺卡右上角破框（素材缺失時 JS onerror 隱藏） */
.v2-answer-card__cat {
  position: absolute;
  right: 8px;
  top: -22px;
  width: 72px;
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(15, 28, 38, 0.18));
}

@media (max-width: 600px) {
  .v2-answer-card__cat {
    width: 58px;
    top: -16px;
  }

  .v2-confirm-btn {
    width: 100%;
  }
}

/* ============================================================================
   PR-UI-V2-Finish：答題／考場統一 V2——進度列、題幹卡、選項、提示與考場底部掣
   （scoped 於 #modal-arena／#modal-exam-stage；行為零改動，純呈現）
   ============================================================================ */

/* ---------- 頂部進度列：左題數／中全寬翡翠條／右連擊丸，全闊度橫列 ---------- */
#modal-arena .pod-layout { flex-direction: column; }
#modal-arena .pod-rail {
  order: 0; flex: none; flex-direction: row; align-items: center; flex-wrap: nowrap;
  gap: 10px; padding: 8px 12px;
  background: #FFFFFF; border: 1px solid var(--border-soft); border-radius: 16px;
}
#modal-arena .pod-main { order: 1; }
#modal-arena .pod-rail__count { font-size: 14px; font-weight: 900; white-space: nowrap; }
#modal-arena .ds-rail__meter {
  flex: 1 1 auto; min-width: 60px; height: 12px; border-radius: 999px;
  background: #EEF2F5; border: 1px solid var(--border-soft);
}
#modal-arena .ds-rail__fill {
  display: block; background: var(--brand-emerald);
}
#modal-arena .ds-rail__combo {
  background: var(--brand-mint-soft); color: var(--brand-emerald-dark);
  border: 1.5px solid var(--brand-emerald); white-space: nowrap;
}
@media (min-width: 1024px) {
  #modal-arena .pod-rail .ds-rail__meter {
    width: auto; height: 12px; aspect-ratio: auto; margin: 0; border-radius: 999px;
    border: 1px solid var(--border-soft); background: #EEF2F5;
  }
  #modal-arena .pod-rail .ds-rail__meter::after { content: none; }
  #modal-arena .pod-rail__count { text-align: left; }
}

/* ---------- 題幹卡：#F6F9F8 圓角卡＋右上白膠囊讀題掣 ---------- */
#modal-arena .arena-question-strip,
#modal-exam-stage .arena-question-strip {
  background: #F6F9F8; border: 1px solid var(--border-soft);
  border-radius: 20px; box-shadow: none; align-items: flex-start;
}
#modal-arena .btn-gramophone,
#modal-exam-stage .btn-gramophone {
  order: 2; margin-left: auto; flex-shrink: 0;
  background: #FFFFFF; border: 1px solid var(--border-soft); color: var(--text-primary);
  border-radius: 9999px; box-shadow: none; padding: 7px 12px;
}
#modal-arena .arena-q-text, #modal-exam-stage .arena-q-text { order: 1; }

/* ---------- 模式標：淺薄荷 ---------- */
#modal-arena .arena-mode-tag,
#modal-exam-stage .arena-mode-tag {
  background: var(--brand-mint-soft); color: var(--brand-emerald-dark);
}

/* ---------- 選項：白卡冷灰圓標，選中實心翡翠 ---------- */
#modal-arena .craft-option-btn,
#modal-exam-stage .craft-option-btn {
  background: #FFFFFF; background-image: none;
  border: 1.5px solid var(--border-soft); border-radius: 16px;
  box-shadow: none; color: var(--text-primary);
}
#modal-arena .opt-key-seal,
#modal-exam-stage .opt-key-seal {
  background: #EEF2F5; color: var(--text-primary); border-radius: 50%;
}
#modal-arena .craft-option-btn.v2-selected .opt-key-seal,
#modal-exam-stage .craft-option-btn.selected .opt-key-seal {
  background: var(--brand-emerald); color: #FFFFFF;
}
#modal-exam-stage .craft-option-btn.selected {
  background: var(--brand-mint-soft); outline: 3px solid var(--brand-emerald); outline-offset: 1px;
}

/* ---------- 提示掣：白底描邊膠囊 ---------- */
#modal-arena .tool-card-btn.hint {
  background: #FFFFFF; border: 1.5px solid var(--border-soft); color: var(--text-primary);
  border-radius: 9999px; box-shadow: none; padding: 8px 14px;
}

/* ---------- 考場底部掣＋草稿紙掣：白／翡翠膠囊 ---------- */
#modal-exam-stage #btn-exam-prev {
  background: #FFFFFF; border: 1px solid var(--border-soft); color: var(--text-primary);
  border-radius: 9999px; box-shadow: none; padding: 10px 18px; font-weight: 900;
}
#modal-exam-stage #btn-exam-next,
#modal-exam-stage #btn-exam-submit-paper {
  background: var(--brand-emerald); border: 1px solid var(--brand-emerald); color: #FFFFFF;
  border-radius: 9999px; box-shadow: none; padding: 10px 18px; font-weight: 900;
}
#modal-exam-stage #btn-toggle-scratch {
  background: #FFFFFF; border: 1px solid var(--border-soft); color: var(--text-primary);
  border-radius: 9999px; box-shadow: none; font-weight: 900;
}
#modal-exam-stage .btn-kraft {
  border-radius: 9999px; box-shadow: none;
}

/* ============================================================
   PR-V2-W2・答題擂台＋考場整頁完成品
   規格：Wave2 PR（neno 指示卡）§一～§十三＋IVAN 相片頭像
   ============================================================ */

/* ---------- §二 答題抬頭：題數進度棒（第 N／總題數） ---------- */
#modal-arena .ds-rail.pod-rail {
  display: flex; align-items: center; gap: 10px;
  background: #FFFFFF; border: 1px solid rgba(203, 213, 225, 0.8);
  border-bottom: 2.5px solid rgba(148, 163, 184, 0.42);
  border-radius: 16px; padding: 10px 12px; margin-bottom: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96), 0 6px 14px -8px rgba(15, 23, 42, 0.10);
}
#modal-arena .pod-rail__meta { display: contents; }
#modal-arena .pod-rail__title { display: none; }
#modal-arena .pod-rail__count {
  font-size: 15px; font-weight: 900; color: var(--text-primary);
  white-space: nowrap; letter-spacing: 0.02em;
}
#modal-arena .ds-rail__meter {
  position: relative; flex: 1 1 auto; height: 12px; min-width: 60px;
  border-radius: 999px; background: #E2E8F0;
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.14);
  overflow: visible;
}
#modal-arena .ds-rail__fill {
  position: absolute; inset: 0 auto 0 0; width: 100%; height: 100%;
  border-radius: 999px; transform-origin: left center;
  background: linear-gradient(90deg, #10B981, #0B8A6A);
  transition: transform 0.35s ease;
}
#modal-arena .ds-rail__pct {
  position: absolute; inset: 0; display: none;
  align-items: center; justify-content: center;
  font-size: 11px; font-weight: 900; color: #FFFFFF;
  -webkit-text-stroke: 3px rgba(7, 102, 78, 0.55); paint-order: stroke fill;
  text-shadow: 0 1px 2px rgba(7, 102, 78, 0.45); pointer-events: none;
}
#modal-arena .ds-rail__cat {
  position: absolute; top: 50%; width: 26px; height: 26px; object-fit: contain;
  transform: translate(-50%, -58%); z-index: 2; pointer-events: none;
  transition: left 0.35s ease; filter: drop-shadow(0 2px 3px rgba(15, 23, 42, 0.22));
}
#modal-arena .ds-rail__cat.w2-cat-bounce { animation: w2CatBounce 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes w2CatBounce {
  0% { transform: translate(-50%, -58%) scale(1); }
  40% { transform: translate(-50%, -95%) scale(1.12); }
  100% { transform: translate(-50%, -58%) scale(1); }
}
#modal-arena .pod-rail__caps { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
#modal-arena .ds-rail__combo, #modal-arena .w2-rail-cap {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 9px; border-radius: 999px; white-space: nowrap;
  font-size: 12px; font-weight: 900; line-height: 1;
}
#modal-arena .ds-rail__combo img, #modal-arena .w2-rail-cap img { width: 15px; height: 15px; }
#modal-arena .ds-rail__combo { background: #F1F5F9; border: 1.5px solid #E2E8F0; color: #94A3B8; }
#modal-arena .ds-rail__combo.is-hot { background: #FEF3C7; border-color: #F59E0B; color: #92400E; }
#modal-arena .ds-rail__combo.is-hot img { animation: w2FlamePulse 0.9s ease-in-out infinite alternate; }
@keyframes w2FlamePulse { from { transform: scale(1); } to { transform: scale(1.14); } }
#modal-arena .w2-rail-cap { background: var(--brand-mint-soft); border: 1.5px solid rgba(11, 138, 106, 0.35); color: var(--brand-emerald-dark, #07664E); }
@media (min-width: 960px) {
  #modal-arena .ds-rail__meter { height: 16px; }
  #modal-arena .ds-rail__pct { display: flex; }
  #modal-arena .ds-rail__cat { width: 30px; height: 30px; }
  #modal-arena .pod-rail__count { font-size: 16px; }
  /* PR-V2-W5 P2（Wave 2 遺留 #1）：百分比文字改「半透明白膠囊＋深石板字」——
     低進度時文字浮喺淺灰軌道、高進度時浮喺翡翠填色，兩邊都有膠囊底托住，
     對比恆定充足，唔再用白字描邊浮喺淺底（7% 時幾乎睇唔到） */
  #modal-arena .ds-rail__pct {
    inset: 1px 0; color: #1E3A34; z-index: 1;
    -webkit-text-stroke: 0; text-shadow: none;
  }
  #modal-arena .ds-rail__pct::before {
    content: ''; position: absolute; left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    width: 44px; height: 13px; border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
    z-index: -1;
  }
}

/* ---------- §二 iPad 雙欄擂台 ---------- */
#modal-arena .arena-side { display: contents; }
@media (min-width: 960px) {
  #modal-arena .paper-modal.arena-modal {
    max-width: 1080px; width: 94vw; min-height: min(680px, 84vh);
    display: flex; flex-direction: column;
  }
  #modal-arena .pod-layout {
    display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.95fr);
    gap: 20px; align-items: start; flex: 1;
  }
  /* 進度欄橫跨兩欄（標題列），題目欄與講解欄在其下並排（ref-04 版式）；
     顯式釘欄位＋重置 pod.css flex 時代遺留的 order（grid 項目同樣受 order 影響，
     舊 order 會令講解欄搶先佔行、題目欄被推落一行） */
  #modal-arena #arena-rail { grid-column: 1 / -1; order: 0; flex: none; }
  #modal-arena .pod-main { grid-column: 1; order: 0; }
  #modal-arena .arena-side { grid-column: 2; order: 0; }
  /* 選項棒全寬單欄（ref-04），不用桌面 2×2 */
  #modal-arena .arena-options-grid { grid-template-columns: 1fr; }
  #modal-arena .arena-side {
    display: flex; flex-direction: column; gap: 12px; position: sticky; top: 0;
    background: var(--brand-mint-soft); border: 1.5px solid rgba(11, 138, 106, 0.28);
    border-radius: 20px; padding: 16px 14px 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
    min-height: 320px;
  }
  #modal-arena .arena-side .arena-footer-bar {
    background: rgba(255, 255, 255, 0.75); border-radius: 14px; padding: 8px 10px;
  }
  #modal-arena .arena-side #arena-answer-card:empty { display: none; }
}
/* 答題前講解欄引導卡（手機隱藏，≥960 常駐右欄） */
.v2-answer-guide { display: none; }
@media (min-width: 960px) {
  .v2-answer-guide {
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
    background: #FFFFFF; border: 1.5px dashed rgba(11, 138, 106, 0.4); border-radius: 16px;
    padding: 18px 14px;
  }
  .v2-answer-guide__title { font-size: 15px; font-weight: 900; color: var(--brand-emerald-dark, #07664E); }
  .v2-answer-guide__cat { width: 84px; height: 84px; object-fit: contain; }
  .v2-answer-guide__text { font-size: 13.5px; line-height: 1.6; color: #475569; margin: 0; }
}

/* ---------- §四 選項觸感回饋 ---------- */
#modal-arena .craft-option-btn.v2-selected { animation: w2OptPop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes w2OptPop { 0% { transform: scale(1); } 35% { transform: scale(0.98); } 70% { transform: scale(1.01); } 100% { transform: scale(1); } }
#modal-arena .craft-option-btn.correct, #modal-exam-stage .craft-option-btn.correct {
  background: #E8F7F2 !important; border-color: var(--brand-emerald, #0B8A6A) !important;
  color: var(--text-primary) !important; box-shadow: 0 0 0 1px var(--brand-emerald, #0B8A6A) inset;
  position: relative; overflow: hidden;
}
#modal-arena .craft-option-btn.correct::after, #modal-exam-stage .craft-option-btn.correct::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 45%; left: -55%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: w2Sweep 0.65s ease-out 0.05s 1 both; pointer-events: none;
}
@keyframes w2Sweep { to { left: 115%; } }
#modal-arena .craft-option-btn.correct .pod__letter, #modal-exam-stage .craft-option-btn.correct .pod__letter {
  background: var(--brand-emerald, #0B8A6A) !important; color: #FFFFFF !important; border-color: transparent !important;
  animation: w2CheckPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes w2CheckPop { 0% { transform: scale(0.6); } 100% { transform: scale(1); } }
#modal-arena .craft-option-btn.wrong, #modal-exam-stage .craft-option-btn.wrong {
  background: #FEF2F2 !important; border-color: #F87171 !important; color: var(--text-primary) !important;
  box-shadow: 0 0 0 1px #F87171 inset;
}
#modal-arena .craft-option-btn.w2-shake { animation: w2Shake 0.28s ease-in-out; }
@keyframes w2Shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  55% { transform: translateX(4px); }
  80% { transform: translateX(-2px); }
}
/* 連擊粒子爆發 */
#modal-arena .arena-options-grid { position: relative; }
.w2-burst { position: absolute; width: 0; height: 0; pointer-events: none; z-index: 5; overflow: visible; }
.w2-burst span {
  position: absolute; left: 0; top: 0; width: 7px; height: 7px; border-radius: 50%;
  background: #F59E0B; animation: w2BurstFly 0.7s ease-out forwards;
}
.w2-burst span:nth-child(3n) { background: #10B981; border-radius: 2px; }
.w2-burst span:nth-child(4n) { background: #FBBF24; width: 5px; height: 5px; }
@keyframes w2BurstFly {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--bx), var(--by)) scale(0.4); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  #modal-arena .craft-option-btn.v2-selected, #modal-arena .ds-rail__cat.w2-cat-bounce,
  #modal-arena .craft-option-btn.w2-shake, .w2-burst span { animation: none !important; }
  .w2-burst { display: none; }
}

/* ---------- §三／§九 題解卡（手機升起＋右欄原位替換） ---------- */
#modal-arena #arena-answer-card { scroll-margin-top: 8px; }
.v2-answer-card { animation: w2CardRise 0.32s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes w2CardRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.v2-answer-card__head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 16px; font-weight: 900;
}
.v2-answer-card--correct .v2-answer-card__head { color: var(--brand-emerald-dark, #07664E); }
.v2-answer-card--wrong .v2-answer-card__head {
  background: #FFE8D1; border: 1.5px solid var(--wrong-apricot-border);
  border-radius: 12px; padding: 8px 10px; color: var(--wrong-text);
  margin: -2px -2px 10px;
}
.v2-answer-card__head .v2-ico { flex-shrink: 0; }
.v2-answer-card__speak {
  margin-left: auto; display: inline-flex; align-items: center; gap: 5px;
  background: #FFFFFF; border: 1.5px solid var(--wrong-apricot-border); color: var(--wrong-text);
  border-radius: 999px; padding: 5px 11px; font-size: 12.5px; font-weight: 900; cursor: pointer;
}
.v2-answer-card__speak img { width: 15px; height: 15px; }
.v2-answer-card__core { font-size: 14.5px; line-height: 1.65; color: var(--text-primary); margin: 8px 0 0; }
.v2-answer-card__more-btn {
  margin-top: 10px; display: inline-flex; align-items: center; gap: 4px;
  background: #F1F5F9; border: 1.5px solid #E2E8F0; color: #475569;
  border-radius: 999px; padding: 6px 13px; font-size: 12.5px; font-weight: 900; cursor: pointer;
}
.v2-answer-card__steps-wrap[hidden] { display: none; }
.v2-answer-card__steps-card {
  background: #F8FAFC; border: 1.5px solid #E2E8F0; border-radius: 14px; padding: 10px 12px;
}
.v2-answer-card__review-pill {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 10px;
  background: #EFF6FF; border: 1.5px solid #BFDBFE; color: #1D4ED8;
  border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 900;
}
.v2-answer-card__review-pill img { width: 14px; height: 14px; }
.v2-answer-card__foot { margin-top: 12px; }
.v2-answer-card__foot .v2-btn-primary { width: 100%; }
#modal-arena .arena-footer-bar #btn-next-turn { flex-shrink: 0; }

/* ---------- §十 結算畫面 ---------- */
#modal-result .result-title, #modal-result h2 { color: var(--text-primary); }
/* 貓圖＋% 圈上下疊放（舊 .result-visual 固定 106px 方框會令 % 圈壓住分數行） */
#modal-result .result-visual {
  width: auto; height: auto; margin: 0 auto 4px;
  display: flex; flex-direction: column; align-items: center;
}
.w2-result-ring {
  width: 96px; height: 96px; border-radius: 50%; margin: 4px auto 10px;
  display: flex; align-items: center; justify-content: center;
  background: conic-gradient(var(--brand-emerald, #0B8A6A) calc(var(--pct) * 1%), #E2E8F0 0);
}
.w2-result-ring__inner {
  width: 76px; height: 76px; border-radius: 50%; background: #FFFFFF;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 900; color: var(--brand-emerald-dark, #07664E);
}
#result-mistakes { text-align: left; margin-top: 10px; }
#result-mistakes .w2-mistake-item {
  background: #FEF2F2; border: 1.5px solid #FECACA; border-radius: 12px;
  padding: 9px 11px; margin-top: 8px; font-size: 13px; line-height: 1.55; color: #475569;
}
#result-mistakes .w2-mistake-item b { color: #991B1B; }
#modal-result .btn-kraft { background: #FFFFFF; border: 1.5px solid #CBD5E1; color: #334155; box-shadow: 0 3px 0 #CBD5E1; }

/* ---------- §十一 考場中樞雙區 ---------- */
#modal-exam-hub .exam-zone { margin-bottom: 14px; }
#modal-exam-hub .exam-zone__title {
  display: flex; align-items: center; gap: 7px;
  font-size: 15.5px; font-weight: 900; color: var(--text-primary); margin: 0 0 4px;
}
#modal-exam-hub .exam-zone__title img { width: 19px; height: 19px; }
#modal-exam-hub .exam-zone__sub { font-size: 12.5px; line-height: 1.55; color: #64748B; margin: 0 0 10px; }
#modal-exam-hub .mock-paper-btn {
  border: 1.5px solid rgba(203, 213, 225, 0.9); border-bottom-width: 3px;
  box-shadow: 0 4px 10px -6px rgba(15, 23, 42, 0.12);
}
#modal-exam-hub .mock-paper-btn.is-selected {
  border-color: var(--brand-emerald, #0B8A6A); background: var(--brand-mint-soft);
  box-shadow: 0 0 0 1.5px var(--brand-emerald, #0B8A6A), 0 4px 0 rgba(7, 102, 78, 0.35);
}
#modal-exam-hub .btn-kraft, #modal-exam-stage .btn-kraft {
  background: #FFFFFF; border: 1.5px solid #CBD5E1; color: #334155; box-shadow: 0 3px 0 #CBD5E1;
}

/* ---------- §十二 考場作答台 ---------- */
#modal-exam-stage .paper-modal.exam-stage-modal {
  min-height: min(720px, 92dvh); display: flex; flex-direction: column;
}
#modal-exam-stage #exam-play-body { flex: 1 1 auto; display: flex; flex-direction: column; }
.w2-exam-progress {
  height: 12px; border-radius: 999px; background: #E2E8F0; overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.14); margin: 2px 0 12px;
}
.w2-exam-progress__fill {
  height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, #10B981, #0B8A6A); transition: width 0.35s ease;
}
#modal-exam-stage .metric-pill.combo {
  background: var(--brand-mint-soft); border-color: rgba(11, 138, 106, 0.4); color: var(--brand-emerald-dark, #07664E);
}
#modal-exam-stage .metric-pill.count {
  background: #EFF6FF; border-color: #BFDBFE; color: #1D4ED8;
}
#modal-exam-stage.exam-in-report #exam-timer-pill,
#modal-exam-stage.exam-in-report #exam-counter-pill,
#modal-exam-stage.exam-in-report #btn-toggle-scratch { display: none !important; }
/* 重組句子：石板虛線托盤＋立體詞卡 */
#modal-exam-stage .reorder-tray {
  background: #F8FAFC; border: 2px dashed #94A3B8; border-radius: 14px; min-height: 52px;
}
#modal-exam-stage .reorder-tile {
  background: #FFFFFF; border: 1.5px solid #CBD5E1; border-bottom-width: 3.5px;
  border-radius: 12px; color: var(--text-primary); font-weight: 800;
  box-shadow: 0 3px 6px -3px rgba(15, 23, 42, 0.15);
}
#modal-exam-stage .reorder-tile.selected {
  background: var(--brand-mint-soft); border-color: var(--brand-emerald, #0B8A6A); color: var(--brand-emerald-dark, #07664E);
}
/* 長答：橫線紙＋探頭貓 */
#modal-exam-stage #hw-text-input {
  background-image: repeating-linear-gradient(transparent, transparent 27px, rgba(148, 163, 184, 0.4) 28px);
  line-height: 28px; border-color: #CBD5E1; background-color: #FFFFFF;
}
#modal-exam-stage .w2-peek-cat {
  position: absolute; right: 10px; bottom: -6px; width: 64px; height: 64px;
  object-fit: contain; pointer-events: none; z-index: 2;
}
#modal-exam-stage .exam-desk-box { position: relative; overflow: visible; }
/* 自評：薄荷勾選卡 */
#modal-exam-stage .exam-desk-box {
  background: #FFFFFF; border: 1.5px solid rgba(203, 213, 225, 0.9); border-radius: 16px;
}
#modal-exam-stage .paper-field {
  background: #F8FAFC; border: 1.5px solid #E2E8F0; border-radius: 12px; color: var(--text-primary);
}
#modal-exam-stage .selfcheck-kp-row {
  display: flex; align-items: center; gap: 8px;
  background: var(--brand-mint-soft); border: 1.5px solid rgba(11, 138, 106, 0.3);
  border-radius: 12px; padding: 8px 10px; margin-top: 7px;
  font-size: 13.5px; font-weight: 700; color: var(--text-primary); cursor: pointer;
}
#modal-exam-stage .selfcheck-kp-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand-emerald, #0B8A6A); flex-shrink: 0; }
#modal-exam-stage .w2-kp-marks {
  margin-left: auto; flex-shrink: 0; background: #FFFFFF; border: 1.5px solid rgba(11, 138, 106, 0.4);
  color: var(--brand-emerald-dark, #07664E); border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 900;
}
/* 成績章：V2 圓章 */
#modal-exam-stage .exam-grade-seal {
  background: #FFFFFF; border: 3px solid var(--brand-emerald, #0B8A6A); color: var(--brand-emerald-dark, #07664E);
  box-shadow: 0 6px 16px -6px rgba(11, 138, 106, 0.4), inset 0 0 0 3px #FFFFFF, inset 0 0 0 5px rgba(11, 138, 106, 0.35);
  text-shadow: none;
}
#modal-exam-stage .exam-grade-seal.w2-seal-a {
  border-color: #D97706; color: #92400E;
  background: linear-gradient(160deg, #FFFBEB, #FEF3C7);
  box-shadow: 0 6px 16px -6px rgba(217, 119, 6, 0.45), inset 0 0 0 3px #FFFBEB, inset 0 0 0 5px rgba(11, 138, 106, 0.5);
}
#modal-exam-stage .exam-grade-seal.w2-seal-b {
  border-color: var(--brand-emerald, #0B8A6A); color: var(--brand-emerald-dark, #07664E); background: var(--brand-mint-soft);
}
#modal-exam-stage .exam-grade-seal.w2-seal-c {
  border-color: #2563EB; color: #1D4ED8; background: #EFF6FF;
  box-shadow: 0 6px 16px -6px rgba(37, 99, 235, 0.4), inset 0 0 0 3px #EFF6FF, inset 0 0 0 5px rgba(37, 99, 235, 0.35);
}

/* ---------- §十二 交卷確認彈窗 ---------- */
.w2-confirm-backdrop {
  position: fixed; inset: 0; z-index: 1200; display: none;
  align-items: center; justify-content: center; padding: 18px;
  background: rgba(15, 23, 42, 0.5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.w2-confirm-backdrop.open { display: flex; }
.w2-confirm-card {
  width: min(400px, 94vw); background: #FFFFFF; border-radius: 22px; padding: 22px 20px 18px;
  border: 1px solid rgba(203, 213, 225, 0.8); border-bottom: 3px solid rgba(148, 163, 184, 0.45);
  box-shadow: 0 24px 54px rgba(15, 23, 42, 0.28); text-align: center;
  animation: w2CardRise 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.w2-confirm-card h3 { margin: 0 0 8px; font-size: 19px; font-weight: 900; color: var(--text-primary); }
.w2-confirm-card p { margin: 0 0 6px; font-size: 14.5px; line-height: 1.65; color: #475569; }
.w2-confirm-card .w2-confirm-missing { color: #B45309; font-weight: 800; }
.w2-confirm-actions { display: flex; gap: 10px; margin-top: 16px; }
.w2-confirm-actions .w2-btn-white, .w2-confirm-actions .v2-btn-primary { flex: 1; }

/* AppDialog 共用輸入框（PR-FIX-DictSync：取代原生 prompt()） */
.app-dialog-input {
  width: 100%; box-sizing: border-box; margin-top: 10px;
  padding: 12px 14px; font: inherit; font-size: 16px; font-weight: 700; color: var(--text-primary);
  background: #F8FAFC; border: 1.5px solid #CBD5E1; border-radius: 14px; outline: none; text-align: center;
}
.app-dialog-input:focus { border-color: var(--brand-emerald); background: #FFFFFF; }

/* AppDialog 危險確認掣（PR-FIX-DictSync 加單 #2：珊瑚紅立體掣，與主掣同一按壓語言） */
.w2-confirm-actions .v2-btn-primary.app-dialog-btn-danger {
  background: linear-gradient(180deg, #F87171 0%, #DC2626 100%);
  box-shadow: 0 4px 0 #991B1B, 0 8px 18px rgba(220, 38, 38, 0.26);
}
.w2-confirm-actions .v2-btn-primary.app-dialog-btn-danger:active {
  box-shadow: 0 1px 0 #991B1B, 0 3px 8px rgba(220, 38, 38, 0.20);
}
.v2-btn-primary.app-dialog-btn-danger::after { display: none; }

/* 提示抽屜：手機不被底欄遮擋 */
#modal-arena .hints-drawer { max-height: none; }
#modal-arena .paper-modal.arena-modal { max-height: 94dvh; overflow-y: auto; }

/* PR-V2-W2 補正：考場主掣已改用 .v2-btn-primary 類別；此處以同等特異性壓過
   上方 PR-V2-03 的 ID 扁平規則，回復 3D 翡翠主掣外觀（漸變＋唇邊＋按壓）。 */
#modal-exam-stage #btn-exam-next,
#modal-exam-stage #btn-exam-submit-paper {
  background: linear-gradient(180deg, #11A37E 0%, #0B8A6A 100%);
  border: none; border-radius: var(--radius-btn);
  box-shadow: 0 4px 0 #07664E, 0 8px 18px rgba(11, 138, 106, 0.26);
  color: #FFFFFF; padding: 10px 22px;
}
#modal-exam-stage #btn-exam-next:active,
#modal-exam-stage #btn-exam-submit-paper:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #07664E, 0 3px 8px rgba(11, 138, 106, 0.20);
}
#modal-exam-stage.exam-in-report .w2-exam-progress { display: none; }

/* PR-V2-W2 補正（視覺 QC）：成績／自評／覆核畫面殘留啡標題、米黃 KPI 卡與弱項行一併 V2 化 */
#modal-exam-stage .result-heading { color: var(--text-primary); }
#modal-exam-stage .result-score { color: #334155; }
#modal-exam-stage .kpi-card { background: #FFFFFF; border: 1.5px solid rgba(203, 213, 225, 0.9); border-radius: 14px; }
#modal-exam-stage .kpi-label { color: #64748B; }
#modal-exam-stage .kpi-val { color: var(--text-primary); }
#modal-exam-stage .weak-row { background: #F8FAFC; border: 1px solid #E2E8F0; color: #334155; margin-top: 6px; }
#modal-result .result-reward-box, #modal-exam-stage .result-reward-box {
  background: var(--brand-mint-soft); border: 1.5px solid rgba(11, 138, 106, 0.3); border-radius: 16px;
}

/* ============================================================
   PR-Fix-ExamLong：考場長答暖色殘留全清＋探頭貓遮字＋回饋列折行＋PIN 閘
   （layout.css 基底嘅米黃／卡夫規則只喺考場範圍內以 V2 覆寫，其他畫面不受影響）
   ============================================================ */
/* 鷹架卡：白卡＋石板字＋翡翠標題（標題／步驟字色由 exam.js 內聯翡翠深綠＋石板，唔改內容） */
#modal-exam-stage .hw-scaffold-box {
  background: #FFFFFF; border: 1.5px solid #E2E8F0; border-radius: 14px;
  padding: 10px 12px; box-shadow: 0 2px 8px -4px rgba(15, 23, 42, 0.12);
}
/* 標點列：霧灰白條＋V2 白晶片＋石板字形，㩒下薄荷態 */
#modal-exam-stage .punct-keyboard-bar {
  background: #F1F5F9; border: 1px solid #E2E8F0; border-radius: 12px; padding: 7px 9px;
}
#modal-exam-stage .punct-lbl { color: #475569; }
#modal-exam-stage .punct-key {
  background: #FFFFFF; border: 1.5px solid #CBD5E1; border-radius: 10px;
  box-shadow: 0 2px 0 #CBD5E1; color: #1E293B;
}
#modal-exam-stage .punct-key:active {
  background: var(--brand-mint-soft); border-color: var(--brand-emerald, #0B8A6A);
  box-shadow: 0 1px 0 var(--brand-emerald, #0B8A6A); transform: translateY(1px);
}
/* 底部資訊列：石板字＋右側預留探頭貓闊度，狀態文字永不入貓身範圍 */
#modal-exam-stage .hw-meta-strip { color: #475569; padding-right: 84px; }
/* 草稿紙抽屜：霧白＋石板虛線（取代米黃） */
#modal-exam-stage .scratch-drawer { background: #F8FAFC; border-color: #94A3B8; }
/* 輸入框邊框：石板（取代卡夫深啡）——長答格、聆聽筆記、填充格共用 */
#modal-exam-stage .exam-textarea { border-color: #CBD5E1; }
/* 長答格框線：V2 淺石板（同鷹架卡 #E2E8F0 家族，2px 略帶存在感，圓角不變）；
   聚焦時移除瀏覽器預設近黑 outline（真機上會渲染成粗黑框），改翡翠邊作聚焦指示 */
#modal-exam-stage #hw-text-input { border: 2px solid #E2E8F0; }
#modal-exam-stage #hw-text-input:focus { outline: none; border-color: var(--brand-emerald, #0B8A6A); }
#modal-exam-stage .exam-fill-row input { border-color: #CBD5E1; }
/* 手寫畫布框＋筆點環：石板／翡翠（筆色本身係墨水色，唔郁） */
#modal-exam-stage .hw-canvas-frame { border-color: #CBD5E1; background: #FFFFFF; }
#modal-exam-stage .pen-dot { box-shadow: 0 0 0 1.5px #94A3B8; }
#modal-exam-stage .pen-dot.active { box-shadow: 0 0 0 2.5px var(--brand-emerald, #0B8A6A); }
/* 底部回饋列：長答旁白唔再單行截尾，改自然折行（≤480px 既有 nowrap 規則由本 ID 規則覆寫） */
#modal-exam-stage .arena-feedback-text {
  white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.45;
}
/* 黏底回饋列底色：白＋石板實線（取代米黃＋啡虛線） */
#modal-exam-stage .arena-footer-bar { background: #FFFFFF; border-top: 1.5px solid #E2E8F0; }
/* 家長 PIN 閘：白卡內容置中（PIN 圓點／數字板沿用家長台置中排版） */
#modal-exam-gate .exam-gate-card { text-align: center; }
#modal-exam-gate .exam-gate-card .w2-confirm-actions { text-align: left; }
