/*
 * Pan Downloader 插件样式
 */

/* 下载按钮容器 */
.pan-downloader-container {
    display: inline-block;
    margin: 10px 0;
}

/* 移动端下载链接样式 */
.pd-download-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
}

.pd-download-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.pd-download-link:active {
    transform: translateY(0);
}

/* 下载按钮基础样式（PC端） */
.pd-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

/* 按钮悬停效果 */
.pd-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.pd-download-btn:active {
    transform: translateY(0);
}

/* 按钮图标 */
.pd-icon {
    font-size: 20px;
    font-weight: bold;
}

/* 按钮文字 */
.pd-text {
    font-size: 16px;
}

/* 网盘类型标签 */
.pd-pan-name {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: normal;
}

/* 错误提示 */
.pd-error {
    padding: 10px 15px;
    background: #fee;
    color: #c33;
    border-left: 4px solid #c33;
    border-radius: 4px;
    font-size: 14px;
}

/* 隐藏的二维码数据容器 */
.pd-qrcode-data {
    display: none !important;
}

.pd-qrcode-data .pd-qrcode-title {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
}

.pd-qrcode-data img {
    display: inline-block;
    max-width: 250px;
    width: 100%;
    height: auto;
    border: 2px solid #f0f0f0;
    border-radius: 8px;
    padding: 10px;
    background: #fafafa;
}

/* 弹窗遮罩层 */
.pd-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 99999;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.25s ease;
}

/* 弹窗主体 */
.pd-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.85);
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    padding: 0;
    max-width: 360px;
    width: 90%;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    z-index: 100000;
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

/* 弹窗显示状态 */
.pd-modal-overlay.show {
    display: block;
}

.pd-modal.show {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* 弹窗顶部装饰条 */
.pd-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    z-index: 10;
}

/* 移除弹窗标题 */
.pd-modal-title {
    display: none;
}

/* 二维码容器 */
.pd-qrcode-container {
    text-align: center;
    margin-bottom: 0;
    padding: 25px 25px 15px;
}

/* 上方蓝色方框 */
.pd-top-box {
    padding: 14px 18px;
    border-radius: 12px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: white;
    margin: 20px 20px 18px;
    background: linear-gradient(135deg, var(--pd-top-color, #007bff) 0%, var(--pd-top-color-dark, #0056b3) 100%);
    box-shadow: 
        0 4px 15px rgba(0, 123, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.pd-top-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        transparent 40%,
        rgba(255, 255, 255, 0.15) 50%,
        transparent 60%,
        transparent
    );
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* 二维码包装器 */
.pd-qrcode-wrapper {
    text-align: center;
    margin: 0 20px 18px;
    position: relative;
}

.pd-qrcode-wrapper::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    opacity: 0.1;
    z-index: -1;
}

.pd-qrcode-wrapper img {
    display: inline-block;
    max-width: 200px;
    width: 100%;
    height: auto;
    border: none;
    border-radius: 12px;
    padding: 10px;
    background: white;
    box-shadow: 
        0 8px 30px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: transform 0.3s ease;
    /* 禁止选中文本和右键菜单 */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none;
}

.pd-qrcode-wrapper img:hover {
    transform: scale(1.05);
}

/* 下方四个方框 */
.pd-bottom-box {
    padding: 12px 14px;
    margin: 10px 15px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #333;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pd-bottom-box:hover {
    transform: translateX(5px);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.pd-bottom-box::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--pd-box-color, #28a745);
}

/* 方框图标 */
.pd-check-icon,
.pd-info-icon,
.pd-warn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
    margin-top: 2px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.pd-check-icon {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.pd-info-icon {
    background: linear-gradient(135deg, #ffc107 0%, #ffca2c 100%);
    color: #333;
}

.pd-warn-icon {
    background: linear-gradient(135deg, #dc3545 0%, #ff6b6b 100%);
    color: white;
}

/* 关闭按钮 */
.pd-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pd-close-btn:hover {
    background: #e0e0e0;
    color: #333;
}

/* 动画定义 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 响应式适配 */
@media (max-width: 768px) {
    .pd-download-btn,
    .pd-download-link {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .pd-modal {
        padding: 0;
        max-width: 300px;
    }
    
    .pd-qrcode-wrapper img {
        max-width: 180px;
    }
    
    .pd-top-box,
    .pd-bottom-box {
        font-size: 12px;
    }
}

/* 响应式适配 */
@media (max-width: 768px) {
    .pd-download-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .pd-modal {
        padding: 20px;
        max-width: 320px;
    }
    
    .pd-qrcode-img {
        max-width: 200px;
    }
}

/* 不同的网盘类型颜色变体 */
.pd-download-btn[data-pan-type="kuake"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.pd-download-btn[data-pan-type="baidu"] {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.pd-download-btn[data-pan-type="uc"] {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.pd-download-btn[data-pan-type="xunlei"] {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}
