/* 长按语音极简反馈层。
 * 复用项目已有视觉：
 *   - 中间圆：Agentmaster 悬浮球（#agent-orb）同款深蓝底 + 青边 + 绿色发光；
 *   - 底部弧型：0_zhuyeyangshi.css 的 .result / 侧边栏同款深蓝半透明 + 绿色发光；
 *   - 取消 / 编辑：主页 .cyber-button 样式。
 * 不做全屏 blur、麦克风动效、波形、计时。 */

.voice-gesture {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 140ms ease, visibility 140ms ease;
}

.voice-gesture.is-open {
    opacity: 1;
    visibility: visible;
}

/* 只有上滑选择时出现的轻微遮罩：从底部到 61.8% 屏高。 */
.voice-gesture__mask {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 61.8%;
    background: linear-gradient(to top, rgba(0, 20, 40, 0.58), rgba(0, 20, 40, 0.22) 70%, rgba(0, 20, 40, 0));
    opacity: 0;
    transition: opacity 160ms ease;
    pointer-events: none;
}

.voice-gesture__mask::after {
    content: "";
    position: absolute;
    left: 8%;
    right: 8%;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(64, 224, 255, 0.35), transparent);
    box-shadow: 0 0 10px rgba(12, 153, 134, 0.55);
}

.voice-gesture.is-choosing .voice-gesture__mask {
    opacity: 1;
}

/* 录音时底部的绿色发光弧型，视觉对齐 .result / 侧边栏。 */
.voice-gesture__arc {
    position: absolute;
    left: -24%;
    right: -24%;
    bottom: -4vh;
    height: 20vh;
    min-height: 140px;
    border-radius: 50% 50% 0 0 / 11vh 11vh 0 0;
    background:
        radial-gradient(120% 80% at 50% 100%, rgba(12, 153, 134, 0.22), rgba(12, 153, 134, 0) 62%),
        linear-gradient(to top, rgba(0, 20, 40, 0.82), rgba(0, 20, 40, 0.5) 60%, rgba(0, 20, 40, 0.08));
    border-top: 1px solid rgba(64, 224, 255, 0.1);
    /* 与左侧边栏默认态一致的 4px 模糊虚化 */
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow:
        0 -8px 30px rgba(12, 153, 134, 0.45),
        inset 0 0 24px rgba(64, 224, 255, 0.04);
    opacity: 0;
    transition: opacity 160ms ease;
    pointer-events: none;
}

.voice-gesture__arc::after {
    content: "";
    position: absolute;
    left: 14%;
    right: 14%;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(64, 224, 255, 0.16), transparent);
    box-shadow: 0 0 22px rgba(12, 153, 134, 0.55);
}

.voice-gesture.is-open .voice-gesture__arc {
    opacity: 1;
}

/* 正中间的圆与实时文字。 */
.voice-gesture__center {
    position: absolute;
    left: 50%;
    top: 45%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: min(86vw, 460px);
    pointer-events: none;
}

.voice-gesture__orb {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 1px solid rgba(64, 224, 255, 0.15);
    background: rgba(0, 20, 40, 0.4);
    box-shadow:
        inset 0 0 15px rgba(64, 224, 255, 0.05),
        0 0 16px rgba(12, 153, 134, 0.72),
        0 0 32px rgba(12, 153, 134, 0.35);
}


.voice-gesture__transcript {
    width: fit-content;
    max-width: 100%;
    min-height: 1.6em;
    margin: 0;
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid rgba(64, 224, 255, 0.12);
    background: rgba(0, 20, 40, 0.28);
    box-shadow:
        inset 0 0 15px rgba(64, 224, 255, 0.05),
        0 0 10px rgba(12, 153, 134, 0.25);
    font-size: 15px;
    line-height: 1.6;
    font-weight: 500;
    text-align: center;
    color: var(--text, #ecf0f1);
    text-shadow: 0 0 8px rgba(12, 153, 134, 0.35);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.voice-gesture.is-preparing .voice-gesture__transcript,
.voice-gesture.is-transcribing .voice-gesture__transcript {
    color: rgba(236, 240, 241, 0.7);
}

.voice-gesture.is-transcript .voice-gesture__transcript {
    color: #ecf0f1;
}

/* 取消 / 编辑：使用主页 .cyber-button，不再自创气泡。 */
.voice-gesture__choices {
    position: absolute;
    left: 50%;
    bottom: calc(30px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%) translateY(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    opacity: 0;
    transition: opacity 160ms ease, transform 160ms ease;
    pointer-events: none;
    z-index: 3;
}

.voice-gesture.is-choosing .voice-gesture__choices {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.voice-gesture__choice {
    top: 0;
    min-width: 118px;
    height: 46px;
    padding: 0 20px;
    font-size: 0.95rem;
    letter-spacing: 0.14em;
    border-radius: 6px;
    background: rgba(0, 20, 40, 0.35);
    opacity: 0.55;
}

.voice-gesture__choice.is-active {
    border-color: var(--primary-clr);
    background: rgba(46, 204, 113, 0.1);
    color: #fff;
    opacity: 1;
    text-shadow: 0 0 4px #fff;
    box-shadow: 0 0 18px var(--glow-clr), inset 0 0 10px var(--glow-clr);
    transform: translateY(-2px);
}

@media (max-width: 420px) {
    .voice-gesture__orb {
        width: 58px;
        height: 58px;
    }

    .voice-gesture__choice {
        min-width: 108px;
        height: 44px;
        font-size: 0.9rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .voice-gesture,
    .voice-gesture__mask,
    .voice-gesture__arc,
    .voice-gesture__choices {
        transition: none;
    }
}
