/* TMUA 在题库大厅、收藏夹、清单预览和手机信息流里的样式（tmua-hall.js / tmua-render.js 的标记）。
   题目排版沿用「模考」（tmua-mocks.css，限定在 .tmx-scope 之内）的 .tm-* 规则，但全部限定在 .tmua-scope 之内，不影响主站其它元素。
   配色：默认（清爽原版 / 流光玻璃）用站内 slate + 红；暖纸书房用 #f7f6f2 / 砖红 #bc5143；深色用 #191c20 / #24282d。 */

/* ---------- tokens ---------- */
.tmua-scope, .fav-scope .tmua-scope {
    --tm-surface: #fff;
    --tm-surface-2: #f8fafc;
    --tm-ink: #1f2937;
    --tm-ink-2: #374151;
    --tm-muted: #64748b;
    --tm-line: #e2e8f0;
    --tm-line-2: #cbd5e1;
    --tm-accent: #ff4b4b;
    --tm-accent-ink: #dc2626;
    --tm-tint: #fff1f2;
    --tm-ok: #15803d;
    --tm-ok-line: #4ade80;
    --tm-ok-tint: #f0fdf4;
    --tm-bad: #b91c1c;
    --tm-bad-line: #f87171;
    --tm-bad-tint: #fef2f2;
    --tm-flag: #92400e;
    --tm-flag-tint: #fffbeb;
    --tm-focus: #ef4444;
}
body.skin-warm-paper .tmua-scope {
    --tm-surface: #fff;
    --tm-surface-2: #fbfaf7;
    --tm-ink: #27282c;
    --tm-ink-2: #45464b;
    --tm-muted: #6b6b66;
    --tm-line: #e3e3dc;
    --tm-line-2: #cfcec5;
    --tm-accent: #bc5143;
    --tm-accent-ink: #b04a3c;
    --tm-tint: #f8eeea;
    --tm-ok: #2c7a4b;
    --tm-ok-line: #4f9c6d;
    --tm-ok-tint: #e8f3ec;
    --tm-bad: #b23b2c;
    --tm-bad-line: #d06656;
    --tm-bad-tint: #fbecea;
    --tm-flag: #9a6412;
    --tm-flag-tint: #fbf1dc;
    --tm-focus: #ba6453;
}
body.theme-dark .tmua-scope {
    --tm-surface: #24282d;
    --tm-surface-2: #1f2327;
    --tm-ink: #edece7;
    --tm-ink-2: #d6d5cf;
    --tm-muted: #a4a59f;
    --tm-line: #363b40;
    --tm-line-2: #4a5057;
    --tm-accent: #bc4940;
    --tm-accent-ink: #e37b70;
    --tm-tint: #3a2a28;
    --tm-ok: #7fcf9b;
    --tm-ok-line: #5aa877;
    --tm-ok-tint: #1e3327;
    --tm-bad: #f2978b;
    --tm-bad-line: #c9665a;
    --tm-bad-tint: #3c2522;
    --tm-flag: #e9b765;
    --tm-flag-tint: #3a3020;
    --tm-focus: #e37b70;
}

/* CIE cells of the filter bar while the hall shows TMUA */
#filterBar > [data-tmh-hidden] { display: none !important; }
/* With the 拓展题 cell the hall bar has nine cells (科目 + eight filters); tmua-hall.js sets .tmh-bar-ext only then, so
   the site's eight-cell templates stay in charge otherwise. The nine-cell templates replace theirs only at the widths
   where those apply: the default layout's inline template above 1180px (app.css wraps to 3, 2 and 1 columns below), the
   warm-paper one from 1600px (warm-paper.css wraps to 4 columns at 768-1599px and has its own narrow rules). */
@media (min-width: 1181px) {
    body.tmua-hall-active:not(.layout-warm-paper) #filterBar.tmh-bar-ext { grid-template-columns: 1.5fr repeat(4, 1fr) 1.6fr 1fr 1fr 1fr !important; }
}
@media (min-width: 768px) and (max-width: 1599px) {
    /* nine cells wrap 3 x 3 (warm-paper.css's four columns would leave the ninth alone on a row) */
    body.tmua-hall-active.layout-warm-paper #filterBar.tmh-bar-ext { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
@media (min-width: 1600px) {
    body.tmua-hall-active.layout-warm-paper #filterBar.tmh-bar-ext { grid-template-columns: minmax(172px, 1.6fr) repeat(4, minmax(90px, 1fr)) minmax(145px, 1.45fr) minmax(96px, 1fr) minmax(100px, 1fr) minmax(110px, 1.05fr) !important; }
}

/* ---------- question text, figures, options, solution (subset of tmua-mocks.css) ---------- */
.tmua-scope .tm-rich { line-height: 1.75; overflow-wrap: anywhere; color: var(--tm-ink); }
.tmua-scope .tm-rich b { font-weight: 700; }
.tmua-scope .tm-rich .tm-gap { display: block; height: .55em; }
.tmua-scope .tm-rich .katex { font-size: 1.08em; }
.tmua-scope .tm-rich .katex-display { margin: .55em 0; overflow-x: auto; overflow-y: hidden; padding: 2px 0; }
.tmua-scope .tm-rich .katex-display > .katex { white-space: nowrap; }
.tmua-scope .tm-rich .tm-nw { white-space: nowrap; }
.tmua-scope .tm-rich .tm-nw .katex { white-space: normal; }
.tmua-scope .tm-q-stem { font-size: 16px; }
.tmua-scope .tm-figures { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin: 14px 0 4px; }
.tmua-scope .tm-figure {
    margin: 0; padding: 10px; justify-self: center; max-width: 100%;
    background: #fff; border: 1px solid var(--tm-line); border-radius: 10px;
}
.tmua-scope .tm-figure img { display: block; max-width: 100%; max-height: 380px; height: auto; margin: 0 auto; filter: none !important; mix-blend-mode: normal !important; }
.tmua-scope .tm-options { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 16px; }
.tmua-scope .tm-options.tm-has-figs { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tmua-scope .tm-opt {
    position: relative; display: flex; align-items: flex-start; gap: 12px;
    width: 100%; min-height: 44px; padding: 9px 13px;
    border: 1px solid var(--tm-line-2); border-radius: 10px;
    background: var(--tm-surface); color: var(--tm-ink);
    text-align: left; font-size: 15px; line-height: 1.6; font-weight: 400;
    transition: border-color .12s, background .12s, box-shadow .12s;
}
.tmua-scope button.tm-opt { cursor: pointer; }
.tmua-scope button.tm-opt:hover { border-color: var(--tm-muted); background: var(--tm-surface-2); }
/* live options (click = answer, v3): a visible focus ring for keyboard answering, a busy state while submitting */
.tmua-scope [data-tmh-live] button.tm-opt:focus-visible { outline: 2px solid var(--tm-focus); outline-offset: 2px; border-color: var(--tm-focus); }
.tmua-scope [data-tmh-live] button.tm-opt:active:not([aria-disabled="true"]) { transform: translateY(1px); }
.tmua-scope [data-tmh-live][aria-busy="true"] button.tm-opt { cursor: progress; }
.tmua-scope [data-tmh-live] button.tm-opt[aria-disabled="true"]:not(.is-selected) { opacity: .6; }
@media (hover: none) { .tmua-scope button.tm-opt:hover { border-color: var(--tm-line-2); background: var(--tm-surface); } }
.tmua-scope .tm-opt-letter {
    flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; margin-top: 1px; border-radius: 50%;
    border: 1.5px solid var(--tm-line-2); background: var(--tm-surface);
    font-weight: 700; font-size: 13px; color: var(--tm-ink-2);
}
.tmua-scope .tm-opt-body { flex: 1 1 auto; min-width: 0; padding-top: 1px; }
.tmua-scope .tm-opt-note { flex-shrink: 0; align-self: center; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.tmua-scope .tm-opt.is-selected { border-color: var(--tm-accent-ink); background: var(--tm-tint); box-shadow: inset 0 0 0 1px var(--tm-accent-ink); }
.tmua-scope .tm-opt.is-selected .tm-opt-letter { background: var(--tm-accent); border-color: var(--tm-accent); color: #fff; }
.tmua-scope .tm-opt.is-correct { border-color: var(--tm-ok-line); background: var(--tm-ok-tint); box-shadow: inset 0 0 0 1px var(--tm-ok-line); }
.tmua-scope .tm-opt.is-correct .tm-opt-letter { background: var(--tm-ok); border-color: var(--tm-ok); color: var(--tm-surface); }
.tmua-scope .tm-opt.is-correct .tm-opt-note { color: var(--tm-ok); background: var(--tm-surface); }
.tmua-scope .tm-opt.is-wrong { border-color: var(--tm-bad-line); background: var(--tm-bad-tint); box-shadow: inset 0 0 0 1px var(--tm-bad-line); }
.tmua-scope .tm-opt.is-wrong .tm-opt-letter { background: var(--tm-bad); border-color: var(--tm-bad); color: var(--tm-surface); }
.tmua-scope .tm-opt.is-wrong .tm-opt-note { color: var(--tm-bad); background: var(--tm-surface); }
.tmua-scope .tm-opt.is-dim { opacity: .62; }
.tmua-scope .tm-opt-fig { flex-direction: column; align-items: stretch; gap: 8px; padding: 8px; }
.tmua-scope .tm-opt-fig.is-dim { opacity: 1; border-style: dashed; }
.tmua-scope .tm-opt-head { display: flex; align-items: center; gap: 8px; }
.tmua-scope .tm-opt-fig .tm-figure { display: block; padding: 4px; justify-self: stretch; }
.tmua-scope .tm-opt-fig .tm-figure img { max-height: 200px; }
.tmua-scope .tm-solution { margin-top: 14px; padding: 14px 16px; border-radius: 10px; background: var(--tm-surface-2); border: 1px solid var(--tm-line); }
.tmua-scope .tm-solution-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.tmua-scope .tm-solution-head h4 { margin: 0; font-size: 15px; font-weight: 700; color: var(--tm-ink); }
.tmua-scope .tm-solution .tm-rich { font-size: 15px; }
.tmua-scope .tm-muted { color: var(--tm-muted); }
.tmua-scope .tm-seg { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--tm-line); border-radius: 10px; background: var(--tm-surface-2); }
.tmua-scope .tm-seg > button { min-height: 28px; padding: 0 11px; border: 0; border-radius: 8px; background: transparent; color: var(--tm-ink-2); font-size: 13px; font-weight: 600; }
.tmua-scope .tm-seg > button[aria-pressed="true"] { background: var(--tm-surface); color: var(--tm-accent-ink); box-shadow: 0 1px 3px rgb(0 0 0 / 10%), inset 0 0 0 1px var(--tm-line); }
.tmua-scope .tm-seg > button:disabled { opacity: .45; cursor: not-allowed; }
.tmua-scope :where(button, summary, a, [tabindex]):focus-visible { outline: 2px solid var(--tm-focus); outline-offset: 2px; }

/* ---------- hall card ---------- */
.tmua-card .tmua-card-body { min-width: 0; }
.tmua-card .tmua-q { min-width: 0; }
.tmua-card .tmua-card-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-family: inherit; }
.tmua-card .tmua-card-label { font-variant-numeric: tabular-nums; }
.tmua-badge {
    display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px;
    font: 700 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    letter-spacing: 0; white-space: nowrap; vertical-align: middle;
    border: 1px solid var(--tm-line, #e2e8f0); background: var(--tm-surface-2, #f8fafc); color: var(--tm-ink-2, #374151);
}
.tmua-badge[hidden] { display: none !important; }
.tmua-badge-open { border-color: var(--tm-bad-line); background: var(--tm-bad-tint); color: var(--tm-bad); }
.tmua-badge-mastered { border-color: var(--tm-ok-line); background: var(--tm-ok-tint); color: var(--tm-ok); }
.tmua-badge-ok { color: var(--tm-ok); }
.tmua-badge-bad { color: var(--tm-bad); }
.tmua-badge-revealed { color: var(--tm-muted); }
.tmua-badge-mock { border-color: var(--tm-flag); background: var(--tm-flag-tint); color: var(--tm-flag); }
/* 拓展题: outside the TMUA specification or harder than recent papers; practice only, never in a smart mock. */
.tmua-badge-ext { position: relative; border-style: dashed; border-color: var(--tm-line-2); background: transparent; color: var(--tm-muted); cursor: help; }
/* Read by screen readers and selectable by touch / keyboard users, never drawn (the badge's own text is 「拓展」). */
.tmh-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.tmua-answer-line { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; color: var(--tm-ink-2); font-weight: 600; }
.tmua-answer-letter {
    display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%;
    background: var(--tm-ok); color: var(--tm-surface); font-size: 15px;
}
.tmua-card details.tmua-answer > .tmua-answer-body { color: var(--tm-ink); }
.tmua-prompt { padding: 4px 2px; color: var(--tm-ink-2); }
.tmua-prompt p { margin: 0 0 12px; line-height: 1.6; }
.tmua-prompt-actions, .tmua-result-actions, .tmua-gate-actions, .tmua-dialog-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
/* result of an inline answer (verdict, notes, 再做一次), inside .tmua-card-body so the warm skin keeps it */
.tmua-result:empty { display: none; }
.tmua-result { display: grid; gap: 8px; }
.tmua-result .tmua-result-actions { gap: 8px 12px; }
.tmua-result-hint, .tmua-result-note { margin: 0; color: var(--tm-muted); font-size: 13px; line-height: 1.55; }
.tmua-result-note .tmua-link { font-size: 13px; }
.tmua-note { margin: 0; color: var(--tm-flag); font-size: 13.5px; font-weight: 600; }
.tmua-again { min-height: 32px; padding: 0 12px; font-size: 13px; }
.tmua-verdict-time { margin-left: auto; color: var(--tm-muted); font-weight: 500; font-size: 12.5px; }
.tmua-verdict:focus { outline: none; }
.tmua-verdict:focus-visible { outline: 2px solid var(--tm-focus); outline-offset: 2px; }
.tmua-sol { border: 1px solid var(--tm-line); border-radius: 10px; background: var(--tm-surface); }
.tmua-sol > summary { padding: 9px 12px; font-weight: 700; cursor: pointer; color: var(--tm-ink); }
.tmua-sol-body { padding: 2px 12px 12px; color: var(--tm-ink); }
.tmua-verdict { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 14px; border-radius: 10px; font-weight: 700; }
.tmua-verdict.is-ok { background: var(--tm-ok-tint); color: var(--tm-ok); border: 1px solid var(--tm-ok-line); }
.tmua-verdict.is-bad { background: var(--tm-bad-tint); color: var(--tm-bad); border: 1px solid var(--tm-bad-line); }
.tmua-verdict small { color: var(--tm-ink-2); font-weight: 500; }
.tmua-loading, .tmua-error { margin: 0; font-size: 14px; color: var(--tm-muted); }
.tmua-error { color: var(--tm-bad); }
/* 「TMUA 错题本」 rows: 错 n 次 · 连续答对 k 次 · 最近做错 MM-DD + 标记已掌握 */
.tmua-mk-strip:empty { display: none; }
.tmua-mk-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 12px; border-radius: 10px; border: 1px dashed var(--tm-line-2); background: var(--tm-surface-2); color: var(--tm-ink-2); font-size: 13px; }
.tmua-mk-facts { font-variant-numeric: tabular-nums; }
.tmua-mk-toggle { margin-left: auto; min-height: 30px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--tm-line-2); background: var(--tm-surface); color: var(--tm-ink); font-size: 13px; font-weight: 700; cursor: pointer; }
.tmua-mk-toggle:hover:not(:disabled) { border-color: var(--tm-ok-line); color: var(--tm-ok); }
.tmua-mk-toggle.is-ready { border-color: var(--tm-ok-line); background: var(--tm-ok-tint); color: var(--tm-ok); box-shadow: 0 0 0 2px var(--tm-ok-tint); }
.tmua-mk-toggle.is-on { border-color: var(--tm-ok-line); background: var(--tm-ok-tint); color: var(--tm-ok); }
.tmua-mk-toggle:disabled { opacity: .6; cursor: progress; }
.tmua-mk-hint { flex-basis: 100%; color: var(--tm-ok); font-weight: 600; }
.tmua-mk-hint .tmua-link { font-size: 13px; }
.tmua-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 14px;
    border: 1px solid var(--tm-line-2); border-radius: 9px; background: var(--tm-surface); color: var(--tm-ink);
    font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer;
}
.tmua-btn:hover:not(:disabled) { border-color: var(--tm-muted); }
.tmua-btn:disabled { opacity: .5; cursor: not-allowed; }
.tmua-btn.tmua-primary { background: var(--tm-accent); border-color: var(--tm-accent); color: #fff; }
.tmua-link { padding: 0; border: 0; background: none; color: var(--tm-accent-ink); font-size: 13px; font-weight: 600; cursor: pointer; }
.tmua-link:hover { text-decoration: underline; }

/* locked rows: never any question text */
.tmua-lock-panel {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 18px 20px;
    border: 1px dashed var(--tm-line-2); border-radius: 12px; background: var(--tm-surface-2); color: var(--tm-ink-2);
}
.tmua-lock-panel p { margin: 0; font-weight: 600; }
.tmua-lock-cta { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--tm-accent-ink); background: transparent; color: var(--tm-accent-ink); font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer; }
.tmua-locked .question-card-meta { opacity: .85; }

/* toolbar above the grid */
.tmua-hall-bar { margin-top: 18px; display: grid; gap: 10px; }
.tmua-hall-bar[hidden] { display: none !important; }
.tmua-mock-banner {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 16px; border-radius: 10px;
    border: 1px solid var(--tm-flag); background: var(--tm-flag-tint); color: var(--tm-ink);
}
.tmua-mock-banner a { margin-left: auto; color: var(--tm-accent-ink); font-weight: 700; text-decoration: none; }
.tmua-hall-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; color: var(--tm-muted); font-size: 13px; }
/* 只看 TMUA 19 P1 Q5 · 显示全部 (a redirected #practice?item=… link) */
.tmua-pin { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; padding: 3px 10px; border: 1px solid var(--tm-accent-ink); border-radius: 999px; background: var(--tm-tint); color: var(--tm-accent-ink); font-weight: 700; }
.tmua-hall-practice { gap: 6px 16px; }
.tmua-tally { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--tm-ink-2); font-variant-numeric: tabular-nums; }
.tmua-tally:empty { display: none; }
.tmua-hall-practice [data-tmh-open-mistakes] { margin-left: auto; }
.tmua-dots { display: inline-flex; gap: 3px; }
.tmua-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--tm-bad); }
.tmua-dots i.is-ok { background: var(--tm-ok); }
.tmua-kbd-hint { color: var(--tm-muted); font-size: 12px; }
@media (hover: none), (pointer: coarse) { .tmua-kbd-hint { display: none; } }
.tmua-gate, .tmua-empty {
    max-width: 620px; margin: 28px auto; padding: 32px 28px; text-align: center; border-radius: 16px;
    border: 1px solid var(--tm-line); background: var(--tm-surface); color: var(--tm-ink);
}
.tmua-gate h3 { margin: 0 0 8px; font-size: 19px; font-weight: 700; }
.tmua-gate p, .tmua-empty p { margin: 0 0 6px; color: var(--tm-muted); line-height: 1.6; }
.tmua-gate-actions { justify-content: center; margin-top: 18px; }
.tmua-gate-icon {
    display: inline-flex; align-items: center; justify-content: center; width: 50px; height: 50px; margin-bottom: 12px;
    border-radius: 50%; background: var(--tm-tint); color: var(--tm-accent-ink); font-size: 22px;
}
.tmua-empty .tmua-btn { margin-top: 12px; }
.tmua-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 12px; }
.tmua-empty-actions .tmua-btn { margin-top: 0; }
.tmua-more { display: flex; justify-content: center; margin: 4px 0 30px; }
.tmua-chunk { display: contents; }

/* ---------- desktop filter cells ---------- */
.tmh-cell .tmh-drop { min-width: 230px; max-height: 20rem; }   /* = max-h-80, also before tailwind.generated.css is rebuilt */
.tmh-cell .tmh-drop-source, .tmh-cell .tmh-drop-chapter, .tmh-cell .tmh-drop-style { min-width: 300px; max-height: 420px; }
.tmh-cell .tmh-drop-sort, .tmh-cell .tmh-drop-status { right: 0; left: auto; }
.tmh-drop .tmh-opt { gap: 2px; }
.tmh-drop .tmh-opt.tmh-indent { padding-left: 30px; }
.tmh-drop .tmh-opt.is-disabled { opacity: .5; }
.tmh-drop .tmh-opt-text { flex: 1 1 auto; min-width: 0; }
/* A chapter row with the Admin 📖: the label and the button side by side (the button is not inside the label). */
.tmh-drop .tmh-opt-wrap { display: flex; align-items: center; }
.tmh-drop .tmh-opt-wrap > .tmh-opt { flex: 1 1 auto; min-width: 0; }
.tmh-drop .tmh-opt-wrap > .tmh-card-link { margin: 0 8px 0 0; }
.tmh-drop .tmh-code { font: 600 11.5px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #64748b; margin-right: 4px; }
.tmh-count { flex-shrink: 0; margin-left: 8px; color: #94a3b8; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.tmh-note { margin: 0; padding: 8px 12px; color: #94a3b8; font-size: 12px; line-height: 1.5; }
.tmh-group-title { margin: 0; padding: 10px 12px 2px; color: #475569; font-size: 12px; font-weight: 700; }
body.theme-dark .tmh-drop .tmh-code, body.theme-dark .tmh-count, body.theme-dark .tmh-note { color: #a4a59f; }
body.theme-dark .tmh-group-title { color: #d6d5cf; }
/* 「9709 考纲」 at the top of the 章节/知识点 menu (above the TMUA chapters): the heading, one small heading per paper, a divider. */
.tmh-s9709 { margin-bottom: 6px; padding-bottom: 4px; border-bottom: 2px solid #e2e8f0; }
.tmh-s9709-title { padding-top: 10px; font-size: 13px; color: #b91c1c; }
.tmh-tmua-title { padding-top: 8px; font-size: 13px; }
.tmh-drop.tmh-drop-chapter { max-height: min(34rem, 70vh); }           /* the 9709 section sits below ~20 TMUA rows: show more of the list */
.tmh-m-group .mobile-filter-chip small { margin-left: 6px; font-size: 11px; opacity: .65; }
.tmh-subgroup-title { margin: 0; padding: 8px 12px 2px; color: #64748b; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
/* coursebook chapters: the fold button sits right of the tick row; sections are indented rows; badge = P2 / P3 only content */
.tmh-s9709-fold { flex: 0 0 auto; width: 32px; align-self: stretch; border: 0; background: transparent; color: #64748b; font-size: 13px; cursor: pointer; }
.tmh-s9709-fold:hover { background: #f1f5f9; color: #0f172a; }
.tmh-s9709-badge { margin-left: 4px; padding: 0 5px; border-radius: 8px; background: #fee2e2; color: #b91c1c; font-size: 10.5px; font-weight: 700; vertical-align: 1px; }
.tmh-s9709 .tmh-opt.tmh-indent { padding-left: 34px; font-weight: 500; }
body.theme-dark .tmh-s9709-fold { color: #b9b8b0; }
body.theme-dark .tmh-s9709-fold:hover { background: #33332f; color: #f1f0ea; }
body.theme-dark .tmh-s9709-badge { background: #5a2a26; color: #f5b3aa; }
body.theme-dark .tmh-s9709 { border-bottom-color: #4a4a45; }
body.theme-dark .tmh-s9709-title { color: #f08a7e; }
body.theme-dark .tmh-subgroup-title { color: #b9b8b0; }

/* ---------- phone feed card ---------- */
.tmua-mobile-card .tmua-m-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 4px; color: var(--tm-muted); font-size: 12.5px; }
.tmua-mobile-card .tmua-m-body { padding: 4px 14px 2px; }
.tmua-mobile-card .tm-q-stem { font-size: 15.5px; }
.tmua-mobile-card .tm-options.tm-has-figs { grid-template-columns: minmax(0, 1fr); }
.tmua-mobile-card .tm-figure img { max-height: 300px; }
.tmua-mobile-card .tmua-result { padding: 10px 0 2px; }
.tmua-m-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 10px 14px 14px; }
/* 入卷 · 收藏 · 答案 · 评论 for the accounts that may build papers: two rows of two, so 「Comments (12)」 still fits.
   The mini program hides 评论 (mp-bridge.js), which leaves three in one row again. */
.tmua-m-actions:has(> button:nth-child(4)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html.cie-mp .tmua-m-actions:has(> button:nth-child(4)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tmua-m-actions button {
    min-height: 38px; padding: 0 6px; border: 1px solid var(--tm-line-2); border-radius: 9px;
    background: var(--tm-surface); color: var(--tm-ink); font-size: 13px; font-weight: 600; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.tmua-m-more { display: flex; justify-content: center; padding: 0 14px 16px; }
.tmua-m-more button { min-height: 38px; padding: 0 16px; border-radius: 9px; border: 1px solid var(--tm-line-2); background: var(--tm-surface); color: var(--tm-ink); font-weight: 600; }
.tmua-mobile-card .tmua-lock-panel { margin: 6px 14px 14px; }
.tmua-drawer-body { padding: 14px 16px 24px; color: var(--tm-ink); }
.tmua-drawer-body .tmua-prompt-actions .tmua-btn { flex: 1 1 auto; }

/* phone strip above the first feed card: 只练没做过的 · 本次 m/n · 错题本 → */
.tmua-feed-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 10px 16px 2px; padding: 9px 12px; border: 1px solid var(--tm-line); border-radius: 12px; background: var(--tm-surface); color: var(--tm-muted); font-size: 13px; }
.tmua-feed-head [data-tmh-open-mistakes] { margin-left: auto; }

/* favorites phone row: the full answerable card (no 3-line clamp, no 查看 sheet since v3) */
.tmua-fav-row .fav-m-row-head { display: flex; align-items: center; gap: 8px; }
.tmua-fav-row .fav-m-row-head .tmua-badge { height: 20px; padding: 0 7px; font-size: 11px; }
.tmua-fav-row .fav-m-row-marks { margin-left: auto; }
.tmua-fav-row .tmua-lock-panel { margin: 6px 0 10px; padding: 12px 14px; }
.tmua-fav-row .tmua-fav-body { display: grid; gap: 10px; margin: 6px 0 10px; }
.tmua-fav-row .tm-q-stem { font-size: 15px; }
.tmua-fav-row .tm-options.tm-has-figs { grid-template-columns: minmax(0, 1fr); }
.tmua-fav-row .tm-figure img { max-height: 280px; }
.tmua-fav-row details.tmua-answer-inline { border: 1px solid var(--tm-line); border-radius: 10px; background: var(--tm-surface-2); }
.tmua-fav-row details.tmua-answer-inline > summary { padding: 10px 12px; font-weight: 700; cursor: pointer; color: var(--tm-ink); }
.tmua-fav-row details.tmua-answer-inline .tmua-answer-body { padding: 4px 12px 12px; background: var(--tm-surface); border-radius: 0 0 10px 10px; }

/* replace / append dialog */
.tmua-dialog-layer { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgb(15 23 42 / 45%); }
.tmua-dialog { width: min(440px, 100%); padding: 22px 22px 18px; border-radius: 14px; background: var(--tm-surface); color: var(--tm-ink); box-shadow: 0 20px 50px rgb(0 0 0 / 25%); }
.tmua-dialog h3 { margin: 0 0 8px; font-size: 17px; font-weight: 700; }
.tmua-dialog p { margin: 0 0 16px; color: var(--tm-muted); line-height: 1.6; }
.tmua-dialog-actions { justify-content: flex-end; }

/* ---------- favorites: the virtual "TMUA 错题本" list ---------- */
.fav-tile-virtual .fav-tile-art { position: relative; }
.fav-virtual-badge {
    position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 999px;
    background: var(--fav-surface, #fff); color: var(--fav-accent, #ff4b4b); border: 1px solid var(--fav-line, #e2e8f0);
    font-size: 11px; font-weight: 700;
}
.fav-v-tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; margin: 10px 0 6px; padding: 3px; border: 1px solid var(--fav-line, #e2e8f0); border-radius: 10px; }
.fav-v-tab { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--fav-muted, #64748b); font-size: 13.5px; font-weight: 700; cursor: pointer; }
.fav-v-tab[aria-selected="true"] { background: var(--fav-tint, #fff1f2); color: var(--fav-accent, #ff4b4b); }
.fav-v-count { font-weight: 500; font-size: 12px; font-variant-numeric: tabular-nums; }
.fav-v-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.fav-v-chip { min-height: 30px; padding: 0 11px; border: 1px solid var(--fav-line, #e2e8f0); border-radius: 999px; background: var(--fav-surface, #fff); color: var(--fav-muted, #64748b); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.fav-v-chip[aria-pressed="true"] { border-color: var(--fav-accent, #ff4b4b); color: var(--fav-accent, #ff4b4b); background: var(--fav-tint, #fff1f2); }
.fav-v-select select { min-height: 30px; padding: 0 8px; border: 1px solid var(--fav-line, #e2e8f0); border-radius: 8px; background: var(--fav-surface, #fff); color: var(--fav-ink, #1f2937); font-size: 12.5px; max-width: 220px; }
/* the list head (the only virtual list): cover at the top, not at the bottom of the tall head (review v3, e2e O9) */
.fav-detail-head.fav-detail-head-virtual { align-items: flex-start; }
/* the list summary: 已作答 N 题 · 正确率 · 首答正确率 + 各章正确率 (a row filters the list by its chapter) */
.fav-v-summary { margin: 4px 0 8px; }
.tmua-mk-summary { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--tm-line); border-radius: 12px; background: var(--tm-surface-2); color: var(--tm-ink-2); font-size: 13px; }
.tmua-mk-overall { margin: 0; font-weight: 600; color: var(--tm-ink); line-height: 1.55; }
.tmua-mk-overall small { font-weight: 500; color: var(--tm-muted); }
.tmua-mk-overall.tmua-muted { color: var(--tm-muted); font-weight: 500; }
.tmua-mk-chapters > summary { cursor: pointer; font-weight: 700; color: var(--tm-ink-2); }
.tmua-mk-teaser { margin-left: 10px; font-weight: 500; color: var(--tm-muted); font-variant-numeric: tabular-nums; }
/* compact: three (or more) chapters a line on a desktop, so 18 chapters take at most 6 lines; the done count is in
   the tooltip */
.tmua-mk-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2px 14px; margin-top: 6px; }
.tmua-mk-row { display: grid; grid-template-columns: 2.9em minmax(0, 1fr) minmax(28px, 56px) 2.9em; align-items: center; gap: 6px; width: 100%; min-height: 30px; padding: 3px 6px; border: 0; border-radius: 8px; background: transparent; color: var(--tm-ink-2); font-size: 12.5px; text-align: left; cursor: pointer; }
.tmua-mk-row:hover { background: var(--tm-surface); }
.tmua-mk-row.is-active { background: var(--tm-tint); color: var(--tm-accent-ink); }
.tmua-mk-code { font: 600 11.5px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--tm-muted); }
.tmua-mk-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tmua-mk-pct { font-variant-numeric: tabular-nums; text-align: right; }
.tmua-meter { display: block; height: 6px; border-radius: 999px; background: var(--tm-line); overflow: hidden; }
.tmua-meter i { display: block; height: 100%; border-radius: 999px; background: var(--tm-ok); }
@media (max-width: 767px) {
    .tmua-mk-row { grid-template-columns: 3em minmax(0, 1fr) minmax(48px, 80px) 3em; }
    .tmua-mk-rows { grid-template-columns: minmax(0, 1fr); }
    /* phone: the first mistake should start on the first screen, so no 148 px cover and a 2-line lead */
    .fav-detail-head.fav-detail-head-virtual .fav-detail-cover { display: none; }
    .fav-detail-head.fav-detail-head-virtual .fav-detail-stats { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}

/* ---------- export workspace ---------- */
.pw-tmua-options { display: grid; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed #e2e8f0; }
.pw-tmua-options[hidden] { display: none; }
.pw-tmua-title { margin: 0; font-size: 12.5px; font-weight: 700; color: #475569; }
#cartList > .cart-item.pw-tmua-flag { border-color: #f59e0b !important; box-shadow: 0 0 0 2px rgb(245 158 11 / 45%); }
.pw-template[disabled] { opacity: .55; cursor: not-allowed; }
.pw-template[disabled] .pw-hint { display: block; margin-top: 2px; }
#pwTmuaCoverWrap[hidden] { display: none; }
/* result of 全部加入组卷清单, shown inside the workspace (the site toast would sit under it) */
.tmua-ws-notice { display: grid; gap: 8px; margin-bottom: 12px; padding: 10px 12px; border: 1px solid #fcd34d; border-radius: 10px; background: #fffbeb; color: #78350f; font-size: 13px; line-height: 1.5; }
.tmua-ws-notice p { margin: 0; }
.tmua-ws-notice-actions { display: flex; align-items: center; gap: 12px; }
.tmua-ws-notice .tmua-btn { min-height: 30px; padding: 0 12px; font-size: 13px; }
html[data-theme="dark"] .tmua-ws-notice { background: #3a2f12; border-color: #a16207; color: #fde68a; }

/* long unique labels (other sources) in the card title */
.tmua-card-label.is-long { font-size: 18px; line-height: 1.35; overflow-wrap: anywhere; }
/* phone feed: the running-mock banner above the first card / in the empty state */
.tmua-mock-banner-m { margin: 12px 16px 4px; font-size: 13.5px; }
/* CIE-only controls next to the TMUA grid: photo search searches CIE questions */
body.tmua-hall-active .hall-search-actions [data-photo-search] { display: none !important; }
/* A TMUA card has no 考官报告, so in the warm footer grid 评论 takes the report's column, right after 答案与解析
   (warm-paper.css gives it the third column on cards without variants). */
body.layout-warm-paper .tmua-card>.warm-card-footer:has(>[data-comments-toggle]):not(:has(>[data-var-count]))>[data-comments-toggle] { grid-column: 2; }
/* the warm skin has its own 清除筛选 next to the result count, which also clears the TMUA filters */
@media (min-width: 768px) { body.layout-warm-paper .tmua-hall-tools [data-tmh-reset] { display: none; } }

@media (max-width: 1100px) {
    .tmua-scope .tm-options.tm-has-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
    .tmua-scope .tm-options.tm-has-figs { grid-template-columns: minmax(0, 1fr); }
    .tmua-scope .tm-opt { padding: 8px 11px; gap: 10px; font-size: 14.5px; }
    .tmua-gate, .tmua-empty { margin: 16px; padding: 24px 18px; }
}
@media (max-width: 359px) {
    .tmua-m-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
    .tmua-m-actions button { padding: 0 4px; font-size: 12.5px; }
}

/* ---------- 2024–25 difficulty scale (v2): the level's descriptor under 「难度 n」 in the 难度 cell ---------- */
.tmh-cell .tmh-drop-difficulty { min-width: 320px; }
.tmh-drop .tmh-diff-desc { display: block; margin-top: 2px; color: #64748b; font-size: 11.5px; font-weight: 400; line-height: 1.45; white-space: normal; }
body.theme-dark .tmh-drop .tmh-diff-desc { color: #a4a59f; }

/* ---------- 考点卡 entry points (Admin only: tmua-hall.js renders them for Admin accounts only) ---------- */
.tmh-card-link { flex-shrink: 0; margin-left: 6px; padding: 0 4px; border: 0; border-radius: 6px; background: transparent; font-size: 14px; line-height: 1.5; cursor: pointer; }
.tmh-card-link:hover { background: rgb(15 23 42 / 7%); }
.tmh-card-chapter { display: inline; padding: 0; font-size: inherit; line-height: inherit; text-align: left; }
.tmh-card-chip { white-space: nowrap; }
.tmh-admin-line {
    display: inline-block; padding: 0 7px; border: 1px dashed var(--tm-line-2, #cbd5e1); border-radius: 6px;
    color: var(--tm-muted, #64748b); font: 600 11.5px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.tmh-admin-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 6px 10px; border: 1px dashed var(--tm-line-2); border-radius: 9px; color: var(--tm-muted); font-size: 12.5px; }
.tmh-admin-strip span { font: 600 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.tmua-mk-rowwrap { display: flex; align-items: center; gap: 2px; min-width: 0; }
.tmua-mk-rowwrap .tmua-mk-row { flex: 1 1 auto; min-width: 0; }
.tmua-mk-rowwrap .tmh-card-link { margin-left: 0; }
