/* ============================================
   VIDEO CALL UI STYLES — v2 redesign
   视频通话界面样式（重构版）
   无渐变 / 无emoji / 对话流浮于画面
   ============================================ */

/* --- Layer 基础 --- */
#layer-video-call {
    --vidcall-font-size: 15px;
    --vidcall-font-color: #ffffff;
    background: rgba(10, 10, 10, 0.95);
    touch-action: manipulation;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 8000;
    position: absolute;
}

/* --- Header 顶部栏 --- */
.vidcall-header {
    padding: 50px 20px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    opacity: 0.8;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 15;
    padding-top: 50px;
    padding-left: 20px;
    padding-right: 20px;
}

/* --- Remote Area: 对方视频/Live2D区域 --- */
.vidcall-remote-area {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #111;
    z-index: 1;
}

#vidcall-live2d-canvas {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    object-fit: cover;
}

.vidcall-remote-name {
    position: absolute;
    top: 90px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 15px;
    font-weight: 500;
    color: rgba(255,255,255,0.7);
    text-shadow: 0 1px 6px rgba(0,0,0,0.6);
    z-index: 5;
    pointer-events: none;
}

/* --- 环境识别结果标签 --- */
.vidcall-env-badge {
    position: absolute;
    top: 120px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    z-index: 10;
    max-width: 80%;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.5s ease;
}
.vidcall-env-badge i {
    margin-right: 4px;
    font-size: 10px;
    opacity: 0.6;
}

/* --- Local PIP: 本地摄像头小窗 --- */
.vidcall-local-pip {
    position: absolute;
    top: 100px;
    right: 15px;
    width: 100px;
    height: 140px;
    border-radius: 12px;
    overflow: hidden;
    z-index: 12;
    box-shadow: 0 2px 12px rgba(0,0,0,0.4);
    border: 1.5px solid rgba(255,255,255,0.1);
    background: #1a1a1a;
    cursor: move;
    touch-action: none;
    transition: box-shadow 0.2s;
}
.vidcall-local-pip:active {
    box-shadow: 0 2px 20px rgba(255,255,255,0.15);
}

.vidcall-local-pip video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

/* --- 大小屏切换（微信式）：点击小窗切换大小屏 --- */
.vidcall-local-pip { cursor: pointer; }
.vidcall-swap-hint {
    position: absolute;
    left: 50%;
    bottom: 6px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: 8px;
    background: rgba(0,0,0,0.45);
    color: rgba(255,255,255,0.85);
    font-size: 9px;
    line-height: 1;
    pointer-events: none;
    z-index: 3;
}
/* 交换后：远端画面变成小窗 */
#layer-video-call.vidcall-swapped .vidcall-remote-area {
    top: 100px;
    left: auto;
    right: 15px;
    bottom: auto;
    width: 100px;
    height: 140px;
    border-radius: 12px;
    z-index: 12;
    box-shadow: 0 2px 12px rgba(0,0,0,0.4);
    border: 1.5px solid rgba(255,255,255,0.1);
    cursor: pointer;
}
#layer-video-call.vidcall-swapped .vidcall-remote-name,
#layer-video-call.vidcall-swapped .vidcall-env-badge {
    display: none !important;
}
/* 交换后：本地画面铺满全屏 */
#layer-video-call.vidcall-swapped .vidcall-local-pip {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: none;
    box-shadow: none;
    z-index: 1;
}
/* 交换后小窗上的提示只显示在当前的小窗（远端）上 */
#layer-video-call:not(.vidcall-swapped) .vidcall-remote-area .vidcall-swap-hint { display: none; }
#layer-video-call.vidcall-swapped .vidcall-local-pip .vidcall-swap-hint { display: none; }

.vidcall-local-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #222;
    color: rgba(255,255,255,0.3);
    font-size: 11px;
    gap: 5px;
}
.vidcall-local-placeholder i {
    font-size: 18px;
    opacity: 0.4;
}

/* 自定义默认形象 */
.vidcall-local-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: inherit;
}
.vidcall-local-placeholder.has-avatar {
    position: relative;
}
.vidcall-local-placeholder.has-avatar #vidcall-local-placeholder-icon,
.vidcall-local-placeholder.has-avatar #vidcall-local-placeholder-text {
    display: none;
}
.vidcall-local-avatar-edit {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.vidcall-local-avatar-edit i {
    font-size: 10px !important;
    opacity: 1 !important;
    color: #fff;
}
.vidcall-local-avatar-edit:active {
    opacity: 1;
    background: rgba(0,0,0,0.8);
}

/* ===== 对话流区域 — 无底板浮于画面 ===== */
.vidcall-flow-area {
    position: absolute;
    bottom: 140px;
    left: 16px;
    right: 16px;
    max-height: 32vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0;
    z-index: 8;
    pointer-events: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.vidcall-flow-area::-webkit-scrollbar { display: none; }

/* 视频通话：底部向上的渐变暗罩，保证浮在画面上的字幕清晰 */
.vidcall-remote-area::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(0,0,0,0.6), rgba(0,0,0,0.18) 45%, transparent);
    pointer-events: none;
    z-index: 2;
}

/* ===== 语音通话：沉浸字幕对话流（复用 vc-flow-* 条目样式） ===== */
.vc-flow-area {
    position: absolute;
    /* [重构] 底部按钮改为单排贴底(70px)+输入框(84px)，对话流下沉、加高，修复"下面太窄" */
    bottom: 140px;
    left: 18px;
    right: 18px;
    max-height: 38vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 8;
    pointer-events: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.vc-flow-area::-webkit-scrollbar { display: none; }

/* 对话流条目入场动画 — 轻轻上滑淡入，避免突然出现 */
@keyframes vc-flow-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.vc-flow-action,
.vc-flow-dialogue,
.vc-flow-user,
.vc-flow-status,
.vc-flow-translate {
    animation: vc-flow-in 0.28s ease-out both;
    font-family: -apple-system, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* 对话流 — 动作描写行（神态/语气，居中、淡） */
.vc-flow-action {
    font-size: 13px;
    color: rgba(255,255,255,0.62);
    text-align: center;
    padding: 4px 6px 2px;
    text-shadow: 0 1px 5px rgba(0,0,0,0.75);
    letter-spacing: 0.2px;
    line-height: 1.5;
}

/* 对话流 — AI对话（母语主字幕，大而清晰） */
.vc-flow-dialogue {
    font-size: 17px;
    font-weight: 500;
    color: #fff;
    padding: 4px 0 0;
    max-width: 88%;
    align-self: flex-start;
    line-height: 1.5;
    text-shadow: 0 1px 8px rgba(0,0,0,0.85), 0 0 2px rgba(0,0,0,0.6);
}

/* 对话流 — 用户发言（右侧，淡一点） */
.vc-flow-user {
    font-size: 15px;
    color: rgba(255,255,255,0.72);
    padding: 6px 0 2px;
    max-width: 80%;
    align-self: flex-end;
    text-align: right;
    line-height: 1.45;
    text-shadow: 0 1px 6px rgba(0,0,0,0.7);
}

/* 对话流 — 状态消息（正在呼叫/通话中等） */
.vc-flow-status {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    text-align: center;
    padding: 4px 0;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

/* --- 旧字幕区域（兼容，隐藏） --- */
.vidcall-subtitle-area {
    display: none;
}

/* --- 实时语音识别文字 --- */
.vidcall-live-transcript {
    position: absolute;
    bottom: 200px;
    left: 10%;
    right: 10%;
    max-height: 60px;
    overflow-y: auto;
    padding: 6px 12px;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 10px;
    display: none;
    z-index: 9;
}
.vidcall-live-transcript.active {
    display: block;
}
.vidcall-live-transcript-content {
    font-size: 14px;
    color: #fff;
    line-height: 1.4;
    text-align: center;
    word-break: break-all;
}
.vidcall-live-transcript-content .interim {
    color: rgba(255,255,255,0.45);
}
.vidcall-live-transcript-content .final {
    color: #fff;
}

/* --- 文字输入区 --- */
.vidcall-text-input-area {
    position: absolute;
    bottom: 80px;
    left: 16px;
    right: 16px;
    box-sizing: border-box;
    overflow: hidden;
    background: rgba(30,30,30,0.8);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 22px;
    padding: 6px 8px 6px 14px;
    display: none;
    align-items: center;
    z-index: 10;
    gap: 8px;
}
.vidcall-text-input-area input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 15px;
    outline: none;
    padding: 6px 0;
}
.vidcall-text-input-area input::placeholder {
    color: rgba(255,255,255,0.3);
}
.vidcall-text-input-area > div {
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    flex-shrink: 0;
    padding: 6px 14px;
    background: rgba(255,255,255,0.12);
    border-radius: 16px;
    font-size: 13px;
    color: rgba(255,255,255,0.8);
    transition: background 0.15s;
}
.vidcall-text-input-area > div:active {
    background: rgba(255,255,255,0.22);
}

/* ===== 底部按钮区 — 单排 ===== */
.vidcall-ptt-area {
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    align-items: center;
    z-index: 5;
    padding: 0 20px;
    padding-bottom: env(safe-area-inset-bottom, 16px);
    width: 100%;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
}

.vidcall-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    transition: transform 0.12s, background 0.15s;
}
.vidcall-btn:active { transform: scale(0.9); }
.vidcall-btn.active { background: #fff; color: #1a1a1a; }

/* 挂断按钮 — 无波纹，纯按压反馈 */
.vidcall-btn.hangup {
    background: #e53935;
    width: 46px;
    height: 46px;
    color: #fff;
    box-shadow: none;
    position: relative;
    overflow: hidden;
}
.vidcall-btn.hangup:active {
    transform: scale(0.88);
    background: #c62828;
}
/* 移除旧版波纹动画 */
.vidcall-btn.hangup::before,
.vidcall-btn.hangup::after {
    display: none;
}

/* PTT按钮 — 同排，稍大一圈 */
.vidcall-ptt-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: 1.5px solid rgba(255,255,255,0.25);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    color: #fff;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}
.vidcall-ptt-btn:active,
.vidcall-ptt-btn.pressing {
    transform: scale(1.1);
    background: rgba(76, 217, 100, 0.35);
    border-color: rgba(76, 217, 100, 0.6);
}
.vidcall-ptt-hint {
    display: none; /* 隐藏"按住说话"文字提示，保持界面干净 */
}

/* --- 旧版挂断controls区域（兼容隐藏） --- */
.vidcall-controls {
    display: none;
}

/* --- 对话记录面板 --- */
.vidcall-log-item { margin-bottom: 10px; display: flex; flex-direction: column; }
.vidcall-log-sender { font-size: 11px; color: rgba(255,255,255,0.4); margin-bottom: 2px; }
.vidcall-log-sender.me { align-self: flex-end; }
.vidcall-log-sender.ai { align-self: flex-start; }
.vidcall-log-action { font-size: 12px; color: rgba(255,255,255,0.4); margin-bottom: 2px; }
.vidcall-log-text { font-size: 14px; color: #fff; line-height: 1.4; }
.vidcall-log-content { background: rgba(255,255,255,0.08); padding: 8px 12px; border-radius: 10px; max-width: 80%; }
.vidcall-log-item.me .vidcall-log-content { align-self: flex-end; }
.vidcall-log-item.ai .vidcall-log-content { align-self: flex-start; }

/* ===== 悬浮胶囊（最小化） ===== */
#vidcall-mini-bubble {
    touch-action: none;
}
@keyframes vc-pill-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* --- Live2D Speaking 底部指示 --- */
.vidcall-live2d-speaking {
    position: absolute;
    bottom: 70px;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255,255,255,0.4);
    animation: vc-speak-pulse 1.5s infinite;
    z-index: 3;
}
@keyframes vc-speak-pulse {
    0% { opacity: 0.2; transform: scaleX(0.4); }
    50% { opacity: 0.8; transform: scaleX(1); }
    100% { opacity: 0.2; transform: scaleX(0.4); }
}

/* --- 波形动画（说话时） --- */
.vidcall-mic-wave {
    position: absolute;
    bottom: 215px;
    left: 50%;
    transform: translateX(-50%);
    height: 30px;
    display: flex;
    align-items: center;
    gap: 3px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 6;
    pointer-events: none;
}
.vidcall-mic-wave.active { opacity: 1; }
.vidcall-mic-wave .vidcall-wave-bar {
    width: 3px;
    background: rgba(255,255,255,0.6);
    border-radius: 2px;
    animation: vidcall-wave-anim 0.5s infinite ease-in-out;
}
.vidcall-mic-wave .vidcall-wave-bar:nth-child(1) { height: 8px; animation-delay: 0.1s; }
.vidcall-mic-wave .vidcall-wave-bar:nth-child(2) { height: 16px; animation-delay: 0.2s; }
.vidcall-mic-wave .vidcall-wave-bar:nth-child(3) { height: 22px; animation-delay: 0.3s; }
.vidcall-mic-wave .vidcall-wave-bar:nth-child(4) { height: 16px; animation-delay: 0.4s; }
.vidcall-mic-wave .vidcall-wave-bar:nth-child(5) { height: 8px; animation-delay: 0.5s; }
@keyframes vidcall-wave-anim {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(2); }
}

/* --- 来电弹窗（视频通话邀请） --- */
.incoming-vidcall-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: vc-fadein 0.3s ease;
}
.incoming-vidcall-popup {
    text-align: center;
    color: #fff;
}
.incoming-vidcall-avatar {
    width: 90px;
    height: 90px;
    margin: 0 auto 15px;
    position: relative;
}
.incoming-vidcall-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.2);
}
.incoming-vidcall-avatar-pulse {
    position: absolute;
    top: -4px; left: -4px; right: -4px; bottom: -4px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.3);
    animation: vc-ring-pulse 2s infinite;
}
@keyframes vc-ring-pulse {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.2); opacity: 0; }
}
.incoming-vidcall-name {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 6px;
}
.incoming-vidcall-label {
    font-size: 13px;
    opacity: 0.6;
    margin-bottom: 40px;
}
.incoming-vidcall-buttons {
    display: flex;
    justify-content: center;
    gap: 50px;
}
.incoming-vidcall-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.incoming-vidcall-btn i {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.incoming-vidcall-btn.reject i {
    background: #e53935;
    color: #fff;
}
.incoming-vidcall-btn.accept i {
    background: #4cd964;
    color: #fff;
}
.incoming-vidcall-btn span {
    font-size: 12px;
    opacity: 0.7;
}
.incoming-vidcall-overlay.dismissing {
    animation: vc-fadeout 0.3s ease forwards;
}
@keyframes vc-fadein {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes vc-fadeout {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* --- 主题兼容 --- */
body.theme-cute .layer#layer-video-call,
body.theme-korean .layer#layer-video-call {
    background: rgba(10, 10, 10, 0.95) !important;
}

/* --- 性能优化 --- */
#vidcall-live2d-canvas {
    will-change: transform;
    image-rendering: auto;
}
.vidcall-local-pip video {
    will-change: transform;
}

/* ===== 通话记录气泡（聊天历史中）===== */
.call-record-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    white-space: nowrap;
}
.call-record-mini:active { opacity: 0.7; }
.call-record-mini .cr-icon {
    font-size: 16px;
    flex-shrink: 0;
}
.call-record-mini .cr-icon.voice { color: #4cd964; }
.call-record-mini .cr-icon.video { color: #007aff; }
.call-record-mini .cr-icon.missed { color: #e53935; }
.call-record-mini .cr-icon-svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.call-record-mini .cr-icon-svg.voice { color: #4cd964; }
.call-record-mini .cr-icon-svg.video { color: #007aff; }
.call-record-mini .cr-icon-svg.missed { color: #e53935; }
.call-record-mini .cr-text {
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 5px;
}
.call-record-mini .cr-text .cr-duration {
    font-size: 12px;
    color: #999;
    font-weight: 400;
}
.call-record-mini .cr-text .cr-missed {
    color: #e53935;
}
.call-record-mini .cr-arrow {
    font-size: 11px;
    color: #c0c0c0;
    margin-left: 2px;
    flex-shrink: 0;
}
.call-record-mini .cr-arrow-svg {
    width: 11px;
    height: 11px;
    color: #c0c0c0;
    margin-left: 2px;
    flex-shrink: 0;
}

/* 深色主题气泡 */
.bubble.me .call-record-mini .cr-text { color: #fff; }
.bubble.me .call-record-mini .cr-text .cr-duration { color: rgba(255,255,255,0.7); }
.bubble.me .call-record-mini .cr-icon.voice { color: #fff; }
.bubble.me .call-record-mini .cr-icon.video { color: #fff; }
.bubble.me .call-record-mini .cr-icon.missed { color: #ffb3b3; }
.bubble.me .call-record-mini .cr-arrow { color: rgba(255,255,255,0.5); }
.bubble.me .call-record-mini .cr-icon-svg.voice { color: #fff; }
.bubble.me .call-record-mini .cr-icon-svg.video { color: #fff; }
.bubble.me .call-record-mini .cr-icon-svg.missed { color: #ffb3b3; }
.bubble.me .call-record-mini .cr-arrow-svg { color: rgba(255,255,255,0.5); }

/* ===== 通话记录卡片式气泡 ===== */
.call-card-bubble {
    background: #fff !important;
    border: 1px solid #e8e8e8 !important;
    border-radius: 10px !important;
    padding: 0 !important;
    min-width: 160px;
    max-width: 200px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.msg-row.me .call-card-bubble {
    background: #f0f7e6 !important;
    border-color: #d4e8c0 !important;
}
.call-card {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    gap: 10px;
    cursor: pointer;
}
.call-card:active { opacity: 0.7; }
.call-card-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}
.call-card-icon.voice { background: #e8f7ef; color: #4cd964; }
.call-card-icon.video { background: #e8f0fe; color: #007aff; }
.call-card-icon.missed { background: #fde8e8; color: #e53935; }
.msg-row.me .call-card-icon.voice { background: rgba(76,217,100,0.15); color: #4cd964; }
.msg-row.me .call-card-icon.video { background: rgba(0,122,255,0.15); color: #007aff; }
.msg-row.me .call-card-icon.missed { background: rgba(229,57,53,0.15); color: #e53935; }
.call-card-info {
    flex: 1;
    min-width: 0;
}
.call-card-title {
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    line-height: 1.3;
}
.msg-row.me .call-card-title { color: #1a1a1a; }
.call-card-missed {
    color: #e53935;
    font-weight: 500;
}
.call-card-meta {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
    line-height: 1.3;
}
.msg-row.me .call-card-meta { color: #888; }
.call-card-hint {
    font-size: 11px;
    color: #007aff;
    margin-top: 3px;
    line-height: 1.2;
}
.msg-row.me .call-card-hint { color: #3d8b37; }

/* ===== 通话记录弹窗 ===== */
.call-history-popup {
    background: #fff;
    border-radius: 16px;
    width: 88%;
    max-width: 400px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
    overflow: hidden;
}
.call-history-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
    background: #fafafa;
}
.call-history-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
}
.call-history-meta {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}
.call-history-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
    background: #ebebeb;
}
.call-history-empty {
    color: #999;
    text-align: center;
    padding: 30px 20px;
    font-size: 13px;
}
.call-log-row {
    display: flex;
    margin: 8px 0;
}
.call-log-row.user { justify-content: flex-end; }
.call-log-row.contact { justify-content: flex-start; }
.call-log-bubble {
    max-width: 75%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.call-log-bubble.user {
    background: #95ec69;
    color: #000;
    border-top-right-radius: 4px;
}
.call-log-bubble.contact {
    background: #fff;
    color: #333;
    border-top-left-radius: 4px;
}
.call-log-action {
    text-align: center;
    font-size: 12px;
    color: #999;
    margin: 10px 0;
}
.call-log-system {
    text-align: center;
    font-size: 11px;
    color: #bbb;
    margin: 4px 0;
}
.call-history-footer {
    padding: 12px 20px;
    border-top: 1px solid #f0f0f0;
    text-align: center;
    flex-shrink: 0;
    background: #fafafa;
}
.call-history-close-btn {
    background: #4cd964;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 10px 40px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.call-history-close-btn:active { opacity: 0.8; }

/* --- 用户语句（旧版兼容，现在走flow） --- */
.vidcall-user-subtitle { display: none; }
.vidcall-status-text { display: none; }
.vidcall-subtitle-text { display: none; }

/* ============================================
   CALL TRANSLATE — 通话翻译相关样式
   适用于视频通话和语音通话
   ============================================ */

/* --- 翻译设置面板 --- */
.call-translate-panel {
    position: absolute;
    top: 85px;
    right: 15px;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 14px;
    padding: 16px;
    z-index: 25;
    min-width: 240px;
    color: #fff;
    font-size: 13px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.call-translate-panel select {
    appearance: none;
    -webkit-appearance: none;
    /* [FIX-下拉纯白看不清] 强制原生下拉弹层用深色配色，
       否则系统浅色主题下展开的选项是白底白字，完全看不见 */
    color-scheme: dark;
    background-color: #2b2b2e !important;
    color: #fff !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='rgba(255,255,255,0.6)'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}
.call-translate-panel select option {
    background: #2b2b2e !important;
    color: #fff !important;
}

/* --- Toggle Switch --- */
.call-translate-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.call-translate-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.call-translate-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255,255,255,0.2);
    border-radius: 24px;
    transition: 0.3s;
}
.call-translate-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}
.call-translate-switch input:checked + .call-translate-slider {
    background-color: #4cd964;
}
.call-translate-switch input:checked + .call-translate-slider:before {
    transform: translateX(20px);
}

/* --- 翻译按钮激活态 --- */
#vidcall-btn-translate.active,
#vc-btn-translate.active {
    color: #4cd964;
}

/* --- 对话流中的翻译文字（中文译文，作为母语下方的小字副行） --- */
.vc-flow-translate {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    align-self: flex-start;
    max-width: 88%;
    margin: 0 0 7px 0;
    padding: 1px 0 0;
    line-height: 1.4;
    text-shadow: 0 1px 5px rgba(0,0,0,0.7);
}

/* --- 语音通话字幕区的翻译行 --- */
.vc-subtitle-translate {
    font-size: 12px;
    color: rgba(255,255,255,0.45);
    font-style: italic;
    margin-top: 2px;
}

/* --- 通话字体变量作用域 ---
   只覆盖内容文字；计时器、按钮、图标、设置面板和输入框保留各自尺寸与颜色。 */
#layer-voice-call #vc-subtitle,
#layer-voice-call .vc-flow-dialogue,
#layer-voice-call .vc-flow-user {
    font-size: var(--vc-call-font-size);
    color: var(--vc-call-font-color);
}
#layer-voice-call .vc-flow-action,
#layer-voice-call .vc-flow-translate,
#layer-voice-call .vc-subtitle-translate {
    font-size: calc(var(--vc-call-font-size) - 2px);
    color: var(--vc-call-font-color);
}
#layer-voice-call #vc-status {
    font-size: calc(var(--vc-call-font-size) + 3px);
    color: var(--vc-call-font-color);
}
#layer-voice-call .vc-flow-status {
    font-size: calc(var(--vc-call-font-size) - 3px);
    color: var(--vc-call-font-color);
}
#layer-voice-call #vc-live-transcript-content,
#layer-voice-call #vc-live-transcript-content .interim,
#layer-voice-call #vc-live-transcript-content .final,
#layer-voice-call #vc-history-content .vc-log-text,
#layer-voice-call #vc-history-content .vc-log-action,
#layer-voice-call #vc-history-content .vc-log-sender {
    color: var(--vc-call-font-color);
}

#layer-video-call #vidcall-subtitle,
#layer-video-call #vidcall-user-subtitle,
#layer-video-call .vc-flow-dialogue,
#layer-video-call .vc-flow-user {
    font-size: var(--vidcall-font-size);
    color: var(--vidcall-font-color);
}
#layer-video-call .vc-flow-action,
#layer-video-call .vc-flow-translate {
    font-size: calc(var(--vidcall-font-size) - 2px);
    color: var(--vidcall-font-color);
}
#layer-video-call #vidcall-status {
    font-size: calc(var(--vidcall-font-size) + 3px);
    color: var(--vidcall-font-color);
}
#layer-video-call .vc-flow-status {
    font-size: calc(var(--vidcall-font-size) - 3px);
    color: var(--vidcall-font-color);
}
#layer-video-call #vidcall-live-transcript-content,
#layer-video-call #vidcall-live-transcript-content .interim,
#layer-video-call #vidcall-live-transcript-content .final {
    font-size: var(--vidcall-font-size);
    color: var(--vidcall-font-color);
}
#layer-video-call #vidcall-history-content .vidcall-log-text {
    font-size: var(--vidcall-font-size);
    color: var(--vidcall-font-color);
}
#layer-video-call #vidcall-history-content .vidcall-log-action {
    font-size: calc(var(--vidcall-font-size) - 2px);
    color: var(--vidcall-font-color);
}
#layer-video-call #vidcall-history-content .vidcall-log-sender {
    font-size: calc(var(--vidcall-font-size) - 3px);
    color: var(--vidcall-font-color);
}
