/**
 * Suopu Child Theme - Custom CSS
 * 
 * 此文件用于添加自定义样式，绝对在所有其他 CSS 文件之后加载（优先级999）
 * 适合用于覆盖和修改主题其他样式，确保开发新功能时不影响现有样式
 * 
 * 加载顺序：绝对最后加载，优先级最高，可以覆盖所有其他样式
 */

/* =================================================
   自定义模态弹窗样式 - 社交分享微信二维码
   ================================================= */

/* 模态弹窗遮罩层 */
.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1050;
    display: none;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
}

/* 模态弹窗显示状态 */
.custom-modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-in-out;
}

/* 遮罩背景 */
.custom-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* 弹窗内容容器 */
.custom-modal-content {
    position: relative;
    background-color: #ffffff;
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 400px;
    margin: 1.75rem auto;
    pointer-events: auto;
    animation: modalSlideIn 0.3s ease-out;
    overflow: hidden;
}

/* 弹窗头部 */
.custom-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* 弹窗标题 */
.custom-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

/* 关闭按钮 */
.custom-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    color: white;
    opacity: 0.8;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.custom-modal-close:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.custom-modal-close:active {
    transform: scale(0.95);
}

/* 弹窗主体 */
.custom-modal-body {
    padding: 32px 24px;
    text-align: center;
}

/* 二维码容器 */
.qrcode-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.qrcode-info img {
    max-width: 200px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    padding: 16px;
    background: white;
}

/* 弹窗动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate3d(0, -50px, 0) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

/* 退出动画 */
.custom-modal.fade-out {
    animation: fadeOut 0.3s ease-in-out;
}

.custom-modal.fade-out .custom-modal-content {
    animation: modalSlideOut 0.3s ease-in;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes modalSlideOut {
    from {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
    to {
        opacity: 0;
        transform: translate3d(0, -50px, 0) scale(0.95);
    }
}

/* 响应式设计 */
@media (max-width: 576px) {
    .custom-modal-content {
        width: 95%;
        margin: 1rem auto;
    }
    
    .custom-modal-header {
        padding: 16px 20px 12px;
    }
    
    .custom-modal-title {
        font-size: 16px;
    }
    
    .custom-modal-body {
        padding: 24px 20px;
    }
    
    .qrcode-info img {
        max-width: 180px;
        padding: 12px;
    }
}

/* 改善按钮焦点样式以增强可访问性 */
.custom-modal-close:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* 确保在高对比度模式下的可见性 */
@media (prefers-contrast: high) {
    .custom-modal-overlay {
        background-color: rgba(0, 0, 0, 0.8);
    }
    
    .custom-modal-content {
        border: 2px solid #000;
    }
}