.xn-voice-captcha {
    margin-bottom: 1rem;
}

.xn-voice-target {
    width: 100%;
}

.xn-voice-trigger {
    position: relative;
    display: block;
    width: 100%;
    min-height: 50px;
    padding: 8px 52px 8px 48px;
    border: 1px solid #d7dce5;
    border-left: 4px solid #4f7cff;
    border-radius: 4px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
    color: #1f2937;
    text-align: left;
    cursor: pointer;
    outline: none;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    -webkit-tap-highlight-color: transparent;
}

.xn-voice-trigger:active {
    background: #f5f8ff;
}

.xn-voice-trigger-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    width: 22px;
    height: 22px;
    margin-top: -11px;
    border: 2px solid #4f7cff;
    border-radius: 50%;
    color: #4f7cff;
    font-size: 13px;
    line-height: 18px;
    text-align: center;
    font-weight: 700;
}

.xn-voice-trigger-main {
    display: block;
    font-size: 14px;
    line-height: 18px;
    font-weight: 600;
}

.xn-voice-trigger-sub {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    line-height: 16px;
    color: #8a94a6;
}

.xn-voice-trigger:after {
    content: '›';
    position: absolute;
    right: 18px;
    top: 50%;
    margin-top: -16px;
    color: #a8b1c2;
    font-size: 32px;
    line-height: 32px;
}

.xn-voice-trigger.is-success {
    border-color: #22c55e;
    border-left-color: #22c55e;
    background: linear-gradient(180deg, #f1fff4 0%, #ecfdf3 100%);
    color: #16803a;
}

.xn-voice-trigger.is-success .xn-voice-trigger-icon {
    border-color: #22c55e;
    color: #22c55e;
}

.xn-voice-trigger.is-success .xn-voice-trigger-icon:before {
    content: '✓';
}

.xn-voice-trigger.is-success .xn-voice-trigger-icon {
    font-size: 0;
}

.xn-voice-trigger.is-success .xn-voice-trigger-icon:before {
    font-size: 14px;
    line-height: 18px;
}

.xn-voice-trigger.is-success .xn-voice-trigger-sub,
.xn-voice-trigger.is-success:after {
    color: #5fbf7d;
}

.xn-voice-trigger.is-error {
    border-left-color: #ef4444;
}

.xn-voice-mask {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    padding: 24px 14px;
    background: rgba(15, 23, 42, 0.46);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.xn-voice-mask.is-open {
    display: block;
}

.xn-voice-dialog {
    position: relative;
    width: 100%;
    max-width: 360px;
    margin: 8vh auto 0;
    padding: 28px 20px 20px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.24);
    text-align: center;
}

.xn-voice-close {
    position: absolute;
    right: 10px;
    top: 8px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #8a94a6;
    font-size: 24px;
    line-height: 28px;
    cursor: pointer;
}

.xn-voice-dialog-icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f7cff 0%, #3bc7ff 100%);
    color: #fff;
    font-size: 28px;
    line-height: 58px;
    font-weight: 700;
    box-shadow: 0 10px 22px rgba(79, 124, 255, 0.25);
}

.xn-voice-dialog-title {
    color: #111827;
    font-size: 18px;
    line-height: 24px;
    font-weight: 700;
}

.xn-voice-dialog-desc {
    margin: 6px 0 16px;
    color: #6b7280;
    font-size: 13px;
    line-height: 20px;
}

.xn-voice-play,
.xn-voice-check,
.xn-voice-refresh {
    display: block;
    width: 100%;
    height: 42px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 40px;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
}

.xn-voice-play {
    border: 1px solid #4f7cff;
    background: #4f7cff;
    color: #fff;
    font-weight: 600;
}

.xn-voice-play.is-speaking {
    background: #315fd6;
}

.xn-voice-input {
    display: block;
    width: 100%;
    height: 44px;
    margin: 12px 0;
    padding: 0 12px;
    border: 1px solid #d7dce5;
    border-radius: 6px;
    background: #fff;
    color: #111827;
    font-size: 20px;
    line-height: 42px;
    text-align: center;
    letter-spacing: 6px;
    outline: none;
    box-sizing: border-box;
    -webkit-appearance: none;
}

.xn-voice-input:focus {
    border-color: #4f7cff;
    box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.13);
}

.xn-image-panel {
    display: none;
    margin: 14px 0 12px;
}

.xn-image-card {
    padding: 14px;
    border: 1px solid rgba(99, 102, 241, 0.16);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 255, 0.96) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 10px 24px rgba(15, 23, 42, 0.07);
}

.xn-image-tip {
    margin-bottom: 10px;
    color: #334155;
    font-size: 13px;
    line-height: 18px;
    font-weight: 600;
    text-align: left;
}

.xn-image-order {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.xn-image-order-step {
    position: relative;
    min-width: 34px;
    height: 32px;
    padding: 0 10px 0 24px;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    background: #fff;
    color: #2563eb;
    font-size: 15px;
    line-height: 30px;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.08);
    box-sizing: border-box;
}

.xn-image-order-step:before {
    content: attr(data-step);
    position: absolute;
    left: 7px;
    top: 50%;
    width: 14px;
    height: 14px;
    margin-top: -7px;
    border-radius: 50%;
    background: #e0ecff;
    color: #2563eb;
    font-size: 10px;
    line-height: 14px;
    text-align: center;
    font-weight: 700;
}

.xn-image-order-step.is-current {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.xn-image-order-step.is-done {
    border-color: #22c55e;
    background: #ecfdf3;
    color: #15803d;
}

.xn-image-order-step.is-done:before {
    content: '✓';
    background: #22c55e;
    color: #fff;
}

.xn-image-progress {
    min-height: 28px;
    margin-bottom: 10px;
    padding: 7px 10px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #475569;
    font-size: 13px;
    line-height: 18px;
    text-align: left;
}

.xn-image-progress.is-error {
    background: #fff1f2;
    color: #e11d48;
}

.xn-image-progress.is-success {
    background: #ecfdf3;
    color: #15803d;
}

.xn-image-board {
    position: relative;
    height: 172px;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    background:
        radial-gradient(circle at 16% 20%, rgba(96, 165, 250, 0.20) 0, rgba(96, 165, 250, 0.20) 13px, transparent 14px),
        radial-gradient(circle at 82% 24%, rgba(45, 212, 191, 0.16) 0, rgba(45, 212, 191, 0.16) 16px, transparent 17px),
        radial-gradient(circle at 34% 78%, rgba(251, 191, 36, 0.18) 0, rgba(251, 191, 36, 0.18) 15px, transparent 16px),
        linear-gradient(135deg, #f8fbff 0%, #eef6ff 48%, #f8fafc 100%);
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.xn-image-board:before,
.xn-image-board:after {
    content: '';
    position: absolute;
    left: -8%;
    right: -8%;
    border-top: 1px dashed rgba(148, 163, 184, 0.42);
    pointer-events: none;
}

.xn-image-board:before {
    top: 34%;
    transform: rotate(-6deg);
}

.xn-image-board:after {
    top: 70%;
    transform: rotate(5deg);
}

.xn-image-board.is-shaking {
    animation: xnImageShake 0.22s ease-in-out;
}

.xn-image-board.is-complete {
    border-color: rgba(34, 197, 94, 0.56);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 0 0 3px rgba(34, 197, 94, 0.12);
}

.xn-image-letter {
    position: absolute;
    z-index: 1;
    width: 44px;
    height: 44px;
    margin: -22px 0 0 -22px;
    border: 1px solid rgba(37, 99, 235, 0.35);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    color: #1d4ed8;
    font-size: 20px;
    line-height: 42px;
    font-weight: 800;
    text-align: center;
    box-shadow: 0 9px 18px rgba(15, 23, 42, 0.14);
    cursor: pointer;
    outline: none;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, background 0.12s ease;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
}

.xn-image-letter:hover {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.20);
}

.xn-image-letter:active {
    box-shadow: 0 5px 12px rgba(15, 23, 42, 0.16);
}

.xn-image-letter.is-picked {
    border-color: #22c55e;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    box-shadow: 0 10px 18px rgba(34, 197, 94, 0.24);
}

.xn-image-letter.is-picked:after {
    content: attr(data-picked-index);
    position: absolute;
    right: -7px;
    top: -7px;
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #0f172a;
    color: #fff;
    font-size: 11px;
    line-height: 16px;
    font-weight: 800;
    box-sizing: border-box;
}

.xn-image-letter:disabled {
    cursor: not-allowed;
}

.xn-image-picked {
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #ffffff;
    color: #64748b;
    font-size: 13px;
    line-height: 18px;
    text-align: left;
}

.xn-image-picked span {
    color: #0f172a;
    font-weight: 700;
}

@keyframes xnImageShake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-4px);
    }
    75% {
        transform: translateX(4px);
    }
}

.xn-voice-check {
    border: 1px solid #22c55e;
    background: #22c55e;
    color: #fff;
    font-weight: 600;
}

.xn-voice-refresh {
    margin-top: 10px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #4b5563;
}

.xn-voice-play:disabled,
.xn-voice-check:disabled,
.xn-voice-refresh:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.xn-voice-msg {
    min-height: 20px;
    margin-top: 12px;
    font-size: 13px;
    line-height: 20px;
}

.xn-voice-msg.is-muted {
    color: #6b7280;
}

.xn-voice-msg.is-error {
    color: #ef4444;
}

.xn-voice-msg.is-success {
    color: #16a34a;
}

@media (max-width: 480px) {
    .xn-voice-mask {
        padding: 12px;
    }

    .xn-voice-dialog {
        margin-top: 6vh;
        padding: 26px 14px 18px;
        border-radius: 12px;
    }

    .xn-voice-trigger {
        min-height: 52px;
    }

    .xn-image-card {
        padding: 12px;
    }

    .xn-image-order {
        gap: 6px;
    }

    .xn-image-order-step {
        height: 30px;
        padding-right: 9px;
        font-size: 14px;
        line-height: 28px;
    }

    .xn-image-board {
        height: 188px;
    }

    .xn-image-letter {
        width: 46px;
        height: 46px;
        margin: -23px 0 0 -23px;
        border-radius: 15px;
        font-size: 21px;
        line-height: 44px;
    }
}
