/**
 * WP 下载按钮插件 - 前台样式 (v3.3.0)
 * Version: 3.3.0
 */

/* ============ 下载卡片容器：与文章内容同宽 ============ */
.wpdb-download-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 32px 0;
    padding: 0;
    clear: both;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* ============ 卡片主体：完全复刻图片 ============ */
.wpdb-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    background: ##f7f5f5;
    border-radius: 10px;
    border: 1px solid #3b82f6;
    padding: 18px 22px;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.wpdb-card:hover {
    box-shadow: 0 6px 24px rgba(59, 130, 246, 0.14);
}

/* 主题色：边框 */
.wpdb-card-theme-blue .wpdb-card { border: 2px solid #206be7; }
.wpdb-card-theme-blue .wpdb-card:hover { box-shadow: 0 6px 24px rgba(59, 130, 246, 0.14); }
.wpdb-card-theme-green .wpdb-card { border-color: #22c55e; }
.wpdb-card-theme-green .wpdb-card:hover { box-shadow: 0 6px 24px rgba(34, 197, 94, 0.14); }
.wpdb-card-theme-red .wpdb-card { border-color: #ef4444; }
.wpdb-card-theme-red .wpdb-card:hover { box-shadow: 0 6px 24px rgba(239, 68, 68, 0.14); }
.wpdb-card-theme-orange .wpdb-card { border-color: #f97316; }
.wpdb-card-theme-orange .wpdb-card:hover { box-shadow: 0 6px 24px rgba(249, 115, 22, 0.14); }
.wpdb-card-theme-purple .wpdb-card { border-color: #8b5cf6; }
.wpdb-card-theme-purple .wpdb-card:hover { box-shadow: 0 6px 24px rgba(139, 92, 246, 0.14); }
.wpdb-card-theme-black .wpdb-card { border-color: #334155; }
.wpdb-card-theme-black .wpdb-card:hover { box-shadow: 0 6px 24px rgba(51, 65, 85, 0.14); }
.wpdb-card-theme-custom .wpdb-card { border-color: #6b7280; }
.wpdb-card-theme-custom .wpdb-card:hover { box-shadow: 0 6px 24px rgba(107, 114, 128, 0.14); }

/* ============ 左侧图标：圆形浅灰背景 + 文件图标 ============ */
.wpdb-card-media {
    flex-shrink: 0;
    width: 88px;
    height: 88px;
    margin-right: 18px;
    border-radius: 50%;
    overflow: hidden;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 缩略图：强制小圆图，自动缩小 */
.wpdb-card-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

/* 文件图标（无缩略图时） */
.wpdb-file-icon {
    width: 44px;
    height: 44px;
    color: #6b7280;
}

/* ============ 右侧内容区 ============ */
.wpdb-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    gap: 8px;
    margin-left: 20px;
}

/* 标题：匹配主题文章内容 h3 样式，防止被主题覆盖 */
.entry .entry-content .wpdb-card-title,
.entry .entry-content .h3.wpdb-card-title,
.wpdb-card-title {
    margin: 0;
    font-size: 16px;
    font-weight: bold;
    line-height: 1.45;
    color: #1f2937;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* 元信息行：免费下载 / 提取码 / 复制按钮 */
.wpdb-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    font-size: 15px;
    line-height: 1.5;
    margin-top: 2px;
}

.wpdb-card-tag {
    color: #f59e0b;
    font-weight: 600;
}

.wpdb-card-code {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #6b7280;
    font-weight: 400;
}

.wpdb-code-label {
    color: #6b7280;
}

.wpdb-code-value {
    color: #374151;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* 复制按钮 */
.wpdb-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s ease;
    vertical-align: middle;
}

.wpdb-copy-btn:hover {
    background: #f3f4f6;
    color: #3b82f6;
}

.wpdb-copy-btn.wpdb-copied {
    color: #22c55e;
}

.wpdb-copy-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* 下载按钮：深色圆角 */
.wpdb-card-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    padding: 9px 24px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
    margin-top: 4px;
    background: #3b4d6a;
    color: #ffffff;
}

.wpdb-card-btn:hover {
    background: #2d3d55;
    box-shadow: 0 4px 12px rgba(59, 77, 106, 0.3);
    color: #ffffff;
}

.wpdb-card-btn-inner {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.wpdb-card-btn .wpdb-dl-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.wpdb-card-btn:hover .wpdb-dl-icon {
    transform: translateY(2px);
}

/* ============ 按钮容器：主+备用并排 ============ */
.wpdb-card-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.wpdb-card-buttons .wpdb-card-btn {
    align-self: auto;
    margin-top: 0;
}

/* 备用按钮：白底蓝边 */
.wpdb-card-btn-backup {
    background: #ffffff !important;
    color: #3b4d6a !important;
    border: 1px solid #3b4d6a;
}

.wpdb-card-btn-backup:hover {
    background: #f3f4f6 !important;
    color: #2d3d55 !important;
    box-shadow: 0 4px 12px rgba(59, 77, 106, 0.18);
}

/* 按钮主题色：仅改变按钮颜色，保持深色基调 */
.wpdb-card-theme-blue .wpdb-card-btn { }
.wpdb-card-theme-blue .wpdb-card-btn:hover { background: #2d3d55; box-shadow: 0 4px 12px rgba(59, 77, 106, 0.3); }
.wpdb-card-theme-green .wpdb-card-btn { background: #3b4d6a; }
.wpdb-card-theme-green .wpdb-card-btn:hover { background: #2d3d55; box-shadow: 0 4px 12px rgba(59, 77, 106, 0.3); }
.wpdb-card-theme-red .wpdb-card-btn { background: #3b4d6a; }
.wpdb-card-theme-red .wpdb-card-btn:hover { background: #2d3d55; box-shadow: 0 4px 12px rgba(59, 77, 106, 0.3); }
.wpdb-card-theme-orange .wpdb-card-btn { background: #3b4d6a; }
.wpdb-card-theme-orange .wpdb-card-btn:hover { background: #2d3d55; box-shadow: 0 4px 12px rgba(59, 77, 106, 0.3); }
.wpdb-card-theme-purple .wpdb-card-btn { background: #3b4d6a; }
.wpdb-card-theme-purple .wpdb-card-btn:hover { background: #2d3d55; box-shadow: 0 4px 12px rgba(59, 77, 106, 0.3); }
.wpdb-card-theme-black .wpdb-card-btn { background: #3b4d6a; }
.wpdb-card-theme-black .wpdb-card-btn:hover { background: #2d3d55; box-shadow: 0 4px 12px rgba(59, 77, 106, 0.3); }
.wpdb-card-theme-custom .wpdb-card-btn { background: #3b4d6a; }
.wpdb-card-theme-custom .wpdb-card-btn:hover { background: #2d3d55; box-shadow: 0 4px 12px rgba(59, 77, 106, 0.3); }

/* ============ 响应式适配 ============ */
@media screen and (max-width: 640px) {
    .wpdb-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 22px 18px;
    }

    .wpdb-card-media {
        width: 88px;
        height: 88px;
        margin-right: 0;
        margin-bottom: 16px;
    }

    .wpdb-file-icon {
        width: 42px;
        height: 42px;
    }

    .wpdb-card-body {
        align-items: center;
        margin-left: 0;
        width: 100%;
    }

    .wpdb-card-title {
        font-size: 16px;
        text-align: center;
    }

    .wpdb-card-meta {
        justify-content: center;
        font-size: 14px;
        gap: 12px;
    }

    .wpdb-card-buttons {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 8px;
    }

    .wpdb-card-buttons .wpdb-card-btn {
        width: 100%;
        padding: 9px 28px;
        font-size: 14px;
    }

    .wpdb-card-btn {
        align-self: center;
        padding: 9px 28px;
        font-size: 14px;
        margin-top: 6px;
    }
}

@media screen and (max-width: 480px) {
    .wpdb-download-wrapper {
        margin: 24px 0;
    }

    .wpdb-card {
        padding: 20px 16px;
    }

    .wpdb-card-title {
        font-size: 15px;
    }

    .wpdb-card-meta {
        gap: 10px;
        font-size: 12px;
    }

    .wpdb-card-btn {
        width: 100%;
        align-self: stretch;
        padding: 10px 20px;
    }
}
