/* 人机验证遮罩 */
.hv-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(145deg, #5b4cdb 0%, #6b5ce7 35%, #4a7cf0 70%, #3d8bfd 100%);
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    --hv-cover: none;
}

.hv-cover {
    position: absolute;
    inset: 0;
    background-image: var(--hv-cover);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.hv-overlay.hv-has-cover .hv-cover {
    opacity: 1;
}

.hv-overlay.hv-has-cover::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(20, 16, 40, 0.35);
    z-index: 0;
    pointer-events: none;
}

.hv-overlay > .hv-card {
    position: relative;
    z-index: 1;
}

.hv-overlay.hv-hiding {
    animation: hvFadeOut 0.35s ease forwards;
    pointer-events: none;
}

@keyframes hvFadeOut {
    to { opacity: 0; visibility: hidden; }
}

.hv-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 20px;
    padding: 32px 28px 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    text-align: center;
    animation: hvSlideIn 0.4s ease;
}

@keyframes hvSlideIn {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.hv-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5b6ef5 0%, #7b5ce7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(91, 110, 245, 0.35);
}

.hv-icon svg {
    width: 30px;
    height: 30px;
    fill: #fff;
}

.hv-title {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
}

.hv-desc {
    margin: 0 0 24px;
    font-size: 13px;
    color: #8a8aa3;
    line-height: 1.5;
}

.hv-code-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 24px;
}

.hv-code-digit {
    width: 44px;
    height: 52px;
    border-radius: 10px;
    background: #f0f1f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: #2d2d44;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
    user-select: none;
}

.hv-label {
    margin: 0 0 12px;
    font-size: 13px;
    color: #5a5a72;
    text-align: left;
}

.hv-input-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 12px;
}

.hv-input {
    width: 44px;
    height: 52px;
    border: 2px solid #e2e4eb;
    border-radius: 10px;
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    color: #1a1a2e;
    outline: none;
    background: #fff;
    caret-color: #5b6ef5;
    transition: border-color 0.2s, box-shadow 0.2s;
    -moz-appearance: textfield;
}

.hv-input::-webkit-outer-spin-button,
.hv-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.hv-input:focus {
    border-color: #5b6ef5;
    box-shadow: 0 0 0 3px rgba(91, 110, 245, 0.15);
}

.hv-input.hv-error {
    border-color: #f56565;
    animation: hvShake 0.4s ease;
}

@keyframes hvShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

.hv-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 20px;
    padding: 0;
    border: none;
    background: none;
    color: #5b6ef5;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}

.hv-refresh:hover {
    color: #4a5ad4;
}

.hv-refresh svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.hv-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hv-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.15s, opacity 0.15s, box-shadow 0.15s;
}

.hv-btn:active {
    transform: scale(0.98);
}

.hv-btn-primary {
    background: linear-gradient(135deg, #6b5ce7 0%, #4a7cf0 100%);
    color: #fff;
    box-shadow: 0 6px 20px rgba(74, 124, 240, 0.35);
}

.hv-btn-primary:hover {
    opacity: 0.95;
}

.hv-btn-primary svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.hv-btn-secondary {
    background: #fff;
    color: #6a6a82;
    border: 1.5px solid #e2e4eb;
}

.hv-btn-secondary:hover {
    background: #f8f8fb;
}

.hv-btn-secondary svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.hv-tip {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #f0f1f5;
    font-size: 11px;
    color: #a0a0b8;
    line-height: 1.5;
    text-align: left;
}

.hv-tip svg {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    fill: #b0b0c8;
    margin-top: 1px;
}

@media (max-width: 400px) {
    .hv-card {
        padding: 28px 18px 20px;
    }

    .hv-code-digit,
    .hv-input {
        width: 40px;
        height: 48px;
        font-size: 20px;
    }

    .hv-code-row,
    .hv-input-row {
        gap: 6px;
    }
}
