/* 练习模式（question-focus.js）：原地进入。题目列表的位置换成一题一屏的视图（.qf-inline），页头、筛选和顶部标签照常可用。
   卡片的样子跟大厅卡片一致（头部是题号和信息行，下面是题目），居中、最宽 960px。
   配色全部取 tmua-hall.css 的 .tmua-scope 令牌（默认 / 暖纸书房 / 流光玻璃，浅色 / 深色）。
   纯 CSS（不用 Tailwind 类，不需要重新构建）。 */

/* ---------- where the view sits: the list it replaces is hidden, not cleared ---------- */
body.qf-hall-desk #questionsGrid { display: none !important; }
body.qf-hall-phone #mobileStudyFeed { display: none !important; }
.fav-detail-view.qf-fav-on #favDetailCards,
.fav-detail-view.qf-fav-on .fav-detail-foot { display: none !important; }

.qf-inline {
    --qf-max: 960px;
    position: relative; width: 100%; max-width: var(--qf-max); min-width: 0; margin: 14px auto 0;
    color: var(--tm-ink); font-family: inherit;
}
.fav-detail-view .qf-inline { margin-top: 18px; }
.qf-inline button { font-family: inherit; }
.qf-inline :where(button, summary, a, [tabindex]):focus-visible { outline: 2px solid var(--tm-focus); outline-offset: 2px; }
.qf-inline [hidden] { display: none !important; }

/* ---------- top bar: title · tag · 已做 x · 还剩 y · ✓ c / a · ⏱ mm:ss · ⌨ ---------- */
.qf-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 0 2px 10px; color: var(--tm-muted); font-size: 13px; }
.qf-title { flex: 1 1 auto; min-width: 0; margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--tm-ink); font-size: 14.5px; font-weight: 700; }
.qf-tagline { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.qf-tag { padding: 2px 10px; border-radius: 999px; background: var(--tm-flag-tint); color: var(--tm-flag); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.qf-progress { color: var(--tm-ink-2); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.qf-score { color: var(--tm-ok); font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.qf-clock {
    display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 11px;
    border: 1px solid var(--tm-line); border-radius: 999px; background: var(--tm-surface); color: var(--tm-ink-2);
    font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer;
}
.qf-clock:hover { border-color: var(--tm-line-2); }
.qf-clock svg { display: block; flex: none; }
.qf-clock[aria-pressed="false"] { color: var(--tm-muted); padding: 0 8px; }
.qf-clock-time::after { content: attr(data-elapsed); }
.qf-icon svg { display: block; }
.qf-icon {
    flex: none; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0;
    border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--tm-ink-2); cursor: pointer;
}
.qf-icon:hover { border-color: var(--tm-line); background: var(--tm-surface-2); }
.qf-exitbtn { min-height: 34px; padding: 0 12px; }

/* ---------- the card: like a hall card ---------- */
.qf-stage { position: relative; outline: none; }
.qf-card-wrap { min-width: 0; }
.qf-card {
    display: grid; overflow: hidden; border: 1px solid var(--tm-line); border-radius: 12px;
    background: var(--tm-surface); color: var(--tm-ink); box-shadow: 0 4px 16px rgb(74 70 46 / 3%);
}
.qf-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; min-height: 58px; padding: 12px 24px; border-bottom: 1px solid var(--tm-line); }
.qf-card-title { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0; color: var(--tm-ink); font: 650 19px/1.3 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: -.5px; }
.qf-card-title .tmua-badge { height: 22px; padding: 0 8px; font-family: inherit; font-size: 11.5px; letter-spacing: 0; }
.qf-meta { display: flex; flex: 1 1 260px; flex-wrap: wrap; align-items: center; gap: 2px 8px; min-width: 0; color: var(--tm-muted); font-size: 13.5px; line-height: 1.6; }
.qf-meta-sep { color: var(--tm-line-2); }
.qf-card-body { display: grid; gap: 12px; min-width: 0; padding: 18px 24px 20px; }
.qf-card .tm-q-stem { font-size: 16.5px; }
.qf-card .tm-opt { min-height: 46px; }
.qf-card .tmua-result:empty { display: none; }
.qf-answer { border: 1px solid var(--tm-line); border-radius: 10px; background: var(--tm-surface-2); }
.qf-answer > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; list-style: none; color: var(--tm-ink-2); font-size: 14px; font-weight: 700; cursor: pointer; user-select: none; }
.qf-answer > summary::-webkit-details-marker { display: none; }
.qf-answer-caret { color: var(--tm-muted); font-size: 12px; transition: transform .12s; }
.qf-answer[open] > summary .qf-answer-caret { transform: rotate(180deg); }
.qf-answer .tmua-answer-body { padding: 4px 14px 14px; border-radius: 0 0 10px 10px; background: var(--tm-surface); color: var(--tm-ink); }
.qf-answer .tmua-answer-body:empty { display: none; }
/* 看答案 before answering: still there, but quiet (DF F5) */
.qf-card:has([data-tmh-live]) .qf-answer:not([open]) { border-style: dashed; background: transparent; }
.qf-card:has([data-tmh-live]) .qf-answer:not([open]) > summary { color: var(--tm-muted); font-size: 13px; font-weight: 500; }
.qf-card-locked .tmua-lock-panel { flex-direction: column; align-items: flex-start; }
.qf-lock-skip { color: var(--tm-muted); font-size: 13px; }

/* ---------- footer: ← 上一题 · ☆ 收藏 · ＋ 入卷 … [下一题 →], kept in sight at the bottom of the page ---------- */
/* A small floating bar, centred under the card (it stays clear of the 小巴拉 widget in the bottom-right corner). */
.qf-foot {
    position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; gap: 8px;
    width: fit-content; max-width: 100%; margin: 12px auto 14px; padding: 7px;
    border: 1px solid var(--tm-line); border-radius: 14px; background: var(--tm-surface); box-shadow: 0 8px 24px rgb(15 23 42 / 10%);
}
.qf-spacer { flex: 0 0 6px; }
.qf-foot .qf-primary { min-width: 120px; }
.qf-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px;
    border: 1px solid var(--tm-line-2); border-radius: 10px; background: var(--tm-surface); color: var(--tm-ink);
    font-size: 14px; font-weight: 600; white-space: nowrap; text-decoration: none; cursor: pointer;
}
.qf-btn:hover:not(:disabled) { border-color: var(--tm-muted); }
.qf-btn:disabled { opacity: .45; cursor: not-allowed; }
.qf-btn.qf-primary { border-color: var(--tm-accent); background: var(--tm-accent); color: #fff; }
.qf-btn.qf-primary:hover:not(:disabled) { filter: brightness(.95); border-color: var(--tm-accent); }
.qf-star[aria-pressed="true"] .fav-star-glyph { color: #d97706; }
.qf-cart[aria-pressed="true"] { border-color: var(--tm-accent-ink); color: var(--tm-accent-ink); }
.qf-link { padding: 0; border: 0; background: none; color: var(--tm-accent-ink); font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

/* ---------- written questions (cie-written-focus.js): the mark scheme, then a self-mark 0…N ---------- */
.cw-ms { display: grid; gap: 12px; padding: 4px 14px 14px; background: var(--tm-surface); border-radius: 0 0 10px 10px; }
.cw-ms-img { display: block; width: 100%; height: auto; }
.cw-answer-text { white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 15px; line-height: 1.8; }
.cw-er { padding: 10px 12px; border-radius: 8px; background: var(--tm-surface-2); color: var(--tm-ink-2); font-size: 14px; line-height: 1.7; }
.cw-er-title { margin: 0 0 4px; color: var(--tm-muted); font-size: 12.5px; font-weight: 700; }
.cw-er-body { white-space: pre-wrap; }
.cw-score { display: grid; gap: 8px; }   /* the mark scheme is in the side rail's panel now: always shown */
.cw-score-lead { margin: 0; color: var(--tm-ink-2); font-size: 14px; font-weight: 600; }
.cw-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cw-chip {
    min-width: 42px; height: 40px; padding: 0 10px; border: 1px solid var(--tm-line-2); border-radius: 10px;
    background: var(--tm-surface); color: var(--tm-ink); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer;
}
.cw-chip:hover { border-color: var(--tm-accent); }
.cw-chip.is-full { border-color: var(--tm-ok); color: var(--tm-ok); }
.cw-chip[aria-pressed="true"] { border-color: var(--tm-accent); background: var(--tm-accent); color: #fff; }
.cw-score:not([data-cw-live]) .cw-chip { cursor: default; opacity: .75; }
.cw-score:not([data-cw-live]) .cw-chip[aria-pressed="true"] { opacity: 1; }
.cw-input { width: 84px; height: 40px; padding: 0 10px; border: 1px solid var(--tm-line-2); border-radius: 10px; font-size: 15px; }
.cw-of { color: var(--tm-muted); font-weight: 600; }
.cw-verdict { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; outline: none; }
.cw-verdict:empty { display: none; }
.cw-verdict-text { color: var(--tm-flag, #b45309); font-size: 14px; font-weight: 700; }
.cw-verdict-text.is-full { color: var(--tm-ok); }

/* by part (the hall's answer_parts): each part opens on its own with its points and its 0…[n]; boxes on the image */
.cw-stem { position: relative; }
/* the hall's answer boxes (app.css .answer-anchor-box): green outline, a ring when hovered or open */
.cw-anchor {
    position: absolute; z-index: 2; padding: 0; border: 2px solid rgba(16, 185, 129, .82); border-radius: 6px;
    background: rgba(110, 231, 183, .12); box-shadow: 0 0 0 2px rgba(16, 185, 129, .10); cursor: pointer;
    transition: box-shadow .15s ease, background-color .15s ease;
}
.cw-anchor:hover, .cw-anchor[aria-expanded="true"] { box-shadow: 0 0 0 4px rgba(52, 211, 153, .35); }
.cw-anchor.is-scored { border-color: #059669; background: #10b981; }   /* marked: solid green */
.cw-anchor:focus-visible { outline: 2px solid #059669; outline-offset: 2px; }
/* the part popup: fixed next to its box, above the ink layer */
.cw-pop {
    position: fixed; z-index: 60; box-sizing: border-box; display: grid; gap: 10px; max-height: min(70vh, 520px); overflow-y: auto; padding: 12px 14px 14px;
    border: 1px solid var(--tm-line-2); border-radius: 12px; background: var(--tm-surface); color: var(--tm-ink);
    box-shadow: 0 12px 32px rgb(15 23 42 / 18%);
}
.cw-pop-head { display: flex; align-items: center; gap: 8px; }
.cw-pop-head .cw-part-got { margin-left: auto; }
.cw-pop-close {
    flex: none; width: 30px; height: 30px; margin-left: 4px; padding: 0; border: 0; border-radius: 8px; background: transparent;
    color: var(--tm-muted); font-size: 20px; line-height: 1; cursor: pointer;
}
.cw-pop-head .cw-part-got:empty + .cw-pop-close { margin-left: auto; }
.cw-pop-close:hover { background: var(--tm-surface-2); color: var(--tm-ink); }
.cw-parts { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.cw-part { border: 1px solid var(--tm-line); border-radius: 10px; background: var(--tm-surface-2); }
.cw-part > summary { display: flex; align-items: center; gap: 8px; padding: 9px 14px; list-style: none; cursor: pointer; user-select: none; }
.cw-part > summary::-webkit-details-marker { display: none; }
.cw-part-label { color: var(--tm-ink); font-weight: 700; }
.cw-part-marks { color: var(--tm-muted); font-variant-numeric: tabular-nums; }
.cw-part-got { margin-left: auto; color: var(--tm-accent-ink); font-size: 13px; font-weight: 600; }
.cw-part[open] > summary { border-bottom: 1px solid var(--tm-line); }
.cw-part-body { display: grid; gap: 10px; padding: 10px 14px 12px; background: var(--tm-surface); border-radius: 0 0 10px 10px; }
.cw-points { margin: 0; padding-left: 18px; color: var(--tm-ink); font-size: 14.5px; line-height: 1.7; }
.cw-part-note { margin: 0; color: var(--tm-muted); font-size: 13px; }
.cw-chip:disabled { cursor: default; opacity: .7; }
.cw-chip[aria-pressed="true"]:disabled { opacity: 1; }
.cw-score.cw-score-parts { display: grid; gap: 8px; }
.cw-lost { color: var(--tm-ink-2); font-size: 13.5px; }

/* ---------- 手写 (practice-ink.js): ink over the card, a scratch area under it, the tools on top of the footer ---------- */
.qf-inkbtn[aria-pressed="true"] { border-color: var(--tm-accent); background: var(--tm-accent); color: #fff; }
.qf-card-wrap.pi-on { position: relative; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.pi-canvas { position: absolute; top: 0; left: 0; z-index: 3; pointer-events: none; }
.pi-base > canvas { position: absolute; left: 0; display: block; }   /* the committed ink, in strips */
.pi-canvas.pi-ink { z-index: 4; }                                     /* the stroke being drawn: the screen's part of the card */
.pi-canvas.pi-live { z-index: 4; pointer-events: auto; touch-action: none; }   /* an empty box over the card that takes the pen */
.pi-hover { position: absolute; top: 0; left: 0; z-index: 4; border-radius: 50%; pointer-events: none; will-change: transform; }   /* under a hovering pen */
.pi-hover[hidden] { display: none; }
.pi-paper {
    position: relative; margin-top: 12px; border: 1px dashed var(--tm-line-2); border-radius: 12px;
    background-color: var(--tm-surface);
    background-image: linear-gradient(var(--tm-line) 1px, transparent 1px), linear-gradient(90deg, var(--tm-line) 1px, transparent 1px);
    background-size: 24px 24px; background-position: -1px -1px;
}
.pi-perf {   /* #inkperf only: how the last stroke went */
    position: fixed; top: 8px; left: 50%; z-index: 70; transform: translateX(-50%); box-sizing: border-box; width: max-content;
    max-width: calc(100vw - 16px); padding: 4px 10px; border-radius: 8px; text-align: center;
    background: rgb(15 23 42 / 82%); color: #fff; font: 600 12px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; pointer-events: none;
}
.pi-paper-more {
    position: absolute; right: 10px; bottom: 10px; z-index: 5; display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; padding: 0; border: 1px solid var(--tm-line-2); border-radius: 50%; background: var(--tm-surface);
    color: var(--tm-ink-2); font-size: 24px; line-height: 1; box-shadow: 0 2px 8px rgb(15 23 42 / 12%); cursor: pointer; touch-action: manipulation;
}
.pi-paper-more:hover:not(:disabled) { border-color: var(--tm-accent); color: var(--tm-accent-ink); }
.pi-paper-more:disabled { opacity: .4; cursor: not-allowed; }
.pi-paper-label { position: absolute; top: 8px; left: 12px; padding: 0 6px; border-radius: 6px; background: var(--tm-surface); color: var(--tm-muted); font-size: 12px; }
.qf-foot.qf-foot-ink { flex-wrap: wrap; justify-content: center; }
.qf-inkrow { display: flex; flex: 1 0 100%; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; padding: 0 0 7px; border-bottom: 1px solid var(--tm-line); }
.qf-ink-tool {
    display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 36px; height: 36px; padding: 0 8px;
    border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--tm-ink-2); font-size: 13px; font-weight: 600; cursor: pointer;
}
.qf-ink-tool:hover:not(:disabled) { border-color: var(--tm-line); background: var(--tm-surface-2); }
.qf-ink-tool[aria-pressed="true"] { border-color: var(--tm-accent); background: var(--tm-surface-2); color: var(--tm-accent-ink); }
.qf-ink-tool:disabled { opacity: .4; cursor: not-allowed; }
.qf-ink-dot { display: block; width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 15%); }
.qf-ink-sep { width: 1px; height: 22px; margin: 0 4px; background: var(--tm-line); }
.qf-ink-status { margin: 0 4px; padding: 0; border: 0; background: none; color: var(--tm-muted); font: inherit; font-size: 12px; white-space: nowrap; }
.qf-ink-status.is-ok { color: var(--tm-ok); }
.qf-ink-status.is-error { color: var(--tm-flag, #b45309); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

/* ---------- side rail (入卷 · 收藏 · 评分标准 · 考官报告 · 手写 · 问小巴拉): floats by the writing hand ---------- */
.qf-rail {
    position: fixed; z-index: 55; display: flex; flex-direction: column; align-items: stretch; gap: 4px; width: 64px; padding: 4px;
    box-sizing: border-box; border: 1px solid var(--tm-line); border-radius: 14px; background: var(--tm-surface);
    box-shadow: 0 8px 24px rgb(15 23 42 / 12%);
    max-height: calc(100vh - 12px); overflow-y: auto; overscroll-behavior: contain;   /* a short landscape phone: it scrolls itself */
}
/* the rail sits over the view's right side (narrow screens, or dropped there): the card keeps that strip free */
.qf-inline.qf-rail-room .qf-stage { padding-right: var(--qf-rail-room, 76px); }
.qf-rail-grip {
    display: flex; align-items: center; justify-content: center; height: 22px; padding: 0; border: 0; border-radius: 8px;
    background: transparent; color: var(--tm-muted); cursor: grab; touch-action: none;
}
.qf-rail-grip:active { cursor: grabbing; background: var(--tm-surface-2); }
.qf-rail-btn {
    display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px 6px; border: 1px solid transparent; border-radius: 10px;
    background: transparent; color: var(--tm-ink-2); font: inherit; cursor: pointer; touch-action: manipulation;
}
.qf-rail-btn svg { width: 20px; height: 20px; }
.qf-rail-glyph { font-size: 19px; line-height: 20px; }
.qf-rail-lab { font-size: 11px; font-weight: 600; line-height: 1.2; text-align: center; white-space: normal; word-break: keep-all; }
.qf-rail-btn:hover { border-color: var(--tm-line); background: var(--tm-surface-2); }
.qf-rail-btn[aria-pressed="true"] { border-color: var(--tm-accent); background: var(--tm-surface-2); color: var(--tm-accent-ink); }
.qf-rail-btn[data-qf="star"][aria-pressed="true"] .qf-rail-glyph { color: #d97706; }
/* ---------- floating panels (评分标准 / 考官报告): moved by their title bar, × closes ---------- */
.qf-float {
    position: fixed; z-index: 58; display: flex; flex-direction: column; box-sizing: border-box; max-height: min(72vh, 640px);
    min-width: 260px; resize: both; overflow: hidden; border: 1px solid var(--tm-line-2); border-radius: 12px;
    background: var(--tm-surface); color: var(--tm-ink); box-shadow: 0 16px 40px rgb(15 23 42 / 20%);
}
.qf-float[data-panel="ms"] { max-height: min(88vh, 960px); }   /* the mark scheme: 1.5× the report panel */
.qf-float-head {
    display: flex; flex: none; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-bottom: 1px solid var(--tm-line);
    background: var(--tm-surface-2); cursor: move; touch-action: none; user-select: none;
}
.qf-float-title { flex: 1 1 auto; font-size: 14px; font-weight: 700; }
.qf-float-close {
    flex: none; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 8px; background: transparent;
    color: var(--tm-muted); font-size: 22px; line-height: 1; cursor: pointer;
}
.qf-float-close:hover { background: var(--tm-surface); color: var(--tm-ink); }
.qf-float-body { flex: 1 1 auto; overflow: auto; padding: 12px 14px 14px; font-size: 14.5px; line-height: 1.7; }
.qf-float-body .cw-ms-img { display: block; width: 100%; height: auto; }
.qf-float-body .cw-er-body { white-space: pre-wrap; }

/* ---------- inline notices in the list's place: loading, all done, skipped left, nothing here ---------- */
.qf-panel {
    display: grid; gap: 10px; padding: 22px 24px; border: 1px solid var(--tm-line); border-radius: 12px;
    background: var(--tm-surface); color: var(--tm-ink); box-shadow: 0 4px 16px rgb(74 70 46 / 3%);
}
.qf-loading { justify-items: center; padding: 34px 24px; text-align: center; color: var(--tm-muted); }
.qf-loading p { margin: 0; }
.qf-h4 { margin: 0; color: var(--tm-ink); font-size: 15px; font-weight: 700; }
.qf-lead { margin: 0; color: var(--tm-ink); font-size: 16px; font-weight: 700; line-height: 1.55; font-variant-numeric: tabular-nums; }
.qf-note, .qf-hint { margin: 0; color: var(--tm-muted); font-size: 13px; line-height: 1.55; }
.qf-facts { margin: 0; color: var(--tm-ink-2); font-size: 14px; font-variant-numeric: tabular-nums; }
.qf-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding-top: 4px; }

.qf-spinner { display: inline-block; width: 22px; height: 22px; border: 3px solid var(--tm-line); border-top-color: var(--tm-accent); border-radius: 50%; animation: qf-spin .8s linear infinite; }
@keyframes qf-spin { to { transform: rotate(360deg); } }
.qf-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- the shortcut list ---------- */
.qf-pop {
    position: absolute; top: 44px; right: 0; z-index: 20;
    width: min(400px, calc(100vw - 32px)); max-height: min(70vh, 560px); overflow: auto; padding: 16px 18px;
    border: 1px solid var(--tm-line); border-radius: 14px; background: var(--tm-surface); color: var(--tm-ink);
    box-shadow: 0 18px 44px rgb(15 23 42 / 18%);
}
.qf-pop-close { position: absolute; top: 8px; right: 8px; }
.qf-keylist { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; margin: 10px 0 0; font-size: 13.5px; }
.qf-keylist dt, .qf-keylist dd { margin: 0; }
.qf-keylist kbd { display: inline-block; min-width: 26px; padding: 1px 7px; border: 1px solid var(--tm-line-2); border-bottom-width: 2px; border-radius: 6px; background: var(--tm-surface-2); color: var(--tm-ink); font: 600 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-align: center; }

/* ---------- the list again: the item the user left from flashes once (DF §1.8) ---------- */
.qf-located { outline: 3px solid var(--tm-accent, #ff4b4b) !important; outline-offset: 4px; animation: qf-flash 1.2s ease-out 1; }
@keyframes qf-flash { 0% { box-shadow: 0 0 0 0 rgb(255 75 75 / 45%); } 100% { box-shadow: 0 0 0 16px rgb(255 75 75 / 0%); } }

/* ---------- entry buttons (tmua-hall.js hall bar / phone strip, favorites heads): ▶ 练习模式 ↔ ■ 退出练习模式 ---------- */
.tmua-focus-wrap { display: inline-flex; align-items: center; gap: 8px; }
.tmua-focus-entry { min-height: 34px; padding: 0 14px; font-size: 13.5px; }
.tmua-focus-entry.is-compact { min-height: 30px; padding: 0 11px; font-size: 13px; }
.tmua-focus-entry.is-exit, .fav-btn-focus.is-exit { border-color: var(--tm-ink-2, #45464b); background: var(--tm-surface, #fff); color: var(--tm-ink, #27282c); }
.tmua-focus-count { color: var(--tm-muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.tmua-feed-head .tmua-focus-entry { order: -1; }

@media (min-width: 768px) {
    .qf-phone { display: none !important; }
}
@media (max-width: 767px) {
    /* The hall on a phone: the view takes the feed's place and scrolls itself above the bottom bar. */
    .qf-inline.qf-own-scroll {
        flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; max-width: none; margin: 0;
        padding-bottom: calc(66px + env(safe-area-inset-bottom));
    }
    .qf-own-scroll .qf-bar { flex: none; padding: 8px 12px 6px; }
    .qf-own-scroll .qf-stage { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: 4px 8px 12px; }
    .qf-own-scroll .qf-foot { position: static; flex: none; margin: 0; padding: 8px 10px; border-width: 1px 0 0; border-radius: 0; box-shadow: none; }
    .qf-bar { gap: 6px 8px; font-size: 12.5px; }
    .qf-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .qf-exitbtn { flex: none; min-height: 34px; padding: 0 10px; font-size: 13px; }
    .qf-progress { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
    .qf-score { margin-left: auto; font-size: 12.5px; }
    .qf-clock { flex: none; min-height: 30px; padding: 0 8px; font-size: 12.5px; }
    .qf-tagline { order: 10; flex-basis: 100%; }
    .qf-desk { display: none !important; }
    .qf-card-head { min-height: 0; padding: 10px 14px; gap: 2px 10px; }
    .qf-card-title { font-size: 16px; }
    .qf-meta { flex-basis: 100%; font-size: 12.5px; }
    .qf-card-body { gap: 10px; padding: 12px 14px 14px; }
    .qf-card .tm-q-stem { font-size: 16px; }
    .qf-card .tm-options.tm-has-figs { grid-template-columns: minmax(0, 1fr); }
    .qf-foot { gap: 8px; width: auto; }
    .qf-foot .qf-spacer { display: none; }
    .qf-foot .qf-btn { flex: 1 1 0; min-height: 46px; padding: 0 10px; }
    .qf-foot .qf-star, .qf-foot .qf-cart { flex: 0 0 50px; }
    .qf-foot .qf-star .qf-lab, .qf-foot .qf-cart .qf-lab { display: none; }
    .qf-panel { padding: 18px 16px; }
    .qf-actions .qf-btn { flex: 1 1 auto; }
    .qf-pop { top: 48px; right: 0; left: 0; width: auto; }
    .qf-inkbtn { flex: none; min-height: 30px; padding: 0 8px; font-size: 12.5px; }
    .qf-ink-tool { min-width: 34px; height: 34px; padding: 0 6px; }
    .qf-ink-more span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .qf-located { animation: none; }
    .qf-spinner { animation-duration: 2.4s; }
    .qf-answer-caret { transition: none; }
}
