/* SmartCaptcha v3 - 智能人机验证样式 */

/* ==================== 触发按钮 ==================== */
.smart-captcha {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
}

.sc-wrapper {
    position: relative;
}

.sc-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 1.5px solid rgba(37, 99, 235, 0.25);
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.04);
    cursor: pointer;
    transition: all 0.25s ease;
    user-select: none;
    -webkit-user-select: none;
}

.sc-trigger:hover {
    border-color: rgba(37, 99, 235, 0.45);
    background: rgba(37, 99, 235, 0.08);
}

.sc-trigger:focus-visible {
    outline: 2px solid #2563EB;
    outline-offset: 2px;
}

.sc-trigger-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    color: #2563EB;
}

.sc-trigger-icon svg {
    width: 100%;
    height: 100%;
}

.sc-trigger-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: rgba(148, 163, 184, 0.9);
    letter-spacing: 0.3px;
}

.sc-trigger-arrow {
    width: 18px;
    height: 18px;
    color: rgba(148, 163, 184, 0.5);
    transition: transform 0.2s ease;
}

.sc-trigger:hover .sc-trigger-arrow {
    transform: translateX(3px);
    color: rgba(148, 163, 184, 0.8);
}

.sc-trigger-arrow svg {
    width: 100%;
    height: 100%;
}

/* ==================== 验证成功 ==================== */
.sc-success {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 1.5px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    background: rgba(16, 185, 129, 0.06);
}

.sc-success-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    color: #10B981;
}

.sc-success-icon svg {
    width: 100%;
    height: 100%;
}

.sc-success-text {
    font-size: 14px;
    font-weight: 500;
    color: #10B981;
}

/* ==================== 弹窗遮罩 ==================== */
.sc-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: scOverlayIn 0.25s ease;
}

.sc-overlay-closing {
    animation: scOverlayOut 0.2s ease forwards;
}

@keyframes scOverlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scOverlayOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* ==================== 验证卡片 ==================== */
.sc-card {
    background: rgba(30, 41, 59, 0.97);
    border: 1px solid rgba(37, 99, 235, 0.15);
    border-radius: 16px;
    padding: 20px;
    width: 340px;
    max-width: 92vw;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 80px rgba(37, 99, 235, 0.08);
    animation: scCardIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.sc-overlay-closing .sc-card {
    animation: scCardOut 0.2s ease forwards;
}

@keyframes scCardIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.sc-card-success {
    border-color: rgba(16, 185, 129, 0.3);
}

.sc-card-fail {
    border-color: rgba(239, 68, 68, 0.3);
    animation: scCardShake 0.4s ease;
}

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

/* ==================== 卡片头部 ==================== */
.sc-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.sc-card-header span {
    flex: 1;
}

.sc-click-target-text {
    color: #3B82F6;
    letter-spacing: 4px;
    font-size: 16px;
}

.sc-card-close,
.sc-card-refresh {
    width: 30px;
    height: 30px;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(148, 163, 184, 0.7);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.sc-card-close:hover,
.sc-card-refresh:hover {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
}

.sc-card-close svg,
.sc-card-refresh svg {
    width: 16px;
    height: 16px;
}

/* ==================== 点选区域 ==================== */
.sc-click-area {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: crosshair;
}

.sc-click-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.sc-click-markers {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.sc-click-marker {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.85);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.5);
    animation: scMarkerPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 2;
}

@keyframes scMarkerPop {
    from { transform: translate(-50%, -50%) scale(0); }
    to { transform: translate(-50%, -50%) scale(1); }
}

.sc-click-hint {
    margin-top: 12px;
    text-align: center;
    font-size: 13px;
    color: rgba(148, 163, 184, 0.7);
    letter-spacing: 1px;
}

/* ==================== 结果图标 ==================== */
.sc-result-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    animation: scResultIn 0.3s ease;
}

.sc-result-icon svg {
    width: 48px;
    height: 48px;
}

.sc-result-success {
    background: rgba(16, 185, 129, 0.15);
    color: #10B981;
}

.sc-result-fail {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
}

@keyframes scResultIn {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

.sc-fail-message {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 13px;
    color: #EF4444;
    z-index: 11;
    animation: scResultIn 0.3s ease;
}

/* ==================== 响应式 ==================== */
@media (max-width: 400px) {
    .sc-card {
        padding: 16px;
        width: 300px;
    }

    .sc-card-header {
        font-size: 13px;
        margin-bottom: 10px;
    }
}

/* 矮屏适配 */
@media (max-height: 500px) {
    .sc-overlay {
        align-items: flex-start;
        padding-top: 20px;
    }

    .sc-card {
        padding: 14px;
    }

    .sc-card-header {
        margin-bottom: 8px;
    }
}

/* ==================== 暗色主题适配 ==================== */
/* 默认就是暗色主题，与cover页风格一致 */

/* 浅色主题覆盖（如果页面使用浅色主题） */
@media (prefers-color-scheme: light) {
    .sc-trigger {
        border-color: rgba(37, 99, 235, 0.2);
        background: rgba(37, 99, 235, 0.03);
    }

    .sc-trigger-text {
        color: #475569;
    }

    .sc-trigger-icon {
        color: #2563EB;
    }
}
