.product-display-widget {
    width: 100%;
    box-sizing: border-box;
}

/* 卡片覆盖链接 - 使整个卡片可点击 */
.pdw-card,
.pdw-music-card,
.pdw-icon-item {
    position: relative;
}

.pdw-card-link {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* 确保交互元素在覆盖链接之上 */
.pdw-fav-btn,
.pdw-download-btn,
.pdw-hover-overlay,
.pdw-image-hover-actions,
.pdw-illust-hover-actions,
.pdw-video-hover-actions,
.pdw-play-icon,
.pdw-music-play-btn,
.pdw-music-cover-wrap,
.pdw-music-info,
.pdw-music-actions,
.pdw-music-dl-btn {
    position: relative;
    z-index: 2;
}

/* 统计行容器 */
.pdw-stats-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.pdw-stats-row .pdw-stats {
    margin-bottom: 0;
}

/* 移动端筛选按钮（默认隐藏） */
.pdw-mobile-filter-btn {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pdw-mobile-filter-btn:hover {
    background: #eee;
    border-color: #ccc;
}

.pdw-mobile-filter-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .pdw-mobile-filter-btn {
        display: inline-flex;
    }
}

.pdw-stats {
    font-size: 14px;
    color: #666;
    margin-bottom: 16px;
    line-height: 1.6;
}

.pdw-stats-number {
    color: #e74c3c;
    font-weight: 600;
    margin: 0 2px;
}

.pdw-stats-cat {
    color: #333;
    font-weight: 500;
    margin: 0 2px;
}

.pdw-grid {
    display: grid;
    gap: 16px;
    width: 100%;
    box-sizing: border-box;
}

.pdw-cols-3 { grid-template-columns: repeat(3, 1fr); }
.pdw-cols-4 { grid-template-columns: repeat(4, 1fr); }
.pdw-cols-5 { grid-template-columns: repeat(5, 1fr); }
.pdw-cols-6 { grid-template-columns: repeat(6, 1fr); }

.pdw-card {
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.pdw-card:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transform: translateY(-2px);
}

.pdw-card-inner {
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
    pointer-events: none;
}

/* 恢复交互元素的点击事件 */
.pdw-card-inner .pdw-fav-btn,
.pdw-card-inner .pdw-download-btn,
.pdw-card-inner .pdw-hover-overlay a,
.pdw-card-inner .pdw-title {
    pointer-events: auto;
}

.pdw-thumb {
    position: relative;
    width: 100%;
    padding-bottom: 130%;
    background-size: cover;
    background-position: center;
    background-color: #f0f0f0;
    overflow: hidden;
    pointer-events: none;
}

.pdw-badge-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 4px;
    vertical-align: middle;
    flex-shrink: 0;
}

.pdw-title-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdw-fav-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.2s ease;
    padding: 0;
    color: #666;
}

.pdw-fav-btn svg {
    width: 20px;
    height: 20px;
}

.pdw-card:hover .pdw-fav-btn {
    opacity: 1;
}

.pdw-fav-btn:hover {
    transform: scale(1.1);
    color: #f59e0b;
    background: rgba(255,255,255,0.9);
}

.pdw-fav-btn.is-favorited {
    opacity: 1;
    color: #f59e0b;
}

.pdw-fav-btn.is-favorited svg {
    fill: #f59e0b;
}

.pdw-hover-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 15px;
    background: linear-gradient(to top, rgba(0,0,0,0.45) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pdw-card:hover .pdw-hover-overlay {
    opacity: 1;
}

.pdw-download-btn {
    display: inline-block;
    width: calc(100% - 30px);
    padding: 10px 0;
    text-align: center;
    background-color: #4CAF50;
    color: #fff;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.pdw-download-btn:hover {
    background-color: #43a047;
    color: #fff;
}

.pdw-title {
    display: flex;
    align-items: center;
    padding: 10px;
    font-size: 13px;
    line-height: 1.4;
    color: #333;
    text-decoration: none;
    overflow: hidden;
    white-space: nowrap;
}

.pdw-title:hover {
    color: #4CAF50;
}

.pdw-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 30px;
    padding: 10px 0;
}

.pdw-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 24px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    background: #fff;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.pdw-nav-btn:hover {
    background-color: #5b5fc7;
    border-color: #5b5fc7;
    color: #fff;
}

.pdw-nav-btn.pdw-nav-next {
    background-color: #5b5fc7;
    border-color: #5b5fc7;
    color: #fff;
}

.pdw-nav-btn.pdw-nav-next:hover {
    background-color: #4a4fb5;
}

.pdw-nav-btn.pdw-disabled {
    color: #ccc;
    border-color: #e0e0e0;
    background: #fafafa;
    cursor: default;
    pointer-events: none;
}

.pdw-page-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pdw-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: #666;
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.pdw-arrow svg {
    width: 20px;
    height: 20px;
    display: block;
}

.pdw-arrow:hover {
    color: #333;
}

.pdw-arrow.pdw-disabled {
    color: #ccc;
    cursor: default;
    pointer-events: none;
}

.pdw-page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 6px;
    border: 1px solid #5b5fc7;
    border-radius: 4px;
    font-size: 14px;
    color: #5b5fc7;
    font-weight: 500;
}

/* ===== 视频样式 ===== */

.pdw-style-video .pdw-grid {
    grid-template-columns: repeat(3, 1fr);
}

.pdw-video-thumb {
    padding-bottom: 0;
    height: 220px;
    position: relative;
}

.pdw-video-player {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.pdw-video-card.is-playing .pdw-video-player {
    opacity: 1;
}

.pdw-video-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    line-height: 1.3;
}

.pdw-video-duration {
    position: absolute;
    top: 8px;
    left: 50px;
    z-index: 2;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    line-height: 1.3;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pdw-video-card:hover .pdw-video-duration {
    opacity: 1;
}

.pdw-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    width: 48px;
    height: 48px;
    background: rgba(0,0,0,0.35);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.pdw-play-icon svg {
    width: 22px;
    height: 22px;
    margin-left: 3px;
}

.pdw-video-card.is-playing .pdw-play-icon {
    opacity: 0;
}

.pdw-video-hover-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pdw-video-card:hover .pdw-video-hover-actions {
    opacity: 1;
}

.pdw-video-hover-actions .pdw-download-btn {
    padding: 6px 16px;
    font-size: 12px;
    border-radius: 4px;
    display: inline-block;
    position: static;
}

.pdw-video-hover-actions .pdw-fav-btn {
    position: static;
    opacity: 1;
    width: 32px;
    height: 32px;
}

.pdw-video-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 33.33%;
    z-index: 2;
    padding: 8px 12px;
    font-size: 13px;
    color: #fff;
    text-decoration: none;
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 100%);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pdw-video-card:hover .pdw-video-title {
    opacity: 1;
}

/* ===== 图片样式 ===== */

.pdw-image-grid .pdw-ad-card {
    grid-row: span 2;
    grid-column: 1;
}

.pdw-ad-card {
    height: 100%;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.pdw-ad-card .pdw-ad-link {
    display: block;
    width: 100%;
    height: 100%;
}

.pdw-ad-card .pdw-ad-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pdw-image-card {
    height: 100%;
}

.pdw-image-card .pdw-card-inner {
    height: 100%;
}

.pdw-image-thumb {
    padding-bottom: 0;
    flex: 1;
    min-height: 180px;
    position: relative;
}

.pdw-image-hover-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pdw-image-card:hover .pdw-image-hover-actions {
    opacity: 1;
}

.pdw-image-hover-actions .pdw-download-btn {
    padding: 6px 16px;
    font-size: 12px;
    border-radius: 4px;
    display: inline-block;
    position: static;
}

.pdw-image-hover-actions .pdw-fav-btn {
    position: static;
    opacity: 1;
    width: 32px;
    height: 32px;
}

.pdw-image-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 20px 12px 8px;
    font-size: 13px;
    color: #fff;
    text-decoration: none;
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 100%);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pdw-image-card:hover .pdw-image-title {
    opacity: 1;
}

/* ===== 插画样式 ===== */

.pdw-illust-grid .pdw-ad-card {
    grid-row: span 2;
    grid-column: 1;
}

.pdw-illust-card {
    height: 100%;
}

.pdw-illust-card .pdw-card-inner {
    height: 100%;
}

.pdw-illust-thumb {
    padding-bottom: 0;
    flex: 1;
    min-height: 180px;
    position: relative;
}

.pdw-illust-hover-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pdw-illust-card:hover .pdw-illust-hover-actions {
    opacity: 1;
}

.pdw-illust-hover-actions .pdw-download-btn {
    padding: 6px 16px;
    font-size: 12px;
    border-radius: 4px;
    display: inline-block;
    position: static;
}

.pdw-illust-hover-actions .pdw-fav-btn {
    position: static;
    opacity: 1;
    width: 32px;
    height: 32px;
}

.pdw-illust-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 20px 12px 8px;
    font-size: 13px;
    color: #fff;
    text-decoration: none;
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 100%);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pdw-illust-card:hover .pdw-illust-title {
    opacity: 1;
}

/* ===== 图标样式 ===== */

.pdw-icon-grid {
    display: grid;
    gap: 16px;
}

.pdw-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    padding: 12px 4px;
    transition: transform 0.2s ease;
}

.pdw-icon-item:hover {
    transform: translateY(-2px);
}

.pdw-icon-img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin-bottom: 8px;
}

.pdw-icon-placeholder {
    background: #f0f0f0;
    border-radius: 8px;
}

.pdw-icon-name {
    font-size: 12px;
    color: #333;
    text-align: center;
    word-break: break-all;
    line-height: 1.3;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== 简历样式 ===== */

/* ===== 音乐样式 ===== */

.pdw-music-grid {
    display: grid;
    gap: 16px;
}

.pdw-music-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: #f8f8f8;
    border-radius: 12px;
    min-width: 0;
    transition: box-shadow 0.2s ease;
}

.pdw-music-card:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.pdw-music-cover-wrap {
    position: relative;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
}

.pdw-music-cover {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    object-fit: cover;
    display: block;
    overflow: hidden;
}

.pdw-music-cover-placeholder {
    background: #e0e0e0;
}

.pdw-music-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(0,0,0,0.45);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s ease;
}

.pdw-music-play-btn:hover {
    background: rgba(0,0,0,0.65);
}

.pdw-music-play-btn svg {
    width: 14px;
    height: 14px;
}

.pdw-music-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pdw-music-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pdw-music-title {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

.pdw-music-title:hover {
    color: #0073aa;
}

.pdw-music-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.pdw-music-card:hover .pdw-music-actions {
    opacity: 1;
}

.pdw-music-dl-btn {
    display: inline-block;
    padding: 5px 16px;
    font-size: 12px;
    border-radius: 4px;
    white-space: nowrap;
    background: #4CAF50;
    color: #fff;
    text-decoration: none;
    transition: background 0.2s ease;
}

.pdw-music-dl-btn:hover {
    background: #43a047;
    color: #fff;
}

.pdw-music-actions .pdw-fav-btn {
    position: static;
    flex-shrink: 0;
    opacity: 1;
    width: 20px;
    height: 20px;
}

.pdw-music-actions .pdw-fav-btn svg {
    width: 16px;
    height: 16px;
}

.pdw-music-bottom {
    display: flex;
    align-items: center;
    gap: 30px;
}

.pdw-music-waveform {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1.5px;
    height: 16px;
    overflow: hidden;
}

.pdw-wave-bar {
    display: inline-block;
    width: 1.5px;
    border-radius: 1px;
    background: #ccc;
}

.pdw-wave-bar:nth-child(odd) { height: 20%; }
.pdw-wave-bar:nth-child(3n) { height: 45%; }
.pdw-wave-bar:nth-child(3n+1) { height: 30%; }
.pdw-wave-bar:nth-child(5n) { height: 60%; }
.pdw-wave-bar:nth-child(7n) { height: 40%; }
.pdw-wave-bar:nth-child(11n) { height: 55%; }
.pdw-wave-bar:nth-child(2n) { height: 25%; }
.pdw-wave-bar:nth-child(4n) { height: 35%; }
.pdw-wave-bar:nth-child(13n) { height: 50%; }
.pdw-wave-bar:nth-child(6n+1) { height: 15%; }

.pdw-music-duration {
    font-size: 12px;
    color: #999;
    flex-shrink: 0;
}

@media (max-width: 1024px) {
    .pdw-style-video .pdw-grid { grid-template-columns: repeat(2, 1fr); }
    .pdw-cols-5 { grid-template-columns: repeat(4, 1fr); }
    .pdw-cols-6 { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 768px) {
    /* 所有样式 - 移动端显示下载按钮和收藏图标 */
    .pdw-hover-overlay,
    .pdw-image-hover-actions,
    .pdw-illust-hover-actions,
    .pdw-video-hover-actions {
        opacity: 1 !important;
        visibility: visible !important;
    }

    .pdw-fav-btn {
        opacity: 1 !important;
    }

    /* 移动端列数控制 - 通过data-mobile-cols属性 */
    .pdw-grid[data-mobile-cols="1"],
    .pdw-music-grid[data-mobile-cols="1"] {
        grid-template-columns: 1fr !important;
    }

    .pdw-grid[data-mobile-cols="2"],
    .pdw-music-grid[data-mobile-cols="2"],
    .pdw-icon-grid[data-mobile-cols="2"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .pdw-grid[data-mobile-cols="3"],
    .pdw-icon-grid[data-mobile-cols="3"] {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .pdw-icon-grid[data-mobile-cols="4"] {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    .pdw-icon-grid[data-mobile-cols="5"] {
        grid-template-columns: repeat(5, 1fr) !important;
    }

    /* 音乐样式 - 移动端适配 */
    .pdw-music-card {
        padding: 12px;
    }

    .pdw-music-actions {
        opacity: 1;
    }

    /* 音乐样式 - 移动端单列显示，与PC端相同 */
    .pdw-music-grid {
        grid-template-columns: 1fr !important;
    }

    .pdw-music-card {
        padding: 12px;
    }

    .pdw-music-cover {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 480px) {
    .pdw-cols-3,
    .pdw-cols-4,
    .pdw-cols-5,
    .pdw-cols-6 {
        grid-template-columns: repeat(2, 1fr);
    }

    .pdw-music-cover {
        width: 56px;
        height: 56px;
    }

    .pdw-music-title {
        font-size: 13px;
    }

    .pdw-music-dl-btn {
        padding: 4px 12px;
        font-size: 11px;
    }
}
