/* 模块四：词汇辨识（任务1/2）— 布局与组件，风格对齐 pretest */

/* ===== 通用样式类 ===== */
.section-title {
  font-size: 0.9rem;
  margin: 12px 0 8px;
  font-weight: 600;
  color: var(--text);
}

.md-hint-text {
  font-size: 0.9rem;
  color: var(--sub-text);
  margin-bottom: 12px;
}

.back-action {
  justify-content: flex-end;
  margin-bottom: 10px;
}

/* ===== 页面布局 ===== */
.md-page {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 14px;
  align-items: start;
}

@media (max-width: 960px) {
  .md-page {
    grid-template-columns: 1fr;
  }
}

.md-panel {
  background: var(--panel);
  border-radius: var(--radius, 14px);
  padding: 12px;
  box-shadow: var(--shadow-sm);
}

.md-panel h3 {
  font-size: 0.95rem;
  margin: 0 0 8px;
}

/* 左侧信息栏整体折叠（与模块三侧栏行为一致） */
.md-sidebar {
  transition: width 0.22s ease, opacity 0.18s ease;
}

.md-sidebar.md-sidebar--collapsed {
  width: 100%;
  max-height: 48px;
  overflow: hidden;
  padding: 8px 10px;
}

.md-sidebar.md-sidebar--collapsed .md-sidebar-body {
  display: none;
}

.md-sidebar-fold {
  width: 100%;
  margin-bottom: 8px;
  font-size: 0.82rem;
}

.md-select-center {
  border: none;
  border-radius: 12px;
  background: var(--bg);
  padding: 12px;
  margin-bottom: 12px;
}

.md-category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  justify-content: center;
}

.md-category-tab {
  flex: 1;
  min-width: 88px;
  padding: 8px 10px;
  border-radius: 10px;
  border: none;
  background: var(--bg);
  cursor: pointer;
  font-size: 0.84rem;
  color: var(--text);
  transition: background 0.18s ease, color 0.18s ease;
}

.md-category-tab:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.md-category-tab.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.md-task-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  justify-content: center;
}

.md-task-tab {
  flex: 0 0 auto;
  min-width: 132px;
  max-width: 260px;
  padding: 8px 10px;
  border-radius: 10px;
  border: none;
  background: var(--bg);
  cursor: pointer;
  font-size: 0.86rem;
  color: var(--text);
  text-align: left;
  line-height: 1.25;
  transition: background 0.18s ease, color 0.18s ease;
}

.md-task-tab:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.md-task-tab.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.md-env-entry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(108px, 132px));
  gap: 14px;
  justify-content: center;
  margin: 12px auto 8px;
}

.md-env-entry-tile {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

.md-env-entry-lock-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 1.125em;
  flex-shrink: 0;
}

.md-env-entry-tile:hover:not(.is-locked) {
  background: var(--primary-soft);
  color: var(--primary);
}

.md-env-entry-tile.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
  border-color: var(--primary);
}

.md-env-entry-tile.is-locked {
  color: var(--primary);
  border-color: var(--primary-soft);
  cursor: not-allowed;
  opacity: 0.72;
}

.md-env-entry-label {
  line-height: 1;
  display: block;
  text-align: center;
}

.md-env-entry-lock {
  width: 1.125em;
  height: 1.125em;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.md-env-entry-lock svg {
  display: block;
  width: 100%;
  height: 100%;
}

.md-env-entry-hint {
  text-align: center;
  margin-top: 4px;
}

.md-scene-tabs {
  margin-bottom: 4px;
}

.md-task-tab.md-task-tab--locked {
  opacity: 0.55;
  cursor: not-allowed;
}

.md-task-tab .md-task-tab-lock {
  display: inline-flex;
  vertical-align: -0.15em;
  margin-right: 4px;
}

.md-task-tab .md-task-tab-lock svg {
  width: 14px;
  height: 14px;
}

.md-task-tab-detail {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  opacity: 0.82;
  margin-top: 2px;
}

.md-unlock-block {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.md-unlock-row {
  margin-bottom: 8px;
}

.md-unlock-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: #56657a;
  margin-bottom: 4px;
}

.md-unlock-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--ops-bg-muted);
  overflow: hidden;
}

.md-unlock-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--primary);
}

.md-unlock-toggle {
  width: 100%;
  margin-bottom: 10px;
  font-size: 0.76rem;
  padding: 7px 10px;
}

.md-unlock-current .md-unlock-bar {
  height: 10px;
}

.md-unlock-rings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 6px;
  justify-items: center;
  margin-top: 2px;
}

.md-unlock-ring-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}

.md-unlock-ring {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  position: relative;
  background: conic-gradient(var(--primary) 0% var(--ring-a, 0%), var(--ops-bg-muted) var(--ring-a, 0%) 100%);
  box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), 0.18);
}

.md-unlock-ring::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg, #f7fafd);
}

.md-unlock-ring-num {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  font-weight: 700;
  font-size: 1rem;
  color: #2a2a26;
  line-height: 1;
  pointer-events: none;
}

.md-status-list {
  max-height: 220px;
  overflow: auto;
  font-size: 0.8rem;
  border-radius: 10px;
  background: var(--ops-bg);
  padding: 6px;
}

.md-status-list:has(.md-status-summary) {
  max-height: none;
  overflow: visible;
}

.md-status-summary {
  font-size: 0.88rem;
  line-height: 1.55;
  color: #454540;
}

.md-status-summary p {
  margin: 0 0 8px;
}

.md-status-summary p:last-child {
  margin-bottom: 0;
}

.md-status-summary-sub {
  font-size: 0.82rem;
  color: #6a7585;
}

.md-status-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 6px;
  line-height: 1.4;
}

.md-status-row:nth-child(even) {
  background: rgba(255, 255, 255, 0.7);
}

/* 字词“训练内容状态”：练习进度徽章（与数字任务的稳定/不稳定并列一套语义） */
.badge.badge-md-try1 {
  background: #fff4e0;
  color: #8a5a12;
}
.badge.badge-md-try2 {
  background: #ffe8cc;
  color: #7a4200;
}

/* 已练习：与全局 badge-1 一致（绿色底） */

.md-status-word-legend {
  margin: 0 0 8px;
}

.md-status-word-legend-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.md-status-legend-line {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.5;
  color: #454540;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.md-status-legend-swatch {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border-radius: 4px;
  margin-top: 0.2em;
  box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), 0.2);
}

.md-status-legend-swatch--0 {
  background: #e3eaf2;
}

.md-status-legend-swatch--try1 {
  background: #fff4e0;
}

.md-status-legend-swatch--try2 {
  background: #ffe8cc;
}

.md-status-legend-swatch--done {
  background: #e9f9ed;
}

.md-status-legend-label {
  font-weight: 600;
}

.md-status-legend-label--0 {
  color: #6a7585;
}

.md-status-legend-label--try1 {
  color: #8a5a12;
}

.md-status-legend-label--try2 {
  color: #7a4200;
}

.md-status-legend-label--done {
  color: #2f7f41;
}

.md-archive-hint {
  margin: 0 0 8px;
  font-size: 0.72rem;
  color: #6a7585;
  line-height: 1.45;
}

.md-archive-scroll {
  max-height: 340px;
  overflow-y: auto;
  margin-bottom: 4px;
}

/* 与训前筛查 pretest“历史存档”一致的卡片与折叠详情 */
.pretest-archive-list {
  display: grid;
  gap: 8px;
  margin: 4px 0 0;
}

.pretest-archive-item {
  border: none;
  border-radius: 12px;
  background: var(--ops-bg);
  padding: 8px 10px;
}

.pretest-archive-item.selected {
  background: var(--primary-soft);
}

.pretest-archive-row {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.78rem;
  color: #4a5566;
  line-height: 1.45;
  cursor: pointer;
  padding: 2px 0;
  white-space: normal;
}

.pretest-archive-row:hover {
  color: #2a2a26;
}

.pretest-archive-detail {
  display: none;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.pretest-archive-item.selected .pretest-archive-detail {
  display: block;
}

.pretest-archive-detail-card {
  margin: 0;
  border: none;
}

.pretest-last-result-card {
  border-radius: 12px;
  background: var(--ops-bg);
  padding: 10px;
  margin: 0;
}

.pretest-last-result-empty {
  font-size: 0.82rem;
  color: #6d695f;
  line-height: 1.5;
}

.pretest-last-result-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.pretest-last-result-date {
  font-size: 0.78rem;
  color: #6a7585;
  line-height: 1.4;
}

.pretest-pass-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.76rem;
  line-height: 1.4;
  background: #e9f4ee;
  color: #2d6e40;
}
.pretest-pass-chip::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3a8f4d;
  flex-shrink: 0;
}

.pretest-last-result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.pretest-last-result-stat {
  border: none;
  border-radius: 10px;
  padding: 8px;
  text-align: center;
  background: var(--panel);
}

.pretest-last-result-toggle {
  cursor: pointer;
  font: inherit;
  color: inherit;
  -webkit-appearance: none;
  appearance: none;
}

.pretest-last-result-toggle:not(.unstable):hover {
  background: var(--primary-soft);
}

.pretest-last-result-toggle:not(.unstable).active {
  background: var(--primary-soft);
}

.pretest-last-result-toggle.unstable {
  background: var(--panel);
}

.pretest-last-result-toggle.unstable:hover {
  background: #faf0f0;
}

.pretest-last-result-toggle.unstable.active {
  background: #faf0f0;
}

.pretest-last-result-stat .label {
  display: block;
  font-size: 0.72rem;
  color: #6a7585;
  margin-bottom: 4px;
}

.pretest-last-result-stat .value {
  display: block;
  font-size: 0.95rem;
  color: #2a3548;
  font-weight: 600;
}

.pretest-last-result-details {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.pretest-last-result-detail {
  display: none;
  border-radius: 8px;
  background: var(--panel);
  padding: 7px 8px;
  font-size: 0.8rem;
  color: #38465a;
  line-height: 1.45;
}

.pretest-last-result-detail.show {
  display: block;
}

.md-tip-box {
  border: none;
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--ops-bg);
  margin-bottom: 12px;
}

.md-tip-box h4 {
  font-size: 0.92rem;
  margin: 0 0 6px;
}

.md-tip-box p {
  font-size: 0.84rem;
  line-height: 1.65;
  color: var(--sub-text);
  margin: 0;
}

.md-progress-wrap {
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 12px;
  background: var(--bg);
}

.md-progress-text {
  font-size: 0.84rem;
  color: var(--sub-text);
  margin-bottom: 6px;
}

.md-progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--ops-bg-muted);
  overflow: hidden;
}

.md-progress-fill {
  width: 0;
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
}

.md-phase-title {
  font-size: 1rem;
  margin: 0 0 10px;
}

.md-learn-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.md-test-options {
  display: grid;
  gap: 10px;
  min-height: 140px;
  margin: 12px 0;
}

.md-item-grid--1 {
  grid-template-columns: 1fr;
}

.md-item-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.md-item-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.md-item-grid--4,
#learnGrid.md-learn-grid.md-item-grid--4,
#testOptions.md-test-options.md-item-grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 720px) {
  #learnGrid.md-learn-grid.md-item-grid--4,
  #testOptions.md-test-options.md-item-grid--4,
  .md-env-summary-grid.md-item-grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #learnGrid.md-learn-grid.md-item-grid--2,
  #testOptions.md-test-options.md-item-grid--2,
  .md-env-summary-grid.md-item-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .md-learn-slot {
    min-height: 132px;
    padding: 10px 8px;
  }

  .md-reveal-img img,
  .md-test-opt-img img,
  .md-env-summary-img img {
    max-height: 108px;
  }

  .md-test-opt-img {
    font-size: 2rem;
  }

  .md-reveal-text,
  .md-test-opt-text,
  .opt-media-text {
    font-size: 0.98rem;
  }

  .md-test-options {
    min-height: 0;
    gap: 8px;
  }
}

.md-learn-slot {
  position: relative;
  border: none;
  border-radius: 12px;
  padding: 12px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.md-learn-heard-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 24px;
  height: 24px;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.md-learn-heard-badge svg,
.md-learn-heard-icon {
  display: block;
  width: 100%;
  height: 100%;
}

.md-slot-type {
  font-size: 0.78rem;
  color: var(--sub-text);
}

.md-playing-label {
  font-size: 0.88rem;
  color: var(--primary);
  font-weight: 600;
  text-align: center;
  min-height: 2.6em;
}

.md-reveal-box {
  text-align: center;
  width: 100%;
}

.md-reveal-img {
  font-size: 3rem;
  line-height: 1.2;
  margin-bottom: 6px;
}

.md-reveal-img img,
.md-test-opt-img img {
  display: block;
  max-width: 100%;
  height: auto;
  max-height: 140px;
  margin: 0 auto;
  object-fit: contain;
}

.md-reveal-text {
  font-size: 1.15rem;
  font-weight: 600;
}

.md-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 9px 14px;
  cursor: pointer;
  font-size: 0.9rem;
  background: var(--bg);
  transition: background 0.15s ease;
}
.btn:hover:not(:disabled) {
  background: var(--primary-soft);
}

.btn.primary {
  background: var(--primary);
  color: #fff;
}
.btn.primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.md-test-confirm-row {
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 8px;
}

.md-test-playing-banner {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 16px;
  border: none;
  border-radius: 0 12px 12px 0;
  border-left: 3px solid var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.5;
}

.md-test-opt {
  border: none;
  border-radius: 12px;
  padding: 10px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.md-test-opt-img {
  font-size: 2.4rem;
}

.opt-btn .md-test-opt-img {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  width: 100%;
}

.md-test-opt-text {
  font-size: 1.05rem;
  font-weight: 600;
}

.md-char-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.md-char-btns button {
  min-width: 36px;
  padding: 6px 10px;
  border-radius: 8px;
  border: none;
  background: var(--bg);
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.15s ease;
}

.md-char-btns button:hover:not(:disabled) {
  background: var(--primary-soft);
}

.md-char-btns button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.md-skip-row {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.md-skip-warn {
  margin: 0 0 4px;
  color: #c23b2a;
  font-size: 0.8rem;
}

.md-skip-link {
  background: none;
  border: 0;
  color: #6a7585;
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.84rem;
}

.md-modal-reveal-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 8px 0 4px;
}

.md-modal-reveal-box .md-reveal-img {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.md-modal-reveal-hint {
  margin: 10px 0 6px;
  text-align: center;
  font-size: 0.92rem;
  line-height: 1.55;
}

.md-reveal3 {
  border: none;
  border-radius: 12px;
  padding: 16px;
  background: #fffaf5;
  text-align: center;
}

.md-reveal3-head {
  font-size: 1rem;
  color: #8b4513;
  margin-bottom: 14px;
  font-weight: 600;
}

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

/* 模态（与 pretest 一致） */
.pretest-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.pretest-modal-overlay.is-open {
  display: flex;
}

.pretest-modal-dialog {
  width: min(440px, 100%);
  background: #fff;
  border-radius: 16px;
  padding: 22px 20px 18px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10), 0 1px 4px rgba(0,0,0,0.06);
  text-align: center;
}

.pretest-modal-dialog.pretest-modal-warn {
  box-shadow: 0 4px 24px rgba(180, 60, 60, 0.12), 0 1px 4px rgba(0,0,0,0.06);
}

.pretest-modal-dialog.pretest-modal-success {
  box-shadow: 0 4px 24px rgba(46, 130, 70, 0.10), 0 1px 4px rgba(0,0,0,0.06);
}

.pretest-modal-title {
  font-size: 1.1rem;
  margin: 0 0 12px;
  color: #2a2a26;
}

.pretest-modal-body {
  font-size: 1rem;
  line-height: 1.65;
  color: #454540;
  margin: 0 0 18px;
  text-align: left;
  white-space: pre-line;
}

.pretest-modal-footer {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pretest-modal-btn-hidden {
  display: none !important;
}

.pretest-modal-ok,
.pretest-modal-next {
  min-width: 120px;
}

.pretest-modal-footer-inline {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pretest-modal-footer-wrong {
  margin-top: 8px;
  text-align: center;
}

.pretest-modal-footer-wrong .pretest-skip-warn {
  text-align: left;
}

.md-reveal3-speak-wrap {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

/* —— 数字辨识（个/十/百位数 + 数字位置） —— */
.md-status-collapse-toggle {
  width: 100%;
  margin: 0 0 8px;
  padding: 6px 10px;
  border-radius: 8px;
  border: none;
  background: var(--ops-bg);
  font-size: 0.78rem;
  color: #4d4d48;
  cursor: pointer;
}

.md-status-legend {
  font-size: 0.74rem;
  color: var(--sub-text);
  line-height: 1.45;
  margin: 0 0 6px;
}

.md-status-list.is-collapsed {
  display: none;
}

.md-wrongbook-only {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.84rem;
  color: #454540;
  margin: 0 0 12px;
  line-height: 1.45;
}

.md-wrongbook-only input {
  margin-top: 3px;
}

#mdNumTaskShell {
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 12px;
  background: var(--ops-bg);
  box-shadow: none;
  margin-bottom: 12px;
}

.md-num-learn-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

@media (max-width: 720px) {
  .md-num-learn-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.md-num-learn-cell {
  border: none;
  border-radius: 12px;
  padding: 10px 8px;
  background: var(--ops-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 120px;
}

.md-num-learn-digit {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
}

.md-num-play-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.md-num-play-audio {
  min-width: 160px;
}

.md-num-play-hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--sub-text);
}

.md-num-target-hint {
  border: none;
  border-radius: 0 10px 10px 0;
  border-left: 3px solid var(--primary);
  padding: 10px 12px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.88rem;
  margin: 0 0 10px;
}

.md-num-seq-preview {
  min-height: 2.2em;
  font-size: 0.86rem;
  color: var(--sub-text);
  margin-bottom: 8px;
}

.md-num-digit-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 720px) {
  .md-num-digit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.md-num-cell {
  border: none;
  border-radius: 10px;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 600;
  background: var(--primary-soft);
  color: var(--primary);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.md-num-cell:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.md-num-cell.is-selected {
  background: var(--primary);
  color: #fff;
}

.md-num-cell.is-pos-pick {
  background: var(--primary);
  color: #fff;
}

.md-num-inline-feedback {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.md-num-feedback-box {
  border: none;
  border-radius: 12px;
  padding: 14px 16px;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--ops-bg);
  margin-bottom: 10px;
}

.md-num-skip-warn {
  font-size: 0.8rem;
  color: #c23b2a;
  text-align: center;
  margin: 0 0 10px;
}

.md-num-progress-hint {
  margin: 0 0 12px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--primary);
  text-align: center;
}

.md-num-answer-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
}

.md-num-answer-row label {
  font-size: 0.88rem;
  color: var(--sub-text);
}

.md-num-answer-input {
  width: min(240px, 100%);
  padding: 12px 14px;
  border: 2px solid var(--border-light);
  border-radius: 10px;
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.04em;
  background: #fff;
  color: var(--text);
}

.md-num-answer-input:focus {
  outline: none;
  border-color: var(--primary);
}

.md-num-pos-learn {
  margin-bottom: 12px;
}

.md-num-pos-learn-target {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
}

.md-num-pos-learn-label {
  font-size: 0.86rem;
  color: var(--sub-text);
}

.md-num-pos-select-tip {
  text-align: center;
  margin: 0 0 10px;
}

.md-num-pos-boxes {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0 12px;
}

@media (max-width: 720px) {
  .md-num-pos-boxes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.md-num-pos-box-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.md-num-pos-box {
  width: 100%;
  min-height: 72px;
  border: 2px solid #c5c0b6;
  border-radius: 12px;
  background: #f7f5f0;
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
  padding: 0;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.md-num-pos-box.is-preview {
  cursor: default;
  background: #f0eee8;
}

.md-num-pos-box.is-playing {
  border-color: #2f2a24;
  box-shadow: 0 0 0 2px rgba(47, 42, 36, 0.18);
}

.md-num-pos-box.is-selected {
  background: #d8d2c6;
  border-color: #6a6458;
  color: #1f1c18;
}

.md-num-pos-box.is-correct-pos {
  background: #d7f0e2;
  border-color: #3f9a6f;
  color: #1d5c40;
}

.md-num-pos-selected-label {
  min-height: 1.1em;
  font-size: 0.72rem;
  color: #6a665f;
}

.md-num-feedback-box.is-correct {
  background: #e8f7ef;
  color: #1d5c40;
}

.md-num-feedback-box.is-wrong {
  background: #fdeceb;
  color: #8a2f24;
}

.md-num-wrong-reveal {
  margin: 8px 0 12px;
}

.md-num-wrong-inner {
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--border-light);
}

.md-num-wrong-title {
  margin: 0 0 10px;
  text-align: center;
  font-weight: 700;
}

.md-num-wrong-fill-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.md-num-retry-note {
  font-size: 0.8rem;
  color: #8a6a2f;
  text-align: center;
  margin: 0 0 10px;
  line-height: 1.5;
}

.md-num-archive-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.md-num-archive-item {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 0.82rem;
}

.md-num-archive-item.is-ok {
  border-left: 3px solid #3f9a6f;
}

.md-num-archive-item.is-bad {
  border-left: 3px solid #c96060;
}

.md-num-archive-item-detail {
  display: none;
  font-size: 0.78rem;
  color: #5f5b53;
  padding: 4px 8px 8px;
}

.md-num-archive-item-detail.is-open {
  display: block;
}

.md-num-learn-plain {
  min-height: 100px;
}

/*数字任务结束反馈（对齐 pretest 训练反馈风格） */
.md-num-feedback-block {
  border: none;
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 8px;
  background: var(--ops-bg);
}

.md-num-feedback-head {
  font-size: 0.92rem;
  margin: 0 0 8px;
  color: #3a3a36;
}

.md-num-legend-line {
  font-size: 0.78rem;
  color: #5f5b53;
  margin-bottom: 10px;
  line-height: 1.6;
}

.md-legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin: 0 4px 0 10px;
  vertical-align: middle;
}

.md-dot-0 {
  background: #b8c4d4;
}

.md-dot-unstable {
  background: #e07070;
}

.md-dot-stable {
  background: #4caf6a;
}

.md-num-summary-list {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}

.md-num-summary-item {
  border: none;
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  background: var(--ops-bg);
}

.md-num-summary-label {
  font-weight: 600;
  color: #2a2a26;
}

.md-num-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 0.74rem;
  font-weight: 500;
  white-space: nowrap;
}
.md-num-badge::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.md-num-badge-na {
  background: #f0f3f7;
  color: #6a7585;
}
.md-num-badge-na::before { background: #9fafc0; }

.md-num-badge-bad {
  background: #faf0f0;
  color: #a06060;
}
.md-num-badge-bad::before { background: #c96060; }

.md-num-badge-stable {
  background: #eef6f4;
  color: #4a8878;
}
.md-num-badge-stable::before { background: #5a9e8a; }

.md-num-distance-summary {
  font-size: 0.86rem;
  color: #4a4a44;
  line-height: 1.55;
  margin: 0;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  white-space: pre-line;
}

.pretest-modal-custom-body {
  margin: 10px 0 4px;
  text-align: left;
}

.md-env-round-summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.md-env-round-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.md-env-round-stat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.9rem;
}

.md-env-round-stat .label {
  color: var(--sub-text);
}

.md-env-round-stat .value {
  font-weight: 700;
  color: var(--text);
}

.md-env-round-stat.is-stable .value {
  color: var(--primary);
}

.md-env-round-stat.is-unstable .value {
  color: #a06060;
}

.md-env-round-summary-lead {
  margin: 0;
  font-size: 0.88rem;
  color: var(--sub-text);
  text-align: center;
}

.md-env-summary-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--panel);
}

.md-env-summary-grid {
  display: grid;
  gap: 10px;
}

.md-env-summary-media {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  margin-bottom: 8px;
}

.md-env-summary-img {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
}

.md-env-summary-img img {
  display: block;
  max-width: 100%;
  max-height: 120px;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
}

.md-env-summary-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.md-env-summary-item-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 6px;
}

.md-env-summary-badge {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.md-env-summary-badge.is-stable {
  background: var(--primary-soft);
  color: var(--primary);
}

.md-env-summary-badge.is-unstable {
  background: #faf0f0;
  color: #a06060;
}

.md-env-summary-replay {
  display: flex;
  justify-content: center;
}
