:root {
  color-scheme: light;
  --lp-ink: #17212b;
  --lp-muted: #5d6875;
  --lp-line: #d9e0e7;
  --lp-bg: #f7f8fb;
  --lp-panel: #ffffff;
  --lp-blue: #1f5fbf;
  --lp-blue-dark: #174b97;
  --lp-green: #177a56;
  --lp-red: #b83b3b;
  --lp-amber: #8a5a00;
  --lp-shadow: 0 14px 40px rgba(23, 33, 43, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--lp-bg);
  color: var(--lp-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

.lp-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.lp-hero,
.lp-test-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 0 24px;
}

.lp-kicker,
.lp-filter-label,
.lp-card-meta,
.lp-question-meta {
  margin: 0;
  color: var(--lp-muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 4px 0 0;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.04;
  letter-spacing: 0;
}

.lp-subtitle {
  max-width: 680px;
  margin: 14px 0 0;
  color: var(--lp-muted);
  font-size: 17px;
}

.lp-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.lp-exam-mode-entry {
  width: auto;
  min-height: 42px;
  padding: 10px 15px;
}

.lp-summary,
.lp-duration {
  min-width: 150px;
  padding: 14px 16px;
  border: 1px solid var(--lp-line);
  border-radius: 8px;
  background: var(--lp-panel);
  text-align: right;
}

.lp-summary strong {
  display: block;
  font-size: 34px;
  line-height: 1;
}

.lp-summary span,
.lp-duration {
  color: var(--lp-muted);
  font-size: 14px;
}

.lp-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin: 10px 0 22px;
  padding: 16px;
  border: 1px solid var(--lp-line);
  border-radius: 8px;
  background: var(--lp-panel);
}

.lp-beta-note {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid rgba(31, 95, 191, 0.16);
  border-radius: 8px;
  background: #eef5ff;
  color: #31506e;
  font-size: 14px;
}

.lp-filter-group {
  min-width: 0;
}

.lp-filter-label {
  display: block;
  margin-bottom: 8px;
}

.lp-segments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lp-segment,
.lp-back,
.lp-primary {
  min-height: 42px;
  border: 1px solid var(--lp-line);
  border-radius: 8px;
  background: #fff;
  color: var(--lp-ink);
  cursor: pointer;
}

.lp-segment {
  padding: 8px 13px;
}

.lp-segment.is-active {
  border-color: var(--lp-blue);
  background: var(--lp-blue);
  color: #fff;
}

.lp-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.lp-card {
  display: flex;
  min-width: 0;
  min-height: 220px;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--lp-line);
  border-radius: 8px;
  background: var(--lp-panel);
  box-shadow: var(--lp-shadow);
}

.lp-card h2 {
  margin: 8px 0 0;
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: 0;
}

.lp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.lp-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--lp-line);
  border-radius: 999px;
  color: var(--lp-muted);
  font-size: 13px;
  white-space: nowrap;
}

.lp-start,
.lp-primary {
  width: 100%;
  padding: 11px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--lp-blue);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  text-align: center;
}

.lp-start:hover,
.lp-primary:hover,
.lp-back:hover {
  background: var(--lp-blue-dark);
  color: #fff;
}

.lp-practice {
  padding-top: 8px;
}

.lp-back {
  width: auto;
  margin-bottom: 18px;
  padding: 8px 13px;
}

.lp-audio,
.lp-results,
.lp-question-group,
.lp-error {
  border: 1px solid var(--lp-line);
  border-radius: 8px;
  background: var(--lp-panel);
  box-shadow: var(--lp-shadow);
}

.lp-audio {
  margin-bottom: 18px;
  padding: 18px;
}

.lp-audio-player {
  display: grid;
  gap: 10px;
}

.lp-audio-source {
  display: none;
}

.lp-audio-controls {
  display: grid;
  grid-template-columns: auto auto auto minmax(140px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.lp-audio-button {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--lp-line);
  border-radius: 8px;
  background: #fff;
  color: var(--lp-ink);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.lp-audio-button:hover,
.lp-audio-button:focus-visible {
  border-color: var(--lp-blue);
  color: var(--lp-blue);
}

.lp-audio-play {
  min-width: 58px;
  background: var(--lp-blue);
  color: #fff;
}

.lp-audio-play:hover,
.lp-audio-play:focus-visible {
  background: var(--lp-blue-dark);
  color: #fff;
}

.lp-audio-time,
.lp-audio-separator {
  color: var(--lp-muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.lp-audio-range {
  width: 100%;
  min-width: 120px;
  accent-color: var(--lp-blue);
  cursor: pointer;
}

.lp-audio-status {
  margin: 0;
  color: var(--lp-amber);
  font-size: 14px;
  font-weight: 700;
}

.lp-audio-note {
  margin: 0;
  color: var(--lp-amber);
  font-weight: 700;
}

.lp-questions {
  display: grid;
  gap: 16px;
}

.lp-question-group {
  min-width: 0;
  padding: 18px;
}

.lp-question-group h2 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.25;
}

.lp-instruction {
  margin: 0 0 16px;
  color: var(--lp-muted);
  white-space: pre-line;
}

.lp-group-html {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  color: var(--lp-ink);
}

.ielts-highlight {
  padding: 0 2px;
  border-radius: 2px;
  background: #fff2a8;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  cursor: pointer;
}

.lp-highlight-menu {
  position: fixed;
  z-index: 2147483000;
  display: inline-flex;
  gap: 4px;
  padding: 5px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
}

.lp-highlight-menu.is-hidden {
  display: none;
}

.lp-highlight-button {
  min-height: 30px;
  padding: 5px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--lp-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.lp-highlight-button:hover,
.lp-highlight-button:focus-visible {
  outline: none;
  background: #fff5c2;
}

.lp-group-html h4,
.lp-group-html h5,
.lp-group-html h6 {
  margin: 16px 0 10px;
  font-size: 18px;
  line-height: 1.25;
}

.lp-group-html .instructions {
  color: var(--lp-muted);
}

.lp-group-html table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 15px;
}

.lp-group-html th,
.lp-group-html td {
  padding: 10px 10px;
  border: 1px solid var(--lp-line);
  text-align: left;
  vertical-align: top;
  line-height: 1.65;
}

.lp-group-html th {
  background: #eef4fa;
}

.lp-group-html ul,
.lp-group-html ol {
  margin: 10px 0 14px;
  padding-left: 24px;
}

.lp-group-html li {
  margin: 7px 0;
}

.lp-group-html .flowchart-container,
.lp-group-html .flow-chart-container {
  display: grid;
  gap: 12px;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--lp-line);
  border-radius: 8px;
  background: #f8fbff;
}

.lp-group-html .flowchart-step,
.lp-group-html .flow-chart-item,
.lp-group-html .flow-chart-content {
  padding: 10px;
  border: 1px solid var(--lp-line);
  border-radius: 8px;
  background: #fff;
}

.lp-group-html .flowchart-pool,
.lp-group-html .flow-chart-pool,
.lp-group-html .drag-pool {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.lp-group-html .drag-option,
.lp-group-html .flowchart-option {
  padding: 8px 10px;
  border: 1px solid var(--lp-line);
  border-radius: 8px;
  background: #fff;
}

.listening-inline-blank {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 3px;
  vertical-align: baseline;
  white-space: nowrap;
}

.blank-number {
  color: var(--lp-ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.lp-group-html .listening-inline-blank .lp-inline-input {
  display: inline-block;
  width: 120px;
  min-width: 90px;
  max-width: 160px;
  min-height: 32px;
  height: 32px;
  margin: 0;
  padding: 4px 8px;
  border-radius: 6px;
  vertical-align: baseline;
}

.lp-option-bank {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  padding: 12px;
  border: 1px solid var(--lp-line);
  border-radius: 8px;
  background: #f8fbff;
}

.lp-bank-item {
  color: var(--lp-ink);
  font-size: 14px;
}

.lp-question {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 260px);
  gap: 14px;
  align-items: start;
  padding: 14px 0;
  border-top: 1px solid var(--lp-line);
}

.lp-question:first-of-type {
  border-top: 0;
}

.lp-stem {
  margin: 0;
  white-space: pre-line;
}

.lp-input,
.lp-select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #c6d0dc;
  border-radius: 8px;
  background: #fff;
  color: var(--lp-ink);
}

.lp-choice-list {
  display: grid;
  gap: 8px;
}

.lp-choice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--lp-line);
  border-radius: 8px;
  background: #fff;
}

.lp-choice input {
  flex: 0 0 auto;
  margin-top: 3px;
}

.lp-actions {
  margin-top: 18px;
  padding: 4px 0 0;
  background: transparent;
}

.lp-primary {
  max-width: 280px;
}

.lp-results {
  margin-top: 18px;
  padding: 18px;
}

.lp-score {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.lp-score-card {
  padding: 14px;
  border: 1px solid var(--lp-line);
  border-radius: 8px;
  background: #fafcff;
}

.lp-score-card strong {
  display: block;
  font-size: 28px;
}

.lp-result-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.lp-result-table th,
.lp-result-table td {
  padding: 10px 8px;
  border-top: 1px solid var(--lp-line);
  text-align: left;
  vertical-align: top;
}

.lp-location summary,
.lp-explanation summary,
.lp-transcript-details summary {
  color: var(--lp-blue);
  cursor: pointer;
  font-weight: 800;
}

.lp-location p,
.lp-explanation p {
  margin: 8px 0 0;
}

.lp-review-cell {
  min-width: 210px;
  width: 42%;
}

.lp-explanation {
  margin-top: 8px;
}

.lp-explanation p {
  max-width: 420px;
  color: var(--lp-ink);
  font-size: 14px;
  line-height: 1.58;
  white-space: normal;
  overflow-wrap: break-word;
}

.lp-location-snippet {
  max-width: 360px;
  color: var(--lp-ink);
  font-size: 14px;
  line-height: 1.55;
  white-space: normal;
  overflow-wrap: break-word;
}

.lp-location-note {
  margin: 8px 0 0;
  color: var(--lp-muted);
  font-size: 14px;
}

.lp-transcript-review {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--lp-line);
}

.lp-transcript-review h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.lp-transcript-details {
  margin-top: 12px;
}

.lp-transcript-text {
  max-height: 420px;
  margin-top: 12px;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--lp-line);
  border-radius: 8px;
  background: #fbfcfe;
  color: var(--lp-ink);
  font-size: 15px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

.lp-answer-highlight {
  padding: 1px 3px;
  border-radius: 4px;
  background: #fff1a8;
  color: var(--lp-ink);
  font-weight: 800;
}

.lp-correct {
  color: var(--lp-green);
  font-weight: 800;
}

.lp-wrong {
  color: var(--lp-red);
  font-weight: 800;
}

.lp-empty {
  padding: 26px;
  border: 1px dashed var(--lp-line);
  border-radius: 8px;
  color: var(--lp-muted);
  text-align: center;
}

.lp-error {
  padding: 18px;
  color: var(--lp-red);
}

.is-hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .lp-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lp-toolbar {
    grid-template-columns: 1fr;
  }

  .lp-question {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .lp-shell {
    width: min(100% - 20px, 1180px);
    padding: 18px 0 40px;
  }

  .lp-hero,
  .lp-test-header {
    display: grid;
    gap: 14px;
  }

  h1 {
    font-size: 34px;
  }

  .lp-summary,
  .lp-duration {
    width: 100%;
    text-align: left;
  }

  .lp-audio-controls {
    grid-template-columns: auto auto auto;
  }

  .lp-audio-range {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .lp-list,
  .lp-score {
    grid-template-columns: 1fr;
  }

  .lp-card {
    min-height: 0;
  }

  .lp-primary {
    max-width: none;
  }

  .lp-actions {
    position: sticky;
    bottom: 0;
    margin-top: 18px;
    padding: 12px 0 0;
    background: linear-gradient(180deg, rgba(247, 248, 251, 0), var(--lp-bg) 35%);
  }

  .lp-group-html table {
    min-width: 580px;
  }

  .lp-result-table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow: visible;
    table-layout: auto;
  }

  .lp-result-table thead {
    display: none;
  }

  .lp-result-table,
  .lp-result-table tbody,
  .lp-result-table tr,
  .lp-result-table td {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .lp-result-table tbody {
    display: grid;
    gap: 12px;
  }

  .lp-result-table tr {
    margin-bottom: 0;
    padding: 12px;
    border: 1px solid var(--lp-line);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
  }

  .lp-result-table td {
    display: grid;
    grid-template-columns: minmax(76px, max-content) minmax(0, 1fr);
    gap: 8px;
    padding: 7px 0;
    border-top: 0;
    min-width: 0;
    white-space: normal;
    overflow-wrap: break-word;
  }

  .lp-result-table td::before {
    color: var(--lp-muted);
    font-size: 13px;
    font-weight: 800;
  }

  .lp-result-table td:nth-child(1)::before {
    content: "题号";
  }

  .lp-result-table td:nth-child(2)::before {
    content: "你的答案";
  }

  .lp-result-table td:nth-child(3)::before {
    content: "正确答案";
  }

  .lp-result-table td:nth-child(4)::before {
    content: "结果";
  }

  .lp-result-table td:nth-child(5)::before {
    content: "复盘";
  }

  .lp-result-table td:nth-child(5),
  .lp-review-cell {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--lp-line);
  }

  .lp-result-table td:nth-child(5)::before {
    display: block;
    margin-bottom: 8px;
  }

  .lp-location,
  .lp-explanation,
  .lp-location summary,
  .lp-explanation summary,
  .lp-location p,
  .lp-explanation p {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .lp-location summary,
  .lp-explanation summary,
  .lp-transcript-details summary {
    display: block;
    padding: 4px 0;
  }

  .lp-location-snippet,
  .lp-explanation p,
  .lp-location-note,
  .lp-transcript-text {
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
    line-height: 1.6;
  }

  .lp-review-cell,
  .lp-location-snippet,
  .lp-explanation p {
    min-width: 0;
    max-width: 100%;
  }

  .lp-results {
    max-width: 100%;
    overflow-x: hidden;
    padding: 14px;
  }
}
