.listening-review-page {
  --review-topbar-height: 58px;
  --review-info-height: 54px;
  --review-main-top-gap: 12px;
  --review-bottom-bar-height: 64px;
  --review-bottom-clearance: 14px;
  --review-left-safe-padding: 72px;
  overflow: hidden;
}

.review-main {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(350px, 0.92fr);
  gap: 10px;
  height: calc(100vh - var(--review-topbar-height) - var(--review-info-height) - var(--review-main-top-gap) - var(--review-bottom-bar-height) - var(--review-bottom-clearance));
  max-height: calc(100vh - var(--review-topbar-height) - var(--review-info-height) - var(--review-main-top-gap) - var(--review-bottom-bar-height) - var(--review-bottom-clearance));
  margin-top: var(--review-main-top-gap);
}

.review-info-bar {
  margin: 0 0 10px;
  padding: 4px 14px 10px;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.review-info-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 13px;
  line-height: 1.6;
  color: #7b8794;
}

.review-info-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.review-info-label {
  color: #8b98a7;
}

.review-info-value {
  color: #66768a;
}

.review-left-pane,
.review-right-pane {
  min-width: 0;
  min-height: 0;
}

.review-left-pane .pane-body {
  min-height: 0;
  overflow: auto;
  padding-bottom: var(--review-left-safe-padding);
  scroll-padding-bottom: var(--review-left-safe-padding);
}

.review-right-pane {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  min-height: 0;
  overflow: hidden;
}

.review-sidebar-shell {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #fbfbff;
}

.review-right-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid rgba(203, 213, 225, 0.7);
  background: rgba(255, 255, 255, 0.9);
}

.review-right-title {
  font-size: 18px;
  font-weight: 900;
  color: #111827;
}

.review-right-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.review-right-score {
  font-size: 14px;
  font-weight: 800;
  color: #475569;
}

.review-view-toggle,
.review-script-toggle {
  white-space: nowrap;
}

.review-sidebar-scroll {
  height: auto;
  min-height: 0;
  overflow: hidden;
  padding: 8px 10px 10px;
}

.review-view {
  height: 100%;
  min-height: 0;
}

.review-view-panel {
  height: 100%;
  min-height: 0;
}

.review-card-panel {
  overflow: auto;
}

.review-analysis-layout {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
}

.review-split-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid rgba(203, 213, 225, 0.7);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  overflow: hidden;
}

.review-split-body {
  min-height: 0;
  overflow: auto;
  padding: 10px;
}

.review-script-body {
  display: flex;
  min-height: 0;
  overflow: hidden;
  padding: 8px 10px 10px;
}

.review-empty {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.review-performance-wrap {
  min-height: 100%;
}

.review-performance-table-wrap {
  height: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.review-performance-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 13px;
  table-layout: fixed;
}

.review-performance-table th,
.review-performance-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  line-height: 1.45;
}

.review-performance-table thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 1;
  font-size: 12px;
  font-weight: 900;
  color: var(--muted);
  padding-top: 7px;
  padding-bottom: 7px;
}

.review-performance-table tbody tr:last-child td {
  border-bottom: none;
}

.review-performance-row {
  cursor: pointer;
}

.review-performance-row.is-active-question {
  background: #fff8e8;
}

.review-performance-table .col-q {
  width: 48px;
}

.review-performance-table .col-correct {
  width: 34%;
}

.review-performance-table .col-user {
  width: 38%;
}

.review-performance-table .col-result {
  width: 58px;
  text-align: center;
}

.review-performance-answer {
  font-weight: 800;
  word-break: break-word;
}

.review-performance-answer.is-correct {
  color: var(--correct);
}

.review-performance-answer.is-wrong {
  color: var(--incorrect);
}

.review-performance-result {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  font-size: 18px;
  line-height: 1;
  font-weight: 900;
}

.review-performance-result.is-correct {
  color: var(--correct);
}

.review-performance-result.is-wrong,
.review-performance-result.is-unanswered {
  color: var(--incorrect);
}

.review-answer-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.review-answer-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.review-answer-item.is-active-question {
  background: #fff8e8;
  border-color: #f6cf73;
}

.review-answer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.review-answer-head h3 {
  font-size: 15px;
}

.review-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.review-status-badge.is-correct {
  color: var(--correct);
}

.review-status-badge.is-wrong {
  color: var(--incorrect);
}

.review-status-badge.is-unanswered {
  color: #9a6700;
}

.review-answer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.review-answer-box {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}

.review-answer-box strong {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.review-explanation-card {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.review-answer-compact {
  display: block;
}

.review-answer-summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px 14px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border: 1px solid rgba(203, 213, 225, 0.75);
  border-radius: 8px;
  background: #fffdf7;
  font-size: 13px;
  line-height: 1.45;
  color: #334155;
}

.review-answer-summary strong {
  font-size: 15px;
  font-weight: 900;
  color: #111827;
}

.review-answer-summary em {
  font-style: normal;
  color: #64748b;
}

.review-answer-part {
  margin-left: auto;
  color: #64748b;
}

.review-explanation-block {
  margin-top: 8px;
  padding: 10px 2px 2px;
  font-size: 14px;
  line-height: 1.75;
  color: #1f2937;
}

.review-explanation-block h3 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 900;
  color: #0f172a;
}

.review-explanation-block div {
  white-space: pre-wrap;
}

.transcript-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
}

.review-script-toggle {
  align-self: flex-end;
  margin-bottom: 4px;
  padding: 5px 9px;
  font-size: 12px;
}

.review-script-toggle.is-active {
  border-color: rgba(59, 130, 246, 0.34);
  background: rgba(239, 246, 255, 0.9);
  color: #1d4ed8;
}

.transcript-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-right: 2px;
  padding-top: 0;
  padding-bottom: 14px;
  scroll-padding-bottom: 14px;
}

.transcript-item {
  border: 0;
  border-bottom: 1px solid rgba(226, 232, 240, 0.95);
  border-left: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  padding: 7px 8px 7px 10px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.transcript-item.is-seekable {
  cursor: pointer;
}

.transcript-item.is-linked,
.transcript-item.is-linked-question {
  background: #fff8dc;
  border-left-color: #f59e0b;
}

.transcript-item.answer-sentence-focus {
  background: #fff4c2;
  border-left-color: #d97706;
  box-shadow: none;
}

.transcript-item.script-line-active {
  background: #eff6ff;
  border-left-color: #60a5fa;
  box-shadow: none;
}

.transcript-item.is-playing {
  border-left-color: #f472b6;
  box-shadow: none;
}

.transcript-speaker {
  font-size: 12px;
  font-weight: 900;
  color: #0f172a;
  margin-right: 6px;
  letter-spacing: 0.02em;
}

.transcript-text {
  font-size: 14px;
  line-height: 1.65;
  font-weight: 500;
  color: #0f172a;
}

.transcript-content {
  font-weight: 600;
}

.transcript-translation {
  margin-top: 3px;
  font-size: 13px;
  line-height: 1.65;
  color: #64748b;
  overflow-wrap: anywhere;
}

.transcript-list:not(.show-zh) .transcript-translation {
  display: none;
}

.transcript-qs {
  display: none;
}

.transcript-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 2px 7px;
  border-bottom: 1px solid rgba(203, 213, 225, 0.8);
  color: #0f172a;
}

.transcript-section-title:not(:first-child) {
  margin-top: 10px;
}

.transcript-section-title strong {
  font-size: 13px;
  font-weight: 900;
}

.transcript-section-title span {
  font-size: 12px;
  color: #64748b;
}

.transcript-q-badge {
  display: inline-flex;
  align-items: center;
  margin: 0 6px 1px 0;
  padding: 1px 5px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 11px;
  line-height: 1.35;
  font-weight: 900;
  vertical-align: baseline;
}

.transcript-empty {
  margin-top: 8px;
}

.mini-audio {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  flex-wrap: nowrap;
}

.review-audio-dock {
  min-height: 64px;
  padding: 6px 8px 8px;
  border-top: 1px solid rgba(203, 213, 225, 0.7);
  background: rgba(251, 251, 255, 0.96);
}

.review-sidebar-audio {
  min-height: 52px;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

.review-audio-topline,
.review-audio-main,
.review-audio-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.review-audio-topline {
  flex: 0 0 auto;
  min-width: 32px;
}

.review-audio-title {
  font-size: 12px;
  font-weight: 900;
  color: #0f172a;
  white-space: nowrap;
}

.review-audio-main .audio-progress {
  flex: 1 1 auto;
  min-width: 92px;
}

.review-audio-main {
  flex: 1 1 auto;
  min-width: 0;
}

.review-audio-actions {
  flex: 0 0 auto;
  justify-content: flex-end;
}

.mini-audio .audio-progress {
  flex: 1 1 92px;
  min-width: 92px;
}

.mini-audio .audio-volume {
  width: 54px;
  flex-basis: 54px;
}

.mini-audio .audio-icon-btn {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
}

.mini-audio .audio-chip-btn {
  min-height: 28px;
  padding: 3px 7px;
  border-radius: 7px;
  font-size: 12px;
}

.mini-audio .audio-time {
  font-size: 12px;
  min-width: 34px;
}

.review-answer-display,
.review-inline-note {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  margin-left: 4px;
  font-weight: 800;
  vertical-align: baseline;
}

.review-choice-note {
  display: block;
  margin: 6px 0 10px 0;
  padding-left: 30px;
}

.review-answer-display.is-correct,
.review-inline-note.is-correct {
  color: var(--correct);
}

.review-answer-display.is-wrong,
.review-inline-note.is-wrong {
  color: var(--incorrect);
}

.review-answer-display.is-unanswered,
.review-inline-note.is-unanswered {
  color: #9a6700;
}

.review-correct-answer {
  color: var(--correct);
}

#reviewQuestionsPane .question.is-active-question {
  background: rgba(255, 248, 220, 0.95);
  outline: 2px solid rgba(245, 158, 11, 0.28);
  outline-offset: 1px;
  box-shadow: none;
}

#reviewQuestionsPane .question.is-correct,
#reviewQuestionsPane .question.is-wrong,
#reviewQuestionsPane .question.is-unanswered {
  background: transparent;
}

#reviewQuestionsPane .choice-option.is-review-correct {
  color: var(--correct);
  font-weight: 800;
}

#reviewQuestionsPane .choice-option.is-review-wrong {
  color: var(--incorrect);
  font-weight: 800;
}

#reviewQuestionsPane .choice-option.is-review-correct input,
#reviewQuestionsPane .choice-option.is-review-wrong input {
  accent-color: currentColor;
}

#reviewQuestionsPane .choice-option {
  display: block;
}

#reviewQuestionsPane .hl,
#reviewQuestionsPane .highlight,
#reviewQuestionsPane .custom-highlight,
#reviewQuestionsPane .text-highlight,
#reviewQuestionsPane .user-highlight,
#reviewQuestionsPane [data-highlight="true"] {
  background: var(--mark-bg);
  color: var(--mark-text);
  border-radius: 4px;
  padding: 0 2px;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.18);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

#reviewQuestionsPane .user-highlight[data-highlight-state="double"],
#reviewQuestionsPane [data-highlight="true"][data-highlight-state="double"] {
  background: var(--selection-bg);
  color: var(--selection-text);
}

#reviewQuestionsPane .reading-pane-title {
  display: none;
}

#reviewQuestionsPane .reading-pane-inner {
  font-size: inherit;
}

#reviewQuestionsPane .reading-questions-content {
  display: block;
}

#reviewQuestionsPane .review-answer-control {
  pointer-events: none;
}

#reviewQuestionsPane .blank.review-answer-control,
#reviewQuestionsPane .feature-input.review-answer-control,
#reviewQuestionsPane .answer-slot.review-answer-control,
#reviewQuestionsPane .drop-slot.review-answer-control,
#reviewQuestionsPane [data-role="answer"].review-answer-control {
  font-weight: 800;
}

#reviewQuestionsPane .blank.review-answer-control.is-correct,
#reviewQuestionsPane .feature-input.review-answer-control.is-correct,
#reviewQuestionsPane .answer-slot.review-answer-control.is-correct,
#reviewQuestionsPane .drop-slot.review-answer-control.is-correct,
#reviewQuestionsPane [data-role="answer"].review-answer-control.is-correct {
  color: var(--correct);
  border-bottom-color: var(--correct);
}

#reviewQuestionsPane .blank.review-answer-control.is-wrong,
#reviewQuestionsPane .feature-input.review-answer-control.is-wrong,
#reviewQuestionsPane .answer-slot.review-answer-control.is-wrong,
#reviewQuestionsPane .drop-slot.review-answer-control.is-wrong,
#reviewQuestionsPane [data-role="answer"].review-answer-control.is-wrong {
  color: var(--incorrect);
  border-bottom-color: var(--incorrect);
}

#reviewQuestionsPane .blank.review-answer-control.is-unanswered,
#reviewQuestionsPane .feature-input.review-answer-control.is-unanswered,
#reviewQuestionsPane .answer-slot.review-answer-control.is-unanswered,
#reviewQuestionsPane .drop-slot.review-answer-control.is-unanswered,
#reviewQuestionsPane [data-role="answer"].review-answer-control.is-unanswered {
  color: #9a6700;
  border-bottom-color: #d97706;
}

@media (max-width: 1180px) {
  .review-main {
    grid-template-columns: 1fr;
    grid-auto-rows: minmax(360px, auto);
    overflow: auto;
  }

  .review-right-pane {
    min-height: 420px;
  }

  .review-analysis-layout {
    grid-template-rows: minmax(260px, 1fr) minmax(260px, 1fr);
  }
}

@media (max-width: 760px) {
  .listening-review-page {
    --review-left-safe-padding: 88px;
  }

  .review-info-bar {
    padding-left: 10px;
    padding-right: 10px;
  }

  .review-right-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .review-right-actions {
    width: 100%;
    justify-content: space-between;
  }

  .review-answer-grid {
    grid-template-columns: 1fr;
  }

  .review-performance-table {
    min-width: 480px;
  }
}
