/*
 * Pan Downloader 插件样式（子比主题风格）
 */

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

/* 移动端下载链接 & PC下载按钮样式（子比主题but风格） */
.pd-download-link,
.pd-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.5em 1.2em;
    border-radius: 4px;
    font-size: 15px;
    font-weight: normal;
    line-height: 1.44;
    border: 1px solid transparent;
    transition: 0.15s;
    cursor: pointer;
    vertical-align: middle;
    text-align: center;
    text-decoration: none;
    color: #fff;
    background: #007bff;
    white-space: nowrap;
}

.pd-download-link:hover,
.pd-download-btn:hover {
    opacity: 0.82;
}

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

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

/* 网盘类型标签 */
.pd-pan-name {
    font-size: 14px;
}

/* 错误提示 */
.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: #fff;
    border-radius: 20px;
    padding: 0;
    max-width: 360px;
    width: 90%;
    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: #007bff;
    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: #007bff;
}

/* 二维码包装器 */
.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: #007bff;
    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-link-display {
    margin: 10px 15px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    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-link-display: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-link-display::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--pd-box-color, #4a7cff);
}

.pd-link-url {
    font-size: 13px;
    color: #2c3e50;
    word-break: break-all;
    flex: 1;
    min-width: 0;
    line-height: 1.5;
    user-select: all;
    -webkit-user-select: all;
    -moz-user-select: all;
    -ms-user-select: all;
}

.pd-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background: #4a7cff;
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-weight: 500;
}

.pd-copy-btn:hover {
    background: #3461d6;
    box-shadow: 0 2px 8px rgba(74, 124, 255, 0.35);
}

.pd-copy-btn.copied {
    background: #22c55e;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.35);
}

.pd-copy-text {
    font-size: 12px;
}

/* 下方四个方框 */
.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,
.pd-info-icon,
.pd-warn-icon {
    background: #007bff;
    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; }
}

/* 统一蓝色按钮 */
.pd-download-btn[data-pan-type="kuake"],
.pd-download-link[data-pan-type="kuake"],
.pd-download-btn[data-pan-type="baidu"],
.pd-download-link[data-pan-type="baidu"],
.pd-download-btn[data-pan-type="uc"],
.pd-download-link[data-pan-type="uc"],
.pd-download-btn[data-pan-type="xunlei"],
.pd-download-link[data-pan-type="xunlei"] {
    background: #007bff;
}
