/* 听写测评 UI — 与磨听力 dictation.html + practice-layout 一致 */

.dtm-loading,
.dtm-error {
  text-align: center;
  padding: 32px 16px;
  font-weight: 700;
  color: var(--text-muted, #6b7280);
}

.dtm-error { color: #b91c1c; }

/* 嵌入综合/单项测试时的工作区 */
.dtm-practice-root.dictation-page .dtm-main-content {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.dictation-test-phase .dtm-practice-root,
.dtm-comp-wrap .dtm-practice-root {
  width: 100%;
}

/* 测评模式：与翻译/阅读单项测试一致的扁平风格 */
.dtm-practice-root.dtm-test-mode .dtm-test-root {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.dtm-practice-root.dtm-test-mode .dtm-test-progress {
  text-align: left;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 800;
  color: var(--text-main, #111827);
  margin: 0 0 12px;
  line-height: 1.3;
}

.dtm-practice-root.dtm-test-mode .dtm-test-workspace {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 12px;
  width: 100%;
}

.dtm-practice-root.dtm-test-mode .dtm-play-bar {
  flex: 0 0 clamp(48px, 9vw, 56px);
  align-self: stretch;
  margin: 0;
  padding: 10px 6px;
  border: 1px solid rgba(116, 123, 255, 0.35);
  border-radius: 12px;
  background: rgba(116, 123, 255, 0.06);
  color: rgb(116, 123, 255);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.dtm-practice-root.dtm-test-mode .dtm-play-bar:hover {
  background: rgba(116, 123, 255, 0.12);
  border-color: rgb(116, 123, 255);
  box-shadow: 0 0 0 2px rgba(116, 123, 255, 0.1);
}

.dtm-practice-root.dtm-test-mode .dtm-play-bar:active {
  transform: scale(0.98);
}

.dtm-practice-root.dtm-test-mode .dtm-play-bar.playing {
  opacity: 0.72;
  pointer-events: none;
}

.dtm-practice-root.dtm-test-mode .dtm-play-bar-icon {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 10px 0 10px 17px;
  border-color: transparent transparent transparent rgb(116, 123, 255);
  margin-left: 4px;
  flex-shrink: 0;
}

.dtm-practice-root.dtm-test-mode .dtm-play-bar-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  color: rgb(116, 123, 255);
}

.dtm-practice-root.dtm-test-mode .dtm-content-side {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.dtm-practice-root.dtm-test-mode .dictation-step-panel {
  margin: 0;
  padding: 0;
  max-width: 100%;
}

.dtm-practice-root.dtm-test-mode .dictation-step-label {
  margin: 0 0 8px;
  font-size: 0.75rem;
  line-height: 1.35;
  font-weight: 500;
  color: #9ca3af;
}

.dtm-practice-root.dtm-test-mode .dictation-step-question {
  margin: 0 0 12px;
  font-size: clamp(1.125rem, 2.8vw, 1.5rem);
  line-height: 1.55;
  font-weight: 500;
  color: rgb(102, 126, 255);
  word-break: break-word;
}

.dtm-practice-root.dtm-test-mode .dictation-mcq-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}

.dtm-practice-root.dtm-test-mode .dictation-mcq-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: #374151;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.dtm-practice-root.dtm-test-mode .dictation-mcq-option:hover {
  border-color: rgba(116, 123, 255, 0.45);
  background: rgba(116, 123, 255, 0.02);
}

.dtm-practice-root.dtm-test-mode .dictation-mcq-option:has(input:checked) {
  border-color: rgb(116, 123, 255);
  background: rgba(116, 123, 255, 0.05);
  box-shadow: 0 0 0 2px rgba(116, 123, 255, 0.12);
}

.dtm-practice-root.dtm-test-mode .dictation-mcq-option input {
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: rgb(116, 123, 255);
}

.dtm-practice-root.dtm-test-mode .dictation-cloze-box {
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  min-height: 88px;
  box-sizing: border-box;
}

.dtm-practice-root.dtm-test-mode .dictation-cloze-box:focus-within {
  border-color: rgb(116, 123, 255);
  box-shadow: 0 0 0 2px rgba(116, 123, 255, 0.12);
}

.dtm-practice-root.dtm-test-mode .dictation-cloze-host {
  font-size: 1rem;
  line-height: 1.65;
  color: #1f2937;
}

.dtm-practice-root.dtm-test-mode .dictation-blank-input {
  border: none;
  border-bottom: 2px solid rgb(116, 123, 255);
  background: transparent;
  min-width: 4em;
  padding: 2px 4px;
  font-size: inherit;
  font-family: inherit;
  color: #111827;
}

.dtm-practice-root.dtm-test-mode .dictation-blank-input:focus {
  outline: none;
  border-bottom-color: rgb(92, 100, 245);
}

.dtm-practice-root.dtm-test-mode .dtm-test-actions {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.dtm-practice-root.dtm-test-mode .dtm-btn {
  appearance: none;
  border: none;
  padding: 12px 28px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.dtm-practice-root.dtm-test-mode .dtm-btn-primary {
  background: rgb(116, 123, 255);
  color: #fff;
}

.dtm-practice-root.dtm-test-mode .dtm-btn-primary:hover:not(:disabled) {
  background: rgb(102, 109, 245);
}

.dtm-practice-root.dtm-test-mode .dtm-btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.dtm-practice-root.dtm-test-mode .hint-section {
  display: none !important;
}

@media (max-width: 520px) {
  .dtm-practice-root.dtm-test-mode .dtm-test-workspace {
    gap: 10px;
  }
  .dtm-practice-root.dtm-test-mode .dtm-play-bar {
    flex-basis: 46px;
    padding: 8px 4px;
  }
  .dtm-practice-root.dtm-test-mode .dtm-play-bar-icon {
    border-width: 8px 0 8px 14px;
  }
  .dtm-practice-root.dtm-test-mode .dtm-btn {
    padding: 10px 22px;
    font-size: 0.9375rem;
  }
}

#section-content.dtm-comp-wrap .dtm-test-root,
#section-content.dictation-test-phase .dtm-test-root {
  flex: 1 0 auto;
  min-height: min-content;
}

/* —— 磨听力 dictation-page 皮肤（与 dictation.html 内联样式对齐）—— */
.dtm-practice-root.dictation-page .header-title {
  color: rgb(102, 126, 255);
  font-size: clamp(1.875rem, 4.8vw, 2.475rem);
}

.dtm-practice-root.dictation-page .dictation-speed-select-wrap {
  position: relative;
  width: fit-content;
  max-width: 100%;
}

.dtm-practice-root.dictation-page .dictation-speed-select-wrap::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #6b7280;
  pointer-events: none;
}

.dtm-practice-root.dictation-page .dictation-speed-select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  padding: 0 30px 0 12px;
}

.dtm-practice-root.dictation-page .play-btn {
  background: rgb(102, 126, 255);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: transparent;
  font-size: 0;
  line-height: 0;
}

.dtm-practice-root.dictation-page .play-btn:hover {
  background: rgb(92, 116, 245);
}

.dtm-practice-root.dictation-page .dictation-play-icon {
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 12px 0 12px 20px;
  border-color: transparent transparent transparent #fff;
  margin-left: 5px;
}

.dtm-practice-root.dictation-page .play-btn.playing .dictation-play-icon {
  opacity: 0.85;
}

.dtm-practice-root.dictation-page .action-bar {
  max-width: 100%;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.dtm-practice-root.dictation-page .action-bar .btn.btn-next,
.dtm-practice-root.dictation-page .action-bar .btn.btn-submit {
  background: rgb(102, 126, 255);
  color: #fff;
  border: none;
  display: block;
}

.dtm-practice-root.dictation-page .action-bar .btn.btn-next:hover,
.dtm-practice-root.dictation-page .action-bar .btn.btn-submit:hover {
  background: rgb(92, 116, 245);
  filter: none;
}

.dtm-practice-root.dictation-page .correct-answer-box {
  max-width: 100%;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: none;
}

.dtm-practice-root.dictation-page .dictation-question-card {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0 auto 20px;
  padding-bottom: 1.75rem;
  box-sizing: border-box;
}

.dtm-practice-root.dictation-page .dictation-question-card .cn-hint-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #fff;
  color: rgb(102, 126, 255);
  font-weight: 700;
  cursor: pointer;
}

.dtm-practice-root.dictation-page .dictation-step-panel {
  max-width: 100%;
  width: 100%;
  margin: 0 auto 16px;
  box-sizing: border-box;
}

.dtm-practice-root.dictation-page .dictation-step-question {
  font-size: 1.575rem;
  font-weight: 600;
  color: #667fff;
  line-height: 1.45;
  margin-bottom: 14px;
}

.dtm-practice-root.dictation-page .dictation-step-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 10px;
}

.dtm-practice-root.dictation-page .dictation-mcq-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dtm-practice-root.dictation-page .dictation-mcq-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  background: #fff;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1.4;
  color: #374151;
}

.dtm-practice-root.dictation-page .dictation-mcq-option input {
  margin-top: 3px;
  flex-shrink: 0;
}

.dtm-practice-root.dictation-page .dictation-cloze-host {
  font-size: clamp(1.25rem, 3.2vw, 1.65rem);
  line-height: 1.55;
  color: #111827;
  word-break: break-word;
}

.dtm-practice-root.dictation-page .dictation-cloze-text {
  white-space: pre-wrap;
}

.dtm-practice-root.dictation-page .dictation-blank-group {
  display: inline-flex;
  align-items: flex-end;
  gap: 0.55em;
  margin: 0 0.08em;
  vertical-align: baseline;
}

.dtm-practice-root.dictation-page .dictation-underline-slot {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  max-width: min(9.5ch, 26vw);
}

.dtm-practice-root.dictation-page .dictation-blank-input {
  display: block;
  min-width: 3.25ch;
  width: 100%;
  max-width: min(9.5ch, 26vw);
  margin: 0;
  padding: 3px 2px 5px;
  border: none;
  border-bottom: 2px solid #374151;
  border-radius: 0;
  background: transparent;
  font-size: inherit;
  font-family: inherit;
  font-weight: 600;
  color: #5c75f5;
  text-align: center;
  box-sizing: border-box;
}

.dtm-practice-root.dictation-page .dictation-blank-input:focus {
  outline: none;
  border-bottom-color: #5c75f5;
  box-shadow: 0 1px 0 0 #5c75f5;
}

.dtm-practice-root.dictation-page .dictation-score-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #374151;
  margin: 0 0 12px 0;
}

.dtm-practice-root.dictation-page .dictation-score-num {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  color: rgb(102, 126, 255);
}

.dtm-practice-root.dictation-page .dictation-score-num--perfect {
  color: #059669;
}

.dtm-practice-root.dictation-page .dictation-score-max {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #6b7280;
  margin-left: 0.2em;
}

.dtm-practice-root.dictation-page .dictation-score-correct-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 8px;
}

.dtm-practice-root.dictation-page .dictation-score-correct-en {
  font-size: 0.9375rem;
  font-weight: 500;
  color: #374151;
  line-height: 1.55;
  word-break: break-word;
}

/* 测评内分栏（等同 body.ep-result-split） */
.dtm-practice-root.ep-result-split .practice-split-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: flex-start;
  gap: 2%;
  min-height: min(520px, 70vh);
  width: 100%;
}

.dtm-practice-root.ep-result-split .practice-pane--left,
.dtm-practice-root.ep-result-split .practice-pane--right {
  flex: 0 0 49%;
  width: 49%;
  max-width: 49%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dtm-practice-root.ep-result-split .practice-pane--right {
  display: flex;
}

.dtm-practice-root.ep-result-split .practice-pane-inner {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: clamp(8px, 2vw, 16px);
  box-sizing: border-box;
}

.dtm-practice-root.ep-result-split .practice-pane--left .practice-pane-inner {
  display: flex;
  flex-direction: column;
}

.dtm-practice-root.ep-result-split .practice-pane--right .practice-pane-inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (max-width: 768px) {
  .dtm-practice-root.ep-result-split .practice-split-row {
    flex-direction: column;
    min-height: 0;
  }
  .dtm-practice-root.ep-result-split .practice-pane--left,
  .dtm-practice-root.ep-result-split .practice-pane--right {
    flex: none;
    width: 100%;
    max-width: 100%;
  }
}
