/* 语音识别 — 1024×720 绝对定位（四行总高 690px，底边留白 30px） */

.view-speech {
  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;
}

/*
 * 竖向核算（相对 .app 顶边）：
 * 标题底 42+58=100 → 提示条 +16 → 顶 116，高 67 → 底 183
 * 主区高 343 → 底 526 → 列表 +11 → 顶 537，高 153 → 底 690（余 30px）
 */

/* ---------- 第一行：标题图 top 42（202×58），返回由安卓原生 ---------- */
.speech-row--head {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100px;
  box-sizing: border-box;
  pointer-events: none;
}

.speech-title-img {
  position: absolute;
  left: 50%;
  top: 42px;
  width: 202px;
  height: 58px;
  margin-left: -101px;
  display: block;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
}

/* ---------- 第二行：top 116（标题底 100 + 间距 16），948×67 ---------- */
.speech-row--tip {
  position: absolute;
  left: 39px;
  top: 116px;
  width: 948px;
  height: 67px;
  margin: 0;
  box-sizing: border-box;
  background: url("../img/speech/jiqiai-yuyin-tishi.png") no-repeat center / 948px 67px;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0 24px 0 22px;
}

.speech-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;
}

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

/* ---------- 第三行：top 183，948×343（左 648 + 间距 14 + 右 286） ---------- */
.speech-row--main {
  position: absolute;
  left: 39px;
  top: 195px;
  width: 948px;
  height: 343px;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  /* border: 1px solid red; */
}

.speech-transcript-wrap {
  flex: 0 0 648px;
  width: 648px;
  height: 343px;
  box-sizing: border-box;
  background: url("../img/speech/jiqiai-yuyin-centerLeft.png") no-repeat center / 648px 343px;
  padding: 24px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(120, 200, 255, 0.75) rgba(12, 36, 78, 0.45);
}

.speech-transcript-wrap::-webkit-scrollbar {
  width: 6px;
}

.speech-transcript-wrap::-webkit-scrollbar-track {
  margin: 4px 0;
  background: rgba(8, 28, 64, 0.45);
  border-radius: 6px;
}

.speech-transcript-wrap::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    rgba(160, 220, 255, 0.92) 0%,
    rgba(90, 170, 255, 0.85) 100%
  );
  border-radius: 6px;
}

.speech-transcript {
  margin: 0;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.5;
  color: #ffffff;
  white-space: pre-wrap;
  word-break: break-word;
}

.speech-transcript.is-placeholder {
  color: transparent;
}

.speech-panel {
  position: relative;
  flex: 0 0 286px;
  width: 286px;
  height: 342px;
  box-sizing: border-box;
  background: url("../img/speech/jiqiai-yuyin-centerRight.png") no-repeat center / 286px 342px;
}

.speech-hold-btn {
  position: absolute;
  left: 83px;
  top: 52px;
  width: 120px;
  height: 120px;
  padding: 0;
  margin: 0;
  border: none;
  background: url("../img/smartVoiceImg/jiqiai-zhinengyuyin-changanlaba.png") no-repeat center / 120px 120px;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  touch-action: none;
}

.speech-hold-btn:hover:not(:disabled) {
  filter: brightness(1.06);
}

.speech-hold-btn.is-recording {
  filter: brightness(1.12);
}

.speech-hold-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.speech-hold-btn.is-hold-lottie {
  background-image: none;
}

.speech-save-btn {
  position: absolute;
  left: 26.5px;
  top: 210px;
  width: 233px;
  height: 90px;
  padding: 0;
  margin: 0;
  border: none;
  background: url("../img/speech/jiqiai-yuyin-jietu.png") no-repeat center / 233px 90px;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.speech-save-btn:hover:not(:disabled) {
  filter: brightness(1.06);
}

.speech-save-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.speech-save-label {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: bold;
  font-size: 26px;
  line-height: 1;
  color: #ffffff;
  pointer-events: none;
  user-select: none;
}

.speech-save-tip {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 20;
  margin: 0;
  padding: 14px 28px;
  box-sizing: border-box;
  max-width: 560px;
  font-size: 22px;
  line-height: 1.4;
  font-weight: 500;
  color: #ffffff;
  text-align: center;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.72);
  border-radius: 10px;
  pointer-events: none;
  transform: translate(-50%, -50%);
  -webkit-transform: translate(-50%, -50%);
}

.speech-save-tip[hidden] {
  display: none !important;
}

.speech-status {
  display: none !important;
}

/* ---------- 第四行：948×153；无数据为 form 底图，有数据为横向列表 ---------- */
.speech-row--gallery {
  position: absolute;
  left: 39px;
  top: 551px;
  width: 948px;
  height: 153px;
  margin: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.speech-gallery-empty {
  display: block;
  width: 948px;
  height: 153px;
  box-sizing: border-box;
  background: url("../img/speech/jiqiai-yuyin-form.png") no-repeat center / 948px 153px;
  pointer-events: none;
  -webkit-user-drag: none;
}

.speech-gallery-empty[hidden] {
  display: none !important;
}

.speech-gallery {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  width: 100%;
  height: 153px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  /* 勿用 flex gap：旧 Android WebView 卡片会贴在一起 */
}

.speech-gallery::-webkit-scrollbar {
  display: none;
  height: 0;
}

.speech-card {
  flex: 0 0 auto;
  width: 223px;
  height: 153px;
  box-sizing: border-box;
  background: url("../img/speech/jiqiai-yuyin-list.png") no-repeat center / 223px 153px;
  padding: 10px;
  margin: 0 18px 0 0;
  border: none;
  overflow: hidden;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  padding-left: 15px !important;
}

.speech-card:hover {
  filter: brightness(1.06);
}

.speech-card:last-child {
  margin-right: 0;
}

.speech-card-text {
  width: 100%;
  margin: 0;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.4;
  color: #ffffff;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  word-break: break-word;
  pointer-events: none;
}

/* 辅助块：不占主布局高度 */
.speech-unsupported,
.speech-debug-wrap {
  position: absolute;
  left: 39px;
  right: 37px;
  z-index: 5;
  display: none;
}

.speech-unsupported:not([hidden]) {
  display: block;
  top: 116px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 180, 80, 0.6);
  border-radius: 10px;
  background: rgba(40, 20, 8, 0.85);
  font-size: 14px;
}

.speech-unsupported[hidden],
.speech-debug-wrap[hidden] {
  display: none !important;
}

.speech-debug-wrap:not([hidden]) {
  display: block;
  top: 600px;
  max-height: 110px;
  overflow: auto;
  background: rgba(0, 0, 0, 0.75);
}

.speech-debug-log {
  margin: 0;
  padding: 10px 12px;
  font-size: 11px;
  white-space: pre-wrap;
  word-break: break-word;
}

.hold-mic-lottie {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: none;
}

.speech-hold-btn.is-hold-lottie .hold-mic-lottie,
.sv-hold-btn.is-hold-lottie .hold-mic-lottie {
  display: block;
}
