/**
 * 下载保护系统 - 弹窗样式
 */

/* 弹窗遮罩层 */
.yali-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.yali-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* 弹窗内容 */
.yali-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: yaliModalSlideIn 0.3s ease-out;
    text-align: center;
}

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

/* 关闭按钮 */
.yali-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    color: #6b7280;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.yali-modal-close:hover {
    background: #e5e7eb;
    color: #374151;
}

/* 弹窗头部 */
.yali-modal-header {
    margin-bottom: 28px;
}

.yali-modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.yali-modal-icon svg {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.yali-modal-title {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.yali-modal-desc {
    font-size: 15px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

/* 弹窗主体 */
.yali-modal-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

/* 按钮样式 */
.yali-modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
    width: 100%;
}

.yali-modal-btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: #fff;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

.yali-modal-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px -2px rgba(59, 130, 246, 0.4);
    color: #fff;
}

.yali-modal-btn-secondary {
    background: #f3f4f6;
    color: #4b5563;
}

.yali-modal-btn-secondary:hover {
    background: #e5e7eb;
    color: #374151;
}

/* 弹窗底部 */
.yali-modal-footer {
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.yali-modal-footer p {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
}

.yali-modal-footer a {
    color: #3b82f6;
    font-weight: 600;
    text-decoration: none;
}

.yali-modal-footer a:hover {
    text-decoration: underline;
}

/* 防止背景滚动 */
body.yali-modal-open {
    overflow: hidden;
}

/* 下载中状态 */
.yali-downloading {
    pointer-events: none;
    opacity: 0.7;
}

.yali-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: yaliSpin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes yaliSpin {
    to {
        transform: rotate(360deg);
    }
}

/* 通知样式 */
.yali-notification {
    animation: yaliNotificationSlideIn 0.3s ease-out;
}

@keyframes yaliNotificationSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 移动端适配 */
@media (max-width: 480px) {
    .yali-modal-content {
        padding: 28px 20px;
        margin: 16px;
        width: calc(100% - 32px);
    }
    
    .yali-modal-title {
        font-size: 20px;
    }
    
    .yali-modal-desc {
        font-size: 14px;
    }
    
    .yali-modal-btn {
        padding: 12px 20px;
        font-size: 15px;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    .yali-modal-content {
        background: #1f2937;
    }
    
    .yali-modal-title {
        color: #f9fafb;
    }
    
    .yali-modal-desc {
        color: #9ca3af;
    }
    
    .yali-modal-close {
        background: #374151;
        color: #9ca3af;
    }
    
    .yali-modal-close:hover {
        background: #4b5563;
        color: #e5e7eb;
    }
    
    .yali-modal-btn-secondary {
        background: #374151;
        color: #d1d5db;
    }
    
    .yali-modal-btn-secondary:hover {
        background: #4b5563;
        color: #f3f4f6;
    }
    
    .yali-modal-footer {
        border-color: #374151;
    }
    
    .yali-modal-footer p {
        color: #9ca3af;
    }
}