/* ════════════════════════════════════════════════════════════
   修小匠 AI · 语音 / 键控 双模式 - 4 幕对话系统
   全屏 overlay，覆盖在原 sxt 应用之上
   ════════════════════════════════════════════════════════════ */

/* 主容器 —— 紫色渐变（沿用原 sxt 视觉系统，#0f0c29 → #302b63 → #24243e） */
#xj-overlay {
  position: fixed;
  inset: 0;
  z-index: 10100;
  display: none;
  background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
  font-family: 'Segoe UI', -apple-system, 'PingFang SC', 'Microsoft YaHei', Tahoma, sans-serif;
  color: #fff;
  overflow: hidden;
  animation: xjFadeIn 0.32s ease;
}
#xj-overlay.visible { display: flex; flex-direction: column; }
/* 顶层光斑增加层次 */
#xj-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 20% 0%, rgba(100,200,255,0.12), transparent 60%),
    radial-gradient(ellipse 50% 40% at 100% 30%, rgba(167,139,250,0.10), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
#xj-overlay > * { position: relative; z-index: 1; }

@keyframes xjFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* 顶部栏 */
#xj-topbar {
  flex: 0 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(100, 200, 255, 0.18);
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.xj-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 18px rgba(100, 200, 255, 0.5);
  position: relative;
  flex: 0 0 auto;
}
.xj-avatar.pulse {
  animation: xjAvatarPulse 2.4s ease-in-out infinite;
}
@keyframes xjAvatarPulse {
  0%, 100% { box-shadow: 0 0 18px rgba(100,200,255,0.5); }
  50%      { box-shadow: 0 0 28px rgba(100,200,255,0.9); }
}

.xj-title-block { flex: 1; min-width: 0; }
.xj-title {
  font-size: 17px;
  font-weight: 600;
  background: linear-gradient(135deg, #64c8ff 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.5px;
}
.xj-subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 2px;
}

/* 麦克风状态指示（演示态：永远显示"已开启 聆听中..."，不可点击切换） */
.xj-mic {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.35);
  border-radius: 20px;
  font-size: 12px;
  color: #4ade80;
  cursor: default;
  user-select: none;
  transition: all 0.2s;
  white-space: nowrap;
}
.xj-mic.off {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.3);
}
.xj-mic-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}
.xj-mic.listening .xj-mic-dot {
  animation: xjBlink 1s infinite;
}
@keyframes xjBlink {
  0%, 100% { opacity: 1;   transform: scale(1);   }
  50%      { opacity: 0.35; transform: scale(0.7); }
}

/* 关闭按钮 */
.xj-close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.xj-close:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

/* 内容区 */
#xj-stage {
  flex: 1; min-height: 0;
  padding: 22px 28px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* 对话气泡 */
.xj-bubble-row {
  display: flex; align-items: flex-start; gap: 12px;
  margin-bottom: 14px;
  flex: 0 0 auto;
}
.xj-bubble {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(99, 102, 241, 0.16));
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 14px;
  padding: 11px 16px;
  font-size: 14px;
  line-height: 1.55;
  color: #e3eefc;
  max-width: 80%;
  white-space: pre-wrap;
  box-shadow: 0 4px 18px rgba(56, 189, 248, 0.1);
}

/* 工作内容卡片 —— 半透明黑底，让紫色渐变在背后若隐若现 */
.xj-card {
  flex: 1; min-height: 0;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(100, 200, 255, 0.22);
  border-radius: 14px;
  padding: 16px;
  overflow: auto;
  position: relative;
}
.xj-card::-webkit-scrollbar { width: 6px; }
.xj-card::-webkit-scrollbar-track { background: transparent; }
.xj-card::-webkit-scrollbar-thumb { background: rgba(100, 200, 255, 0.3); border-radius: 3px; }

/* 待机/唤醒幕 —— 完整复刻原 sxt 视觉风格 */
.xj-idle {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px;
}

/* 头像容器 + 旋转环 + 光晕（来自原 sxt .ai-avatar-container / .ai-glow / .ai-avatar-ring） */
.xj-idle-avatar-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  margin-bottom: 8px;
}
.xj-idle-glow {
  position: absolute;
  inset: -22px;
  background: radial-gradient(circle, rgba(100,200,255,0.35) 0%, transparent 70%);
  border-radius: 50%;
  animation: xjGlowPulse 3s ease-in-out infinite;
  pointer-events: none;
}
.xj-idle-ring {
  position: absolute;
  inset: -10px;
  border: 2px solid rgba(100, 200, 255, 0.55);
  border-radius: 50%;
  border-top-color: rgba(100, 200, 255, 0.9);
  animation: xjRingRotate 10s linear infinite;
}
.xj-idle-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 40px rgba(100, 200, 255, 0.5);
  position: relative;
  z-index: 1;
  transition: all 0.3s;
}
.xj-idle-img.active {
  box-shadow: 0 0 70px rgba(100, 200, 255, 0.9);
  transform: scale(1.04);
}
@keyframes xjGlowPulse {
  0%, 100% { transform: scale(1);   opacity: 0.55; }
  50%      { transform: scale(1.1); opacity: 0.85; }
}
@keyframes xjRingRotate {
  to { transform: rotate(360deg); }
}

/* 修小匠 主标题（蓝紫渐变） */
.xj-idle-name {
  font-size: 38px;
  font-weight: 700;
  background: linear-gradient(135deg, #64c8ff 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 4px;
  margin-top: 4px;
}
.xj-idle-status {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 4px;
}

/* 唤醒提示（沿用原 sxt .key-hint 设计） */
.xj-idle-keyhint {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: rgba(100, 200, 255, 0.1);
  border-radius: 10px;
  border: 1px solid rgba(100, 200, 255, 0.3);
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
}
.xj-idle-keyhint .xj-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px; height: 36px;
  padding: 0 10px;
  border-radius: 6px;
  background: rgba(100, 200, 255, 0.2);
  border: 1px solid rgba(100, 200, 255, 0.5);
  color: #64c8ff;
  font-weight: 700;
  font-size: 16px;
  font-family: 'SF Mono', Menlo, monospace;
  flex: 0 0 auto;
}

/* 语音示例提示 */
.xj-idle-hint {
  margin-top: 10px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
  line-height: 2;
  max-width: 90%;
}
.xj-idle-hint kbd {
  display: inline-block;
  padding: 2px 9px;
  background: rgba(167, 139, 250, 0.2);
  border: 1px solid rgba(167, 139, 250, 0.5);
  border-radius: 5px;
  color: #cbb6ff;
  font-size: 12px;
  margin: 0 3px;
  font-family: 'SF Mono', Menlo, monospace;
}

/* "思考"过渡幕 —— 让 AI 调取数据/生成题目/汇总成绩看起来更真实 */
.xj-thinking {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 30px 20px;
}
.xj-thinking-text {
  margin-top: 6px;
  font-size: 17px;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(100, 200, 255, 0.08);
  border: 1px solid rgba(100, 200, 255, 0.28);
  padding: 12px 28px;
  border-radius: 999px;
  letter-spacing: 0.5px;
  animation: xjThinkPulseText 2.4s ease-in-out infinite;
}
@keyframes xjThinkPulseText {
  0%, 100% { box-shadow: 0 0 0 0   rgba(100, 200, 255, 0); }
  50%      { box-shadow: 0 0 0 10px rgba(100, 200, 255, 0.06); }
}
.xj-thinking-dots {
  display: flex;
  gap: 10px;
  height: 18px;
  align-items: center;
  margin-top: 4px;
}
.xj-thinking-dots span {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: linear-gradient(135deg, #64c8ff 0%, #a78bfa 100%);
  box-shadow: 0 0 10px rgba(100, 200, 255, 0.6);
  animation: xjDotBounce 1.2s infinite ease-in-out both;
}
.xj-thinking-dots span:nth-child(2) { animation-delay: 0.18s; }
.xj-thinking-dots span:nth-child(3) { animation-delay: 0.36s; }
@keyframes xjDotBounce {
  0%, 70%, 100% { transform: translateY(0);    opacity: 0.45; }
  35%           { transform: translateY(-9px); opacity: 1;    }
}

/* 学情数据幕 - 双栏布局 */
.xj-learn-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 14px;
  height: 100%;
  min-height: 0;
}
.xj-block {
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(100, 200, 255, 0.2);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.xj-block-title {
  font-size: 13px;
  font-weight: 600;
  color: #93d4ff;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}
.xj-block-title::before {
  content: '';
  width: 3px; height: 14px;
  background: linear-gradient(to bottom, #38bdf8, #6366f1);
  border-radius: 2px;
}

/* 学情表格 */
.xj-table-wrap {
  flex: 1; min-height: 0;
  overflow: auto;
  border-radius: 8px;
}
.xj-table-wrap::-webkit-scrollbar { width: 4px; height: 4px; }
.xj-table-wrap::-webkit-scrollbar-thumb { background: rgba(100, 200, 255, 0.3); border-radius: 2px; }
.xj-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}
.xj-table th, .xj-table td {
  padding: 5px 8px;
  text-align: center;
  border-bottom: 1px solid rgba(100, 200, 255, 0.08);
  white-space: nowrap;
}
.xj-table thead th {
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.22), rgba(56, 189, 248, 0.1));
  color: #d0e8ff;
  font-weight: 600;
  z-index: 2;
}
.xj-table thead th.xj-cell-warn {
  background: linear-gradient(180deg, rgba(248, 113, 113, 0.3), rgba(248, 113, 113, 0.15));
  color: #fecaca;
}
.xj-table tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.02); }
.xj-table tbody tr:hover { background: rgba(56, 189, 248, 0.08); }
.xj-table td.xj-name { color: #93d4ff; font-weight: 500; }
.xj-table td.xj-cell-warn {
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.08);
}
.xj-table td.xj-low { color: #fb923c; font-weight: 600; }

/* 摘要数据条 */
.xj-summary-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 10px;
  flex: 0 0 auto;
}
.xj-summary-cell {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(100, 200, 255, 0.2);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
}
.xj-summary-cell.warn { border-color: rgba(248, 113, 113, 0.5); }
.xj-summary-label {
  font-size: 11px;
  color: #8aa9c5;
}
.xj-summary-val {
  font-size: 18px;
  font-weight: 700;
  color: #93d4ff;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.xj-summary-cell.warn .xj-summary-val { color: #fca5a5; }
.xj-summary-sub {
  font-size: 10px;
  color: #475569;
  margin-top: 1px;
}

/* echarts 容器 */
.xj-chart {
  width: 100%;
  flex: 1;
  min-height: 220px;
}

.xj-chart-row {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
  height: 100%;
  min-height: 0;
}
.xj-chart-row > .xj-block { min-height: 0; }

/* 试题幕 */
.xj-quiz-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.xj-quiz-item {
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(100, 200, 255, 0.22);
  border-left: 4px solid #64c8ff;
  border-radius: 10px;
  padding: 14px 16px;
  animation: xjSlideIn 0.5s ease both;
}
.xj-quiz-item:nth-child(1) { animation-delay: 0.05s; }
.xj-quiz-item:nth-child(2) { animation-delay: 0.25s; }
.xj-quiz-item:nth-child(3) { animation-delay: 0.45s; }
@keyframes xjSlideIn {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: translateX(0); }
}
.xj-quiz-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
}
.xj-quiz-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #64c8ff, #a78bfa);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex: 0 0 auto;
}
.xj-quiz-tag {
  font-size: 11px;
  padding: 2px 9px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #93d4ff;
  border-radius: 10px;
}
.xj-quiz-type {
  font-size: 11px;
  padding: 2px 9px;
  background: rgba(167, 139, 250, 0.18);
  border: 1px solid rgba(167, 139, 250, 0.45);
  color: #cbb6ff;
  border-radius: 10px;
  margin-left: auto;
}
.xj-quiz-title {
  font-size: 14px;
  font-weight: 600;
  color: #e3eefc;
  margin-bottom: 9px;
  line-height: 1.55;
}
.xj-quiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
}
/* 判断题：两个选项并排放在中间，让 A 正确 / B 错误更醒目 */
.xj-quiz-options.xj-quiz-options-two {
  grid-template-columns: minmax(140px, 220px) minmax(140px, 220px);
  gap: 14px 30px;
  margin-top: 4px;
}
.xj-quiz-options.xj-quiz-options-two .xj-quiz-option {
  padding: 8px 14px;
  background: rgba(56, 189, 248, 0.06);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 8px;
  font-size: 14px;
}
.xj-quiz-option {
  font-size: 13px;
  color: #cbd5e1;
  padding: 5px 0;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  line-height: 1.5;
}
.xj-quiz-option .xj-opt-key {
  color: #93d4ff;
  font-weight: 600;
  flex: 0 0 auto;
}
.xj-quiz-meta {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px dashed rgba(100, 200, 255, 0.15);
  font-size: 11px;
  color: #64748b;
  display: flex;
  gap: 16px;
}
.xj-quiz-meta span strong { color: #4ade80; font-weight: 600; }

/* 成绩幕：左大柱图 ＋ 右两个环形图 */
.xj-result-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(280px, 1fr);
  gap: 14px;
  height: 100%;
  min-height: 0;
}
.xj-block-left { display: flex; flex-direction: column; min-height: 0; }
.xj-chart-tall { flex: 1 1 auto; min-height: 360px; }
.xj-stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
  flex: 0 0 auto;
}
.xj-stat-row-3 {
  grid-template-columns: repeat(3, 1fr);
}
.xj-stat-cell {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(99, 102, 241, 0.08));
  border: 1px solid rgba(100, 200, 255, 0.2);
  border-radius: 10px;
  padding: 10px 12px;
  text-align: center;
}
.xj-stat-label {
  font-size: 11px;
  color: #93b7d6;
}
.xj-stat-val {
  font-size: 22px;
  font-weight: 700;
  color: #93d4ff;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.xj-stat-cell.good { background: linear-gradient(135deg, rgba(74, 222, 128, 0.15), rgba(74, 222, 128, 0.05)); border-color: rgba(74, 222, 128, 0.35); }
.xj-stat-cell.good .xj-stat-val { color: #4ade80; }
.xj-stat-cell.warn { background: linear-gradient(135deg, rgba(248, 113, 113, 0.15), rgba(248, 113, 113, 0.05)); border-color: rgba(248, 113, 113, 0.35); }
.xj-stat-cell.warn .xj-stat-val { color: #fca5a5; }
/* 副标题（最快/最慢用时下方的姓名） */
.xj-stat-sub {
  font-size: 11px;
  color: #93b7d6;
  margin-top: 4px;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.xj-stat-cell.warn .xj-stat-sub { color: #fca5a5; }
/* 高亮统计卡（蓝紫渐变光晕，专门突出"平均正确率 89.5%"和"平均用时 45 秒"） */
.xj-stat-cell.highlight {
  background: linear-gradient(135deg, rgba(100, 200, 255, 0.32), rgba(167, 139, 250, 0.28));
  border: 1px solid rgba(100, 200, 255, 0.6);
  box-shadow: 0 0 18px rgba(100, 200, 255, 0.22);
  animation: xjStatPulse 2.6s ease-in-out infinite;
  position: relative;
}
.xj-stat-cell.highlight .xj-stat-label { color: #d0e8ff; }
.xj-stat-cell.highlight .xj-stat-val {
  background: linear-gradient(135deg, #64c8ff 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: #fff;
  font-size: 24px;
  letter-spacing: 0.5px;
}
@keyframes xjStatPulse {
  0%, 100% { box-shadow: 0 0 18px rgba(100, 200, 255, 0.22); }
  50%      { box-shadow: 0 0 28px rgba(167, 139, 250, 0.42); }
}

/* 学生成绩列表 —— 6 列：序号 / 姓名 / 用时 / 进度条 / 正确率 / 得分 */
.xj-result-list {
  flex: 1; min-height: 0;
  overflow: auto;
}
.xj-result-list::-webkit-scrollbar { width: 4px; }
.xj-result-list::-webkit-scrollbar-thumb { background: rgba(100, 200, 255, 0.3); border-radius: 2px; }
.xj-result-item {
  display: grid;
  grid-template-columns: 28px 64px 70px 1fr 56px 60px;
  gap: 10px;
  align-items: center;
  padding: 6px 4px;
  border-bottom: 1px solid rgba(100, 200, 255, 0.08);
  font-size: 12px;
}
.xj-result-rank {
  text-align: center;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}
.xj-result-name { color: #e3eefc; font-weight: 500; }
.xj-result-time {
  color: #93b7d6;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}
.xj-result-bar-wrap {
  position: relative;
  height: 9px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 5px;
  overflow: hidden;
}
.xj-result-bar {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, #38bdf8, #4ade80);
  border-radius: 5px;
  transition: width 0.6s ease;
}
.xj-result-bar.ok   { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.xj-result-bar.warn { background: linear-gradient(90deg, #f87171, #ef4444); }
.xj-result-bar.bad  { background: linear-gradient(90deg, #f87171, #ef4444); }
.xj-result-acc {
  text-align: right;
  color: #93d4ff;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}
.xj-result-acc.ok   { color: #fbbf24; }
.xj-result-acc.warn { color: #fca5a5; }
.xj-result-score {
  text-align: right;
  color: #93d4ff;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.xj-result-score.ok   { color: #fbbf24; }
.xj-result-score.warn { color: #fca5a5; }
.xj-result-score.bad  { color: #f87171; }

/* 底部交互区 */
#xj-footbar {
  flex: 0 0 auto;
  padding: 12px 24px;
  border-top: 1px solid rgba(100, 200, 255, 0.2);
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}
.xj-foot-status {
  font-size: 13px;
  color: #93b7d6;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.xj-foot-status.heard { color: #4ade80; }
.xj-foot-help {
  font-size: 11px;
  color: #64748b;
  text-align: right;
  line-height: 1.7;
}
.xj-foot-help kbd {
  display: inline-block;
  padding: 1px 7px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 4px;
  color: #93d4ff;
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 11px;
}

/* 进入按钮 —— 圆形头像 + 标签气泡，更显眼 */
#xj-launch-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 18px 6px 6px;
  background: linear-gradient(135deg, rgba(100, 200, 255, 0.22), rgba(167, 139, 250, 0.22));
  border: 1px solid rgba(100, 200, 255, 0.55);
  border-radius: 999px;
  color: #d0e8ff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 6px 22px rgba(100, 200, 255, 0.3);
  transition: all 0.2s;
  font-family: inherit;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
#xj-launch-fab:hover {
  background: linear-gradient(135deg, rgba(100, 200, 255, 0.4), rgba(167, 139, 250, 0.4));
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(100, 200, 255, 0.5);
}
#xj-launch-fab .xj-fab-img {
  width: 38px; height: 38px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 12px rgba(100, 200, 255, 0.45);
  flex: 0 0 auto;
  background: rgba(255,255,255,0.05);
}
#xj-launch-fab .xj-fab-text {
  background: linear-gradient(135deg, #64c8ff 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 1px;
}
#xj-launch-fab::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 999px;
  pointer-events: none;
  box-shadow: 0 0 0 4px rgba(100, 200, 255, 0);
  animation: xjFabRipple 2.4s ease-out infinite;
}
@keyframes xjFabRipple {
  0%   { box-shadow: 0 0 0 0   rgba(100, 200, 255, 0.45); }
  80%  { box-shadow: 0 0 0 14px rgba(100, 200, 255, 0); }
  100% { box-shadow: 0 0 0 0   rgba(100, 200, 255, 0); }
}

/* 浮窗（识别到的语音文本）*/
#xj-heard {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(8, 16, 32, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 22px;
  padding: 6px 16px;
  font-size: 12px;
  color: #93d4ff;
  max-width: 70vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: none;
  z-index: 5;
}
#xj-heard.visible { display: block; animation: xjHeardIn 0.25s ease; }
@keyframes xjHeardIn {
  from { opacity: 0; transform: translate(-50%, 6px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* —— 幕5：拖拽小游戏 iframe 容器 —— */
.xj-game-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: #f3f8ff;
  border: 1px solid rgba(56, 189, 248, 0.28);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04) inset, 0 18px 50px rgba(7, 16, 38, 0.5);
}
.xj-game-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #f3f8ff;
}
.xj-game-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(15, 12, 41, 0.92), rgba(36, 36, 62, 0.92));
  color: #b9d4ff;
  font-size: 14px;
  z-index: 2;
  pointer-events: none;
}
.xj-game-loading-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, #64c8ff, #a78bfa);
  box-shadow: 0 0 12px rgba(100, 200, 255, 0.6);
  animation: xjGameDot 1.2s ease-in-out infinite;
}
.xj-game-loading-dot:nth-child(2) { animation-delay: .15s; }
.xj-game-loading-dot:nth-child(3) { animation-delay: .30s; }
.xj-game-loading-text {
  margin-left: 6px;
  letter-spacing: 1px;
  font-weight: 600;
  background: linear-gradient(135deg, #64c8ff 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
@keyframes xjGameDot {
  0%, 100% { transform: translateY(0);   opacity: .5; }
  50%      { transform: translateY(-6px); opacity: 1; }
}

/* —— 触屏 / 平板隐形热区（四角分别 1/2/3/4） —— */
#xj-touch-zones {
  position: absolute;
  inset: 0;
  pointer-events: none;          /* 容器本身穿透；只让 4 个按钮接收事件 */
  z-index: 12;                   /* 高于 stage 内容（含 iframe），低于 topbar 控件视觉 */
}
.xj-touch {
  position: absolute;
  width: 56px;
  height: 56px;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  outline: none;
  cursor: default;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  opacity: 0;                    /* 完全隐形 */
}
.xj-touch:focus,
.xj-touch:hover,
.xj-touch:active { outline: none; background: transparent; opacity: 0; }

/* 位置：上 80px / 下 70px 让出 topbar、footbar 和 stage 顶部 bubble；
   左 / 右 16px 不与 topbar 关闭按钮垂直重叠（关闭按钮 Y≈14-56，热区 Y≥80） */
.xj-touch-tl { top: 80px;    left: 16px; }
.xj-touch-tr { top: 80px;    right: 16px; }
.xj-touch-bl { bottom: 70px; left: 16px; }
.xj-touch-br { bottom: 70px; right: 16px; }

/* 触摸笔记本 / 手机端缩小一点，避免误触 */
@media (max-width: 900px) {
  .xj-touch { width: 48px; height: 48px; }
  .xj-touch-tl, .xj-touch-tr { top: 70px; }
  .xj-touch-bl, .xj-touch-br { bottom: 60px; }
}
