/* L4-W2 · 通话 UI 样式
   视觉铁规：只用 tokens.css 的变量（颜色 / 圆角 / 阴影 / 字体 / 动效），
   复用 base.css 的 .btn / .btn-primary / .btn-danger / .btn-icon / .card /
   .badge / .avatar / .modal-* 组件类；不引入新颜色、不改字体、不改间距体系
   （间距只用既有刻度 8 / 12 / 16 / 22）。本文件只补视频窗布局与通话层定位。 */

#call-root { position: fixed; inset: 0; z-index: 1300; pointer-events: none; }
#call-root:empty { display: none; }

/* 来电卡片：右上浮层，复用 .card 的质感 */
.call-incoming {
  pointer-events: auto;
  position: absolute;
  top: 76px;
  right: 22px;
  width: 320px;
  padding: 16px;
  animation: callSlideIn var(--t-med) var(--ease-spring) both;
}
.call-incoming-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.call-incoming-name { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.02em; }
.call-incoming-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.call-incoming-actions { display: flex; gap: 8px; margin-top: 16px; }
.call-incoming-actions .btn { flex: 1; justify-content: center; }

/* 通话中全屏层 */
.call-overlay {
  pointer-events: auto;
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-canvas);
  background-image: var(--bg-canvas-grad);
  animation: callFadeIn var(--t-med) var(--ease-snappy) both;
}
.call-overlay-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 22px;
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border-subtle);
}
.call-overlay-title { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--text-primary); }
.call-overlay-net { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.call-overlay-timer { font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); }

/* 视频窗：本地画中画 + 远端主窗；群组平铺 grid */
.call-video-area { flex: 1; min-height: 0; padding: 16px 22px; display: flex; flex-direction: column; gap: 12px; }
.call-video-main {
  position: relative; flex: 1; min-height: 0;
  border-radius: var(--radius-lg);
  background: var(--bg-recessed);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-raised);
  overflow: visible;
}
.call-video-main video { width: 100%; height: 100%; object-fit: cover; display: block; background: var(--bg-recessed); border-radius: var(--radius-lg); }
.call-video-fallback {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  color: var(--text-secondary); background: var(--bg-recessed);
}
.call-video-label {
  position: absolute; left: 12px; bottom: 12px;
  font-size: 12px; font-weight: 600;
  background: var(--bg-glass); color: var(--text-primary);
  padding: 2px 8px; border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}
.call-video-self {
  position: absolute; right: 12px; bottom: 12px; width: 176px; aspect-ratio: 16 / 9;
  border-radius: var(--radius-md); overflow: visible;
  background: var(--bg-recessed);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-raised);
}
.call-video-self video { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: var(--radius-md); }
.call-video-self .call-video-fallback { gap: 8px; }

.call-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(2, 1fr); grid-auto-rows: 1fr; gap: 12px; }
.call-tile {
  position: relative; min-height: 120px;
  border-radius: var(--radius-lg); overflow: visible;
  background: var(--bg-recessed);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-raised-sm);
}
.call-tile video { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: var(--radius-lg); }
.call-tile-more {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--text-secondary);
  background: var(--bg-surface);
}

/* 底部控制条：复用 .btn / .btn-danger / .btn-icon */
.call-controls {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 16px 22px 22px;
  background: var(--bg-glass);
  border-top: 1px solid var(--border-subtle);
}
.call-controls .btn { min-width: 96px; justify-content: center; }

/* 拨号中 / 结束态共用同一 overlay 的居中态 */
.call-center-state {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  padding: 22px; text-align: center;
}
.call-center-state .call-state-text { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.call-center-state .call-state-sub { font-size: 13px; color: var(--text-secondary); }

/* 通话记录行 */
.call-log-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--radius-sm); background: var(--bg-recessed); border: 1px solid var(--border-subtle); }
.call-log-row .call-log-name { font-size: 13.5px; font-weight: 650; color: var(--text-primary); }
.call-log-row .call-log-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

@keyframes callSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes callFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
