/* AI 实验室选功能页（1024×720 深色底） */
#pptAiLabOverlay {
  position: fixed;
  inset: 0;
  z-index: 60002;
  display: none;
  align-items: stretch;
  justify-content: center;
  background: #050a18;
  overflow: hidden;
}

#pptAiLabOverlay.ppt-ai-lab-open {
  display: flex;
}

#pptAiLabOverlay .ppt-ai-lab-shell {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#pptAiLabOverlay .ai-lab-scale-outer {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#pptAiLabOverlay .ai-lab-scale-stage {
  width: 1024px;
  height: 720px;
  flex-shrink: 0;
  transform-origin: center center;
  position: relative;
  /* transform 由 js/ai-lab-scale.js 按容器尺寸计算 */
}

#pptAiLabOverlay .ai-lab-app {
  width: 1024px;
  height: 720px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  background-color: #050a18;
  background-image: url("../img/face/jiqiai-beijing.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  color: #ffffff;
  overflow: hidden;
}

#view-ai-lab-home.view-ai-lab-home {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 32px 32px;
  box-sizing: border-box;
}

#view-ai-lab-home .ai-lab-home-title {
  margin: 0 0 40px;
  font-size: 36px;
  font-weight: 600;
  color: #ffffff;
  text-align: center;
}

#view-ai-lab-home .home-grid {
  display: grid;
  grid-template-columns: repeat(3, 208px);
  column-gap: 40px;
  row-gap: 36px;
  justify-content: center;
}

#view-ai-lab-home .home-tile {
  position: relative;
  width: 208px;
  height: 226px;
  margin: 0;
  padding: 0;
  border: none;
  cursor: pointer;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 208px 226px;
  -webkit-tap-highlight-color: transparent;
}

#view-ai-lab-home .home-tile:disabled,
#view-ai-lab-home .home-tile.is-soon {
  cursor: not-allowed;
  filter: grayscale(0.85) brightness(0.72);
  opacity: 0.75;
}

#view-ai-lab-home .home-tile--speech {
  background-image: url("../img/tab/jiqiai-yuyin.png");
}

#view-ai-lab-home .home-tile--face {
  background-image: url("../img/tab/jiqiai-renlianbidui.png");
}

#view-ai-lab-home .home-tile--smart-voice {
  background-image: url("../img/tab/jiqiai-zhinengyuyin.png");
}

#view-ai-lab-home .home-tile--image {
  background-image: url("../img/tab/jiqiai-tupianshibie.png");
}

#view-ai-lab-home .home-tile--expression {
  background: linear-gradient(145deg, #2a6fd4 0%, #5b4fcf 55%, #7b3fa8 100%);
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  background-size: cover;
}

#view-ai-lab-home .home-tile--tts {
  background: linear-gradient(145deg, #1a6fd4 0%, #3d8fcf 55%, #5b9fd8 100%);
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  background-size: cover;
}

#view-ai-lab-home .home-tile--single-train {
  background: linear-gradient(145deg, #2d8a6e 0%, #3aa889 55%, #4ec4a0 100%);
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  background-size: cover;
}

#view-ai-lab-home .home-tile--classify-train {
  background: linear-gradient(145deg, #6b4c9a 0%, #8a6bb8 55%, #a88fd0 100%);
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  background-size: cover;
}

#view-ai-lab-home .home-tile--doodle {
  background-image: url("../img/tab/jiqiai-huihuashibie.png");
}

#view-ai-lab-home .home-tile-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 17px;
  margin: 0;
  font-weight: 500;
  font-size: 30px;
  line-height: 1.2;
  color: #ffffff;
  text-align: center;
  pointer-events: none;
}

#view-ai-lab-home .home-tile-soon {
  position: absolute;
  right: 12px;
  top: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.45);
  font-size: 14px;
  color: #9cc5ff;
  pointer-events: none;
}

/* 选功能 tile：WebView 内可点（原生按钮未接回调时的兜底；接了回调两边都能进） */

#pptAiLabOverlay #view-ai-lab-home[hidden] {
  display: none !important;
}

#pptAiLabOverlay #view-speech-rec[hidden] {
  display: none !important;
}

#pptAiLabOverlay #view-speech-rec:not([hidden]) {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#pptAiLabOverlay #sr-debug-toolbar {
  display: none !important;
  position: fixed;
  left: 8px;
  top: 8px;
  z-index: 100020;
  max-width: 90vw;
  background: rgba(0, 0, 0, 0.75);
  padding: 8px;
  border-radius: 6px;
  font-size: 12px;
}

#pptAiLabOverlay #sr-debug-toolbar.sr-debug-toolbar--visible {
  display: block !important;
}

#pptAiLabOverlay .sr-debug-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

#pptAiLabOverlay .sr-debug-buttons button {
  font-size: 12px;
  padding: 4px 8px;
}

#pptAiLabOverlay #ir-debug-toolbar {
  display: none !important;
  position: fixed;
  left: 8px;
  top: 8px;
  z-index: 100021;
  max-width: 90vw;
  max-height: 70vh;
  overflow: auto;
  background: rgba(0, 0, 0, 0.75);
  padding: 8px;
  border-radius: 6px;
  font-size: 12px;
  color: #fff;
}

#pptAiLabOverlay #ir-debug-toolbar.ir-debug-toolbar--visible {
  display: block !important;
}

#pptAiLabOverlay .ir-debug-scene {
  margin-bottom: 4px;
  opacity: 0.85;
}

#pptAiLabOverlay .ir-debug-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

#pptAiLabOverlay .ir-debug-buttons button {
  font-size: 12px;
  padding: 4px 8px;
}

#pptAiLabOverlay #expr-debug-toolbar {
  display: none !important;
  position: fixed;
  left: 8px;
  top: 8px;
  z-index: 100022;
  max-width: 90vw;
  max-height: 70vh;
  overflow: auto;
  background: rgba(0, 0, 0, 0.75);
  padding: 8px;
  border-radius: 6px;
  font-size: 12px;
  color: #fff;
}

#pptAiLabOverlay #expr-debug-toolbar.expr-debug-toolbar--visible {
  display: block !important;
}

#pptAiLabOverlay .expr-debug-scene {
  margin-bottom: 4px;
  opacity: 0.85;
}

#pptAiLabOverlay .expr-debug-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

#pptAiLabOverlay .expr-debug-buttons button {
  font-size: 12px;
  padding: 4px 8px;
}

/* 576 子页可见时强制设计高度，防止 ai-lab-scale 仍按 720 缩放导致内容贴上、底部留白 */
#pptAiLabOverlay:has(#view-image-rec:not([hidden])) .ai-lab-scale-stage,
#pptAiLabOverlay:has(#view-image-rec:not([hidden])) .ai-lab-app,
#pptAiLabOverlay:has(#view-expression-rec:not([hidden])) .ai-lab-scale-stage,
#pptAiLabOverlay:has(#view-expression-rec:not([hidden])) .ai-lab-app,
#pptAiLabOverlay:has(#view-tts:not([hidden])) .ai-lab-scale-stage,
#pptAiLabOverlay:has(#view-tts:not([hidden])) .ai-lab-app,
#pptAiLabOverlay:has(#view-speech-rec:not([hidden])) .ai-lab-scale-stage,
#pptAiLabOverlay:has(#view-speech-rec:not([hidden])) .ai-lab-app,
#pptAiLabOverlay:has(#view-smart-voice:not([hidden])) .ai-lab-scale-stage,
#pptAiLabOverlay:has(#view-smart-voice:not([hidden])) .ai-lab-app {
  width: 1024px;
  height: 576px;
}
