/* 绘画识别 — 布局与图像识别 / 智能语音一致（1024×720 绝对定位） */

.view-doodle {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
  overflow: hidden;
  color: #ffffff;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  text-align: left;
}

.dh-row--head {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 102px;
  pointer-events: none;
}

.dh-title-img {
  position: absolute;
  left: 50%;
  top: 45px;
  height: 58px;
  width: auto;
  max-width: 280px;
  margin-left: 0;
  transform: translateX(-50%);
  display: block;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
}

/* 右上角：清空 */
.dh-clear-btn {
  position: absolute;
  top: 30px;
  right: 37px;
  z-index: 4;
  width: 164px;
  height: 71px;
  padding: 0;
  margin: 0;
  border: none;
  box-sizing: border-box;
  background: url("../img/doodleHuiHua/jiqiai-huihuashibie-qingkong.png") no-repeat center / 164px 71px;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto;
}

.dh-clear-btn:hover:not(:disabled) {
  filter: brightness(1.06);
}

.dh-clear-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.dh-clear-label {
  display: block;
  font-weight: bold;
  font-size: 30px;
  line-height: 71px;
  color: #ffffff;
  text-align: center;
  pointer-events: none;
  user-select: none;
}

.dh-row--tip {
  position: absolute;
  left: 39px;
  top: 116px;
  width: 948px;
  height: 67px;
  box-sizing: border-box;
  background: url("../img/smartVoiceImg/jiqiai-zhinengyuyin-tishi.png") no-repeat center / 948px 67px;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0 24px 0 22px;
}

.dh-tip-icon {
  flex-shrink: 0;
  width: 23px;
  height: 31px;
  margin-right: 10px;
  background: url("../img/speech/jiqiai-yuyin-dengpao.png") no-repeat center / 23px 31px;
}

.dh-tip-text {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-weight: 500;
  font-size: 26px;
  line-height: 1.35;
  color: #ffffff;
}

/* 第三行：画板 948×421，距第二行 14px */
.dh-row--board {
  position: absolute;
  left: 39px;
  top: 197px;
  width: 948px;
  height: 421px;
  box-sizing: border-box;
}

.dh-board-inner {
  position: relative;
  z-index: 2;
  width: 948px;
  height: 421px;
  box-sizing: border-box;
  background: url("../img/doodleHuiHua/jiqiai-huihuashibie-huaban.png") no-repeat center / 948px 421px;
  overflow: visible;
  cursor: crosshair;
  touch-action: none;
}

.view-doodle.is-tools-hidden .dh-toolbar-btn--tools,
.view-doodle.is-tools-hidden .dh-toolbar-menus {
  display: none !important;
}

.view-doodle.is-camera-open .dh-toolbar-menus {
  visibility: hidden;
  pointer-events: none;
}

.view-doodle.is-draw-locked .dh-board-inner {
  pointer-events: none;
  cursor: default;
}

.dh-canvas {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  display: block;
  width: 948px;
  height: 421px;
  /* 透明 canvas 在部分 Android WebView 不接收触摸，事件由 .dh-board-inner 处理 */
  background: transparent;
  pointer-events: none;
}

.dh-video {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  width: 948px;
  height: 421px;
  object-fit: contain;
  z-index: 2;
  background: transparent;
}

.dh-video[hidden] {
  display: none !important;
}

/* 第四行：底栏按钮 */
.dh-row--toolbar {
  position: absolute;
  left: 39px;
  top: 633px;
  width: 948px;
  height: 67px;
  box-sizing: border-box;
  z-index: 6;
}

.dh-bar-confidence {
  position: absolute;
  left: 0;
  top: 0;
  width: 384px;
  height: 67px;
  box-sizing: border-box;
  background: url("../img/doodleHuiHua/jiqiai-huihuashibie-zhixin.png") no-repeat center / 384px 67px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  font-weight: bold;
  font-size: 24px;
  line-height: 1.2;
  color: #ffffff;
  pointer-events: none;
  user-select: none;
}

.dh-bar-result,
.dh-bar-conf {
  white-space: nowrap;
}

.dh-bar-message {
  display: none;
  width: 100%;
  text-align: center;
  white-space: nowrap;
}

.dh-bar-confidence.is-message-only {
  justify-content: center;
}

.dh-bar-confidence.is-message-only .dh-bar-result,
.dh-bar-confidence.is-message-only .dh-bar-conf {
  display: none;
}

.dh-bar-confidence.is-message-only .dh-bar-message {
  display: block;
}

.dh-toolbar-btn {
  position: absolute;
  top: 0;
  height: 67px;
  padding: 0;
  margin: 0;
  border: none;
  box-sizing: border-box;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.dh-toolbar-btn:hover:not(:disabled) {
  filter: brightness(1.06);
}

.dh-toolbar-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.dh-toolbar-btn--tools {
  left: 435px;
  width: 160px;
  background: url("../img/doodleHuiHua/jiqiai-huihuashibie-gongju-kaiqi.png") no-repeat center / 160px 67px;
}

.dh-toolbar-btn--tools.is-open {
  filter: brightness(1.08);
}

.dh-toolbar-btn--predict {
  left: 612px;
  width: 159px;
  background: url("../img/doodleHuiHua/jiqiai-huihuashibie-shibie.png") no-repeat center / 159px 67px;
}

.dh-toolbar-btn--camera {
  left: 788px;
  width: 160px;
  background: url("../img/doodleHuiHua/jiqiai-huihuashibie-gongju-kaiqi.png") no-repeat center / 160px 67px;
}

.dh-toolbar-label {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
  pointer-events: none;
  user-select: none;
  color: #ffffff;
}

.dh-toolbar-label--bold {
  font-weight: bold;
  font-size: 24px;
  line-height: 1;
}

/* 工具菜单：锚在「工具」按钮上方（未展开不占位、不挡画板） */
.dh-toolbar-menus {
  display: none;
  position: absolute;
  left: 435px;
  bottom: 67px;
  width: 420px;
  height: 0;
  z-index: 8;
}

.dh-toolbar-menus.is-open {
  display: block;
  pointer-events: auto;
}

.dh-menu-erji {
  position: absolute;
  left: 0;
  bottom: 8px;
  width: 233px;
  height: 69px;
  box-sizing: border-box;
  background: url("../img/doodleHuiHua/jiqiai-huihuashibie-huaxiang-erji.png") no-repeat center / 233px 69px;
  pointer-events: auto;
}

.dh-menu-erji[hidden] {
  display: none !important;
}

.dh-erji-btn {
  position: absolute;
  top: 16px;
  width: 37px;
  height: 37px;
  padding: 0;
  margin: 0;
  border: none;
  box-sizing: border-box;
  cursor: pointer;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 37px 37px;
  -webkit-tap-highlight-color: transparent;
}

.dh-erji-btn--color {
  left: 22px;
  background-image: url("../img/doodleHuiHua/jiqiai-huihuashibie-se2.png");
}

.dh-erji-btn--color.is-active {
  background-image: url("../img/doodleHuiHua/jiqiai-huihuashibie-se1.png");
}

.dh-erji-btn--width {
  left: 98px;
  background-image: url("../img/doodleHuiHua/jiqiai-huihuashibie-cu2.png");
}

.dh-erji-btn--width.is-active {
  background-image: url("../img/doodleHuiHua/jiqiai-huihuashibie-cu1.png");
}

.dh-erji-btn--eraser {
  right: 22px;
  background-image: url("../img/doodleHuiHua/jiqiai-huihuashibie-ca2.png");
}

.dh-erji-btn--eraser.is-active {
  background-image: url("../img/doodleHuiHua/jiqiai-huihuashibie-ca1.png");
}

/* 三级：颜色 */
.dh-panel-color {
  position: absolute;
  left: 244px;
  bottom: 8px;
  width: 192px;
  height: 139px;
  box-sizing: border-box;
  background: url("../img/doodleHuiHua/jiqiai-huihuashibie-huaxiang-sanji.png") no-repeat center / 192px 139px;
  pointer-events: auto;
}

.dh-panel-color[hidden],
.dh-panel-sanji2[hidden] {
  display: none !important;
}

.dh-color-swatches {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
}

/* 3 行 × 4 列：首点 (17,11)，列距/行距 14px（30px 色块 + 14px 间距） */
.dh-color-item {
  position: absolute;
  width: 36px;
  height: 36px;
  padding: 0;
  margin: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  box-sizing: border-box;
  cursor: pointer;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}

.dh-color-item:nth-child(1) {
  left: 14px;
  top: 8px;
}
.dh-color-item:nth-child(2) {
  left: 58px;
  top: 8px;
}
.dh-color-item:nth-child(3) {
  left: 102px;
  top: 8px;
}
.dh-color-item:nth-child(4) {
  left: 146px;
  top: 8px;
}
.dh-color-item:nth-child(5) {
  left: 14px;
  top: 52px;
}
.dh-color-item:nth-child(6) {
  left: 58px;
  top: 52px;
}
.dh-color-item:nth-child(7) {
  left: 102px;
  top: 52px;
}
.dh-color-item:nth-child(8) {
  left: 146px;
  top: 52px;
}
.dh-color-item:nth-child(9) {
  left: 14px;
  top: 96px;
}
.dh-color-item:nth-child(10) {
  left: 58px;
  top: 96px;
}

.dh-color-item::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 30px;
  height: 30px;
  margin: 0;
  border-radius: 50%;
  background: var(--swatch, #fefdfe);
  box-sizing: border-box;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.dh-color-item.is-selected {
  border-color: #00fff2;
}

/* 三级：粗细 / 橡皮擦（底边与二级条、色板对齐） */
.dh-panel-sanji2 {
  position: absolute;
  left: 244px;
  bottom: 8px;
  width: 174px;
  height: 63px;
  box-sizing: border-box;
  background: url("../img/doodleHuiHua/jiqiai-huihuashibie-huaxiang-sanji2.png") no-repeat center / 174px 63px;
  pointer-events: auto;
}

/* 粗细/橡皮擦：三圆横排（勿用 flex+gap+inset，旧 Android 会挤在左侧） */
.dh-width-swatches,
.dh-eraser-swatches {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 0;
}

.dh-width-item,
.dh-eraser-item {
  position: absolute;
  padding: 0;
  margin: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  box-sizing: border-box;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.dh-width-item.is-selected,
.dh-eraser-item.is-selected {
  border-color: #00fff2;
}

.dh-width-dot,
.dh-eraser-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  border-radius: 50%;
  background: #ffffff;
  transform: translate(-50%, -50%);
  -webkit-transform: translate(-50%, -50%);
  pointer-events: none;
}

.dh-width-dot--thin,
.dh-eraser-dot--thin {
  width: 10px;
  height: 10px;
}

.dh-width-item:nth-child(1),
.dh-eraser-item:nth-child(1) {
  left: 32px;
  top: 24px;
  width: 16px;
  height: 16px;
}

.dh-width-dot--mid,
.dh-eraser-dot--mid {
  width: 16px;
  height: 16px;
}

.dh-width-item:nth-child(2),
.dh-eraser-item:nth-child(2) {
  left: 70px;
  top: 21px;
  width: 22px;
  height: 22px;
}

.dh-width-dot--thick,
.dh-eraser-dot--thick {
  width: 22px;
  height: 22px;
}

.dh-width-item:nth-child(3),
.dh-eraser-item:nth-child(3) {
  left: 114px;
  top: 18px;
  width: 28px;
  height: 28px;
}

#doodle-result {
  display: none !important;
}
