/* 口语对话 —— 只做视觉层，DOM 契约与 JS 逻辑不变 */

.call-card { padding: 20px 16px 18px; }

/* ---------- AI 卡通伙伴 ---------- */
.ai-avatar {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    margin-bottom: 14px;
    min-height: 178px;
}

.ai-avatar img {
    position: relative;
    z-index: 1;
    width: 168px;
    height: 168px;
    border-radius: 24px;
    object-fit: cover;
    object-position: center top;
    background: transparent;
    box-shadow: 0 14px 32px -14px rgba(99, 102, 241, .55);
    animation: talkie-breathe 3.6s ease-in-out infinite;
    will-change: transform;
}

/* 说话时的光晕环（JS 加 .speaking） */
.avatar-glow {
    position: absolute;
    z-index: 0;
    bottom: 12px;
    left: 50%;
    width: 150px;
    height: 150px;
    margin-left: -75px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, .38), rgba(99, 102, 241, 0) 70%);
    opacity: 0;
    pointer-events: none;
}

.ai-avatar.speaking img {
    animation: talkie-speak 1.1s ease-in-out infinite;
}

.ai-avatar.speaking .avatar-glow {
    animation: talkie-glow 1.1s ease-out infinite;
}

@keyframes talkie-breathe {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-4px) scale(1.015); }
}

@keyframes talkie-speak {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-6px) scale(1.06); }
}

@keyframes talkie-glow {
    0% { opacity: .9; transform: scale(.85); }
    100% { opacity: 0; transform: scale(1.45); }
}

@media (prefers-reduced-motion: reduce) {
    .ai-avatar img, .ai-avatar.speaking img,
    .ai-avatar.speaking .avatar-glow { animation: none; }
}

/* ---------- 对话区 ---------- */
.chat-bubbles {
    height: 220px;
    overflow-y: auto;
    overscroll-behavior: contain;
    text-align: left;
    padding: 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r);
    margin-bottom: 12px;
}

.bubble {
    margin: 8px 0;
    padding: 11px 14px;
    border-radius: 16px;
    max-width: 82%;
    font-size: 14.5px;
    line-height: 1.55;
    word-break: break-word;
    animation: talkie-bubble-in .25s var(--ease) both;
}

@keyframes talkie-bubble-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.bubble.ai {
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom-left-radius: 6px;
    color: var(--text);
    margin-right: auto;
    box-shadow: var(--sh-sm);
}

.bubble.user {
    background: var(--grad);
    color: #fff;
    border-bottom-right-radius: 6px;
    margin-left: auto;
    box-shadow: 0 10px 22px -14px rgba(99, 102, 241, .9);
}

/* ---------- 状态与控件 ---------- */
.asr-status {
    margin: 0 0 14px;
    padding: 9px 12px;
    border-radius: var(--r-sm);
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text-3);
    min-height: 20px;
}

.call-controls {
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    align-items: center;
    gap: 10px;
}

.timer-pill {
    padding: 7px 12px;
    border-radius: var(--r-pill);
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-2);
    white-space: nowrap;
}

#record-btn {
    background: var(--danger);
    box-shadow: 0 10px 22px -12px rgba(239, 68, 68, .65);
    /* iOS 长按会弹"拷贝/选择"系统菜单（pointerdown preventDefault 挡不住），必须 CSS 关 */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: none;   /* 按住时不触发页面滚动/缩放手势 */
}

#record-btn.recording {
    background: var(--danger-text);
    animation: talkie-rec-pulse 1.4s ease-in-out infinite;
}

@keyframes talkie-rec-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .35); }
    50% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
}

#end-call { box-shadow: none; }

/* ---------- 文本降级输入 ---------- */
.text-input-area {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--border-strong);
}

.text-input-area input {
    width: 100%;
    padding: 12px 14px;
}

#send-text {
    margin-top: 10px;
    width: 100%;
    max-width: 200px;
}

/* ---------- 通话报告 ---------- */
.report-card { text-align: left; }

#report-content {
    font-size: 15px;
    line-height: 1.75;
    margin-bottom: 18px;
    color: var(--text);
}

#report-content h3 {
    margin: 22px 0 10px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--brand);
}

.report-item {
    padding: 14px 15px;
    margin-bottom: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r);
    border-left: 4px solid var(--brand);
}

.report-original {
    font-size: 14px;
    color: var(--text-2);
    margin-bottom: 4px;
    word-break: break-word;
}

.report-correction {
    font-size: 14px;
    color: var(--success);
    font-weight: 600;
    margin-bottom: 4px;
    word-break: break-word;
}

.report-note {
    font-size: 12.5px;
    color: var(--text-3);
    font-style: italic;
    line-height: 1.6;
}

#report-area button { width: 100%; max-width: 240px; margin: 0 auto; display: block; }

/* ---------- 移动端 ---------- */
@media (max-width: 600px) {
    .ai-avatar { min-height: 150px; }
    .ai-avatar img { width: 140px; height: 140px; }
    .avatar-glow { width: 124px; height: 124px; margin-left: -62px; }
    .chat-bubbles { height: 200px; padding: 12px; }
    .call-controls { grid-template-columns: 1fr 1fr; }
    .timer-pill { grid-column: 1 / -1; justify-self: center; }
    .bubble { max-width: 88%; }
}
