/* ═══════════════════════════════════════════════════════
   玻璃面板样式 —— 复刻自 test5 (sign-language-ar) 的 index.css
   ═══════════════════════════════════════════════════════ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg: #0a0a1a;
  --cyan: #00f0ff;
  --magenta: #ff00aa;
  --lime: #00ff88;
  --amber: #ffaa00;
  --purple: #aa55ff;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: #fff;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

/* 全屏视频背景（canvas 渲染镜像画面 + 骨架） */
#screen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: #000;
}

.overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}

.overlay > * {
  pointer-events: auto;
}

/* ── 玻璃面板 ── */
.glass-panel {
  background: rgba(10, 10, 30, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.glass-panel-solid {
  background: rgba(10, 10, 30, 0.92);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 8px 0 32px rgba(0, 0, 0, 0.5);
}

.glass-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.glass-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

/* ── 文字发光 ── */
.text-glow-cyan { color: var(--cyan); text-shadow: 0 0 20px rgba(0, 240, 255, 0.5), 0 0 40px rgba(0, 240, 255, 0.2); }
.text-glow-magenta { color: var(--magenta); text-shadow: 0 0 20px rgba(255, 0, 170, 0.5), 0 0 40px rgba(255, 0, 170, 0.2); }
.text-glow-lime { color: var(--lime); text-shadow: 0 0 20px rgba(0, 255, 136, 0.5); }

/* ── 置信度条 ── */
.confidence-bar {
  width: 90px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}
.confidence-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--lime));
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* ── 底部导航按钮 ── */
.nav-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 18px;
  border-radius: 12px;
  background: rgba(10, 10, 30, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.2s ease;
}
.nav-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
}
.nav-btn-active {
  background: rgba(0, 240, 255, 0.12);
  border-color: rgba(0, 240, 255, 0.25);
  color: var(--cyan);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.15);
}

/* ── 按钮 ── */
.btn {
  padding: 6px 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}
.btn-cyan { background: rgba(0, 240, 255, 0.2); color: var(--cyan); }
.btn-cyan:hover { background: rgba(0, 240, 255, 0.32); }
.btn-ghost { background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.6); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.2); color: #fff; }

/* ── 滚动条 ── */
.custom-scrollbar::-webkit-scrollbar { width: 4px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 2px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

/* ═══════════════════════════════════════════════════════
   本项目布局
   ═══════════════════════════════════════════════════════ */

.hidden { display: none !important; }

/* 顶部状态条 */
#status-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  z-index: 30;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.1em;
}
.status-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #ff3b3b;
  display: inline-block;
}
.status-dot.on { background: var(--lime); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* 识别 HUD */
#hud {
  position: fixed;
  top: 60px; left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  text-align: center;
}
#hud .word {
  font-size: 52px;
  font-weight: 700;
  letter-spacing: 0.05em;
}
#hud .category {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-top: 4px;
}
#hud .conf-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

/* 底部导航 */
#bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-bottom: 22px;
  z-index: 30;
}

/* 句子构建条 */
#sentence-bar {
  position: fixed;
  bottom: 92px; left: 50%;
  transform: translateX(-50%);
  width: min(720px, calc(100% - 40px));
  z-index: 25;
}
#sentence-bar .sentence-text {
  min-height: 32px;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: #fff;
}

/* 居中面板（学习 / 资料库 / 考试）——容器全屏但穿透点击，只有面板本体拦截 */
.center-panel {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 35;
  padding: 20px;
  pointer-events: none;
}
.center-panel .panel-inner {
  width: min(680px, 100%);
  max-height: 82vh;
  overflow-y: auto;
  padding: 28px;
  pointer-events: auto;
}

/* 课程卡片列表 */
.lesson-list { display: flex; flex-direction: column; gap: 12px; }
.lesson-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  cursor: pointer;
  text-align: left;
  width: 100%;
}

/* 资料库网格 */
.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}
.lib-item {
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
}
.lib-item .emoji { font-size: 26px; }
.lib-item .word { font-size: 17px; font-weight: 700; margin-top: 4px; }
.lib-item .cat { font-size: 11px; color: rgba(255, 255, 255, 0.4); margin-top: 2px; }

/* 筛选按钮组 */
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-chip {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
}
.filter-chip.active { background: rgba(0, 240, 255, 0.18); color: var(--cyan); border-color: rgba(0, 240, 255, 0.3); }

/* 搜索框 */
.search-input {
  flex: 1;
  padding: 9px 14px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 14px;
  outline: none;
}
.search-input::placeholder { color: rgba(255, 255, 255, 0.3); }
.search-input:focus { border-color: rgba(0, 240, 255, 0.5); }

/* 学习进度条 */
.progress-track {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--lime));
  transition: width 0.5s ease;
}

/* 目标手势卡 */
.target-card {
  text-align: center;
  padding: 24px;
  transition: all 0.3s ease;
}
.matched {
  box-shadow: 0 0 0 2px var(--lime), 0 0 24px rgba(0, 255, 136, 0.25);
}

/* 难度徽标 */
.badge {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
}
.badge-1 { background: rgba(0, 255, 136, 0.18); color: var(--lime); }
.badge-2 { background: rgba(255, 170, 0, 0.18); color: var(--amber); }
.badge-3 { background: rgba(255, 0, 170, 0.18); color: var(--magenta); }

/* 加载屏 */
#loading {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  transition: opacity 0.5s ease;
}
#loading.fade { opacity: 0; pointer-events: none; }

/* 提示文本 */
.hint {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
}
.muted { color: rgba(255, 255, 255, 0.45); }

h2.title { font-size: 24px; font-weight: 700; }
.subtitle { font-size: 13px; color: rgba(255, 255, 255, 0.45); margin-top: 4px; }

/* 加载条动画 */
@keyframes loadingbar {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(0); }
  100% { transform: translateX(100%); }
}

/* ═══════════════════════════════════════════════════════
   移动端适配
   ═══════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  /* 顶部指令条：允许换行、更紧凑 */
  #learn-target-bar,
  #exam-target-card {
    flex-wrap: wrap;
    gap: 6px 12px;
    padding: 10px 12px;
  }

  /* 识别 HUD 字号略缩小 */
  #hud .word { font-size: 38px; }

  /* 居中面板占满、少内边距 */
  .center-panel { padding: 10px; }
  .center-panel .panel-inner { padding: 18px; max-height: 88vh; }

  /* 资料库网格更紧凑 */
  .lib-grid { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }

  /* 底部导航触屏友好 + 安全区 */
  #bottom-nav { gap: 8px; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .nav-btn { padding: 6px 14px; }

  /* 句子构建条 */
  #sentence-bar { width: calc(100% - 20px); bottom: 84px; }
  #sentence-bar .sentence-text { font-size: 16px; }

  /* 状态条 */
  #status-bar { padding: 10px 14px; font-size: 11px; }
}
