/**
 * 弹窗式图标顺序验证码样式
 * 点击触发 → 弹出小窗口 → 按顺序点击图标
 */
.captcha-trigger-box {
    width: 100%;
    height: 40px;
    line-height: 40px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f9f9f9;
    text-align: center;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    user-select: none;
    transition: all 0.2s;
}
.captcha-trigger-box:hover {
    border-color: #0ec5a1;
    color: #0ec5a1;
}
.captcha-trigger-box.verified {
    border-color: #5cb85c;
    background: #f0f9f0;
    color: #5cb85c;
    cursor: default;
}
.captcha-trigger-box.verified::before {
    content: "✓ ";
    font-weight: bold;
}

/* 弹窗遮罩层 */
.captcha-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    justify-content: center;
    align-items: center;
}
.captcha-modal-overlay.active {
    display: flex;
}

/* 弹窗主体 */
.captcha-modal {
    background: #fff;
    border-radius: 8px;
    width: 320px;
    max-width: 90%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    overflow: hidden;
    animation: captchaSlideIn 0.3s ease;
}
@keyframes captchaSlideIn {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 弹窗头部 */
.captcha-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.captcha-modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}
.captcha-modal-close {
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    border-radius: 50%;
    cursor: pointer;
    color: #999;
    font-size: 18px;
    transition: all 0.2s;
}
.captcha-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* 提示文字 */
.captcha-modal-tip {
    padding: 12px 20px 0;
    font-size: 14px;
    color: #666;
    text-align: center;
}
.captcha-modal-tip .target-icons {
    font-size: 22px;
    margin-top: 5px;
    letter-spacing: 8px;
}

/* 图标网格区域 */
.captcha-grid {
    padding: 15px 20px 20px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.captcha-grid-item {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    background: #fafafa;
    transition: all 0.15s;
    user-select: none;
}
.captcha-grid-item:hover {
    border-color: #0ec5a1;
    background: #f0fffc;
    transform: scale(1.05);
}
.captcha-grid-item.clicked {
    border-color: #0ec5a1;
    background: #e6f7f4;
    position: relative;
}
.captcha-grid-item.clicked::after {
    content: attr(data-order);
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    background: #0ec5a1;
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
}
.captcha-grid-item.wrong {
    border-color: #e74c3c;
    background: #fdf0ef;
    animation: captchaShake 0.4s ease;
}
@keyframes captchaShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* 底部操作栏 */
.captcha-modal-footer {
    padding: 0 20px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.captcha-refresh-btn {
    color: #0ec5a1;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}
.captcha-refresh-btn:hover {
    text-decoration: underline;
}
.captcha-status {
    font-size: 13px;
    color: #999;
}
.captcha-status.success {
    color: #5cb85c;
}
.captcha-status.error {
    color: #e74c3c;
}

/* 成功/失败提示 */
.captcha-result-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.95);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 10;
}
.captcha-result-overlay.active {
    display: flex;
}
.captcha-result-overlay .result-icon {
    font-size: 48px;
    margin-bottom: 10px;
}
.captcha-result-overlay .result-text {
    font-size: 16px;
    color: #333;
}
.captcha-modal {
    position: relative;
}
