.speaking-mode .app-shell {
  --speaking-right-pane-width: max(620px, calc((100vw - 236px) * 1.05 / 2));
  grid-template-columns: 236px minmax(560px, 0.95fr) minmax(620px, 1.05fr);
}

.speaking-mode .table-pane,
.speaking-mode .detail-pane {
  overflow: hidden;
}

.speaking-mode .table-pane {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line);
  border-right: 0;
  overflow: hidden;
}

.speaking-mode .detail-pane {
  position: relative;
  z-index: 1;
}

.speaking-single-pane {
  grid-column: 2 / -1;
}

.speaking-p2-pane {
  grid-column: 2;
}

.speaking-p3-pane {
  grid-column: 3;
}

.speaking-filter-section {
  display: block;
}

.speaking-filter-section[hidden] {
  display: none;
}

.speaking-partner-workspace {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  place-items: center;
  background: #ffffff;
}

.speaking-partner-qr {
  display: block;
  width: 34%;
  height: auto;
}

.speaking-board {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
  background: #ffffff;
}

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

.speaking-panel-grid {
  display: grid;
  grid-template-columns: minmax(560px, 0.95fr) minmax(620px, 1.05fr);
  min-height: 0;
}

.speaking-panel-grid > .speaking-board {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.speaking-panel-grid > .speaking-detail-board {
  border-left: 1px solid var(--line);
}

.speaking-panel-grid .speaking-detail-body {
  border-left: 0;
}

.speaking-board-single {
  grid-template-rows: auto minmax(0, 1fr);
}

.speaking-list-board {
  grid-template-rows: auto minmax(0, 1fr);
}

.speaking-board-head {
  position: relative;
  display: grid;
  gap: 6px;
  min-height: 92px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  place-items: center start;
}

.speaking-board-head-spanning {
  z-index: 4;
  align-content: start;
  gap: 10px;
  min-height: 0;
  padding-bottom: 16px;
  overflow: visible;
}

.speaking-board-head-join {
  border-left: 0;
  z-index: 1;
  min-height: 148px;
}

.speaking-board-head h2,
.speaking-board-title span {
  margin: 0;
  color: #17191c;
  font-family:
    "Georgia", "Times New Roman", "Songti SC", serif;
  font-size: 28px;
  line-height: 1.12;
  font-weight: 700;
}

.speaking-board-title span {
  color: var(--text);
}

.speaking-board-title {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
  flex-wrap: wrap;
}

.speaking-unit-tabs {
  display: flex;
  gap: 8px;
  min-width: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  background: #fafafb;
}

.speaking-unit-tabs button {
  display: grid;
  gap: 3px;
  min-width: 150px;
  max-width: 220px;
  min-height: 54px;
  padding: 9px 12px;
  border: 1px solid #dedee0;
  border-radius: 8px;
  background: #ffffff;
  color: #17191c;
  cursor: pointer;
  text-align: left;
}

.speaking-unit-tabs button:hover {
  background: #fafafb;
}

.speaking-unit-tabs button.active {
  border-color: #dedee0;
  background: #f2f2f3;
  color: var(--text);
}

.speaking-unit-tabs span {
  overflow: hidden;
  font-size: 13px;
  font-weight: 780;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.speaking-unit-tabs small {
  overflow: hidden;
  color: #777b86;
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.speaking-topic-tags {
  display: flex;
  align-items: center;
  align-content: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  min-height: 42px;
  padding: 0;
  border-bottom: 0;
  overflow: visible;
  background: transparent;
}

.speaking-shared-topic-tags {
  width: 100%;
  margin: 0;
  padding: 0;
  border-top: 0;
  overflow: visible;
}

.speaking-topic-tags button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #dedee0;
  border-radius: 8px;
  background: #ffffff;
  color: #17191c;
  cursor: pointer;
  white-space: nowrap;
}

.speaking-topic-tags button:hover {
  background: #fafafb;
}

.speaking-topic-tags button.active {
  border-color: #dedee0;
  background: #f2f2f3;
  color: var(--text);
}

.speaking-topic-tags span {
  font-size: 13px;
  font-weight: 780;
}

.speaking-topic-tags small {
  color: #777b86;
  font-size: 12px;
}

.speaking-topic-stack {
  min-height: 0;
  overflow: auto;
}

.speaking-p3-pane .speaking-topic-stack {
  padding: 18px 24px 28px;
  border-left: 1px solid var(--line);
}

.speaking-panel-grid .speaking-detail-board > .speaking-topic-stack {
  padding: 18px 24px 28px;
}

.speaking-panel-grid .speaking-p2p3-detail-board > .speaking-topic-stack {
  padding-top: 0;
}

.speaking-p2p3-detail-board > .speaking-topic-stack > .speaking-cue-card:first-child {
  padding-top: 0;
}

.speaking-p2-list-board {
  grid-template-rows: minmax(0, 1fr);
}

.speaking-p2-list-board .speaking-topic-stack {
  padding-bottom: 116px;
}

.speaking-p3-pane .speaking-cue-card,
.speaking-p3-pane .speaking-qa {
  border-top: 0;
}

.speaking-panel-grid .speaking-cue-card,
.speaking-panel-grid .speaking-qa {
  border-top: 0;
}

.speaking-board-single .speaking-topic-stack {
  align-content: start;
}

.speaking-topic-section {
  display: grid;
  gap: 12px;
  padding: 22px 24px 26px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  scroll-margin-top: 88px;
}

.speaking-board-single .speaking-topic-section:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.speaking-section-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.speaking-section-heading h3 {
  margin: 0;
  color: #17191c;
  font-size: 24px;
  line-height: 1.18;
  font-weight: 840;
}

.speaking-section-heading p {
  margin: 0;
  color: #777b86;
  font-size: 16px;
  line-height: 1.4;
  font-weight: 720;
}

.speaking-card-list {
  display: grid;
  gap: 8px;
}

.speaking-question-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 12px;
  border: 1px solid #dedee0;
  border-radius: 8px;
  background: #ffffff;
  color: #17191c;
  cursor: pointer;
  text-align: left;
}

.speaking-question-card:hover {
  background: #fafafb;
}

.speaking-question-card.active {
  border-color: #dedee0;
  background: #f2f2f3;
  box-shadow: inset 4px 0 0 var(--text);
}

.speaking-question-card > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #f2f2f3;
  color: var(--text);
  font-size: 12px;
  font-weight: 820;
}

.speaking-question-card strong {
  display: grid;
  gap: 4px;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 760;
}

.question-en,
.question-zh {
  display: block;
  min-width: 0;
}

.question-zh {
  color: #777b86;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
}

.speaking-detail-board {
  grid-template-rows: auto minmax(0, 1fr);
}

.speaking-p2p3-detail-board {
  grid-template-rows: auto minmax(0, 1fr);
}

.speaking-detail-body {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 0;
  padding: 20px 24px 28px;
  border-left: 1px solid var(--line);
  overflow: auto;
}

.speaking-detail-tabs {
  display: grid;
  grid-template-columns: repeat(2, 72px);
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin-top: 0;
  min-height: 63px;
  padding: 0 16px;
  border-left: 0;
  border-bottom: 0;
  background: #ffffff;
}

.speaking-detail-tabs button {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 38px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #777b86;
  cursor: pointer;
  font-size: 13px;
  font-weight: 780;
}

.speaking-detail-tabs button::after {
  position: absolute;
  bottom: -1px;
  left: 50%;
  width: 4em;
  height: 2px;
  background: transparent;
  content: "";
  transform: translateX(-50%);
}

.speaking-detail-tabs button:hover {
  color: var(--text);
}

.speaking-detail-tabs button.active {
  background: transparent;
  color: var(--text);
}

.speaking-detail-tabs button.active::after {
  background: var(--text);
}

.speaking-answer-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid #dedee0;
  border-radius: 8px;
  background: #ffffff;
}

.speaking-answer-card strong {
  color: #17191c;
  font-size: 13px;
  font-weight: 820;
}

.speaking-answer-card p {
  margin: 0;
  color: #17191c;
  font-size: 15px;
  line-height: 1.75;
}

.speaking-answer-card.zh p {
  color: #777b86;
}

.speaking-detail-head {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.speaking-detail-head .detail-title h2 {
  font-size: 32px;
}

.speaking-flow {
  display: grid;
  gap: 0;
  padding-bottom: 32px;
}

.speaking-stage {
  display: grid;
  gap: 12px;
  padding: 22px 24px 26px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.speaking-stage-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.speaking-stage-title span {
  color: var(--text);
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

.speaking-stage-title h3 {
  margin: 0;
  color: #17191c;
  font-size: 16px;
  font-weight: 820;
}

.speaking-qa,
.speaking-cue-card {
  display: grid;
  gap: 10px;
  padding: 14px 0 0;
  border-top: 1px solid #ececec;
}

.speaking-qa:first-of-type,
.speaking-cue-card:first-of-type {
  border-top: 0;
}

.speaking-qa h4,
.speaking-cue-card h4 {
  margin: 0;
  color: #17191c;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 780;
}

.speaking-qa p,
.speaking-answer p,
.speaking-template-slot p {
  margin: 0;
  color: #17191c;
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.speaking-translation,
.speaking-answer.zh p {
  color: #777b86;
}

.speaking-cue-card pre {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 14px;
  border: 1px solid #dedee0;
  border-radius: 8px;
  background: #fafafb;
  color: #17191c;
  font-family: inherit;
  font-size: 14px;
  font-weight: 780;
  line-height: 1.5;
  white-space: normal;
}

.speaking-cue-card pre .question-en {
  margin-bottom: 0;
  white-space: pre-wrap;
}

.speaking-cue-card pre .question-zh {
  line-height: 1.35;
  white-space: normal;
}

.speaking-answer {
  display: grid;
  gap: 0;
}

.speaking-answer-unit {
  display: grid;
  gap: 6px;
}

.speaking-answer-sentence {
  padding: 0 2px;
  border-radius: 5px;
  cursor: default;
  transition: box-shadow 120ms ease;
}

.speaking-answer-sentence.is-highlighted {
  box-shadow: inset 0 -5px var(--highlight);
}

.speaking-bilingual-answer {
  display: grid;
  gap: 18px;
}

.speaking-answer-pair {
  display: grid;
  gap: 6px;
}

.speaking-panel-grid .speaking-cue-card > pre,
.speaking-panel-grid .speaking-qa > pre {
  width: min(100%, 760px);
}

.speaking-panel-grid .speaking-cue-card > .speaking-answer,
.speaking-panel-grid .speaking-cue-card > .speaking-bilingual-answer,
.speaking-panel-grid .speaking-qa > .speaking-answer,
.speaking-panel-grid .speaking-qa > .speaking-answer-unit,
.speaking-panel-grid .speaking-reference-answer {
  width: min(calc(100% - 28px), 732px);
  margin-left: 14px;
}

.speaking-reference-list {
  display: grid;
  gap: 16px;
}

.speaking-reference-answer {
  display: grid;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid #ececec;
}

.speaking-reference-answer:first-child {
  padding-top: 0;
  border-top: 0;
}

.speaking-reference-answer h4 {
  margin: 0;
  color: #17191c;
  font-size: 14px;
  font-weight: 820;
  line-height: 1.4;
}

.speaking-answer strong,
.speaking-template-slot strong {
  color: #17191c;
  font-size: 13px;
  font-weight: 820;
}

.speaking-template-slot {
  position: absolute;
  right: 18px;
  bottom: 16px;
  left: 18px;
  z-index: 5;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 14px;
  align-items: center;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid #dedee0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(12px);
}

.speaking-template-slot::before {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--text);
  content: "P2";
  font-size: 12px;
  font-weight: 820;
  grid-row: 1 / span 2;
}

.speaking-skeleton-board {
  color: transparent;
}

.speaking-skeleton-head {
  gap: 14px;
}

.speaking-skeleton-part {
  width: 104px;
  height: 28px;
  border-radius: 8px;
}

.speaking-skeleton-part-p1 {
  width: 82px;
  height: 28px;
  border-radius: 8px;
}

.speaking-skeleton-title {
  width: 168px;
  height: 30px;
  border-radius: 8px;
}

.speaking-skeleton-tags {
  gap: 10px;
}

.speaking-skeleton-tag,
.speaking-skeleton-tag-wide {
  height: 36px;
  border-radius: 8px;
}

.speaking-skeleton-tag {
  width: 126px;
}

.speaking-skeleton-tag-wide {
  width: 176px;
}

.speaking-skeleton-list,
.speaking-skeleton-detail {
  background: #ffffff;
}

.speaking-skeleton-section {
  gap: 14px;
}

.speaking-skeleton-section-title,
.speaking-skeleton-section-title-short {
  height: 24px;
  border-radius: 8px;
}

.speaking-skeleton-section-title {
  width: 168px;
}

.speaking-skeleton-section-title-short {
  width: 128px;
}

.speaking-skeleton-section-subtitle {
  width: 118px;
  height: 15px;
}

.speaking-skeleton-card {
  cursor: default;
}

.speaking-skeleton-card:hover {
  background: #ffffff;
}

.speaking-skeleton-card-index {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.speaking-skeleton-card-text,
.speaking-skeleton-card-text-wide,
.speaking-skeleton-card-zh {
  height: 13px;
}

.speaking-skeleton-card-text {
  width: min(340px, 72%);
}

.speaking-skeleton-card-text-wide {
  width: min(430px, 86%);
}

.speaking-skeleton-card-zh {
  width: min(190px, 46%);
}

.speaking-skeleton-tabs {
  pointer-events: none;
}

.speaking-skeleton-tab {
  width: 48px;
  height: 18px;
  margin: 0 auto 10px;
}

.speaking-skeleton-answer {
  gap: 14px;
  cursor: default;
}

.speaking-skeleton-answer-title,
.speaking-skeleton-answer-title-short {
  height: 16px;
  border-radius: 8px;
}

.speaking-skeleton-answer-title {
  width: min(520px, 80%);
}

.speaking-skeleton-answer-title-short {
  width: min(360px, 56%);
}

.speaking-skeleton-answer-line,
.speaking-skeleton-answer-line-wide,
.speaking-skeleton-answer-line-short {
  height: 13px;
}

.speaking-skeleton-answer-line {
  width: min(560px, 86%);
}

.speaking-skeleton-answer-line-wide {
  width: min(650px, 96%);
}

.speaking-skeleton-answer-line-short {
  width: min(420px, 62%);
}

.speaking-skeleton-filter-count {
  width: 28px;
  height: 10px;
  margin-left: auto;
}
