#tool-body {
  --primary: #2563eb;
  --primary-light: rgba(37, 99, 235, 0.1);
  --primary-border: #2563eb;
  --card-bg: #ffffff;
  --card-text: #222;
  --muted-text: #8a8f99;
  --border-color: #e3e6eb;
  --border-dash: #c9ced6;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --chip-bg: #f2f4f8;
  --success-bg: rgba(22, 163, 74, 0.1);
  --success-text: #16a34a;
  --danger-text: #dc2626;
  --code-bg: #f8fafc;
}
.theme-dark-mode #tool-body {
  --primary: #60a5fa;
  --primary-light: rgba(96, 165, 250, 0.12);
  --primary-border: #60a5fa;
  --card-bg: #2d2d2d;
  --card-text: #e8e8e8;
  --muted-text: #9aa0aa;
  --border-color: #3a3a3a;
  --border-dash: #4a4a4a;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
  --chip-bg: #383838;
  --success-bg: rgba(34, 197, 94, 0.14);
  --success-text: #4ade80;
  --danger-text: #f87171;
  --code-bg: #252525;
}

#tool-body .bc-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
#tool-body .bc-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--card-text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
#tool-body .bc-card-title i {
  color: var(--primary);
}

/* ===== 模式切換 Tab ===== */
#tool-body .bc-tabs {
  display: flex;
  background: var(--chip-bg);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 14px;
  gap: 4px;
}
#tool-body .bc-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--muted-text);
  font-size: 14px;
  padding: 8px 0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
#tool-body .bc-tab i {
  margin-right: 5px;
}
#tool-body .bc-tab.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px var(--primary-light);
}
#tool-body .bc-tab:not(.active):hover {
  color: var(--primary);
}

/* ===== 圖片模式：拖拽區 ===== */
#tool-body .bc-dropzone {
  border: 2px dashed var(--border-dash);
  border-radius: 10px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s, background 0.2s;
  text-align: center;
  padding: 20px;
  box-sizing: border-box;
}
#tool-body .bc-dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}
#tool-body .bc-dropzone.busy {
  pointer-events: none;
  opacity: 0.65;
}
#tool-body .bc-drop-icon {
  font-size: 52px;
  color: var(--primary);
  opacity: 0.85;
}
#tool-body .bc-drop-title {
  font-size: 15px;
  color: var(--card-text);
  margin: 4px 0 0;
}
#tool-body .bc-drop-sub {
  font-size: 13px;
  color: var(--muted-text);
  margin: 0;
}
#tool-body .bc-drop-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 10px;
}
#tool-body .bc-chip {
  font-size: 12px;
  color: var(--muted-text);
  background: var(--chip-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 3px 12px;
}
#tool-body .bc-dropzone .layui-icon {
  font-size: 14px;
  margin-right: 4px;
}

/* 預覽 */
#tool-body .bc-preview-wrap {
  text-align: center;
}
#tool-body .bc-preview-box {
  background: var(--code-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 12px;
  overflow: hidden;
}
#tool-body .bc-preview-box img {
  max-width: 100%;
  max-height: 280px;
  display: block;
  margin: 0 auto;
  object-fit: contain;
}
#tool-body .bc-preview-status {
  font-size: 13px;
  color: var(--muted-text);
  margin-bottom: 10px;
}
#tool-body .bc-preview-status i.fa-spin {
  margin-right: 6px;
}
#tool-body .bc-preview-status.success {
  color: var(--success-text);
}
#tool-body .bc-preview-status.fail {
  color: var(--danger-text);
}

/* ===== 攝像頭模式 ===== */
#tool-body .bc-camera-wrap {
  position: relative;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}
#tool-body .bc-camera-wrap video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
#tool-body .bc-scanline {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  box-shadow: 0 0 12px var(--primary);
  animation: bc-scan 2.2s ease-in-out infinite;
  display: none;
}
#tool-body .bc-scanline.on {
  display: block;
}
@keyframes bc-scan {
  0% { top: 6%; }
  50% { top: 92%; }
  100% { top: 6%; }
}
#tool-body .bc-camera-hint {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 12px;
  border-radius: 20px;
  padding: 4px 14px;
  white-space: nowrap;
  display: none;
  z-index: 2;
}
#tool-body .bc-camera-hint.on {
  display: block;
}
#tool-body .bc-camera-side {
  position: absolute;
  inset: 6%;
  border: 2px solid var(--primary);
  border-radius: 8px;
  opacity: 0.65;
  display: none;
  pointer-events: none;
  z-index: 1;
}
#tool-body .bc-camera-side.on {
  display: block;
}
#tool-body .bc-camera-tip {
  font-size: 13px;
  color: var(--muted-text);
  margin: 12px 0 0;
  text-align: center;
}
#tool-body .bc-camera-btns {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  justify-content: center;
}
#tool-body .bc-camera-btns .layui-btn {
  min-width: 130px;
}

/* ===== 結果區 ===== */
#tool-body .bc-empty {
  color: var(--muted-text);
  font-size: 13px;
  text-align: center;
  padding: 40px 10px;
  line-height: 1.9;
}
#tool-body .bc-empty i {
  display: block;
  font-size: 46px;
  color: var(--border-dash);
  margin-bottom: 12px;
}
#tool-body .bc-result-item {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: var(--card-bg);
}
#tool-body .bc-result-item:last-child {
  margin-bottom: 0;
}
#tool-body .bc-result-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 8px;
}
#tool-body .bc-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.25);
}
#tool-body .bc-result-value {
  font-size: 17px;
  font-family: Consolas, Monaco, "Courier New", monospace;
  word-break: break-all;
  color: var(--card-text);
  line-height: 1.5;
  user-select: all;
  margin-bottom: 10px;
}
#tool-body .bc-result-copy {
  font-size: 12px;
  color: var(--muted-text);
  background: var(--chip-bg);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  padding: 3px 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
#tool-body .bc-result-copy:hover {
  color: var(--primary);
  border-color: var(--primary);
}