/* 按住说话 · 录音态 UI（用户端 / 商家端共用） */
.voice-file-input-hidden {
    position: fixed;
    left: -9999px;
    top: 0;
    width: 1px;
    height: 1px;
    opacity: 0.01;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    padding: 0;
    margin: 0;
}
.voice-http-tip {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    z-index: 9999;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
    font-size: 13px;
    line-height: 1.45;
    border-radius: 12px;
    text-align: center;
    pointer-events: none;
}
.voice-http-tip a { color: #7ecbff; font-weight: 600; text-decoration: underline; }

.xiaolin-voice-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    z-index: 9998;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #1a5fb4 0%, #3584e4 100%);
    color: #fff;
    font-size: 13px;
    line-height: 1.45;
    box-shadow: 0 -2px 16px rgba(0,0,0,0.15);
}
.xiaolin-voice-banner-text { flex: 1; min-width: 0; }
.xiaolin-voice-banner-text a { color: #fff; font-weight: 700; text-decoration: underline; }
.xiaolin-voice-banner-close {
    border: none;
    background: rgba(255,255,255,0.2);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
    cursor: pointer;
}

.recording-cancel-tip {
    display: none;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) scale(0.92);
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 20px;
    color: #fff;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0.75;
    transition: 0.2s;
    pointer-events: none;
    z-index: 10;
}
.recording-cancel-tip svg { width: 18px; height: 18px; flex-shrink: 0; }
.input-area.is-recording .recording-cancel-tip { display: flex; }
.input-area.is-recording-cancel .recording-cancel-tip {
    opacity: 1;
    transform: translateX(-50%) scale(1.08);
    background: rgba(255, 59, 48, 0.92);
}
.recording-panel {
    display: none;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 36px;
    flex-wrap: wrap;
}
.wave-bars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 28px;
}
.wave-bars span {
    display: block;
    width: 3px;
    height: 10px;
    background: var(--surface);
    border-radius: 2px;
    animation: voiceWave 0.55s ease-in-out infinite;
}
.wave-bars span:nth-child(1) { animation-delay: 0s; }
.wave-bars span:nth-child(2) { animation-delay: 0.08s; }
.wave-bars span:nth-child(3) { animation-delay: 0.16s; }
.wave-bars span:nth-child(4) { animation-delay: 0.24s; }
.wave-bars span:nth-child(5) { animation-delay: 0.32s; }
.wave-bars span:nth-child(6) { animation-delay: 0.24s; }
.wave-bars span:nth-child(7) { animation-delay: 0.16s; }
.wave-bars span:nth-child(8) { animation-delay: 0.08s; }
@keyframes voiceWave {
    0%, 100% { height: 8px; opacity: 0.65; }
    50% { height: 26px; opacity: 1; }
}
.recording-hint {
    font-size: 15px;
    color: #fff;
    font-weight: 500;
    white-space: nowrap;
}
.recording-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.recording-btn {
    border: none;
    border-radius: 18px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.recording-btn-cancel {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}
.recording-btn-send {
    background: #fff;
    color: #007AFF;
}
.input-area.is-recording-cancel .recording-btn-send {
    color: #FF3B30;
    opacity: 0.45;
    pointer-events: none;
}
.input-area.is-recording .input-bar-shell {
    background: #007AFF;
    box-shadow: 0 2px 12px rgba(0, 122, 255, 0.35);
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: background 0.2s, box-shadow 0.2s;
}
.input-area.is-recording-cancel .input-bar-shell {
    background: #FF3B30;
    box-shadow: 0 2px 12px rgba(255, 59, 48, 0.35);
}
.input-area.is-recording-cancel .input-bar-shell::before,
.input-area.is-recording-cancel .input-bar-shell::after {
    border-color: rgba(255, 255, 255, 0.5);
}
.input-area.is-recording .input-bar-shell::before,
.input-area.is-recording .input-bar-shell::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 28px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    animation: voiceRipple 1.2s ease-out infinite;
    pointer-events: none;
}
.input-area.is-recording .input-bar-shell::after {
    animation-delay: 0.6s;
}
@keyframes voiceRipple {
    0% { transform: scale(1); opacity: 0.55; }
    100% { transform: scale(1.08); opacity: 0; }
}
.input-area.is-recording .mode-toggle,
.input-area.is-recording .input-wrapper,
.input-area.is-recording .send-btn,
.input-area.is-recording .camera-btn,
.input-area.is-recording .plus-btn {
    display: none !important;
}
.voice-toggle-cancel {
    display: none;
    flex-shrink: 0;
    border: none;
    border-radius: 999px;
    padding: 0 14px;
    height: 34px;
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    align-items: center;
    justify-content: center;
    z-index: 3;
}
/* 安卓点击开关录音：保留中间按钮 + 左侧取消 */
.input-area.voice-toggle-mic.is-recording .voice-toggle-cancel {
    display: flex !important;
}
.input-area.voice-toggle-mic.is-recording .input-wrapper {
    display: flex !important;
    flex: 1;
    z-index: 2;
}
.input-area.voice-toggle-mic.is-recording .hold-to-speak {
    display: flex !important;
    color: #fff;
    font-weight: 700;
}
.input-area.voice-toggle-mic.is-recording .recording-panel,
.input-area.voice-toggle-mic.is-recording .recording-cancel-tip {
    display: none !important;
}
.input-area.voice-toggle-mic.is-recording .mode-toggle,
.input-area.voice-toggle-mic.is-recording .camera-btn,
.input-area.voice-toggle-mic.is-recording .plus-btn,
.input-area.voice-toggle-mic.is-recording .send-btn {
    display: none !important;
}
.input-area.is-recording .recording-panel {
    display: flex;
}
.input-area.voice-file-capture .hold-to-speak {
    color: var(--primary);
    cursor: pointer;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: rgba(232, 131, 90, 0.15);
}
.input-area.voice-file-capture .hold-to-speak-text {
    pointer-events: none;
    user-select: none;
}
.input-area.voice-file-capture .recording-cancel-tip {
    display: none !important;
}
