/* 语音合成 — 设计稿 1024×576 */

.view-tts {
  --tts-design-w: 1024;
  --tts-design-h: 576;
  --tts-ui-scale: 1;
  --tts-wave-color: #7ec8fb;
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-sizing: border-box;
  background-color: #050a18;
  background-image: url("../img/face/jiqiai-beijing.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  color: #ffffff;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  pointer-events: auto;
  user-select: none;
}

.view-tts .tts-scale-outer {
  width: calc(var(--tts-design-w) * 1px * var(--tts-ui-scale));
  height: calc(var(--tts-design-h) * 1px * var(--tts-ui-scale));
  flex: 0 0 auto;
  position: relative;
}

.view-tts .tts-scale-stage {
  position: absolute;
  left: 0;
  top: 0;
  width: calc(var(--tts-design-w) * 1px);
  height: calc(var(--tts-design-h) * 1px);
  transform: scale(var(--tts-ui-scale));
  transform-origin: top left;
  box-sizing: border-box;
}

.view-tts .tts-shell {
  position: relative;
  width: calc(var(--tts-design-w) * 1px);
  height: calc(var(--tts-design-h) * 1px);
  box-sizing: border-box;
}

.view-tts .tts-panel--main {
  position: absolute;
  left: 26px;
  top: 28px;
  width: 972px;
  height: 520px;
  box-sizing: border-box;
  background: url("../img/tts/tts-main-bg.png") no-repeat center / 972px 520px;
  overflow: hidden;
}

.view-tts .tts-voice-bar {
  position: absolute;
  left: 50%;
  top: 33px;
  width: 260px;
  height: 48px;
  margin-left: -130px;
  box-sizing: border-box;
  background: url("../img/tts/tts-voice-bar-bg.png") no-repeat center / 260px 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  z-index: 2;
}

.view-tts .tts-voice-label {
  margin: 0;
  font-weight: 500;
  font-size: 18px;
  line-height: 1.2;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.view-tts .tts-voice-label::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: #4cff7a;
  vertical-align: middle;
}

.view-tts .tts-stage {
  position: absolute;
  left: 50%;
  top: 92px;
  width: 508px;
  height: 281px;
  margin-left: -254px;
  z-index: 1;
}

.view-tts .tts-robot-stage {
  position: relative;
  width: 508px;
  height: 281px;
  box-sizing: border-box;
}

.view-tts .tts-robot-img {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  width: 508px;
  height: 281px;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
  z-index: 1;
}

/* 左右音波：与语音转写一致，进入页面即显示 */
.view-tts .tts-waveform {
  position: absolute;
  top: 0;
  width: 169px;
  height: 281px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  pointer-events: none;
  z-index: 2;
}

.view-tts .tts-waveform--left {
  left: 0;
}

.view-tts .tts-waveform--right {
  right: 0;
}

.view-tts .tts-waveform-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 100%;
  height: 100%;
  max-height: 281px;
}

.view-tts .tts-wave-bar {
  flex: 0 0 4px;
  width: 4px;
  min-height: 6px;
  height: 10px;
  border-radius: 2px;
  background: var(--tts-wave-color);
  box-shadow: 0 0 8px rgba(126, 200, 251, 0.55);
  transition: height 0.07s ease-out, opacity 0.15s ease;
}

.view-tts .tts-robot-stage:not(.is-speaking) .tts-wave-bar {
  opacity: 0.55;
}

.view-tts .tts-robot-stage.is-speaking .tts-wave-bar {
  opacity: 1;
}

.view-tts .tts-transcript-wrap {
  position: absolute;
  left: 50%;
  bottom: 32px;
  width: 555px;
  height: 107px;
  margin-left: -277.5px;
  box-sizing: border-box;
  background: url("../img/tts/tts-transcript-bg.png") no-repeat center / 555px 107px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  z-index: 2;
}

.view-tts .tts-transcript-wrap[hidden] {
  display: none !important;
}

.view-tts .tts-transcript {
  margin: 0;
  width: 100%;
  max-height: 100%;
  overflow: hidden;
  font-weight: 400;
  font-size: 18px;
  line-height: 1.45;
  color: #ffffff;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  white-space: pre-wrap;
  word-break: break-word;
}

.view-tts .tts-transcript.is-placeholder {
  opacity: 0.72;
}

.view-tts .tts-action-btn {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.view-tts .tts-status,
.view-tts .tts-unsupported {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}
