/* 下载资源分类页面样式 - 高端现代版 */

/* 登录提示样式 - 移除锁图标，只保留悬停提示 */
.download-login-required {
    position: relative;
}

/* 悬停时显示登录提示 */
.download-login-required:hover::before {
    content: '需要登录才能下载';
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
}

/* 备用深色模式覆盖 - 使用属性选择器 */
body.darking .download-item,
html[data-night="1"] .download-item,
body.darking .download-item[data-dark-mode="auto"],
html[data-night="1"] .download-item[data-dark-mode="auto"] {
    background: #2d2d2d !important;
    background-color: #2d2d2d !important;
    border: 1px solid #404040 !important;
    color: #e0e0e0 !important;
}

body.darking .download-item:hover,
html[data-night="1"] .download-item:hover,
body.darking .download-item[data-dark-mode="auto"]:hover,
html[data-night="1"] .download-item[data-dark-mode="auto"]:hover {
    background: #2d2d2d !important;
    background-color: #2d2d2d !important;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4) !important;
}

body.darking .item-title,
html[data-night="1"] .item-title,
body.darking .download-item[data-dark-mode="auto"] .item-title,
html[data-night="1"] .download-item[data-dark-mode="auto"] .item-title {
    color: #ffffff !important;
}

body.darking .item-description,
html[data-night="1"] .item-description,
body.darking .download-item[data-dark-mode="auto"] .item-description,
html[data-night="1"] .download-item[data-dark-mode="auto"] .item-description {
    color: #b0b0b0 !important;
}

body.darking .sources-label,
html[data-night="1"] .sources-label,
body.darking .download-item[data-dark-mode="auto"] .sources-label,
html[data-night="1"] .download-item[data-dark-mode="auto"] .sources-label {
    color: #b0b0b0 !important;
}

/* 重置和基础样式 */
.download-resources,
.download-section {
    margin-top: 0;
}

/* 分组标题样式 */
.download-section {
    margin-bottom: 50px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e8ecf0;
    position: relative;
}

.section-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 1px;
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    background: linear-gradient(135deg, #1f80ff 0%, #0d6efd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-count {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.3);
}

/* 三栏网格布局 */
.download-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

/* 高端下载项目样式 - 浅色模式默认样式 */
.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: all 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;
}

.download-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.download-item:hover::before {
    opacity: 1;
}

.download-item:hover {
    transform: translateY(-4px);
    background: white !important;
    background-color: white !important;
    transition: all 0.2s ease !important; /* 加快悬停过渡速度 */
}

/* 左侧缩略图区域 */
.item-thumbnail {
    width: 160px;
    height: 160px;
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
    padding: 12px;
    box-sizing: border-box;
}

.item-thumbnail a {
    display: block;
    width: 100%;
    height: 100%;
}

.item-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border: none !important;
    outline: none !important;
}

.download-item:hover .item-thumbnail img {
    transform: scale(1.08);
}

/* 文件类型标签 */
.file-type-badge {
    display: none;
}

.download-item:hover .file-type-badge {
    display: none;
}

/* 中间内容区域 */
.item-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    position: relative;
    z-index: 2;
}

.item-title {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    color: #1a1a1a;
}

/* 一句话描述 */
.item-description {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: #6c757d;
    line-height: 1.6;
    font-weight: 400;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* 下载源 */
.download-sources {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.sources-label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 600;
    margin-right: 6px;
}

.source-tag {
    padding: 6px 14px;
    border-radius: 25px;
    font-size: 11px;
    font-weight: 700;
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    display: inline-block;
}

.source-tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.4s;
}

.source-tag:hover::before {
    left: 100%;
}

.source-tag:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.source-default {
    background: linear-gradient(135deg, #1f80ff 0%, #0d6efd 100%);
}

.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);
}

.source-baidu:hover {
    background: linear-gradient(135deg, #0d6efd 0%, #0056b3 100%);
    color: white !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(31, 128, 255, 0.4);
}

.source-quark {
    background: linear-gradient(135deg, #ffe78f 0%, #ffd700 100%);
    color: #333;
}

.more-sources {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
}

/* 右侧操作区域 */
.item-actions {
    width: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1f80ff 0%, #0d6efd 100%);
    flex-shrink: 0;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 2;
    overflow: hidden;
    transition: width 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 悬浮显示资源详情 */
.hover-detail {
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

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

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

/* 详情按钮 */
.btn-detail {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: #1f80ff;
    padding: 12px 16px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    border: 2px solid rgba(31, 128, 255, 0.3);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.btn-detail::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s;
}

.btn-detail:hover::before {
    left: 100%;
}

.btn-detail:hover {
    background: #1f80ff;
    border-color: #0d6efd;
    color: white;
    text-decoration: none;
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(31, 128, 255, 0.4);
}

.btn-detail:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(31, 128, 255, 0.3);
}

.btn-detail i {
    font-size: 14px;
    margin-right: 4px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 100px 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 20px;
    grid-column: 1 / -1;
    border: 1px solid #e8ecf0;
}

.empty-icon {
    margin-bottom: 30px;
}

.empty-icon i {
    font-size: 64px;
    color: #667eea;
    background: linear-gradient(135deg, #1f80ff 0%, #0d6efd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.empty-state h3 {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 700;
}

.empty-state p {
    font-size: 16px;
    color: #6c757d;
    margin: 0;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .download-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .item-thumbnail {
        width: 140px;
        height: 140px;
        padding: 10px;
    }
    
    .item-thumbnail img {
        border-radius: 6px;
        background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    }
    
    .download-item:hover .item-actions {
        width: 100px;
        padding: 15px 12px;
    }
    
    .btn-detail {
        padding: 10px 14px;
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .download-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .download-item {
        min-height: 160px;
    }
    
    .item-thumbnail {
        width: 120px;
        height: 120px;
        padding: 8px;
    }
    
    .item-thumbnail img {
        border-radius: 6px;
        background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    }
    
    .item-content {
        padding: 15px;
    }
    
    .download-item:hover .item-actions {
        width: 90px;
        padding: 12px 10px;
    }
    
    .btn-detail {
        padding: 8px 12px;
        font-size: 11px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .section-title {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .download-grid {
        gap: 15px;
    }
    
    .download-item {
        flex-direction: column;
        min-height: auto;
    }
    
    .item-thumbnail {
        width: 100%;
        height: 200px;
        padding: 15px;
    }
    
    .item-thumbnail img {
        border-radius: 8px;
        background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    }
    
    .item-content {
        padding: 15px;
    }
    
    .item-actions {
        width: 100%;
        flex-direction: row;
        justify-content: center;
        padding: 15px 20px;
        background: linear-gradient(135deg, #1f80ff 0%, #0d6efd 100%);
        position: relative;
        right: auto;
        top: auto;
        bottom: auto;
    }
    
    .file-type-badge {
        display: none;
    }
    
    .hover-detail {
        opacity: 1;
        transform: translateX(0);
    }
    
    .btn-detail {
        padding: 10px 20px;
        font-size: 12px;
        min-width: 120px;
    }
    
    .btn-detail i {
        font-size: 12px;
    }
    
    .empty-state {
        padding: 80px 20px;
    }
    
    .empty-icon i {
        font-size: 48px;
    }
    
    .empty-state h3 {
        font-size: 20px;
    }
}

/* 加载状态 */
.download-loading {
    text-align: center;
    padding: 60px;
    color: #6c757d;
    grid-column: 1 / -1;
}

.download-loading i {
    font-size: 32px;
    animation: spin 1s linear infinite;
    color: #667eea;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 分类页面头部优化 */
.download-category-header {
    background: linear-gradient(135deg, #1f80ff 0%, #0d6efd 100%);
    color: white;
    padding: 60px 40px;
    border-radius: 20px;
    margin-bottom: 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.download-category-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="1" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="1" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.download-category-header h1 {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 20px;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.download-category-header p {
    font-size: 20px;
    opacity: 0.9;
    margin: 0;
    position: relative;
    z-index: 1;
    font-weight: 500;
}

/* 筛选器样式 */
.download-filters {
    background: white;
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8ecf0;
}

.download-filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.download-filter-label {
    font-weight: 700;
    color: #2c3e50;
    margin-right: 20px;
    font-size: 16px;
}

.download-filter-btn {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #6c757d;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e8ecf0;
}

.download-filter-btn:hover,
.download-filter-btn.active {
    background: linear-gradient(135deg, #1f80ff 0%, #0d6efd 100%);
    color: white;
    text-decoration: none;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.download-item {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.download-item:nth-child(1) { animation-delay: 0.1s; }
.download-item:nth-child(2) { animation-delay: 0.2s; }
.download-item:nth-child(3) { animation-delay: 0.3s; }
.download-item:nth-child(4) { animation-delay: 0.4s; }
.download-item:nth-child(5) { animation-delay: 0.5s; }
.download-item:nth-child(6) { animation-delay: 0.6s; }

/* 深色模式适配 - 使用主题CSS变量 */
@media (prefers-color-scheme: dark) {
    .download-item {
        background: var(--tb--bdbg, #2d2d2d) !important;
        background-color: var(--tb--bdbg, #2d2d2d) !important;
        border: 1px solid var(--tb--border, #404040) !important;
        color: var(--tb--content, #e0e0e0) !important;
    }
    
    .download-item:hover {
        background: var(--tb--bdbg, #2d2d2d) !important;
        background-color: var(--tb--bdbg, #2d2d2d) !important;
        box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4) !important;
    }
    
    .item-title {
        color: var(--tb--content, #ffffff) !important;
    }
    
    .item-description {
        color: var(--tb--gray, #b0b0b0) !important;
    }
    
    .sources-label {
        color: var(--tb--gray, #b0b0b0) !important;
    }
    
    .source-baidu {
        background: linear-gradient(135deg, #1f80ff 0%, #0d6efd 100%) !important;
        color: white !important;
    }
    
    .source-quark {
        background: linear-gradient(135deg, #ffe78f 0%, #ffd700 100%) !important;
        color: #333 !important;
    }
    
    .more-sources {
        background: linear-gradient(135deg, #6c757d 0%, #495057 100%) !important;
        color: white !important;
    }
    
    .item-actions {
        background: linear-gradient(135deg, #1f80ff 0%, #0d6efd 100%) !important;
    }
    
    .btn-detail {
        background: rgba(255, 255, 255, 0.9) !important;
        color: #1f80ff !important;
        border: 2px solid rgba(31, 128, 255, 0.3) !important;
    }
    
    .btn-detail:hover {
        background: #1f80ff !important;
        border-color: #0d6efd !important;
        color: white !important;
    }
    
    .file-type-badge {
        display: none !important;
    }
    
    .download-item:hover .file-type-badge {
        display: none !important;
    }
}

