/* 多语言语音聊天智能体：录音电话/麦克风动画 */
.recording-indicator[hidden] { display: none !important; }

.recording-indicator {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(3, 10, 28, .72);
    backdrop-filter: blur(9px);
    -webkit-backdrop-filter: blur(9px);
}

.recording-phone {
    position: relative;
    width: min(88vw, 330px);
    min-height: 410px;
    padding: 34px 24px 28px;
    overflow: hidden;
    text-align: center;
    color: #fff;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 42px;
    background: linear-gradient(165deg, rgba(39,53,91,.98), rgba(11,18,42,.98));
    box-shadow: 0 28px 80px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.18);
}

.recording-phone::before {
    content: "";
    position: absolute;
    top: 12px;
    left: 50%;
    width: 92px;
    height: 7px;
    border-radius: 999px;
    background: rgba(0,0,0,.55);
    transform: translateX(-50%);
}

.recording-label {
    margin: 10px 0 16px;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: .08em;
}

.recording-mic-wrap {
    position: relative;
    display: grid;
    place-items: center;
    width: 150px;
    height: 150px;
    margin: 8px auto 18px;
}

.recording-pulse,
.recording-pulse::before,
.recording-pulse::after {
    position: absolute;
    inset: 0;
    content: "";
    border: 2px solid rgba(255, 82, 110, .72);
    border-radius: 50%;
    animation: recordingPulse 1.8s ease-out infinite;
}
.recording-pulse::before { animation-delay: .45s; }
.recording-pulse::after { animation-delay: .9s; }

.recording-mic {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 92px;
    height: 92px;
    font-size: 48px;
    border-radius: 50%;
    background: linear-gradient(145deg, #ff3d62, #b81f48);
    box-shadow: 0 12px 35px rgba(255, 49, 92, .42);
    animation: micBeat .9s ease-in-out infinite alternate;
}

.recording-timer {
    font-size: 2rem;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.recording-hint {
    min-height: 1.5em;
    margin: 8px 0 18px;
    color: #dbe5ff;
    font-size: 1rem;
}

.recording-wave {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 46px;
    margin-bottom: 18px;
}
.recording-wave span {
    width: 5px;
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(#71d8ff, #8f63ff);
    animation: voiceWave .8s ease-in-out infinite alternate;
}
.recording-wave span:nth-child(2) { animation-delay: .10s; }
.recording-wave span:nth-child(3) { animation-delay: .20s; }
.recording-wave span:nth-child(4) { animation-delay: .30s; }
.recording-wave span:nth-child(5) { animation-delay: .40s; }
.recording-wave span:nth-child(6) { animation-delay: .50s; }
.recording-wave span:nth-child(7) { animation-delay: .60s; }

.recording-release {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 22px;
    border-radius: 999px;
    background: linear-gradient(90deg, #477cff, #8b55ff);
    box-shadow: 0 10px 28px rgba(83, 91, 255, .35);
    font-weight: 800;
}


/*
 * 录音绿色椭圆直接画在“松开按钮结束录音”本身。
 * 不再使用 position:fixed + getBoundingClientRect() 的独立浮层，
 * 因而不受微信内置浏览器、Chrome 地址栏高度和 visualViewport 差异影响。
 */
.recording-release {
    position: relative;
    isolation: isolate;
    border: 4px solid #23d66f !important;
    background: linear-gradient(90deg, rgba(35,214,111,.20), rgba(42,120,255,.72), rgba(139,85,255,.82));
    box-shadow: 0 0 0 2px rgba(35,214,111,.18),
                0 0 30px rgba(35,214,111,.58),
                0 10px 28px rgba(83,91,255,.35);
    animation: recordingRingGlow 1s ease-in-out infinite alternate;
}

.recording-release::before {
    content: "";
    position: absolute;
    inset: -10px -14px;
    z-index: -1;
    border: 2px solid rgba(35,214,111,.50);
    border-radius: 999px;
    pointer-events: none;
}

@keyframes recordingRingGlow {
    from { box-shadow: 0 0 0 2px rgba(35,214,111,.16), 0 0 18px rgba(35,214,111,.34), 0 10px 28px rgba(83,91,255,.30); }
    to { box-shadow: 0 0 0 3px rgba(35,214,111,.26), 0 0 38px rgba(35,214,111,.72), 0 10px 30px rgba(83,91,255,.42); }
}

/* 禁止提示文字、按钮文字、标题等被长按选择/复制。 */
.voice-page,
.recording-indicator,
.voice-page button,
.voice-page label,
.voice-page .status,
.voice-page .empty,
.voice-page h1,
.voice-page h2,
.voice-page p,
.voice-page th,
.voice-page td,
.recording-phone,
.recording-phone * {
    -webkit-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important;
}

/* 只有语音识别原文和译文允许选择、复制。 */
.voice-page textarea.original,
.voice-page textarea.translation {
    -webkit-user-select: text !important;
    user-select: text !important;
    -webkit-touch-callout: default !important;
}

/* 防止 iPhone 长按录音按钮出现文字选择手柄、绿色选择框或按钮位移。 */
#recordBtn,
#recordBtn.recording,
#recordBtn:active,
#recordBtn:focus,
#recordBtn:focus-visible {
    -webkit-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important;
    touch-action: none !important;
    transform: none !important;
    translate: none !important;
    outline: none !important;
}

@keyframes recordingPulse {
    0% { transform: scale(.62); opacity: .85; }
    100% { transform: scale(1.16); opacity: 0; }
}
@keyframes micBeat {
    from { transform: scale(.96); }
    to { transform: scale(1.05); }
}
@keyframes voiceWave {
    from { height: 10px; opacity: .55; }
    to { height: 42px; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .recording-pulse, .recording-pulse::before, .recording-pulse::after,
    .recording-mic, .recording-wave span { animation: none; }
}
