/* ===========================================================
   二年级下册第三章《三　两位数乘、除以一位数》· 动手互动实验室专属样式
   全部作用域收拢在 .b1lab-wrap.b3lab-theme 内，零外链、严格触控热区
   =========================================================== */
.b1lab-wrap.b3lab-theme {
  --b3-amber: #D97706;
  --b3-amber-dark: #B45309;
  --b3-amber-light: #FEF3C7;
  --b3-forest: #15803D;
  --b3-forest-dark: #166534;
  --b3-forest-light: #DCFCE7;
  --b3-sky: #2563EB;
  --b3-sky-light: #DBEAFE;
  --b3-coral: #EA580C;
  --b3-coral-light: #FFEDD5;
  --b3-plum: #7C3AED;
  --b3-plum-light: #EDE9FE;
}

.b1lab-wrap.b3lab-theme button:focus-visible,
.b1lab-wrap.b3lab-theme [tabindex]:focus-visible {
  outline: 3px solid #2563EB;
  outline-offset: 2px;
}

/* 通用工具栏与状态徽章 */
.b1lab-wrap.b3lab-theme .b3-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}

.b1lab-wrap.b3lab-theme .b3-chip-btn {
  min-height: 46px;
  padding: 9px 16px;
  border-radius: 15px;
  background: #FFFFFF;
  border: 2.5px solid #F59E0B;
  box-shadow: 0 4px 0 #D97706;
  font-size: 15.5px;
  font-weight: 900;
  color: #78350F;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  touch-action: none;
  cursor: pointer;
}

.b1lab-wrap.b3lab-theme .draggable-chip {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.b1lab-wrap.b3lab-theme .b3-chip-btn.alt-sky {
  border-color: #3B82F6;
  box-shadow: 0 4px 0 #1D4ED8;
  color: #1E3A8A;
  background: #EFF6FF;
}

.b1lab-wrap.b3lab-theme .b3-chip-btn.alt-mint {
  border-color: #10B981;
  box-shadow: 0 4px 0 #047857;
  color: #065F46;
  background: #ECFDF5;
}

.b1lab-wrap.b3lab-theme .b3-chip-btn.alt-rose {
  border-color: #F43F5E;
  box-shadow: 0 4px 0 #BE123C;
  color: #881337;
  background: #FFF1F2;
}

.b1lab-wrap.b3lab-theme .b3-status-banner {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: #FFFBEB;
  border: 2px solid #FCD34D;
  color: #92400E;
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  line-height: 1.45;
}

.b1lab-wrap.b3lab-theme .b3-status-banner.ok {
  background: #ECFDF5;
  border-color: #6EE7B7;
  color: #065F46;
}

/* B1 & B4：托盘 / 竹篮容器 */
.b1lab-wrap.b3lab-theme .b3-trays-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.b1lab-wrap.b3lab-theme .b3-tray-box {
  background: #FFFFFF;
  border: 2.5px dashed #CBD5E1;
  border-radius: 18px;
  padding: 12px 10px;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: border-color 0.15s, background-color 0.15s, transform 0.15s;
}

.b1lab-wrap.b3lab-theme .b3-tray-box.drop-zone-hover,
.b1lab-wrap.b3lab-theme .b3-tray-box.active-tray {
  border-style: solid;
  border-color: #3B82F6;
  background: #EFF6FF;
  transform: translateY(-2px);
}

.b1lab-wrap.b3lab-theme .b3-tray-box.matched {
  border-style: solid;
  border-color: #10B981;
  background: #F0FDF4;
}

.b1lab-wrap.b3lab-theme .b3-tray-title {
  font-size: 14px;
  font-weight: 900;
  color: #475569;
}

.b1lab-wrap.b3lab-theme .b3-bundle-items {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  min-height: 46px;
}

/* 十捆小棒与单块积木视觉 */
.b1lab-wrap.b3lab-theme .b3-ten-pack {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 5px 9px;
  border-radius: 10px;
  background: linear-gradient(180deg, #FDE68A 0%, #F59E0B 100%);
  border: 2px solid #B45309;
  color: #78350F;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 3px 0 #B45309;
}

.b1lab-wrap.b3lab-theme .b3-one-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #DBEAFE;
  border: 2px solid #2563EB;
  color: #1E3A8A;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 2px 0 #1D4ED8;
}

/* B2 & B7：SVG 画布容器 */
.b1lab-wrap.b3lab-theme .b3-svg-stage {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  display: block;
  touch-action: none;
  user-select: none;
}

/* B3：收银台与人民币纸币 */
.b1lab-wrap.b3lab-theme .b3-shop-desk {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  align-items: stretch;
}

.b1lab-wrap.b3lab-theme .b3-goods-card,
.b1lab-wrap.b3lab-theme .b3-cash-pad {
  background: #FFFFFF;
  border: 2.5px solid #E2E8F0;
  border-radius: 18px;
  padding: 14px;
  text-align: center;
}

.b1lab-wrap.b3lab-theme .b3-cash-pad.drop-zone-hover {
  border-color: #10B981;
  background: #ECFDF5;
}

.b1lab-wrap.b3lab-theme .b3-bill-note {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  padding: 7px 14px;
  border-radius: 11px;
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  border: 2px solid #D97706;
  box-shadow: 0 3px 0 #B45309;
  font-size: 15px;
  font-weight: 900;
  color: #92400E;
}

.b1lab-wrap.b3lab-theme .b3-bill-note.bill-50 {
  background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
  border-color: #059669;
  box-shadow: 0 3px 0 #047857;
  color: #065F46;
}

/* B5：乘除密码账单表 */
.b1lab-wrap.b3lab-theme .b3-ledger-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.b1lab-wrap.b3lab-theme .b3-ledger-row {
  background: #FFFFFF;
  border-radius: 14px;
}

.b1lab-wrap.b3lab-theme .b3-ledger-row td {
  padding: 10px 8px;
  font-size: 15.5px;
  font-weight: 800;
  border-top: 2px solid #E2E8F0;
  border-bottom: 2px solid #E2E8F0;
  text-align: center;
}

.b1lab-wrap.b3lab-theme .b3-ledger-row td:first-child {
  border-left: 2px solid #E2E8F0;
  border-radius: 14px 0 0 14px;
}

.b1lab-wrap.b3lab-theme .b3-ledger-row td:last-child {
  border-right: 2px solid #E2E8F0;
  border-radius: 0 14px 14px 0;
}

.b1lab-wrap.b3lab-theme .b3-ledger-row.active-row td {
  border-color: #3B82F6;
  background: #EFF6FF;
}

.b1lab-wrap.b3lab-theme .b3-mystery-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  min-height: 44px;
  padding: 4px 10px;
  border-radius: 12px;
  border: 2.5px dashed #F59E0B;
  background: #FFFBEB;
  color: #B45309;
  font-weight: 900;
}

.b1lab-wrap.b3lab-theme .b3-mystery-slot.solved {
  border-style: solid;
  border-color: #10B981;
  background: #ECFDF5;
  color: #065F46;
}

/* B6：树苗比价双展台 */
.b1lab-wrap.b3lab-theme .b3-compare-booths {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.b1lab-wrap.b3lab-theme .b3-booth-card {
  background: #FFFFFF;
  border: 2.5px solid #CBD5E1;
  border-radius: 20px;
  padding: 14px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.b1lab-wrap.b3lab-theme .b3-booth-card.scanned {
  border-color: #10B981;
  background: #F0FDF4;
}

.b1lab-wrap.b3lab-theme .b3-booth-card.drop-zone-hover {
  border-color: #F59E0B;
  background: #FFFBEB;
}

/* W1：半价火车票份数条 */
.b1lab-wrap.b3lab-theme .b3-ticket-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: #FFFFFF;
  border: 2px solid #E2E8F0;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.b1lab-wrap.b3lab-theme .b3-ticket-seg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, #DDD6FE 0%, #C4B5FD 100%);
  border: 2px solid #7C3AED;
  color: #4C1D95;
  font-weight: 900;
  font-size: 14.5px;
  box-shadow: 0 3px 0 #6D28D9;
}

.b1lab-wrap.b3lab-theme .b3-ticket-seg.child-seg {
  background: linear-gradient(180deg, #BAE6FD 0%, #7DD3FC 100%);
  border-color: #0284C7;
  color: #0C4A6E;
  box-shadow: 0 3px 0 #0369A1;
}

/* W2：算式拨轮破译机 */
.b1lab-wrap.b3lab-theme .b3-cipher-machine {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 12px;
  border-radius: 20px;
  background: #1E293B;
  color: #F8FAFC;
  border: 3px solid #475569;
}

.b1lab-wrap.b3lab-theme .b3-dial-col {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: #0F172A;
  padding: 7px 8px;
  border-radius: 14px;
  border: 2px solid #8B5CF6;
}

.b1lab-wrap.b3lab-theme .b3-dial-btn {
  min-width: 44px;
  min-height: 44px;
  border-radius: 10px;
  background: #334155;
  color: #F8FAFC;
  font-size: 16px;
  font-weight: 900;
  border: 1.5px solid #64748B;
}

.b1lab-wrap.b3lab-theme .b3-dial-btn:hover:not(:disabled) {
  background: #475569;
}

.b1lab-wrap.b3lab-theme .b3-dial-val {
  font-size: 26px;
  font-weight: 900;
  color: #FDE047;
  min-width: 38px;
  text-align: center;
  line-height: 1.2;
}

.b1lab-wrap.b3lab-theme .b3-fixed-digit {
  font-size: 28px;
  font-weight: 900;
  color: #E2E8F0;
  padding: 0 4px;
}

/* W4：乘除幻方数阵盘 */
.b1lab-wrap.b3lab-theme .b3-cross-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(76px, 108px));
  justify-content: center;
  gap: 10px;
  margin: 8px auto;
}

.b1lab-wrap.b3lab-theme .b3-node-cell {
  min-height: 68px;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px;
  font-weight: 900;
  text-align: center;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.b1lab-wrap.b3lab-theme .b3-node-cell.fixed-node {
  background: #EDE9FE;
  border: 2.5px solid #7C3AED;
  color: #4C1D95;
  font-size: 18px;
}

.b1lab-wrap.b3lab-theme .b3-node-cell.slot-node {
  background: #FFFFFF;
  border: 2.5px dashed #94A3B8;
  color: #334155;
  font-size: 14.5px;
  cursor: pointer;
}

.b1lab-wrap.b3lab-theme .b3-node-cell.slot-node.selected-slot,
.b1lab-wrap.b3lab-theme .b3-node-cell.slot-node.drop-zone-hover {
  border-style: solid;
  border-color: #7C3AED;
  background: #F5F3FF;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
}

.b1lab-wrap.b3lab-theme .b3-node-cell.slot-node.line-ok {
  border-style: solid;
  border-color: #10B981;
  background: #ECFDF5;
  color: #065F46;
}

@media (max-width: 600px) {
  .b1lab-wrap.b3lab-theme .b3-trays-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .b1lab-wrap.b3lab-theme .b3-compare-booths {
    grid-template-columns: minmax(0, 1fr);
  }
  .b1lab-wrap.b3lab-theme .b3-ledger-row td {
    font-size: 13.5px;
    padding: 8px 4px;
  }
  .b1lab-wrap.b3lab-theme .b3-mystery-slot {
    min-width: 50px;
    padding: 3px 6px;
    font-size: 13px;
  }
  .b1lab-wrap.b3lab-theme .b3-bill-note {
    min-height: 44px;
    padding: 6px 10px;
    font-size: 14px;
  }
  .b1lab-wrap.b3lab-theme .b3-fixed-digit {
    font-size: 22px;
  }
  .b1lab-wrap.b3lab-theme .b3-dial-val {
    font-size: 22px;
  }
  .b1lab-wrap.b3lab-theme .b3-cross-grid {
    grid-template-columns: repeat(3, minmax(68px, 1fr));
    gap: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .b1lab-wrap.b3lab-theme *,
  .b1lab-wrap.b3lab-theme *::before,
  .b1lab-wrap.b3lab-theme *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
