/* ============================================================================
   vision-correction.css — 視力矯正模擬器（per-sim styles）· layout v1.2
   ----------------------------------------------------------------------------
   Depends on platform tokens (_ds-tokens.css / platform-base.css) + family
   tokens & components (_sim-tokens.css). Defines this sim's "一屏盡覽 landscape
   劇場模式" (design-spec §4.6): a full-viewport fixed overlay (topbar / stage
   console / bottom band) that breaks out of the lesson's narrow column so the
   whole simulator fits one screen with zero page scroll. Visual language
   (tokens / 黑光路 / two-layer / semantic colour) is unchanged from v1.
   Zero external deps, zero build step.
   ============================================================================ */

/* wrapper is token-scope only (display:contents) — the visible thing is the
   fixed .vc-theatre child, so the wrapper carries no card box. */
.sim.vc { display:contents; }

/* body-scroll lock while a theatre is open (design-spec §4.6.8). Global rule.
   overflow:hidden alone does NOT reliably block scroll on mobile Chromium/Safari
   (well-documented iOS-class quirk: a page with a viewport <meta> tag can still be
   scrolled programmatically/by touch past an overflow:hidden root — verified via
   Playwright isMobile emulation, drive.js portrait tests). The robust fix (used by
   body-scroll-lock and similar libs) is position:fixed on body while locked; JS
   (openTheatre/closeTheatre) captures/restores scrollY across the lock via body.top. */
html.vc-body-lock, html.vc-body-lock body { overflow:hidden !important; }
html.vc-body-lock body { position:fixed !important; width:100%; }

/* ==========================================================================
   §4.6-B · 劇場模式 overlay（open state）— 全視窗一屏 landscape
   ========================================================================== */
.vc-theatre {
  position:fixed; inset:0; z-index:1000;
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;   /* 頂欄 / 舞台 / 底條 */
  grid-template-columns:minmax(0,1fr);          /* 單欄 0-min：子項須縮至 viewport */
  gap:clamp(8px, 1.4vh, 14px);
  padding:clamp(8px, 1.4vh, 16px);
  height:100dvh; width:100vw;
  margin:0; border:0; box-shadow:none;          /* override .sim card box */
  background:var(--bg);
  overflow:hidden;                              /* 硬 guard：全屏容器內任何東西都不得溢出視窗 */
  font-family:var(--font); color:var(--ink);
  /* boss 2026-07 回饋：投影/學生睇清楚 → 劇場內文字整體升一級。只喺 .vc-theatre
     子樹覆寫結構字階（家族 `_sim-tokens.css` 基線不動，唔影響劇場外的「開啟模擬器」
     啟動卡）；一屏零滾動靠鬆排版密度承托，唔靠縮字（見下方 rail 間距/padding 調整）。 */
  --t-xs:   .8125rem;   /* 12px → 13px */
  --t-cap:  .875rem;    /* 13px → 14px */
  --t-sm:   1rem;       /* 14px → 16px */
  --t-body: 1.0625rem;  /* 16px → 17px */
  --t-h3:   1.25rem;    /* 18px → 20px */
  --t-h2:   1.5rem;     /* 22px → 24px */
  --t-h1:   1.875rem;   /* 28px → 30px */
}
.vc-theatre[hidden] { display:none; }
.vc-theatre > * { min-width:0; }                /* 防 grid 子項 min-width:auto 撐爆共享欄（§4.6.8） */

/* ---- 頂欄：品牌 + flow 指示 + 引導/關閉 ---- */
.vc-topbar { display:flex; align-items:center; gap:var(--s-4);
  padding:var(--s-2) var(--s-3); min-height:48px;
  background:var(--surface); border:1px solid var(--hairline);
  border-radius:var(--radius-sm); box-shadow:var(--shadow-rest); }
.vc-topbar .brand { font-size:var(--t-sm); font-weight:700; color:var(--ink); white-space:nowrap;
  display:flex; align-items:center; gap:6px; min-width:0; overflow:hidden; text-overflow:ellipsis; }
.vc-topbar .brand .ic { font-size:1.1rem; }
.vc-topbar-spacer { flex:1; }
.vc-topbar .vc-hint-btn, .vc-topbar .vc-close { flex:none; }

/* flow 指示（pills；showStage 切 on/done） */
.vc-topbar .vc-flownav { display:flex; align-items:center; gap:5px; flex-wrap:nowrap; overflow:hidden;
  font-size:var(--t-xs); color:var(--ink3); margin:0; }
.vc-topbar .vc-flow-step { padding:3px 10px; border-radius:var(--radius-pill); background:var(--band);
  font-weight:600; white-space:nowrap; }
.vc-topbar .vc-flow-step.on { background:var(--accent); color:var(--accent-on); }
.vc-topbar .vc-flow-step.done { background:var(--ok-soft); color:var(--ok-text); }

/* ---- 舞台中列：疊放四階段（console + 前/後測/結果 flowcard）+ 引導 sheet ---- */
.vc-mid { position:relative; min-width:0; min-height:0;
  display:grid; grid-template-columns:1fr; grid-template-rows:1fr; }
.vc-mid > * { grid-area:1 / 1; min-width:0; min-height:0; }

/* ---- 舞台：landscape console（三格）---- */
.vc-console {
  display:grid; min-height:0;
  max-width:1680px; width:100%; height:100%; margin:0 auto;
  grid-template-columns:minmax(0,1.55fr) minmax(340px, 1fr);
  grid-template-rows:minmax(0,1.35fr) minmax(0,1fr);
  grid-template-areas:
    "mechanism control"
    "primary   control";
  gap:clamp(8px, 1.4vh, 16px);
}
.vc-console .sim-panel { min-height:0; margin:0; padding:var(--s-3); gap:var(--s-2); }
.vc-console .m-mech, .vc-console .vc-mechanism { grid-area:mechanism; }
.vc-console .m-primary, .vc-console .vc-primary { grid-area:primary; }
.vc-console .m-control, .vc-console .vc-control { grid-area:control; overflow:auto; }  /* 右側全高 rail：內容超高才 contained scroll，永不整頁滾 */
.vc-console .sim-panel-h { flex:none; }
/* 格標題原壓 --t-xs 遷就緊湊 console；boss 反映過小 → 回復 --t-sm（隨劇場字階升級），
   改由下面鬆排版密度（padding/gap）承托，唔再靠壓細標題爭位。 */
.vc-console .sim-panel-t { font-size:var(--t-sm); }
/* control rail 縱向 padding 額外收緊（品控 bounce#2 P0②，見下方 rail 段落註解）*/
.vc-console .m-control.sim-panel { padding-top:var(--s-1); padding-bottom:var(--s-1); }

/* SVG 舞台：flex 撐滿剩餘高、SVG 等比縮到盒內（取代 v1 的 height:auto → 不再向下溢出）*/
.m-stage { flex:1; min-height:0; display:flex; align-items:center; justify-content:center;
  background:var(--sim-stage); border:1px solid var(--sim-stage-bd);
  border-radius:var(--radius-sm); padding:var(--s-2); overflow:hidden; }
.m-stage svg { width:100%; height:100%; display:block; }   /* viewBox + 預設 meet → 等比縮 */
.m-note { flex:none; font-size:var(--t-xs); color:var(--ink2); line-height:1.4; }

/* ---- control rail（③）：toggles 2 欄省高、sliders 全寬 ---- */
.m-control .rail-toggles { display:grid; grid-template-columns:1fr 1fr; gap:var(--s-1); }
.m-control .vc-toggle-block { gap:3px; }
.m-control .vc-toggle-cap { font-size:var(--t-xs); color:var(--ink3); font-weight:600; text-align:center; line-height:1.2; }
.m-control .sim-seg { width:100%; justify-content:center; }
.m-control .sim-seg button { flex:1; padding:0 var(--s-2); min-height:34px; font-size:var(--t-cap); justify-content:center; }
/* 品控 bounce#2 P0②：收窄 rail 排版密度令 n 滑桿正下方「鏡片剖面＋厚度數字」
   落入 1280×720 可視 fold（縮 gap/padding/滑桿盒高，唔縮字級、唔改幾何比例） */
.m-control .vc-controls { gap:var(--s-1); }
.m-control .sim-panel-h { margin-bottom:2px; }
.m-control .sim-ctrl { gap:3px; }
.m-control .sim-ctrl-note { line-height:1.25; }
.m-control .sim-range-wrap { min-height:26px; }

/* ==========================================================================
   結構性根治（品控 delta FAIL，跨多輪 bounce 共源根因）：所有先前 bounce 都是
   靠壓死固定尺寸（47px lens-stage、26px range-wrap…）去湊夠 1280×720 一屏，
   假設從未變過「視窗高度＝720px」——一旦矮過（品控實測：/pilot 700px、/learn
   680px），固定尺寸元素照舊佔位，把核心反饋（n 滑桿→厚度數字→透鏡剖面）擠出
   .vc-control 可視 fold。§4.6.7 承諾 landscape 560px 起保證一屏零滾動，故呢個
   假設本身就是錯的——要治的是「rail 用固定垂直預算」，不是再調一個數。

   根治：rail 內容分兩截（JS 已對應包裝 .vc-rail-scroll / .vc-rail-core）：
   - .vc-rail-scroll（次要／可壓縮：模式 toggles＋主滑桿＋度數大字）flex:1 +
     min-height:0 + overflow-y:auto —— 視窗越矮，呢截自己內部先儘量捲，唔會
     頂爆版面。
   - .vc-rail-core（核心反饋簇：n 滑桿→厚度數字→透鏡剖面）flex:none —— 永遠
     攞返自己嘅完整內容高度，喺 .vc-controls 分配空間時第一優先，唔會被壓縮
     或擠走；scroll 截淨袋剩餘空間，剩多少得多少，甚至可以是 0。
   結果：560→720px 全段，n 滑桿＋反饋永遠同屏可見，唔使內部滾動；只有非核心
   內容（次要 toggles／度數）會隨視窗變矮而先進入 contained-scroll。 */
.m-control .vc-controls { flex:1 1 auto; min-height:0; }
.m-control .vc-rail-scroll { flex:1 1 auto; min-height:0; overflow-y:auto;
  display:flex; flex-direction:column; gap:var(--s-1); }
.m-control .vc-rail-core { flex:none; display:flex; flex-direction:column; gap:var(--s-1); }

/* 鏡片剖面壓縮盒（compact；剖面幾何不變，只縮盒）。
   boss bug report 2026-07-05「右下缺失了透鏡形狀」：上一輪 30px 盒（border-box，
   扣 padding 後內容高僅 22px）令鏡片渲染成一條 <16px 細片、形狀不可辨。回升至 47px
   （對 pilot 入口（fold 淨耗最緊嗰邊）淨耗 17px，仍留 ~6px 緩衝）＋縱向 padding 由
   4px 收窄至 1px（橫向不變）進一步讓渡內容高度→實際內容高 45px；配合 JS viewBox
   240×90（見 renderLensProfile，鏡片豎向填滿由 69%推到 89%）令鏡片實際渲染高度
   回升至 ~40px，凹/凸形狀＋厚薄差異肉眼可辨。 */
.m-control .vc-lens-stage { height:47px; display:flex; align-items:center; justify-content:center; padding:1px var(--s-1); }
.m-control .vc-lens-stage svg { width:auto; height:100%; max-width:100%; }
.m-control .vc-lens-nums { margin-top:0; padding:1px 6px; }
.m-control .vc-lens-nums .vc-lens-vals { margin-top:2px; }

/* ---- 底條：狀態帶（因→果文字錨，aria-live）+ 引導步驟 + 進行後測 ---- */
.vc-bottombar { display:flex; align-items:center; gap:var(--s-4);
  padding:var(--s-2) var(--s-4); min-height:46px;
  background:var(--surface); border:1px solid var(--hairline);
  border-radius:var(--radius-sm); box-shadow:var(--shadow-rest); }
.vc-bottombar .vc-status { font-size:var(--t-sm); color:var(--ink2); font-weight:600; white-space:nowrap;
  overflow:hidden; text-overflow:ellipsis; min-width:0; }
.vc-bottombar .vc-status b { color:var(--ink); font-family:var(--font-num); }
.vc-topost-wrap { flex:none; margin:0; text-align:right; }
.vc-topost { max-width:none; }

/* 引導步驟指示（scaffold 降維成一行；點按展開 bottom-sheet） */
.vc-steps { display:flex; align-items:center; gap:6px; flex:1; justify-content:center; overflow:hidden;
  border:0; background:transparent; cursor:pointer; font-family:var(--font); min-width:0; }
.vc-steps .step { display:flex; align-items:center; gap:5px; font-size:var(--t-xs); color:var(--ink3);
  font-weight:600; white-space:nowrap; }
.vc-steps .step .n { width:20px; height:20px; border-radius:50%; background:var(--band);
  display:inline-flex; align-items:center; justify-content:center; font-family:var(--font-num); font-size:11px; }
.vc-steps .step.on { color:var(--accent-text); }
.vc-steps .step.on .n { background:var(--accent); color:var(--accent-on); }
.vc-steps .step.done { color:var(--ok-text); }
.vc-steps .step.done .n { background:var(--ok-soft); color:var(--ok-text); }
.vc-steps .arw { color:var(--ink3); }
.vc-steps:focus-visible { outline:3px solid var(--accent); outline-offset:2px; border-radius:var(--radius-sm); }

/* ---- 引導 bottom-sheet（scaffold predict→operate→verify；覆蓋，不推高三格）---- */
.vc-sheet { position:absolute; left:0; right:0; bottom:0; z-index:6;
  max-height:40%; overflow:auto;
  background:var(--surface); border:1px solid var(--hairline);
  border-radius:var(--radius-sm) var(--radius-sm) 0 0;
  box-shadow:0 -10px 34px rgba(0,0,0,.14);
  padding:var(--s-3) var(--s-4); }
.vc-sheet[hidden] { display:none; }
.vc-sheet-h { display:flex; align-items:center; justify-content:space-between; gap:var(--s-3); margin-bottom:var(--s-2); }
.vc-sheet-h .t { font-size:var(--t-xs); letter-spacing:.06em; text-transform:uppercase;
  color:var(--accent-text); font-weight:700; }
.vc-sheet .vc-scaffold { margin:0; border-left:0; box-shadow:none; border:0; padding:0; background:transparent; }

/* ---- 引導與延伸抽屜（guide：預測解鎖 + PhET + 假設）---- */
.vc-drawer { position:fixed; top:0; right:0; bottom:0; z-index:1010;
  width:min(430px, 92vw); overflow:auto;
  background:var(--surface); border-left:1px solid var(--hairline);
  box-shadow:-14px 0 44px rgba(0,0,0,.20);
  padding:var(--s-4); display:flex; flex-direction:column; gap:var(--s-3); }
.vc-drawer[hidden] { display:none; }
.vc-drawer-h { display:flex; align-items:center; justify-content:space-between; gap:var(--s-3); }
.vc-drawer-h .t { font-size:var(--t-h3); font-weight:700; color:var(--ink); }
.vc-drawer .vc-guide { margin:0; }

/* ---- flow 階段卡（前/後測/結果）：劇場內置中單屏 ---- */
.vc-mid > .vc-stage-pre,
.vc-mid > .vc-stage-post,
.vc-mid > .vc-stage-results { display:grid; place-items:center; overflow:auto; padding:var(--s-2); }
.vc-mid > .vc-stage-pre > *,
.vc-mid > .vc-stage-post > *,
.vc-mid > .vc-stage-results > * { width:min(560px, 96%); max-height:100%; overflow:auto; }

/* ==========================================================================
   §4.6.7 · portrait / 矮視窗 fallback：console 轉單欄 + contained scroll + 轉屏提示
   （不採 transform:scale fit；直向仍整頁不滾、仍全螢幕專注）
   ========================================================================== */
.vc-rotate-hint { display:none; }
@media (max-aspect-ratio:6/5), (max-height:559px) {
  .vc-console {
    grid-template-columns:1fr; grid-template-rows:none;
    grid-template-areas:"hint" "primary" "mechanism" "control";
    overflow-y:auto;   /* 只 console body 內滾，整頁與頂/底條永不滾 */
  }
  .vc-console .m-control, .vc-console .vc-control { overflow:visible; }
  .vc-console .sim-panel { min-height:auto; }
  .m-stage { min-height:180px; flex:none; }
  .m-control .vc-lens-stage { height:auto; }
  .m-control .vc-lens-stage svg { width:100%; height:auto; }
  /* 品控 bounce#3 回歸修：桌面劇場 rail 為咗喺 1280×720 塞落 fold，把觸控目標壓細
     過 --tap-min（sim-seg button min-height:34px、sim-range-wrap min-height:26px，
     見上面桌面 .m-control 規則）——呢個壓縮只應該喺有滑鼠嘅桌面 landscape 劇場先
     成立，portrait/矮視窗（觸控為主）要覆寫回標準 44px 觸控目標，否則手機用戶按
     不中按鈕。桌面壓縮值在此 media query 之外，不受影響。 */
  .m-control .sim-seg button { min-height:var(--tap-min); }
  .m-control .sim-range-wrap { min-height:var(--tap-min); }
  /* landscape 矮視窗結構性根治（.vc-rail-scroll/.vc-rail-core，見上面桌面段落
     大註解）只適用於 landscape console：portrait/矮視窗 fallback 本身已經是
     「成個 .vc-console 一件過 contained-scroll、rail 唔再獨立捲」，兩截拆分
     喺呢度冇意思仲會整多層冗餘 overflow-y:auto。打返做純自然流排版，行為同
     呢輪修改前一致（唔影響 bounce#3 已驗證嘅 portrait 觸控/順序回歸）。 */
  .m-control .vc-controls,
  .m-control .vc-rail-scroll,
  .m-control .vc-rail-core { flex:none; min-height:auto; overflow:visible; }
  .vc-rotate-hint { display:flex; align-items:center; gap:8px; grid-area:hint;
    font-size:var(--t-xs); color:var(--warn-text); background:var(--warn-soft);
    border-radius:var(--radius-sm); padding:6px 12px; }
  /* 窄頂欄：收起 flow 標籤、壓縮品牌，保住「✕ 返回課文」關閉按鈕永遠可見 */
  .vc-topbar { gap:var(--s-2); }
  .vc-topbar .vc-flownav { display:none; }
  .vc-topbar .brand { font-size:var(--t-xs); }
  .vc-topbar .vc-hint-btn { font-size:0; padding:0 var(--s-3); }
  .vc-topbar .vc-hint-btn::before { content:"？"; font-size:var(--t-sm); }
  /* 底條：窄屏收起狀態文字，保住進行後測 + 步驟 */
  .vc-bottombar .vc-status { display:none; }
  .vc-sheet { max-height:50%; }
}

/* ==========================================================================
   ① 你所見（primary）：程式繪製場景 + CSS filter:blur（GPU，S1 結論）
   ========================================================================== */
.vc-scene { display:block; width:100%; height:100%;
  filter:blur(0px);                                     /* live 由 blurPx 驅動 */
  transition:filter var(--dur) var(--ease); will-change:filter; }
.m-primary .m-stage { background:#FBFBFD; }             /* 視力表底（白瓷） */
.vc-scene-cap { flex:none; font-size:var(--t-xs); color:var(--ink2); text-align:center; }

/* ② 眼球側視光路（mechanism）：SVG 儀器台 note */
.vc-mech-note { flex:none; font-size:var(--t-xs); color:var(--ink2); }

/* 調節代償提示（潛伏性遠視／老花靠調節維持清晰時） */
.vc-accom-note { flex:none; font-size:var(--t-xs); color:var(--warn-text); background:var(--warn-soft);
  border-radius:var(--radius-sm); padding:6px 10px; line-height:1.4; }

/* ==========================================================================
   ③ 眼鏡矯正（control）：控制 + 鏡片剖面
   ========================================================================== */
.vc-controls { display:flex; flex-direction:column; gap:var(--s-4); }
.vc-row { display:flex; flex-direction:column; gap:var(--s-2); }
.vc-toggle-block { display:flex; flex-direction:column; align-items:center; gap:4px; }
.vc-toggle-cap { font-size:var(--t-xs); color:var(--ink2); font-weight:600; text-align:center; }

/* 探索模式按鈕：未解鎖時視覺鎖定（boss 回饋：睇落要似鎖住，唔好似壞咗嘅掣）。
   刻意不用原生 disabled——按下去仍要即時彈提示引導去預測題，原生 disabled
   會令瀏覽器完全不 fire click，做不到「按下去彈提示」。改用 aria-disabled
   + 視覺淡化，維持可操作但睇得出鎖住（WAI-ARIA APG 對「要解釋唔可用原因」
   按鈕嘅建議做法）。 */
.sim-seg button[aria-disabled="true"] { opacity:.55; cursor:not-allowed; }
.sim-seg button[aria-disabled="true"] .lock { opacity:1; margin-left:2px; }

/* 鏡片剖面 stage（厚薄視覺化） */
.vc-lens-stage { background:var(--sim-stage); border:1px solid var(--sim-stage-bd);
  border-radius:var(--radius-sm); padding:var(--s-2); }
.vc-lens-stage svg { display:block; width:100%; height:auto; }
/* 品控 bounce#3 P0-v2（結構性根治，非壓縮）：本區以前為 display:flex + flex-wrap，
   「n=」「中心厚」「<b>1.00</b>」…每個文字片段／<b> 都各自變成獨立 flex item，
   逐個 item 之間被逼加 column-gap（12px）——人為撐大咗數值行嘅視覺闊度，令佢喺
   實際內容遠未頂到 rail 可用闊度（實測 nowrap ≈340px，1280×720 劇場可用 ≈464px，
   淨空 120px+）就提早摺行；摺唔摺行隨 n 令小數位/位數變化而不定（掃 n 全域 13 點
   有 11 點摺行、2 點唔摺），令固定 margin 預留必然有時啱有時穿（上輪 21px 靜態
   預留只喺唔摺行嗰刻啱，一摺行盒高多 23px 即溢出）。
   根治：改用純文字區塊排版（.vc-lens-type / .vc-lens-vals 各自一個 block、
   text-align:center），去咗 flex-item 間嘅人為 gap——數值行變成單一元素，
   文字自然流走，喺 n 全域掃描下量得恆定單行、盒高唔再隨 n 跳動。 */
.vc-lens-nums { font-family:var(--font-num); font-size:var(--t-xs); color:var(--ink2);
  text-align:center; margin-top:var(--s-1); padding:2px 6px; border-radius:8px;
  transition:background .5s ease; }
/* 數值本身比周邊字眼放大一級（「主數字重、單位次」慣例）；折射率滑桿在配鏡模式下
   只改厚薄（不改度數/成像），效果較隱晦 — 靠此放大 + 下面 .vc-flash 短暫 highlight
   讓學生睇得出「有郁」（boss 2026-07 回饋：唔好靜靜地變）。 */
.vc-lens-nums b { color:var(--ink); font-size:var(--t-sm); font-weight:700; }
/* 鏡片類型／限幅提示：由 SVG text 移做 HTML 字（bounce#2 P0②）——恆定用 --t-xs／--t-sm
   渲染，唔隨 .vc-lens-stage 盒高縮放，令壓縮 rail 高度時唔會跌穿可辨字級。
   獨立一個 block（唔再靠 flex-basis:100%）令佢同下面數值行天然分行。 */
.vc-lens-nums .vc-lens-type { font-family:var(--font); font-weight:600;
  color:var(--ink); font-size:var(--t-sm); }
/* 數值行（bounce#3 新增）：獨立 block，文字自然流走（冇 flex 人為 gap）；
   窄屏（portrait）闊度不足時仍可自然換行，唔會再突然跳成兩倍高。 */
.vc-lens-nums .vc-lens-vals { margin-top:var(--s-1); }
.vc-lens-nums .vc-lens-clamp { color:var(--warn-text); font-weight:600; font-size:var(--t-xs); }
.vc-lens-nums.vc-flash { background:var(--accent-soft); }
.vc-lens-nums.vc-flash b { color:var(--accent-text); }
@media (prefers-reduced-motion:reduce){ .vc-lens-nums { transition:none; } }

/* 度數大字（配鏡模式鎖存，探索模式隨 n 變） */
.vc-degree { text-align:center; }
.vc-degree .big { font-family:var(--font-num); font-size:var(--t-h3); font-weight:700; color:var(--ink); }
.vc-degree .lab { font-size:var(--t-xs); color:var(--ink2); }
.vc-locktag { display:inline-flex; align-items:center; gap:4px; font-size:var(--t-xs);
  color:var(--accent-text); font-weight:600; }

/* ---- 引導 / 預測題 / PhET 區（現於抽屜內） ---- */
.vc-guide { display:flex; flex-direction:column; gap:var(--s-3); }
.vc-predict { border-top:3px solid var(--accent); }
.vc-phet { display:flex; align-items:center; gap:var(--s-3); flex-wrap:wrap;
  background:var(--band); border:1px solid var(--hairline); border-radius:var(--radius-sm);
  padding:var(--s-3) var(--s-4); }
.vc-phet .txt { flex:1; min-width:160px; }
.vc-phet .txt .t { font-size:var(--t-sm); font-weight:700; color:var(--ink); }
.vc-phet .txt .s { font-size:var(--t-xs); color:var(--ink2); }

/* 簡化假設明示（design-spec §6.3 / S3 §6） */
.vc-assump { font-size:var(--t-xs); color:var(--ink3); line-height:1.5;
  padding-top:var(--s-3); border-top:1px solid var(--hairline); }
.vc-assump summary { cursor:pointer; color:var(--ink2); font-weight:600; }

/* ==========================================================================
   M2 · flow（前測 → 模擬器 → 後測 → 結果）flowcard 內容樣式
   （頂欄 flow 指示已在 .vc-topbar；此處為卡內樣式）
   ========================================================================== */
.vc-flownav { display:flex; align-items:center; gap:6px; flex-wrap:wrap;
  font-size:var(--t-xs); color:var(--ink3); }
.vc-flow-step { padding:3px 10px; border-radius:var(--radius-pill); background:var(--band); font-weight:600; }
.vc-flow-step.on { background:var(--accent); color:var(--accent-on); }
.vc-flow-step.done { color:var(--ok-text); background:var(--ok-soft); }
.vc-flow-sep { color:var(--ink3); }

/* 試行題目標籤（QUESTIONS_APPROVED=false） */
.vc-trial { display:inline-flex; align-items:center; gap:4px; font-size:var(--t-xs); font-weight:700;
  color:var(--warn-text); background:var(--warn-soft); padding:2px 10px; border-radius:var(--radius-pill); }

/* 前後測卡 */
.vc-test { border-top:3px solid var(--accent); }
.vc-test-head { display:flex; align-items:center; justify-content:space-between; gap:var(--s-3); flex-wrap:wrap; }
.vc-test-hint { font-size:var(--t-sm); color:var(--ink2); margin:var(--s-1) 0 var(--s-3); }
.vc-test-proglab { font-family:var(--font-num); font-size:var(--t-xs); color:var(--ink2); margin-bottom:6px; text-align:center; }
.vc-test .bar { margin-bottom:var(--s-4); }
.vc-test-stem { font-size:var(--t-body); font-weight:600; color:var(--ink); margin:0 0 var(--s-2); }

/* scaffolding predict→operate→verify（現於 bottom-sheet 內） */
.vc-scaffold { border-left:4px solid var(--accent); }
.vc-sc-step { margin-top:var(--s-3); }
.vc-sc-step p { margin:0 0 var(--s-2); }
.vc-sc-hidden { display:none; }
.vc-sc-ok { color:var(--ok-text); font-weight:600; }
.vc-sc-miss { color:var(--ink2); }
.vc-pred { font-weight:700; color:var(--accent-text); }

/* 進行後測按鈕 */
.vc-topost.ready { animation:vc-pulse 1.2s var(--ease) 2; }
@keyframes vc-pulse { 0%,100%{ box-shadow:0 0 0 0 var(--accent-soft) } 50%{ box-shadow:0 0 0 6px var(--accent-soft) } }
.vc-topost-note { font-size:var(--t-xs); color:var(--ink3); margin-top:var(--s-2); }
@media (prefers-reduced-motion:reduce){ .vc-topost.ready { animation:none; } }

/* 結果卡 */
.vc-results { border-top:3px solid var(--ok-fill); }
.vc-score { font-size:var(--t-h2); text-align:center; color:var(--ink); margin:var(--s-2) 0; }
.vc-score b { font-family:var(--font-num); color:var(--accent-text); }
.vc-score b.up { color:var(--ok-text); }
.vc-score-note { text-align:center; font-size:var(--t-sm); color:var(--ink2); margin-bottom:var(--s-4); }
.vc-qtable { display:flex; flex-direction:column; gap:6px; margin-bottom:var(--s-4); }
.vc-qrow { display:flex; align-items:center; gap:var(--s-3); font-size:var(--t-sm); }
.vc-qrow .qn { color:var(--ink2); min-width:5em; }
.vc-qrow .qp { font-family:var(--font-num); font-weight:700; padding:2px 10px; border-radius:var(--radius-pill); }
.vc-qrow .qp.ok { background:var(--ok-soft); color:var(--ok-text); }
.vc-qrow .qp.no { background:var(--bad-soft); color:var(--bad-text); }
.vc-results-acts { display:flex; gap:var(--s-2); flex-wrap:wrap; justify-content:center; }
.vc-results-note { font-size:var(--t-xs); color:var(--ink3); margin-top:var(--s-3); line-height:1.5; text-align:center; }

/* 探索模式進階記號（design-spec §5.2：提醒「改 n 移動焦點」是理想化前提） */
.sim.explore-active .vc-control { position:relative; }
.sim.explore-active .vc-control::before {
  content:"🎯 探索模式"; position:absolute; top:var(--s-1); right:var(--s-1);
  font-size:10px; font-weight:700; color:var(--warn-text);
  background:var(--warn-soft); padding:2px 8px; border-radius:var(--radius-pill); z-index:2; }

/* horizontal-overflow guard */
.vc-theatre, .vc-theatre * { max-width:100%; }
.vc-theatre svg { max-width:100%; }

/* ==========================================================================
   建議面板（#20 M8）：劇場內置中對話框 + 半透明背幕。全用既有 tokens。
   ========================================================================== */
.vc-suggest { position:fixed; inset:0; z-index:1020; display:flex; align-items:center; justify-content:center;
  padding:var(--s-4); background:rgba(0,0,0,.34); }
.vc-suggest[hidden] { display:none; }
.vc-suggest-card { width:min(460px, 96%); max-height:88vh; overflow:auto;
  background:var(--surface); border:1px solid var(--hairline); border-radius:var(--radius-sm);
  box-shadow:0 18px 50px rgba(0,0,0,.28); padding:var(--s-4); display:flex; flex-direction:column; gap:var(--s-3); }
.vc-suggest-hd { display:flex; align-items:center; justify-content:space-between; gap:var(--s-3); }
.vc-suggest-t { font-size:var(--t-h3); font-weight:700; color:var(--ink); }
.vc-suggest-x { flex:none; border:0; background:transparent; cursor:pointer; font-size:1.1rem;
  color:var(--ink3); line-height:1; padding:4px 8px; border-radius:var(--radius-sm); min-height:34px; }
.vc-suggest-x:hover { background:var(--band); color:var(--ink); }
.vc-suggest-desc { font-size:var(--t-sm); color:var(--ink2); line-height:1.5; }
.vc-suggest-ta { width:100%; box-sizing:border-box; resize:vertical; min-height:96px;
  font-family:inherit; font-size:var(--t-sm); color:var(--ink); line-height:1.5;
  background:var(--bg); border:1px solid var(--hairline); border-radius:var(--radius-sm); padding:var(--s-2); }
.vc-suggest-ta:focus-visible { outline:2px solid var(--accent); outline-offset:1px; border-color:var(--accent); }
.vc-suggest-status { font-size:var(--t-xs); min-height:1.2em; color:var(--ink2); line-height:1.4; }
.vc-suggest-status.ok { color:var(--ok-text); font-weight:600; }
.vc-suggest-status.warn { color:var(--warn-text); font-weight:600; }
.vc-suggest-status.bad { color:var(--bad-text); font-weight:600; }
.vc-suggest-actions { display:flex; justify-content:flex-end; gap:var(--s-2); }
.ext-tag{display:inline-block;margin-left:6px;padding:1px 8px;border:1px solid var(--ink3,#8a8f98);border-radius:999px;font-size:.78em;font-weight:500;line-height:1.5;color:var(--ink2,#4a4f57);background:transparent;vertical-align:middle;white-space:nowrap}
