/* 风险弹窗样式 */
.risk-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.risk-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.risk-modal {
    background: #fff;
    border-radius: 24px;
    padding: 0;
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.3s ease;
}

.risk-modal-overlay.show .risk-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* 警告类型 */
.risk-modal.warning .risk-modal-header {
    background: linear-gradient(135deg, #ff9500, #ff6b00);
}

.risk-modal.warning .risk-icon {
    background: rgba(255, 255, 255, 0.2);
}

/* 风控类型 */
.risk-modal.banned .risk-modal-header {
    background: linear-gradient(135deg, #ff3b30, #d32f2f);
}

.risk-modal.banned .risk-icon {
    background: rgba(255, 255, 255, 0.2);
}

.risk-modal-header {
    padding: 40px 32px 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* 动态背景效果 */
.risk-modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.risk-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    animation: iconBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 1;
}

@keyframes iconBounce {
    0% {
        transform: scale(0) rotate(-180deg);
    }
    60% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0);
    }
}

.risk-modal-title {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 8px;
    position: relative;
    z-index: 1;
}

.risk-modal-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    position: relative;
    z-index: 1;
}

.risk-modal-body {
    padding: 32px;
    background: #fff;
}

.risk-message {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    margin: 0 0 20px;
    text-align: center;
}

.risk-keywords {
    background: linear-gradient(135deg, #f5f7fa, #e8ecf1);
    border-radius: 12px;
    padding: 16px 20px;
    margin: 20px 0;
}

.risk-keywords-label {
    font-size: 13px;
    color: #666;
    margin: 0 0 8px;
    font-weight: 600;
}

.risk-keywords-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.risk-keyword-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: #fff;
    border-radius: 20px;
    font-size: 13px;
    color: #ff3b30;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.risk-keyword-tag::before {
    content: '•';
    margin-right: 6px;
    font-size: 16px;
}

.risk-countdown {
    background: linear-gradient(135deg, #fff5f5, #ffe5e5);
    border-radius: 12px;
    padding: 16px 20px;
    margin: 20px 0;
    text-align: center;
}

.risk-countdown-label {
    font-size: 13px;
    color: #666;
    margin: 0 0 8px;
    font-weight: 600;
}

.risk-countdown-time {
    font-size: 28px;
    font-weight: 700;
    color: #ff3b30;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
}

.risk-countdown-unit {
    font-size: 14px;
    color: #999;
    margin-left: 4px;
}

.risk-modal-footer {
    padding: 0 32px 32px;
    display: flex;
    gap: 12px;
}

.risk-btn {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.risk-btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.risk-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

.risk-btn-primary:active {
    transform: translateY(0);
}

.risk-btn-secondary {
    background: #f5f7fa;
    color: #666;
}

.risk-btn-secondary:hover {
    background: #e8ecf1;
}

/* 警告提示动画 */
.risk-modal.warning .risk-icon {
    animation: iconBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
               shake 0.5s ease-in-out 0.6s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0) rotate(0); }
    25% { transform: translateX(-8px) rotate(-5deg); }
    75% { transform: translateX(8px) rotate(5deg); }
}

/* 风控提示动画 */
.risk-modal.banned .risk-icon {
    animation: iconBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
               error-pulse 1.5s ease-in-out infinite 0.6s;
}

@keyframes error-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.4);
    }
    50% {
        box-shadow: 0 0 0 12px rgba(255, 59, 48, 0);
    }
}

/* 响应式设计 */
@media (max-width: 640px) {
    .risk-modal {
        width: 95%;
        max-width: none;
        border-radius: 20px;
    }

    .risk-modal-header {
        padding: 32px 24px 24px;
    }

    .risk-modal-body {
        padding: 24px;
    }

    .risk-modal-footer {
        padding: 0 24px 24px;
        flex-direction: column;
    }

    .risk-icon {
        width: 70px;
        height: 70px;
        font-size: 36px;
    }

    .risk-modal-title {
        font-size: 20px;
    }

    .risk-countdown-time {
        font-size: 24px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .risk-modal {
        background: #1c1c1e;
    }

    .risk-modal-body {
        background: #1c1c1e;
    }

    .risk-message {
        color: #e5e5e7;
    }

    .risk-keywords {
        background: linear-gradient(135deg, #2c2c2e, #3a3a3c);
    }

    .risk-keywords-label,
    .risk-countdown-label {
        color: #98989d;
    }

    .risk-keyword-tag {
        background: #2c2c2e;
        color: #ff453a;
    }

    .risk-countdown {
        background: linear-gradient(135deg, #2c2c2e, #3a3a3c);
    }

    .risk-btn-secondary {
        background: #2c2c2e;
        color: #e5e5e7;
    }

    .risk-btn-secondary:hover {
        background: #3a3a3c;
    }
}
