/* 
 * Zib Download Modal Styles
 * Version: 1.9.3 - 优化宽高比和间距，改进字体大小
 */

#zib-smart-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
}

#zib-smart-modal .modal-mask {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
}

/* ✅ 整体变窄，优化宽高比 */
#zib-smart-modal .modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    max-width: 360px; /* 从380px减小到360px，更窄 */
    width: 88%; /* 从90%减小到88% */
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease-out;
}

/* ✅ 调整顶部区域，增加安全提示与关闭按钮的间距 */
#zib-smart-modal .modal-header {
    padding: 16px 20px 0; /* 减少顶部内边距 */
    text-align: center;
    flex-shrink: 0;
    position: relative;
}

#zib-smart-modal .modal-header h4 {
    margin: 0;
    color: #1e293b;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px; /* 减小标题下边距 */
    padding-right: 30px;
}

/* ✅ 调整右上角关闭按钮位置，增加与安全提示的距离 */
#zib-smart-modal .modal-close {
    position: absolute;
    top: 6px; /* 从18px减小到6px */
    right: 20px;
    font-size: 22px; /* 从24px减小到22px */
    color: #94a3b8;
    cursor: pointer;
    z-index: 10;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    background: rgba(0,0,0,0.05);
    line-height: 1;
}

#zib-smart-modal .modal-close:hover {
    color: #475569;
    background: rgba(0,0,0,0.1);
    transform: rotate(90deg);
}

#zib-smart-modal .modal-body {
    padding: 0 16px 8px; /* 左右内边距从18px减小到16px */
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px; /* 从4px增加到6px，增加元素间距 */
}

/* ✅ 调整安全提示，增加上边距避免与关闭按钮太近 */
#zib-smart-modal .security-notice {
    background: #fff9db;
    color: #856404;
    padding: 10px 14px; /* 上下从8px增加到10px */
    border-radius: 8px;
    margin-top: 8px; /* 增加上边距 */
    margin-bottom: 10px; /* 增加下边距 */
    font-size: 13px;
    line-height: 1.4; /* 从1.3增加到1.4，增加行高 */
    text-align: center;
    border: 1px solid #ffeaa7;
    font-weight: 500;
    flex-shrink: 0;
}

/* ✅ 二维码容器调整 */
#zib-smart-modal .qrcode-container {
    margin: 6px 0; /* 从4px增加到6px */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    padding: 4px;
    background: white;
    border-radius: 8px;
}

#zib-smart-modal .qrcode-container img {
    width: 180px;
    height: 180px;
    display: block;
    border-radius: 6px;
    background: #f8f9fa;
}

/* === 链接样式调整 === */
#zib-smart-modal .link-box-minimal {
    margin: 8px 0; /* 从4px增加到8px，增加链接区域外边距 */
}

#zib-smart-modal .link-text-minimal {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 5px 12px; /* 从6px10px调整到5px12px */
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 38px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

#zib-smart-modal .link-text-minimal:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* ✅ 增加链接字体大小 */
#zib-smart-modal .link-content-minimal {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px; /* 从11px增加到12px */
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px; /* 从5px增加到6px */
    line-height: 1.3; /* 从1.2增加到1.3 */
}

#zib-smart-modal .link-content-minimal:before {
    content: "📋";
    font-size: 13px; /* 从12px增加到13px */
    flex-shrink: 0;
}

/* ✅ 调整复制成功提示，减小高度 */
#zib-smart-modal .link-copied-minimal {
    background: #10b981;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    min-height: 29px; /* 从36px减小到30px，降低高度 */
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInMinimal 0.2s ease;
}

@keyframes fadeInMinimal {
    from { opacity: 0; transform: translateY(-2px); }
    to { opacity: 1; transform: translateY(0); }
}

#zib-smart-modal .tips-container {
    margin: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

#zib-smart-modal .tip-item {
    padding: 6px 10px;
    margin-bottom: 4px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.3; /* 从1.2增加到1.3 */
    text-align: left;
    min-height: 36px;
    display: flex;
    align-items: center;
}

#zib-smart-modal .tip-recommended {
    background: #f0fdf4;
    border-left: 3px solid #10b981;
    color: #059669;
    font-weight: 600;
}

#zib-smart-modal .tip-alternative {
    background: #f8fafc;
    border-left: 3px solid #94a3b8;
    color: #475569;
}

#zib-smart-modal .tip-warning {
    background: #fefce8;
    border-left: 3px solid #eab308;
    color: #854d0e;
    font-size: 11px;
    margin-bottom: 0;
}

/* ✅ 底部区域调整 */
#zib-smart-modal .modal-footer {
    padding: 12px 20px 16px;
    border-top: 1px solid #f1f5f9;
    flex-shrink: 0;
}

#zib-smart-modal .modal-footer button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    width: 100%;
    transition: all 0.3s ease;
    margin-top: 8px;
}

#zib-smart-modal .modal-footer button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#zib-smart-modal .modal-footer button:active {
    transform: translateY(0);
}

/* 动画效果 */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* 响应式设计 */
@media (max-width: 480px) {
    #zib-smart-modal .modal-content {
        width: 92%;
        max-width: 340px; /* 从350px减小到340px */
    }
    
    #zib-smart-modal .modal-body {
        padding: 0 14px 6px;
        gap: 5px;
    }
    
    #zib-smart-modal .modal-header {
        padding: 14px 14px 0;
    }
    
    #zib-smart-modal .modal-header h4 {
        font-size: 15px;
        margin-bottom: 8px; /* 从10px减小到8px */
    }
    
    #zib-smart-modal .modal-close {
        top: 14px;
        right: 14px;
        font-size: 20px; /* 从22px减小到20px */
        width: 26px;
        height: 26px;
    }
    
    #zib-smart-modal .security-notice {
        padding: 8px 10px;
        font-size: 12px;
        margin-top: 6px; /* 增加移动端的上边距 */
        margin-bottom: 8px;
        line-height: 1.3;
    }
    
    #zib-smart-modal .qrcode-container img {
        width: 160px;
        height: 160px;
    }
    
    #zib-smart-modal .link-text-minimal {
        min-height: 34px; /* 从32px增加到34px */
        font-size: 11px;
        padding: 7px 10px; /* 移动端适当调整 */
    }
    
    #zib-smart-modal .link-content-minimal {
        font-size: 11px; /* 移动端保持11px */
        line-height: 1.2;
        gap: 5px;
    }
    
    #zib-smart-modal .link-content-minimal:before {
        font-size: 12px;
    }
    
    #zib-smart-modal .link-copied-minimal {
        min-height: 30px; /* 移动端适当减小 */
        font-size: 11px;
        padding: 5px 8px;
    }
    
    #zib-smart-modal .tip-item {
        min-height: 34px;
        font-size: 11px;
        line-height: 1.2;
    }
    
    #zib-smart-modal .modal-footer {
        padding: 10px 14px 12px;
    }
    
    #zib-smart-modal .modal-footer button {
        padding: 10px 16px;
        font-size: 14px;
        margin-top: 6px;
    }
}