/* 通话页样式 —— #/call。
 * 设计语言跟 design-system.css 走：陶土橙 + 琥珀/玫瑰辅助、--deep-* 深色沉浸、
 * 克制动效、层级阴影。不引入 emoji，全部线性 SVG 图标。
 */

#callPanelWrap {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(120% 90% at 50% -10%, rgba(232, 160, 180, 0.16), transparent 60%),
        radial-gradient(90% 70% at 85% 110%, rgba(201, 100, 66, 0.14), transparent 55%),
        var(--deep-grad-bg);
    color: var(--deep-text);
    font-family: var(--font-sans, -apple-system, system-ui, 'PingFang SC', sans-serif);
}
#callPanelWrap.hidden { display: none; }

.call-panel {
    width: 100%;
    max-width: 420px;
    height: 100%;
    padding: max(24px, env(safe-area-inset-top)) 28px max(32px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    text-align: center;
}

/* ── 顶栏 ── */
.call-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    opacity: 0.7;
    min-height: 32px;
}
.call-eyebrow {
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--deep-text-faint);
}
.call-close {
    background: var(--deep-surface);
    border: none;
    color: var(--deep-text);
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background var(--transition, 200ms ease);
}
.call-close svg { width: 18px; height: 18px; }
.call-close:hover { background: var(--deep-surface-strong); }
.call-header-right { display: flex; gap: 8px; align-items: center; }
.call-lock {
    background: var(--deep-surface);
    border: none;
    color: var(--deep-text-faint);
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background var(--transition, 200ms ease), color var(--transition, 200ms ease);
}
.call-lock svg { width: 16px; height: 16px; }
.call-lock:hover { background: var(--deep-surface-strong); color: var(--deep-text); }
.call-lock.active { background: rgba(220, 180, 40, 0.2); color: var(--deep-amber); }
/* 陪睡模式：月亮键点亮 + 整体状态提示 */
#callSleep.active { background: rgba(232,160,180,0.22); color: var(--deep-rose); }
#callPanelWrap.sleeping .call-avatar {
    box-shadow: 0 0 0 4px rgba(232,160,180,0.2), 0 0 44px rgba(232,160,180,0.4);
}
#callPanelWrap.sleeping .call-avatar-wrap { animation: call-sleep-breathe 4s ease-in-out infinite; }
@keyframes call-sleep-breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(0.97); }
}
#callPanelWrap.sleeping .call-status { color: var(--deep-rose); }

/* 夜间统计 */
.call-sleep-stats {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(232,160,180,0.08);
    border: 1px solid rgba(232,160,180,0.18);
    font-size: 11px;
    color: var(--deep-rose);
}
.call-sleep-stats.hidden { display: none; }
.call-sleep-row { line-height: 1.6; }

/* ── 头像：沈游紫渐变 + 呼吸光晕 ── */
.call-avatar-wrap {
    position: relative;
    width: 132px; height: 132px;
    margin-top: clamp(32px, 10vh, 64px);
}
.call-avatar {
    width: 100%; height: 100%;
    border-radius: 50%;
    background: var(--deep-avatar-grad);
    display: flex; align-items: center; justify-content: center;
    font-size: 52px; font-weight: 600; color: #fff;
    box-shadow: 0 12px 40px var(--deep-avatar-glow);
    position: relative;
    z-index: 1;
}
.call-avatar-ring {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 2px solid transparent;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.call-avatar-wrap.speaking .call-avatar-ring {
    opacity: 1;
    border-color: rgba(255, 255, 255, 0.35);
    animation: call-ring-pulse 1.8s ease-out infinite;
}
@keyframes call-ring-pulse {
    0%   { transform: scale(0.96); opacity: 0.6; }
    100% { transform: scale(1.18); opacity: 0; }
}
.call-avatar-wrap.speaking .call-avatar {
    box-shadow: 0 0 0 4px rgba(201,100,66,0.3), 0 0 44px rgba(154,92,245,0.55);
}

/* ── 身份 ── */
.call-name { font-size: 22px; font-weight: 600; margin-top: 20px; letter-spacing: 0.01em; }
.call-status { font-size: 15px; color: var(--deep-text-secondary); margin-top: 6px; }
.call-subtitle { font-size: 13px; color: var(--deep-text-faint); min-height: 18px; margin-top: 2px; }

/* ── 字幕：底部轻量浮现 ── */
.call-transcript {
    width: 100%;
    margin-top: auto;
    max-height: 26vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 0;
    font-size: 13px;
    scrollbar-width: none;
}
.call-transcript::-webkit-scrollbar { display: none; }
.call-transcript.hidden { display: none; }
.call-line {
    padding: 8px 14px;
    border-radius: 16px;
    max-width: 82%;
    text-align: left;
    line-height: 1.5;
    animation: call-line-in 0.25s var(--ease-out-expo, cubic-bezier(0.16,1,0.3,1));
}
@keyframes call-line-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.call-line-user { align-self: flex-end;   background: var(--deep-accent-muted); color: var(--deep-accent-soft); }
.call-line-ai   { align-self: flex-start; background: var(--deep-surface); color: var(--deep-text); }
/* 感知附注：[audio]/[mood] 淡紫小字（蓝图踩坑 13，故意让用户看见怎么被听成什么样） */
.call-line-meta {
    font-size: 11px;
    color: var(--deep-meta);
    font-style: italic;
    opacity: 0.75;
    margin-top: 3px;
    line-height: 1.4;
}
.call-line-mood { color: var(--deep-rose); }
/* 外语译文行 */
.call-line-trans {
    font-size: 12px;
    color: var(--deep-trans);
    margin-top: 3px;
    line-height: 1.4;
}

/* ── 控制按钮：大圆钮 ── */
.call-controls {
    display: flex;
    gap: 22px;
    margin-top: 24px;
    align-items: center;
}
.call-btn {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    background: none;
    border: none;
    color: var(--deep-text);
    cursor: pointer;
    transition: transform 0.15s var(--ease-out-expo, cubic-bezier(0.16,1,0.3,1));
}
.call-btn:active { transform: scale(0.94); }
.call-ico {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: var(--deep-surface-strong);
    display: flex; align-items: center; justify-content: center;
    transition: background var(--transition, 200ms ease), box-shadow var(--transition, 200ms ease);
}
.call-ico svg { width: 26px; height: 26px; }
.call-btn em { font-style: normal; font-size: 12px; color: var(--deep-text-faint); letter-spacing: 0.02em; }
.call-btn:hover .call-ico { background: rgba(255,255,255,0.22); }

.call-btn-primary .call-ico { background: var(--deep-ok); box-shadow: 0 6px 20px rgba(110,155,99,0.35); }
.call-btn-primary:hover .call-ico { background: #82B287; }
.call-btn-hangup .call-ico { background: var(--deep-danger); box-shadow: 0 6px 20px rgba(220,60,60,0.3); }
.call-btn-hangup:hover .call-ico { background: #D55A52; }
.call-btn.muted .call-ico { background: rgba(227,161,58,0.75); box-shadow: 0 6px 20px rgba(220,180,40,0.25); }
.call-btn.hidden { display: none; }

/* ── 浮球：通话音量式胶囊 ── */
#callBall {
    position: fixed;
    right: 16px;
    bottom: 100px;
    z-index: 1100;
    display: flex; align-items: center; gap: 8px;
    background: var(--deep-ball-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--deep-accent-strong);
    border-radius: 999px;
    padding: 9px 16px;
    color: var(--deep-text);
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(0,0,0,0.45);
    transition: transform 0.15s var(--ease-out-expo, cubic-bezier(0.16,1,0.3,1));
    -webkit-user-select: none; user-select: none;
}
#callBall:active { transform: scale(0.95); }
#callBall.hidden { display: none; }
.call-ball-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--deep-ok);
    animation: call-ball-pulse 1.6s infinite;
}
@keyframes call-ball-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(110,155,99,0.5); }
    50%      { box-shadow: 0 0 0 7px rgba(61,156,99,0); }
}

/* ── 全局来电卡：玻璃拟态 ── */
#callIncomingCard {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: var(--deep-overlay);
    backdrop-filter: blur(18px);
    display: flex; align-items: center; justify-content: center;
    color: var(--deep-text);
    font-family: var(--font-sans, -apple-system, system-ui, 'PingFang SC', sans-serif);
}
#callIncomingCard.hidden { display: none; }
.call-incoming-inner {
    text-align: center;
    padding: 36px 32px 28px;
    border-radius: 28px;
    background: var(--deep-surface);
    border: 1px solid var(--deep-border);
    box-shadow: 0 24px 60px rgba(0,0,0,0.5);
    max-width: 320px; width: 82%;
    animation: call-card-in 0.35s var(--ease-out-back, cubic-bezier(0.34,1.56,0.64,1));
}
@keyframes call-card-in {
    from { opacity: 0; transform: translateY(18px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.call-incoming-avatar {
    width: 88px; height: 88px; margin: 0 auto;
    border-radius: 50%;
    background: var(--deep-avatar-grad);
    display: flex; align-items: center; justify-content: center;
    font-size: 36px; font-weight: 600; color: #fff;
    box-shadow: 0 10px 32px var(--deep-avatar-glow);
    animation: call-ring-pulse 1.8s ease-out infinite;
}
.call-incoming-title { font-size: 22px; font-weight: 600; margin: 16px 0 4px; }
.call-incoming-reason { font-size: 13px; color: var(--deep-text-secondary); min-height: 18px; margin-bottom: 22px; }
.call-incoming-actions { display: flex; gap: 16px; justify-content: center; }
.call-incoming-btn {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    background: none; border: none; color: var(--deep-text); cursor: pointer;
    transition: transform 0.15s var(--ease-out-expo, cubic-bezier(0.16,1,0.3,1));
}
.call-incoming-btn:active { transform: scale(0.94); }
.call-incoming-btn .call-ico {
    width: 60px; height: 60px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.call-incoming-btn .call-ico svg { width: 24px; height: 24px; }
.call-incoming-btn em { font-style: normal; font-size: 12px; color: var(--deep-text-faint); }
.call-incoming-reject .call-ico { background: var(--deep-danger); box-shadow: 0 6px 18px rgba(220,60,60,0.3); }
.call-incoming-accept .call-ico { background: var(--deep-ok); box-shadow: 0 6px 18px rgba(110,155,99,0.35); }
