/* 表情识别 — 1024×720 绝对定位（切图间距同设计稿） */

/* 机器人 WebView：功能页勿用 flex 列布局，改 block + 绝对铺满（同 mate-ppt expression-rec-standalone） */
.app > .view.view-expression:not([hidden]) {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  flex: none;
  display: block;
  overflow: hidden;
}

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

/*
 * 竖向核算（相对 .app 顶边）：
 * 标题 top 43，高 59 → 底 102
 * 提示条 +14 → top 116，高 67 → 底 183
 * 主区 +14 → top 197，高 342 → 底 539
 * 结果区 +11 → top 550，高 153 → 底 703
 */

/* ---------- 第一行：标题 177×59，top 43，水平居中 ---------- */
.expr-row--head {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 102px;
  box-sizing: border-box;
  pointer-events: none;
}

.expr-title-img {
  position: absolute;
  left: 50%;
  top: 43px;
  width: 177px;
  height: 59px;
  margin-left: 0;
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  display: block;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
}

/* 948 宽内容区：left 50% + translateX，旧 WebView 比 left:39px 更稳 */
.expr-row--tip,
.expr-row--main,
.expr-row--bottom {
  position: absolute;
  left: 50%;
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
}

/* ---------- 第二行：948×67，top 116 ---------- */
.expr-row--tip {
  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;
}

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

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

/* ---------- 第三行：top 197，左 648 + 间距 14 + 右 286 ---------- */
.expr-row--main {
  top: 197px;
  width: 948px;
  height: 342px;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.expr-left-panel {
  position: relative;
  flex: 0 0 648px;
  width: 648px;
  height: 342px;
  box-sizing: border-box;
  background: url("../img/expression/jiqiH5-biaoqing-left.png") no-repeat center / 648px 342px;
  overflow: hidden;
}

.expr-preview-stage {
  position: absolute;
  left: 14px;
  top: 14px;
  right: 14px;
  bottom: 14px;
  overflow: hidden;
}

.expr-media-box {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 100%;
  max-height: 100%;
  box-sizing: border-box;
}

.expr-media-box[hidden] {
  display: none !important;
}

.expr-media-box .expr-video,
.expr-media-box .expr-preview {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  display: block;
  margin: 0;
  padding: 0;
  border: none;
  object-fit: contain;
  object-position: center center;
}

.expr-media-box .expr-video[hidden],
.expr-media-box .expr-preview[hidden] {
  display: none !important;
}

.expr-overlay {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.expr-overlay[hidden] {
  display: none !important;
}

/* 本地素材库：3×2 网格（同人脸比对样例，无顶部 title 图） */
.expr-materials {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 4;
  box-sizing: border-box;
  overflow: hidden;
  touch-action: pan-y;
}

.expr-materials[hidden] {
  display: none !important;
}

.expr-materials-grid {
  position: absolute;
  left: 50%;
  top: 50%;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  display: grid;
  grid-template-columns: repeat(3, 98px);
  column-gap: 27px;
  row-gap: 27px;
  box-sizing: border-box;
  padding: 8px;
}

.expr-material-btn {
  display: block;
  width: 98px;
  height: 134px;
  margin: 0;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  line-height: 0;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.expr-material-btn:hover:not(:disabled) {
  border-color: rgba(120, 200, 255, 0.85);
}

.expr-material-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.expr-material-btn img {
  display: block;
  width: 98px;
  height: 134px;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}

.expr-right-panel {
  position: relative;
  flex: 0 0 286px;
  width: 286px;
  height: 342px;
  box-sizing: border-box;
  background: url("../img/expression/jiqiH5-biaoqing-right.png") no-repeat center / 286px 342px;
}

/* 上传图片：233×90，距顶 69px */
.expr-action-btn {
  position: absolute;
  left: 26.5px;
  width: 233px;
  height: 90px;
  padding: 0;
  margin: 0;
  border: none;
  box-sizing: border-box;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
}

.expr-action-btn--upload {
  top: 69px;
  background-image: url("../img/expression/jiqiH5-biaoqing-chuanBtn.png");
  background-size: 233px 90px;
}

.expr-action-btn--camera {
  top: 183px;
  background-image: url("../img/expression/jiqiH5-biaoqing-paiBtn.png");
  background-size: 233px 90px;
}

.expr-action-btn:hover:not(.is-disabled) {
  filter: brightness(1.06);
}

.expr-action-btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.expr-action-label {
  position: absolute;
  left: 104px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 26px;
  font-weight: 400;
  line-height: 1;
  color: #ffffff;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

/* ---------- 第四行：948×153，top 550 ---------- */
.expr-row--bottom {
  top: 550px;
  width: 948px;
  height: 153px;
  box-sizing: border-box;
  background: url("../img/expression/jiqiH5-biaoqing-bom.png") no-repeat center / 948px 153px;
  overflow: hidden;
}

.expr-results-empty {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: block;
  pointer-events: none;
}

.expr-results-empty[hidden] {
  display: none !important;
}

.expr-results-empty-img {
  position: absolute;
  left: 50%;
  top: 50%;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  display: block;
  width: 149px;
  height: 125px;
  object-fit: contain;
  -webkit-user-drag: none;
}

.expr-results {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  box-sizing: border-box;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  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);
}

.expr-results.is-message {
  align-items: center;
  justify-content: center;
  padding: 0 20px;
}

.expr-results-message {
  margin: 0;
  width: 100%;
  text-align: center;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.4;
  color: #e6e6e6;
}

.expr-face-block {
  margin-bottom: 0;
  width: 100%;
  display: flex;
  justify-content: center;
}

.expr-results[hidden] {
  display: none !important;
}

.expr-results::-webkit-scrollbar {
  width: 6px;
}

.expr-results::-webkit-scrollbar-thumb {
  background: rgba(120, 180, 255, 0.45);
  border-radius: 3px;
}

.expr-face-block:last-child {
  margin-bottom: 0;
}

.expr-kv {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 12px 48px;
  margin: 0 auto;
  width: fit-content;
  max-width: 100%;
  justify-content: center;
}

.expr-kv-item {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 0;
  min-width: 0;
  font-size: 24px;
  line-height: 1.4;
  color: #e6e6e6;
  white-space: nowrap;
}

.expr-kv-label {
  flex-shrink: 0;
  font-weight: 400;
  color: #e6e6e6;
}

.expr-kv-value {
  flex: 1;
  min-width: 0;
  font-weight: 400;
  color: #e6e6e6;
}
