/* lesson4 纯前端体验区 */
.xlab {
  margin: 1.1em 0 1.4em;
  padding: 14px 16px 16px;
  background: #f3f7f4;
  border: 1px solid var(--line, #c9d9d1);
  border-radius: 16px;
}
.xlab-title {
  margin: 0 0 6px;
  font-size: 1.02rem;
  color: var(--teal-deep, #0b4f49);
}
.xlab-hint {
  margin: 0 0 12px;
  font-size: 0.88rem;
  color: var(--muted, #4f635c);
}
.xlab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 8px 0;
}
.xlab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.xlab-card {
  padding: 12px 10px;
  text-align: center;
  background: #fffdf8;
  border: 1px dashed #b9d5ca;
  border-radius: 12px;
  cursor: pointer;
  user-select: none;
  font-size: 0.92rem;
  transition: border-color 0.15s, background 0.15s;
}
.xlab-card:hover {
  border-color: var(--teal, #0f766e);
}
.xlab-card.is-natural {
  background: #eef8f3;
  border-color: #3d8b6e;
}
.xlab-card.is-made {
  background: #fff8eb;
  border-color: #c47b2d;
}
.xlab-card.is-auto {
  background: #e8f1ff;
  border-color: #4a7fd4;
}
.xlab-card.is-ai {
  background: #f3e8ff;
  border-color: #8b5cf6;
}
.xlab-card.is-picked {
  outline: 2px solid var(--teal, #0f766e);
}
.xlab-card.is-wrong {
  border-color: #c45c2d;
  background: #ffeee6;
}
.xlab-card.is-ok {
  border-color: #3d8b6e;
  background: #eef8f3;
}
.xlab button,
.xlab .xlab-btn {
  appearance: none;
  border: 1px solid #9fc2b4;
  background: #fff;
  color: var(--teal-deep, #0b4f49);
  border-radius: 10px;
  padding: 8px 14px;
  font: inherit;
  cursor: pointer;
}
.xlab button.primary,
.xlab .xlab-btn.primary {
  background: var(--teal, #0f766e);
  border-color: var(--teal, #0f766e);
  color: #fff;
}
.xlab button.xlab-mic.is-listening,
.xlab button.primary.is-listening {
  background: #c45c2d;
  border-color: #c45c2d;
  animation: xlab-mic-pulse 1s ease-in-out infinite;
}
@keyframes xlab-mic-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(196, 92, 45, 0.45);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(196, 92, 45, 0);
  }
}
.xlab button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.xlab-status {
  margin: 10px 0 0;
  font-size: 0.9rem;
  color: var(--muted, #4f635c);
  min-height: 1.4em;
}
.xlab-status.is-ok {
  color: var(--teal, #0f766e);
}
.xlab-status.is-bad {
  color: #8a5a12;
}
.xlab canvas {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  background: #fff;
  border: 1px solid #9fc2b4;
  border-radius: 12px;
  touch-action: none;
}
.xlab-bins {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.xlab-bin {
  min-height: 64px;
  padding: 10px;
  border-radius: 12px;
  border: 1px dashed #b9d5ca;
  background: #fff;
}
.xlab-bin h5 {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: var(--teal-deep, #0b4f49);
}
/* 与 lesson1 .dlg-line 同思路：左栏定宽、右栏撑满，左右齐 */
.xlab-field {
  display: grid;
  grid-template-columns: 7.5em minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
  margin: 0 0 14px;
  max-width: 520px;
}
.xlab-field label {
  display: block;
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
  color: var(--teal-deep, #0b4f49);
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  text-align: left;
}
.xlab textarea,
.xlab input[type="text"],
.xlab select {
  width: 100%;
  max-width: 520px;
  min-width: 0;
  height: 2.05em;
  min-height: 2.05em;
  padding: 4px 10px;
  line-height: 1.3;
  border-radius: 8px;
  border: 1px solid #9fc2b4;
  font: inherit;
  font-size: 0.92rem;
  box-sizing: border-box;
}
.xlab textarea {
  height: auto;
  min-height: 4.5em;
  padding: 8px 10px;
  line-height: 1.45;
}
.xlab-field input[type="text"],
.xlab-field select {
  max-width: none;
  width: 100%;
  min-width: 0;
  justify-self: stretch;
}
.xlab-chat {
  max-width: 520px;
  min-height: 140px;
  max-height: 240px;
  overflow: auto;
  padding: 10px 12px;
  background: #fff;
  border: 1px dashed #b9d5ca;
  border-radius: 12px;
  font-size: 0.9rem;
}
.xlab-chat .bubble {
  margin: 6px 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: #eef8f3;
}
.xlab-chat .bubble.me {
  background: #fff8eb;
}
.xlab-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 6px 0;
  font-size: 0.92rem;
}
.xlab-art {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1;
  border-radius: 12px;
  border: 1px solid #9fc2b4;
  background: #0b4f49;
}
.xlab-poster {
  max-width: 520px;
  padding: 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, #eef8f3, #fff8eb);
  border: 1px solid #b9d5ca;
}
.xlab-poster h4 {
  margin: 0 0 8px;
  color: var(--teal-deep, #0b4f49);
  font-family: inherit;
}
.xlab-meter {
  height: 10px;
  border-radius: 999px;
  background: #e7f5ef;
  overflow: hidden;
  max-width: 420px;
}
.xlab-meter > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #3d8b6e, #0f766e);
  transition: width 0.25s ease;
}

@media (max-width: 1024px), (pointer: coarse) {
  .xlab button,
  .xlab .xlab-btn {
    min-height: 44px;
    padding: 10px 16px;
    touch-action: manipulation;
  }
}
