/* 下载资源小工具样式 */

/* 小工具容器 */
.tb-widget-download {
    margin-bottom: 30px;
}

/* 引用主样式文件中的下载卡片样式 */
.tb-widget-download .download-item {
    display: flex;
    align-items: center;
    background: white !important;
    background-color: white !important;
    border: 1px solid #e8ecf0 !important;
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    position: relative;
    min-height: 160px;
    cursor: pointer;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04);
    color: #333 !important;
    margin-bottom: 0;
}

.tb-widget-download .download-item:hover {
    transform: translateY(-4px);
    background: white !important;
    background-color: white !important;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.1);
}

.tb-widget-download .file-type-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    background: linear-gradient(135deg, #ffd700 0%, #ffb347 100%);
    color: #333;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
    display: none;
}

.tb-widget-download .item-thumbnail {
    flex: 0 0 120px;
    height: 120px;
    padding: 12px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tb-widget-download .item-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.tb-widget-download .no-thumbnail {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 8px;
    font-size: 32px;
    color: #999;
}

.tb-widget-download .item-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tb-widget-download .item-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tb-widget-download .item-description {
    font-size: 13px;
    color: #666;
    margin: 0 0 12px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tb-widget-download .item-sources {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.tb-widget-download .sources-label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 600;
    margin-right: 6px;
    flex-shrink: 0;
}

.tb-widget-download .source-baidu,
.tb-widget-download .source-quark {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-block;
    white-space: nowrap;
    flex-shrink: 0;
    margin: 2px 0;
}

.tb-widget-download .source-baidu {
    background: linear-gradient(135deg, #1f80ff 0%, #0d6efd 100%);
    color: white !important;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tb-widget-download .source-quark {
    background: linear-gradient(135deg, #ffe78f 0%, #ffd700 100%);
    color: #333 !important;
    font-weight: 600;
}

.tb-widget-download .source-baidu:hover,
.tb-widget-download .source-quark:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}

.tb-widget-download .item-actions {
    width: 0;
    padding: 0;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(135deg, #1f80ff 0%, #0d6efd 100%);
    transition: width 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.tb-widget-download .download-item:hover .item-actions {
    width: 120px;
    padding: 20px 15px;
}

.tb-widget-download .btn-detail {
    color: white;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    opacity: 0;
    transform: translateX(15px);
    transition: opacity 0.2s ease 0.05s, transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.05s;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    white-space: nowrap;
}

.tb-widget-download .download-item:hover .btn-detail {
    opacity: 1;
    transform: translateX(0);
}

.tb-widget-download .btn-detail:hover {
    background: rgba(255, 255, 255, 0.3);
    text-decoration: none;
    color: white;
}

/* 副标题 */
.tb-widget-download .widget-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

/* 下载资源网格 */
.download-widget-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .download-widget-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .tb-widget-download .item-sources {
        gap: 6px;
    }
    
    .tb-widget-download .sources-label {
        font-size: 11px;
        margin-right: 4px;
    }
    
    .tb-widget-download .source-baidu,
    .tb-widget-download .source-quark {
        padding: 5px 10px;
        font-size: 11px;
        margin: 1px 0;
    }
}

@media (max-width: 480px) {
    .download-widget-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .tb-widget-download .item-sources {
        gap: 4px;
        flex-wrap: nowrap;
    }
    
    .tb-widget-download .sources-label {
        font-size: 10px;
        margin-right: 3px;
    }
    
    .tb-widget-download .source-baidu,
    .tb-widget-download .source-quark {
        padding: 4px 8px;
        font-size: 10px;
        margin: 0;
        flex: 1;
        text-align: center;
    }
}


/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    .tb-widget-download .widget-subtitle {
        color: #b0b0b0;
    }
}

/* 主题深色模式 */
body.darking .tb-widget-download .widget-subtitle,
html[data-night="1"] .tb-widget-download .widget-subtitle {
    color: #b0b0b0 !important;
}

/* 小工具深色模式支持 - 使用主题CSS变量 */
body.darking .tb-widget-download .download-item,
html[data-night="1"] .tb-widget-download .download-item {
    background: var(--tb--bdbg, #1a1a1a) !important;
    background-color: var(--tb--bdbg, #1a1a1a) !important;
    border: 1px solid var(--tb--border, #333) !important;
    color: var(--tb--content, #e0e0e0) !important;
}

body.darking .tb-widget-download .download-item:hover,
html[data-night="1"] .tb-widget-download .download-item:hover {
    background: var(--tb--bdbg, #1a1a1a) !important;
    background-color: var(--tb--bdbg, #1a1a1a) !important;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4) !important;
}

body.darking .tb-widget-download .item-title,
html[data-night="1"] .tb-widget-download .item-title {
    color: var(--tb--content, #ffffff) !important;
}

body.darking .tb-widget-download .item-description,
html[data-night="1"] .tb-widget-download .item-description {
    color: var(--tb--gray, #b0b0b0) !important;
}

body.darking .tb-widget-download .sources-label,
html[data-night="1"] .tb-widget-download .sources-label {
    color: var(--tb--gray, #b0b0b0) !important;
}
