/* YLT Modal 现代化模态框样式 */

/* 遮罩层 */
.ylt-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ylt-modal-overlay.zoom-enter {
    opacity: 1;
}

.ylt-modal-overlay.zoom-active {
    opacity: 1;
}

/* 模态框容器 */
.ylt-modal-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    max-width: 90vw;
    max-height: 80vh;
    min-width: 280px;
    opacity: 0;
    transform: scale(0.7);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    position: relative;
}

/* 不同类型的主题颜色 */
.ylt-modal-info {
    border-top: 3px solid #2979ff;
}

.ylt-modal-success {
    border-top: 3px solid #19be6b;
}

.ylt-modal-warning {
    border-top: 3px solid #ff9900;
}

.ylt-modal-error {
    border-top: 3px solid #fa3534;
}

.ylt-modal-question {
    border-top: 3px solid #2979ff;
}

.zoom-enter .ylt-modal-container {
    opacity: 0;
    transform: scale(0.7);
}

.zoom-active .ylt-modal-container {
    opacity: 1;
    transform: scale(1);
}

/* 头部 */
.ylt-modal-header {
    padding: 16px 20px 12px;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.ylt-modal-title {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
    color: #666;
    line-height: 1.3;
    padding-right: 36px;
    opacity: 0.9;
    letter-spacing: 0.02em;
}

.ylt-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ylt-modal-close:hover {
    background-color: #f5f5f5;
    color: #666;
}

/* 内容区域 */
.ylt-modal-body {
    padding: 16px 20px 18px;
    color: #666;
    font-size: 13px;
    line-height: 1.5;
    word-wrap: break-word;
    max-height: 50vh;
    overflow-y: auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.ylt-modal-header + .ylt-modal-body {
    padding-top: 14px;
}

/* 图标样式 */
.ylt-modal-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    flex-shrink: 0;
    margin-top: 1px;
}

.ylt-modal-icon-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.ylt-modal-icon-success {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.ylt-modal-icon-warning {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.ylt-modal-icon-error {
    background: linear-gradient(135deg, #ff6b6b 0%, #feca57 100%);
}

.ylt-modal-icon-question {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 内容文本 */
.ylt-modal-content {
    flex: 1;
    color: #333;
    line-height: 1.4;
    font-weight: 400;
}

/* 无图标时的内容样式 */
.ylt-modal-body:not(:has(.ylt-modal-icon)) {
    display: block;
    text-align: center;
}

.ylt-modal-body:not(:has(.ylt-modal-icon)) .ylt-modal-content {
    color: #666;
}

/* 有图标时内容靠左对齐 */
.ylt-modal-body:has(.ylt-modal-icon) .ylt-modal-content {
    text-align: left;
}

/* 图标动画效果 */
.ylt-modal-icon {
    animation: iconBounce 0.6s ease-out;
}

@keyframes iconBounce {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 底部按钮区域 */
.ylt-modal-footer {
    padding: 12px 20px 18px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.ylt-modal-footer.reverse {
    flex-direction: row-reverse;
}

/* 按钮样式 */
.ylt-modal-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
    min-width: 70px;
    position: relative;
    outline: none;
    background: #fff;
}

.ylt-modal-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ylt-modal-btn:active {
    transform: translateY(0);
}

/* 确认按钮 */
.ylt-modal-btn-confirm {
    background-color: #2979ff;
    color: #fff;
    border-color: #2979ff;
}

.ylt-modal-btn-confirm:hover {
    background-color: #1e6dff;
    border-color: #1e6dff;
}

/* 取消按钮 */
.ylt-modal-btn-cancel {
    color: #606266;
    background-color: #fff;
    border-color: #ddd;
}

.ylt-modal-btn-cancel:hover {
    color: #409eff;
    border-color: #409eff;
}

/* 加载状态 */
.ylt-modal-btn.loading {
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-loading {
    display: none;
}

.loading-icon {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: ylt-modal-spin 1s linear infinite;
}

@keyframes ylt-modal-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 目标元素提醒效果已移至JavaScript中动态生成 */

/* 响应式设计 */
@media (max-width: 768px) {
    .ylt-modal-container {
        width: 85vw !important;
        margin: 20px;
        max-height: 90vh;
        min-width: 260px;
    }
    
    .ylt-modal-header {
        padding: 14px 16px 10px;
    }
    
    .ylt-modal-title {
        font-size: 14px;
        font-weight: 500;
        color: #666;
        padding-right: 32px;
        opacity: 0.9;
    }
    
    .ylt-modal-close {
        top: 10px;
        right: 12px;
        width: 20px;
        height: 20px;
        font-size: 16px;
    }
    
    .ylt-modal-body {
        padding: 14px 16px 16px;
        gap: 8px;
        font-size: 12px;
    }
    
    .ylt-modal-icon {
        width: 18px;
        height: 18px;
        font-size: 11px;
    }
    
    .ylt-modal-footer {
        padding: 10px 16px 16px;
        flex-direction: column-reverse;
        gap: 8px;
    }
    
    .ylt-modal-btn {
        width: 100%;
        margin: 3px 0;
        padding: 10px 16px;
        font-size: 14px;
    }
}

/* 暗色主题支持 */
@media (prefers-color-scheme: dark) {
    .ylt-modal-container {
        background: #2c2c2c;
        color: #fff;
    }
    
    .ylt-modal-title {
        color: #ddd;
        font-size: 15px;
        font-weight: 500;
        opacity: 0.9;
    }
    
    .ylt-modal-body {
        color: #ccc;
        font-size: 13px;
    }
    
    .ylt-modal-content {
        color: #e0e0e0;
    }
    
    .ylt-modal-header {
        border-bottom-color: #444;
    }
    
    .ylt-modal-btn-cancel {
        background-color: #3c3c3c;
        border-color: #555;
        color: #ccc;
        font-size: 13px;
    }
    
    .ylt-modal-btn-cancel:hover {
        border-color: #409eff;
        color: #409eff;
    }
    
    .ylt-modal-close {
        color: #ccc;
    }
    
    .ylt-modal-close:hover {
        background-color: #444;
        color: #fff;
    }
}

/* 自定义滚动条 */
.ylt-modal-body::-webkit-scrollbar {
    width: 6px;
}

.ylt-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.ylt-modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.ylt-modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 特效增强 */
.ylt-modal-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    z-index: 1;
}

/* 无标题样式调整 */
.ylt-modal-container:not(:has(.ylt-modal-header)) .ylt-modal-body {
    padding-top: 24px;
}

/* 确保无标题时的样式一致性 */
.ylt-modal-container .ylt-modal-body:first-child {
    padding-top: 18px;
    border-radius: 12px 12px 0 0;
}

.ylt-modal-container .ylt-modal-footer:last-child {
    border-radius: 0 0 12px 12px;
}

/* 动画优化 */
.ylt-modal-overlay * {
    box-sizing: border-box;
}

/* 防止页面滚动 */
body.ylt-modal-open {
    overflow: hidden;
}

/* 目标元素高亮样式 */
.ylt-modal-target-highlight {
    position: relative;
    transition: all 0.3s ease;
    z-index: 999;
}

.ylt-modal-target-highlight::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border-radius: 8px;
    z-index: -1;
    animation: ylt-modal-highlight-glow 1.5s infinite alternate;
}

.ylt-modal-target-highlight::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid;
    border-radius: 6px;
    z-index: -1;
    animation: ylt-modal-highlight-border 1s infinite;
}

/* Primary 类型高亮 */
.ylt-modal-target-highlight-primary {
    animation: ylt-modal-highlight-pulse-primary 2s infinite;
}

.ylt-modal-target-highlight-primary::before {
    background: linear-gradient(45deg, 
        rgba(64, 158, 255, 0.3), 
        rgba(102, 177, 255, 0.3), 
        rgba(64, 158, 255, 0.3));
}

.ylt-modal-target-highlight-primary::after {
    border-color: #409eff;
}

/* Success 类型高亮 */
.ylt-modal-target-highlight-success {
    animation: ylt-modal-highlight-pulse-success 2s infinite;
}

.ylt-modal-target-highlight-success::before {
    background: linear-gradient(45deg, 
        rgba(103, 194, 58, 0.3), 
        rgba(133, 206, 97, 0.3), 
        rgba(103, 194, 58, 0.3));
}

.ylt-modal-target-highlight-success::after {
    border-color: #67c23a;
}

/* Warning 类型高亮 */
.ylt-modal-target-highlight-warning {
    animation: ylt-modal-highlight-pulse-warning 2s infinite;
}

.ylt-modal-target-highlight-warning::before {
    background: linear-gradient(45deg, 
        rgba(230, 162, 60, 0.3), 
        rgba(235, 181, 99, 0.3), 
        rgba(230, 162, 60, 0.3));
}

.ylt-modal-target-highlight-warning::after {
    border-color: #e6a23c;
}

/* Info 类型高亮 */
.ylt-modal-target-highlight-info {
    animation: ylt-modal-highlight-pulse-info 2s infinite;
}

.ylt-modal-target-highlight-info::before {
    background: linear-gradient(45deg, 
        rgba(144, 147, 153, 0.3), 
        rgba(176, 179, 184, 0.3), 
        rgba(144, 147, 153, 0.3));
}

.ylt-modal-target-highlight-info::after {
    border-color: #909399;
}

/* Error 类型高亮 */
.ylt-modal-target-highlight-error {
    animation: ylt-modal-highlight-pulse-error 2s infinite;
}

.ylt-modal-target-highlight-error::before {
    background: linear-gradient(45deg, 
        rgba(245, 108, 108, 0.3), 
        rgba(247, 137, 137, 0.3), 
        rgba(245, 108, 108, 0.3));
}

.ylt-modal-target-highlight-error::after {
    border-color: #f56c6c;
}

/* 高亮脉动动画 - Primary */
@keyframes ylt-modal-highlight-pulse-primary {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(64, 158, 255, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(64, 158, 255, 0);
    }
}

/* 高亮脉动动画 - Success */
@keyframes ylt-modal-highlight-pulse-success {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(103, 194, 58, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(103, 194, 58, 0);
    }
}

/* 高亮脉动动画 - Warning */
@keyframes ylt-modal-highlight-pulse-warning {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(230, 162, 60, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(230, 162, 60, 0);
    }
}

/* 高亮脉动动画 - Info */
@keyframes ylt-modal-highlight-pulse-info {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(144, 147, 153, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(144, 147, 153, 0);
    }
}

/* 高亮脉动动画 - Error */
@keyframes ylt-modal-highlight-pulse-error {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(245, 108, 108, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(245, 108, 108, 0);
    }
}

/* 高亮发光动画 */
@keyframes ylt-modal-highlight-glow {
    0% {
        opacity: 0.3;
        transform: scale(1);
    }
    100% {
        opacity: 0.6;
        transform: scale(1.02);
    }
}

/* 高亮边框动画 */
@keyframes ylt-modal-highlight-border {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
        transform: scale(1.02);
    }
} 