* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: #000; overflow: hidden; color: #fff; font-family: sans-serif; }
.stage { position: fixed; inset: 0; background: #000; }
.media {  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
         transition: opacity 0.15s ease; will-change: opacity; opacity: 0; }
#idle  { opacity: 1; }
#actor { opacity: 0; }
#status { position: fixed; top: 2px; right: 4px; font-size: 11px; z-index: 100; background: rgba(0,0,0,0.4); padding: 1px 4px; border-radius: 3px; opacity: 0.6; }
#inputbar { pointer-events: auto;  position: fixed; left: 0; right: 0; bottom: 0; height: 80px; display: flex; align-items: center; gap: 10px; padding: 0 16px; background: rgba(0,0,0,0.75); z-index: 100; }
#textInput { flex: 1; height: 52px; background: rgba(255,255,255,0.12); color: #fff; border: 2px solid rgba(255,255,255,0.25); border-radius: 26px; padding: 0 22px; font-size: 18px; outline: none; -webkit-tap-highlight-color: rgba(56,189,248,0.3); }
#textInput:focus { border-color: #38bdf8; background: rgba(255,255,255,0.18); box-shadow: 0 0 12px rgba(56,189,248,0.3); }
#sendBtn { height: 52px; padding: 0 28px; border-radius: 26px; background: #38bdf8; color: #000; border: none; font-size: 18px; font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: rgba(56,189,248,0.4); }
#sendBtn:active { background: #0284c7; }
/* 字幕：跟在【右侧中间的手机话筒二维码】正下方（35% + 二维码高约185px + 12px 间距），
   随语音逐字同步流出（由 renderSyncedSubtitle 按音频进度驱动）。
   上边固定、向下生长并限高（15vh），保证整块字幕底边留在 2/3 线以上 ——
   底部 1/3 是视频播放窗口，绝不覆盖；pointer-events:none 不挡触摸。 */
#subtitle { position: fixed; left: 16px; right: 16px; top: calc(35% + 200px); bottom: auto;
  max-height: 15vh; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  text-align: center; font-size: 30px; font-weight: 600; line-height: 1.42; color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.95); background: rgba(0,0,0,0.32);
  padding: 12px 18px; border-radius: 12px; z-index: 250; opacity: 0; pointer-events: none;
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  transition: opacity 0.25s ease; }

/* ===== 下半屏 MV 浮层：平时隐藏；放歌时覆盖下半屏，小禾本体保持全屏 ===== */
.mv-stage { position: fixed; left: 0; right: 0; bottom: 0; height: 50%; background: #000; z-index: 50; display: none; }
.mv-stage.active { display: block; }
#mvVideo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.mv-title { position: absolute; top: 10px; left: 12px; right: 232px; font-size: 28px; line-height: 1.35; color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.95); background: rgba(0,0,0,0.5); padding: 8px 16px; border-radius: 10px;
  opacity: 0; transition: opacity 0.25s ease; z-index: 51; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-title.active { opacity: 1; }
/* 放歌时的触摸「停止播放」按钮：放歌期间麦克风会被自己的歌声干扰，
   所以必须给触摸屏留一个可靠的实体停止入口。 */
.mv-stop { position: absolute; top: 10px; right: 12px; z-index: 60;
  min-width: 200px; min-height: 72px; padding: 0 24px;
  background: rgba(220,38,38,0.88); color: #fff; border: 2px solid rgba(255,255,255,0.55);
  border-radius: 16px; font-size: 28px; font-weight: 600; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.mv-stop:active { background: rgba(248,113,113,0.95); }

/* ===== 触摸控制（常驻，全屏也始终可见）：退出全屏 / 重启 / 关闭 ===== */
.ctrl-btn {
  position: fixed; top: 12px; right: 12px; z-index: 210;
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(0,0,0,0.5); color: #fff; border: 1px solid rgba(255,255,255,0.4);
  font-size: 30px; line-height: 1; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  display: flex; align-items: center; justify-content: center;
}
.ctrl-btn:active { background: rgba(56,189,248,0.5); }
.ctrl-menu {
  position: fixed; top: 84px; right: 12px; z-index: 211;
  display: flex; flex-direction: column; gap: 12px; align-items: stretch;
}
.ctrl-menu[hidden] { display: none; }
.ctrl-item {
  min-width: 160px; min-height: 60px; padding: 0 20px;
  background: rgba(18,18,18,0.94); color: #fff; border: 1px solid rgba(255,255,255,0.3);
  border-radius: 14px; font-size: 22px; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.ctrl-item:active { background: rgba(56,189,248,0.4); border-color: #38bdf8; }
.standby {
  position: fixed; inset: 0; z-index: 300; background: #000;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.standby[hidden] { display: none; }
.standby-tip { color: #888; font-size: 28px; text-align: center; line-height: 2; }
.standby-tip span { color: #555; font-size: 19px; }

/* ===== 虚拟键盘（双模式：英文 + 中文）===== */
.vkb { position: fixed; left: 0; right: 0; bottom: 80px; z-index: 90;
  background: rgba(14,14,18,0.97); padding: 8px 6px 14px; }
.vkb[hidden] { display: none; }
.vkb-tab { display: flex; gap: 6px; margin-bottom: 8px; justify-content: center; }
.vkb-mode { padding: 8px 24px; border-radius: 8px; background: rgba(255,255,255,0.08); color: #aaa; border: 1px solid rgba(255,255,255,0.15); font-size: 15px; cursor: pointer; }
.vkb-mode.active { background: #38bdf8; color: #000; border-color: #38bdf8; font-weight: 600; }
.vkb-panel { display: flex; flex-direction: column; gap: 5px; }
.vkb-row { display: flex; justify-content: center; gap: 4px; }
.vkb-row button { min-width: 12vw; height: 48px; border-radius: 8px;
  background: rgba(255,255,255,0.12); color: #fff; border: 1px solid rgba(255,255,255,0.2);
  font-size: 17px; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.vkb-row button:active { background: rgba(56,189,248,0.5); border-color: #38bdf8; }
.vkb-bksp { min-width: 14vw !important; }
.vkb-space { flex: 1; }
.vkb-enter { min-width: 16vw !important; background: rgba(56,189,248,0.35) !important; }

/* ===== 唤醒提示：未喊唤醒词时屏幕常驻提示，避免"小禾不理人"误解 ===== */
.wake-hint { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  z-index: 70; padding: 8px 18px; border-radius: 22px;
  background: rgba(0,0,0,0.45); color: #ffd479; font-size: 17px; font-weight: 600;
  letter-spacing: 1px; pointer-events: none; white-space: nowrap;
  border: 1px solid rgba(255,212,121,0.4); backdrop-filter: blur(4px); }
.wake-hint.active { color: #7CFFB2; border-color: rgba(124,255,178,0.5); background: rgba(0,40,20,0.5); }

/* ===== 讲解调图浮层：平时隐藏；讲解场景/零配件时下半屏展示示意图+说明，小禾人像保持上半屏 ===== */
.img-stage { position: fixed; left: 0; right: 0; bottom: 0; height: 52%; background: rgba(10,14,22,0.96);
  z-index: 55; display: none; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 32px 36px; box-sizing: border-box; }
.img-stage.active { display: flex; }
.img-view { max-width: 100%; max-height: 78%; object-fit: contain; border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.6); background: #fff; }
.img-caption { margin-top: 18px; max-width: 92%; text-align: center; color: #fff; font-size: 26px; line-height: 1.4;
  background: rgba(0,0,0,0.45); padding: 10px 20px; border-radius: 12px; }
.img-close { position: absolute; top: 10px; right: 12px; z-index: 60;
  min-width: 160px; min-height: 64px; padding: 0 22px;
  background: rgba(56,189,248,0.85); color: #fff; border: 2px solid rgba(255,255,255,0.5);
  border-radius: 16px; font-size: 26px; font-weight: 600; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.img-close:active { background: rgba(125,211,252,0.95); }

/* ===== 手机端适配：隐藏扫码框与屏占虚拟键盘，输入栏紧凑化，避免超屏 =====
   仅对窄屏（手机）生效；大屏（桌面/展示机/电视）保持原有完整功能。 */
@media (max-width: 768px) {
  /* 手机扫码对话框：藏起，不遮挡视频；大屏照常显示（功能保留） */
  #phoneQR { display: none !important; }
  /* 虚拟键盘：手机自带系统软键盘，隐藏 Windows 兜底的屏占 vkb，避免超屏；大屏保留 */
  #vkb, #kbdBtn { display: none !important; }
  /* 输入栏紧凑：缩小按钮/字号、收紧间距，横向不溢出 */
  #inputbar { height: 64px; gap: 6px; padding: 0 10px; background: rgba(0,0,0,0.82); }
  #micLabel { display: none !important; }
  #micBtn { width: 44px !important; height: 44px !important; font-size: 22px !important; }
  #textInput { height: 44px; font-size: 16px; padding: 0 16px; min-width: 0; border-radius: 22px; }
  #sendBtn { height: 44px !important; padding: 0 18px !important; font-size: 16px !important; border-radius: 22px; }
  /* 字幕位置上移，避开紧凑输入栏 */
  #subtitle { top: 18%; font-size: 22px; }
  .wake-hint { bottom: 72px; font-size: 15px; padding: 6px 14px; }
}
