/* Result page: #/result/:id — the practice workspace (.pr-* in practice.css) in locked read-only mode. */
.rs-page { --rs-chrome: 110px; }
.rs-body { background: #fff; }
.pr-status.rs-done { color: var(--muted); }
.rs-tools { display: flex; align-items: center; gap: 6px; flex: none; }
.rs-tools:empty { display: none; }

/* ---------- Status banner ---------- */
.rs-top { padding: 14px 20px 0; display: flex; flex-direction: column; gap: 12px; }
.rs-banner {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 0;
  padding: 14px 18px; border-radius: var(--radius); border: 1px solid var(--brand-100);
  background: linear-gradient(90deg, var(--brand-50), #f6fbf9 60%, #fff);
}
.rs-b-done { display: flex; align-items: center; gap: 10px; padding-right: 22px; font-weight: 600; color: var(--brand-600); }
.rs-b-check { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font-size: 13px; }
.rs-b-cell { display: flex; flex-direction: column; padding: 0 22px; border-left: 1px solid var(--brand-100); line-height: 1.3; }
.rs-b-cell b { font-size: 19px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rs-b-cell b small { font-size: 12px; font-weight: 500; color: var(--muted); }
.rs-b-cell span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.rs-b-note { flex: 1 1 220px; padding-left: 22px; border-left: 1px solid var(--brand-100); font-size: 12.5px; color: var(--muted); }

/* ---------- Lab banner ---------- */
.rs-lab {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px;
  border-radius: var(--radius); border: 1px solid var(--line); background: #fafcfb;
}
.rs-lab-body { flex: 1; min-width: 0; font-size: 13px; }
.rs-lab-title { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.rs-lab-drill { background: #f1f5fc; border-color: #d3e1f8; }
.rs-lab-drill .rs-lab-title { color: var(--info); }
.rs-lab-pass { background: var(--brand-50); border-color: var(--brand-100); }
.rs-lab-pass .rs-lab-title { color: var(--brand-600); }
.rs-lab-fail { background: var(--danger-50); border-color: #f6cdc8; }
.rs-lab-fail .rs-lab-title { color: var(--danger); }
.rs-lab-pending { background: var(--warn-50); border-color: #f4dfb8; }
.rs-lab-pending .rs-lab-title { color: #9a5f05; }

/* ---------- Analysis ---------- */
.rs-analysis { padding: 12px 2px 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.rs-an-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.rs-an-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.rs-an-btn { color: var(--brand-600); }
.rs-an-out { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 12px; padding: 14px 16px; background: #fafcfb; border: 1px solid var(--line); border-radius: 10px; }
.rs-an-sub { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.rs-an-foot { margin-top: 8px; }
.rs-list { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.75; }
.rs-list li + li { margin-top: 4px; }
.rs-plain .stat-num { font-size: 22px; }

/* ---------- Objective workspace ---------- */
.rs-view { padding-top: 14px; }
.rs-strip { border-top: 1px solid #efe9d2; }
.rs-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.rs-left {
  position: sticky; top: 0; height: calc(100vh - var(--topbar) - var(--rs-chrome)); height: calc(100dvh - var(--topbar) - var(--rs-chrome));
  overflow: auto; padding: 16px 28px 32px; border-right: 1px solid var(--line); background: #fff;
}
.rs-right { padding: 8px 28px 48px; min-width: 0; }
.rs-left-note { margin-bottom: 10px; }
.rs-left .pr-passage { max-width: 760px; margin: 0 auto; }

.rs-q { cursor: pointer; padding: 14px 10px; margin: 0 -10px; border-bottom: 1px dashed var(--line); transition: background 0.15s; }
.rs-q:hover { background: #fbfdfc; }
.rs-q.is-sel { background: #fbfaf2; }
.rs-q.is-ok .pr-no { background: var(--brand-50); color: var(--brand-600); }
.rs-q.is-bad .pr-no { background: var(--danger-50); color: var(--danger); }
.rs-opt { cursor: default; }
.rs-opt:hover { border-color: var(--line); background: #fff; }
.rs-opt.right { border-color: var(--brand-100); background: var(--brand-50); }
.rs-opt.right .pr-opt-l { border-color: var(--brand); color: var(--brand-600); }
.rs-opt.mine .pr-opt-l { background: var(--brand); border-color: var(--brand); color: #fff; }
.rs-opt.wrong { border-color: #f6cdc8; background: var(--danger-50); }
.rs-opt.wrong .pr-opt-l { background: var(--danger); border-color: var(--danger); color: #fff; }
.rs-pick, .rs-gap { display: inline-block; padding: 1px 10px; border-radius: 6px; font-weight: 600; font-family: Georgia, "Times New Roman", serif; }
.rs-pick.ok, .rs-gap.ok { background: var(--brand-50); color: var(--brand-600); }
.rs-pick.bad, .rs-gap.bad { background: var(--danger-50); color: var(--danger); }

.rs-verdict {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px; margin: 10px 0 0 36px; padding: 7px 12px;
  border-radius: 8px; font-size: 13px;
}
.rs-verdict b { font-weight: 600; }
.rs-verdict em { font-style: normal; font-weight: 600; }
.rs-verdict .link-btn { font-size: 13px; }
.rs-v-icon { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: 11px; font-weight: 700; margin-right: -6px; }
.rs-verdict.ok { background: var(--brand-50); color: var(--brand-600); }
.rs-verdict.ok .rs-v-icon { background: var(--brand); }
.rs-verdict.bad { background: var(--danger-50); color: #9c3329; }
.rs-verdict.bad .rs-v-icon { background: var(--danger); }
.rs-verdict.bad b { color: var(--danger); }

/* Script and passage evidence */
.rs-script { margin-bottom: 18px; }
.rs-script-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.rs-script-head audio { height: 32px; max-width: 100%; }
.rs-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; padding: 4px 8px; margin: 0 -8px; border-radius: 6px; line-height: 1.75; font-size: var(--pr-fs); transition: background 0.2s; }
.rs-line .en { flex: 1 1 260px; }
.rs-spk { flex: none; width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; background: var(--brand); transform: translateY(-1px); }
.rs-spk-W { background: #c2577a; }
.rs-spk-M { background: var(--info); }
.rs-evidence { background: var(--danger-50); }
.rs-ev-tag { font-size: 11px; color: var(--danger); font-family: -apple-system, sans-serif; white-space: nowrap; }
.rs-line.rs-sel { background: #fff3c4; box-shadow: inset 3px 0 0 var(--warn); }
.rs-speaking { background: var(--brand-100); }
mark.rs-ev { background: #fff0a8; color: inherit; padding: 1px 2px; border-radius: 3px; }
.rs-locate-flash { animation: rs-locate-pulse 1.6s ease-out; }
@keyframes rs-locate-pulse {
  0%, 35% { box-shadow: 0 0 0 5px #ffe17d; background: #ffe88a; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.rs-para-ans .pr-para-label { background: var(--brand); color: #fff; }
.rs-blank { display: inline-block; padding: 0 6px; border-bottom: 2px solid var(--line); color: var(--text); font-weight: 600; }
.rs-blank sup { font-size: 10px; color: var(--muted); margin-right: 3px; font-weight: 400; }
.rs-blank.ok { border-color: var(--brand); color: var(--brand-600); }
.rs-blank.bad { border-color: var(--danger); color: var(--brand-600); }
.rs-blank.bad s { color: var(--danger); font-weight: 400; }
.rs-blank.rs-sel { background: #fff3c4; border-radius: 3px 3px 0 0; }
.rs-bank { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 12px; margin: 0 auto 14px; max-width: 760px; border: 1px solid var(--line); border-radius: 8px; background: #fafcfb; font-size: 14px; font-family: Georgia, "Times New Roman", serif; }
.rs-bank b { color: var(--muted); margin-right: 4px; font-family: -apple-system, sans-serif; font-size: 12px; }

/* ---------- Writing / translation evaluation workspace ---------- */
.rs-wsplit { grid-template-columns: minmax(260px, 0.42fr) minmax(0, 1fr); border-top: 1px solid var(--line); }
.rs-wsplit .rs-left { background: #fafcfb; }
.rs-src-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; font-size: 14px; }
.rs-src { font-size: var(--pr-fs); line-height: 1.85; }
.rs-zh { font-size: 15px; line-height: 2; letter-spacing: 0.02em; }
.rs-essay { position: relative; padding: 30px 0 14px; border-bottom: 1px solid var(--line); }
.rs-fix-tag { position: absolute; top: 6px; left: 0; padding: 0 8px; border-radius: 4px; font-size: 11.5px; background: var(--danger-50); color: var(--danger); border: 1px solid #f6cdc8; }
.rs-text { white-space: pre-wrap; line-height: 1.95; font-size: var(--pr-fs); word-break: break-word; }
mark.rs-issue {
  position: relative; background: #fde3df; color: inherit; border-bottom: 2px solid var(--danger); border-radius: 2px; padding: 0 1px; cursor: help; outline: none;
}
mark.rs-issue:hover::after, mark.rs-issue:focus-visible::after, mark.rs-issue.open::after {
  content: attr(data-note); position: absolute; left: 0; top: calc(100% + 6px); z-index: 20; width: max-content; max-width: 280px;
  padding: 6px 10px; border-radius: 8px; background: #1d2a26; color: #fff; font: 12.5px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  white-space: normal; box-shadow: var(--shadow);
}
mark.rs-issue[data-note=""]::after { display: none; }
.rs-essay-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; }
.rs-issues { margin: 10px 0 0; padding-left: 20px; font-size: 13px; color: var(--muted); }
.rs-issues li { margin-top: 4px; }
.rs-issue-q { color: var(--danger); margin-right: 8px; }

.rs-eval { padding: 18px 0 8px; }
.rs-eval-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.rs-eval-head h2 { font-size: 18px; }
.rs-eval-sub { font-size: 12.5px; color: #9a5f05; }
.rs-eval-score { text-align: right; }
.rs-eval-score b { font-size: 38px; line-height: 1; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.rs-eval-score small { color: var(--muted); font-size: 14px; }
.rs-eval-score > span { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.rs-summary { margin: 10px 0 0; font-size: 14px; line-height: 1.6; }
.rs-proto { margin: 8px 0 14px; font-size: 12px; color: var(--muted); }
.rs-dims { display: grid; grid-template-columns: repeat(var(--rs-n, 4), minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; }
.rs-dim { padding: 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rs-dim + .rs-dim { border-left: 1px solid var(--line); }
.rs-dim-name { font-size: 13px; color: var(--muted); }
.rs-dim-score { font-size: 22px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.rs-dim-score small { font-size: 12px; font-weight: 500; color: var(--muted); }
.rs-dim-comment { font-size: 13px; line-height: 1.7; }
.rs-quote { margin: 0; padding: 2px 0 2px 10px; border-left: 2px solid var(--line); color: var(--muted); font-size: 12.5px; line-height: 1.65; }
.rs-fb { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 18px; }
.rs-fb > div, .rs-exprs, .rs-cover { padding-top: 12px; border-top: 1px solid var(--line); }
.rs-fb-title { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.rs-exprs, .rs-cover { margin-top: 18px; }
.rs-expr { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rs-expr li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-size: 14px; }
.rs-from { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(212, 72, 59, 0.5); }
.rs-arrow { color: var(--muted); font-size: 12px; }
.rs-to { color: var(--brand-600); font-weight: 600; }
.rs-kp { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 13px; border: 1px solid; }
.rs-kp.hit { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-600); }
.rs-kp.miss { background: var(--danger-50); border-color: #f6cdc8; color: var(--danger); }
.rs-ref { margin-top: 18px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fafcfb; }
.rs-ref > summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--brand-600); }
.rs-ref .rs-text { margin-top: 10px; }

/* Version history modal */
.rs-hist { display: flex; flex-direction: column; gap: 8px; }
.rs-hist-row { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.rs-hist-row > summary { cursor: pointer; display: flex; align-items: center; gap: 12px; }
.rs-hist-text { white-space: pre-wrap; margin: 10px 0; line-height: 1.8; font-size: 14px; max-height: 260px; overflow: auto; }

/* ---------- Narrow screens ---------- */
@media (max-width: 1180px) {
  .rs-dims { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rs-dim:nth-child(odd) { border-left: 0; }
  .rs-dim:nth-child(n + 3) { border-top: 1px solid var(--line); }
}
@media (max-width: 860px) {
  .rs-top { padding: 12px 14px 0; }
  .rs-b-cell { padding: 0 12px; }
  .rs-b-done { flex-basis: 100%; }
  .rs-b-cell:nth-of-type(2) { border-left: 0; padding-left: 0; }
  .rs-b-note { flex-basis: 100%; border-left: 0; padding-left: 0; }
  .rs-an-out, .rs-fb { grid-template-columns: 1fr; gap: 12px; }
  .rs-split, .rs-wsplit { grid-template-columns: 1fr; }
  .rs-left { position: static; height: auto; max-height: 50vh; border-right: 0; border-bottom: 1px solid var(--line); padding: 14px; }
  .rs-right { padding: 6px 14px 32px; }
  .rs-verdict { margin-left: 0; }
  .rs-tools .btn { padding: 0 8px; }
  .rs-dims { grid-template-columns: 1fr; }
  .rs-dim + .rs-dim { border-left: 0; border-top: 1px solid var(--line); }
}
