/* ========== call.css — 灰白简约风格 ========== */

.call-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  flex-direction: column;
}
.call-screen.show {
  display: flex;
  animation: callFadeIn .3s ease;
}
@keyframes callFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── 背景：浅灰渐变，移除深色毛玻璃 ── */
.call-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #ffffff 0%, #f5f5f5 40%, #ececec 100%);
  z-index: 0;
  /* 覆盖 JS 设置的 backgroundImage */
  filter: none !important;
  transform: none !important;
}
.call-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: transparent;
}

/* ── 容器 ── */
.call-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: env(safe-area-inset-top, 20px) 0 env(safe-area-inset-bottom, 24px);
}

/* ══════════════════════════════════════════
   顶部信息区 — 下移 + 灰色文字
   ══════════════════════════════════════════ */
.call-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 36px 20px 16px;
  flex-shrink: 0;
}

.call-avatar-large {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: #e8e8e8;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  border: none;
  box-shadow:
    0 2px 12px rgba(0, 0, 0, 0.06),
    0 0 0 3px rgba(0, 0, 0, 0.03);
}
.call-avatar-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* 无头像时 SVG 颜色 */
.call-avatar-large svg path,
.call-avatar-large svg circle {
  stroke: #aaa !important;
}

.call-name {
  font-size: 22px;
  font-weight: 600;
  color: #1d1d1f;
  letter-spacing: -.3px;
}
.call-timer {
  font-size: 14px;
  color: #888;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.call-type-label {
  font-size: 12px;
  color: #aaa;
  margin-top: 2px;
}

/* ══════════════════════════════════════════
   消息区 — 灰白气泡
   ══════════════════════════════════════════ */
.call-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}

.call-msg-row {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  animation: msgIn .25s ease;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.call-msg-row.sent     { align-self: flex-end;  align-items: flex-end;  }
.call-msg-row.received { align-self: flex-start; align-items: flex-start; }

.call-msg-bubble {
  padding: 8px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
}
.call-msg-row.sent .call-msg-bubble {
  background: #e9e9eb;
  color: #1d1d1f;
  border-bottom-right-radius: 4px;
}
.call-msg-row.received .call-msg-bubble {
  background: #ffffff;
  color: #333;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.call-action-bubble {
  font-style: italic;
  font-size: 13px;
  color: #999 !important;
  background: #f0f0f0 !important;
}
.call-msg-thought {
  font-size: 12px;
  color: #aaa;
  font-style: italic;
  padding: 4px 14px 0;
  line-height: 1.4;
}
.call-msg-action {
  font-size: 11px;
  color: #bbb;
  padding: 2px 14px 0;
  line-height: 1.3;
}

/* ══════════════════════════════════════════
   心声条 — 灰白卡片
   ══════════════════════════════════════════ */
.call-thought-bar {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin: 0 16px 4px;
  background: #ffffff;
  border-radius: 10px;
  flex-shrink: 0;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid #eee;
}
.call-thought-icon { flex-shrink: 0; }
.call-thought-icon svg {
  stroke: #aaa;
  fill: none;
  stroke-width: 1.5;
}
.call-thought-text {
  font-size: 12px;
  color: #888;
  font-style: italic;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ══════════════════════════════════════════
   输入条 / 动作条 — 白底卡片风格
   ══════════════════════════════════════════ */
.call-input-bar,
.call-action-bar {
  display: none;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 16px;
  margin: 0 12px 6px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}
.call-input-bar.show,
.call-action-bar.show { display: flex; }

.call-input-wrap {
  flex: 1;
  background: transparent;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid #e0e0e0;
}
.call-input-wrap textarea {
  width: 100%;
  border: none;
  outline: none;
  padding: 8px 4px;
  font-size: 14px;
  resize: none;
  max-height: 80px;
  line-height: 1.4;
  background: transparent;
  font-family: inherit;
  color: #333;
  box-sizing: border-box;
}
.call-input-wrap textarea::placeholder { color: #bbb; }

/* 发送按钮 — 精致灰白圆角 */
.call-input-send {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  background: #f0f0f0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s, border-color .15s;
}
.call-input-send svg {
  width: 16px;
  height: 16px;
}
.call-input-send svg path {
  stroke: #555 !important;
  fill: none !important;
}
.call-input-send:hover {
  background: #e0e0e0;
  border-color: #d0d0d0;
}
.call-input-send:active {
  background: #d5d5d5;
}
/* 禁用态（可选） */
.call-input-send:disabled {
  background: #f5f5f5;
  border-color: #eee;
}
.call-input-send:disabled svg path {
  stroke: #ccc !important;
}

/* ══════════════════════════════════════════
   ★★★ 底部控制区 — 灰白简约核心 ★★★
   ══════════════════════════════════════════ */
.call-controls {
  padding: 14px 20px;
  padding-bottom: max(40px, env(safe-area-inset-bottom, 40px));
  flex-shrink: 0;
}
.call-controls.hidden { display: none; }

.call-ctrl-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px 0;
  max-width: 340px;
  margin: 0 auto;
}

.call-ctrl-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.call-ctrl-item span {
  font-size: 11px;
  color: #888;
  font-weight: 500;
  letter-spacing: .2px;
}

/* ★ 按钮 — 白色圆形 + 柔和阴影 */
.call-ctrl-btn {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.call-ctrl-btn:active {
  transform: scale(.92);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.call-ctrl-btn.active {
  background: #1d1d1f;
  border-color: #1d1d1f;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

/* ★ 按钮图标 — 灰色线条 */
.call-ctrl-btn svg {
  width: 24px;
  height: 24px;
  stroke: #555;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.call-ctrl-btn.active svg { stroke: #fff; }

/* ★ 挂断按钮 — 红色 */
.call-end-btn {
  background: #ff3b30 !important;
  border-color: transparent !important;
  box-shadow: 0 3px 12px rgba(255, 59, 48, 0.25) !important;
}
.call-end-btn svg {
  stroke: #fff !important;
}
.call-end-btn:active {
  background: #d63028 !important;
  box-shadow: 0 2px 8px rgba(255, 59, 48, 0.30) !important;
}

/* 打字指示器 — 适配浅色 */
.call-msg-bubble .typing-indicator { padding: 4px 0; }
.call-msg-bubble .typing-indicator span { background: #ccc; }

/* ══════════════════════════════════════════
   长按删除菜单 — 灰白风格
   ══════════════════════════════════════════ */
.call-delete-overlay {
  position: absolute;
  inset: 0;
  z-index: 100;
}
.call-delete-menu {
  position: fixed;
  z-index: 101;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 10px;
  border: 1px solid #e5e5ea;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.10);
  min-width: 100px;
  overflow: hidden;
  animation: callMenuIn .12s ease;
}
@keyframes callMenuIn {
  from { opacity: 0; transform: scale(.94); }
  to   { opacity: 1; transform: scale(1);   }
}
.call-delete-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  cursor: pointer;
  transition: background .1s;
}
.call-delete-item:active { background: rgba(0, 0, 0, 0.04); }
.call-delete-item svg {
  stroke: #ff453a;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.call-delete-item span {
  font-size: 14px;
  color: #ff453a;
  font-weight: 500;
}

/* ══════════════════════════════════════════
   历史模式关闭按钮 — 灰白风格覆盖
   ══════════════════════════════════════════ */
#callControlsHistory .call-ctrl-btn {
  background: #f0f0f0 !important;
  border: 1px solid #e0e0e0 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
}
#callControlsHistory .call-ctrl-btn svg {
  stroke: #555 !important;
}
#callControlsHistory .call-ctrl-item span {
  color: #888 !important;
}
