/**
 * archive-call.css — 「按档案打电话」通话覆盖层。
 *
 * ⚠️ 类名全部用 `ac-` 前缀，且**不复用**站内既有类（.btn-secondary / .error-message 等）：
 *    本表是全局静态引入的，蹭既有类名会重演 dingpan.css 那种「谁生效只看加载顺序」的坑
 *    （见 index.html 顶部 dingpan.css 的长注释）。
 *
 * 布局用 dvh + env(safe-area-inset-bottom)：iOS Safari 地址栏收起/展开时 100vh 会把挂断键
 * 顶到屏幕外，通话中够不着挂断是硬故障。dvh 不支持的老浏览器落 vh 兜底。
 */

.ac-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;            /* 高于 dingpan(1000)：通话中不该被任何面板盖住 */
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #1b1430 0%, #0e0a1c 100%);
  color: #fff;
  height: 100vh;
  height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.ac-overlay[hidden] { display: none !important; }

/* 通话中禁止背景滚动（iOS 上不锁的话背景会跟着惯性滚） */
body.archive-call-open { overflow: hidden; }

.ac-header {
  flex: 0 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 20px 12px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
/* A3：「正在看：{姓名}（{关系}）」通话页常驻一行 */
.ac-subject {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .3px;
  min-height: 24px;
}
.ac-meta {
  margin-top: 6px;
  font-size: 13px;
  color: rgba(255, 255, 255, .62);
  display: flex;
  justify-content: center;
  gap: 12px;
}
.ac-timer { font-variant-numeric: tabular-nums; }

.ac-log {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ac-turn {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.ac-turn--user {
  align-self: flex-end;
  background: #6b4fd8;
  border-bottom-right-radius: 5px;
}
.ac-turn--master {
  align-self: flex-start;
  background: rgba(255, 255, 255, .1);
  border-bottom-left-radius: 5px;
}
/* 流式中的 ASR 气泡：未定格，视觉上要能看出还在识别 */
.ac-turn.is-interim { opacity: .6; }

.ac-hint {
  flex: 0 0 auto;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, .5);
  padding: 4px 16px 10px;
  min-height: 18px;
}

.ac-actions {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  gap: 40px;
  padding: 12px 16px 26px;
}
.ac-btn {
  border: 0;
  background: transparent;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ac-btn__icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: rgba(255, 255, 255, .14);
}
.ac-btn--hangup .ac-btn__icon {
  background: #e5484d;
  transform: rotate(135deg);   /* 听筒朝下 = 挂断 */
}
.ac-btn--mic.is-muted .ac-btn__icon {
  background: rgba(255, 255, 255, .28);
  opacity: .55;
}
.ac-btn__label { color: rgba(255, 255, 255, .72); }

/* ── 档案列表 / 详情页的拨号按钮 ───────────────────────────────────────────── */
.ac-dial {
  border: 0;
  background: transparent;
  padding: 6px 8px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
/* A5 灰态：allowOthers=false 时非本人档案置灰。用 aria-disabled 而不是 disabled —— 点击仍要
   能触发，好给出「现在只能给自己打电话」的解释性提示（PRD §3.3 的三合一半屏 v1 先用 toast 代）。*/
.ac-dial[aria-disabled="true"] { opacity: .3; }

.ac-dial-lg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 13px 16px;
  border: 0;
  border-radius: 12px;
  background: #6b4fd8;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.ac-dial-lg[aria-disabled="true"] { background: #b9b3cc; }

/* 拨打态（预检通过 → 等 user gesture 开麦）：绿色接听键 + 取消 */
.ac-btn--dial .ac-btn__icon { background: #2ea043; }
.ac-btn--cancel .ac-btn__icon { background: rgba(255, 255, 255, .14); font-size: 20px; }
