/* 产品相关下载小部件样式 */
.geniatech-downloads-widget {
    width: 100%;
}

.geniatech-downloads-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.geniatech-downloads-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
}

.geniatech-downloads-title-icon i,
.geniatech-downloads-title-icon svg {
    display: block;
    width: 1em;
    height: 1em;
}

.geniatech-downloads-container {
    width: 100%;
}

.geniatech-downloads-empty {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px;
}

/* 分组布局样式 */
.geniatech-downloads-widget.layout-grouped .geniatech-download-group {
    margin-bottom: 30px;
}

.geniatech-download-group-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 8px;
}

.geniatech-download-group-items {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* 网格布局样式 */
.geniatech-downloads-grid {
    display: grid;
    gap: 20px;
}

.geniatech-downloads-grid.columns-1 {
    grid-template-columns: 1fr;
}

.geniatech-downloads-grid.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.geniatech-downloads-grid.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.geniatech-downloads-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* 列表布局样式 */
.geniatech-downloads-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 下载项目样式 */
.geniatech-download-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: transparent;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    border-radius: 0;
    transition: all 0.3s ease;
}

/* 单个项目时不显示分割线 */
.geniatech-download-item.single-item {
    border-bottom: none;
}

/* 最后一个项目不显示分割线 */
.geniatech-download-item:last-child {
    border-bottom: none;
}

.geniatech-download-item:hover {
    background: #f8f9fa;
}

.geniatech-download-item.grid-item {
    flex-direction: column;
    text-align: center;
    padding: 20px;
}

.geniatech-download-info {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 20px;
}

.geniatech-download-item.grid-item .geniatech-download-info {
    flex-direction: column;
    margin-bottom: 15px;
    gap: 10px;
}

.geniatech-download-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin: 0;
    line-height: 1.4;
    flex: 2;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.geniatech-download-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    color: #666666;
    flex-shrink: 0;
}

.geniatech-download-title-icon i,
.geniatech-download-title-icon svg {
    display: block;
    width: 1em;
    height: 1em;
}

.geniatech-download-category {
    font-size: 14px;
    color: #666;
    margin: 0;
    flex: 1;
    min-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.geniatech-download-date {
    font-size: 14px;
    color: #999;
    margin: 0;
    flex: 1;
    min-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.geniatech-download-meta {
    display: none;
}

.geniatech-download-item.grid-item .geniatech-download-title,
.geniatech-download-item.grid-item .geniatech-download-category,
.geniatech-download-item.grid-item .geniatech-download-date {
    flex: none;
    min-width: auto;
    text-align: center;
}

.geniatech-download-version,
.geniatech-download-size {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.geniatech-download-version::before {
    content: '📋';
    font-size: 10px;
}

.geniatech-download-size::before {
    content: '📁';
    font-size: 10px;
}

/* 下载按钮样式 */
.geniatech-download-actions {
    flex-shrink: 0;
}

.geniatech-download-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #e74c3c;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: none;
    outline: none;
}

.geniatech-download-button:hover {
    background: #c0392b;
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
}

.geniatech-download-button:active {
    transform: translateY(0);
}

.geniatech-download-button i {
    font-size: 14px;
}

.geniatech-download-button-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 6px;
    line-height: 1;
}

.geniatech-download-button-icon i,
.geniatech-download-button-icon svg {
    display: block;
    width: 1em;
    height: 1em;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .geniatech-downloads-grid.columns-3,
    .geniatech-downloads-grid.columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* 手机端下载项目内容水平滑动 */
    .geniatech-download-item {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .geniatech-download-item::-webkit-scrollbar {
        display: none;
    }
    
    /* 确保下载项目内容不换行 */
    .geniatech-download-info {
        display: flex;
        align-items: center;
        flex: 1;
        gap: 15px;
        min-width: max-content; /* 防止内容收缩 */
        white-space: nowrap;
    }
    
    .geniatech-download-title,
    .geniatech-download-category,
    .geniatech-download-date {
        flex-shrink: 0; /* 防止收缩 */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* 设置固定宽度比例：标题40% 分类30% 日期30% */
    .geniatech-download-title {
        width: 160px; /* 约40% */
        max-width: 160px;
        font-size: 14px;
    }
    
    .geniatech-download-category {
        width: 120px; /* 约30% */
        max-width: 120px;
        font-size: 12px;
    }
    
    .geniatech-download-date {
        width: 120px; /* 约30% */
        max-width: 120px;
        font-size: 12px;
    }
    
    .geniatech-download-title-icon {
        font-size: 12px;
    }
    
    /* 手机端按钮只显示图标 */
    .geniatech-download-button {
        padding: 8px;
        min-width: 36px;
        justify-content: center;
        flex-shrink: 0;
    }
    
    .geniatech-download-button-text {
        display: none; /* 隐藏按钮文字 */
    }
    
    /* 网格布局在手机端调整 */
    .geniatech-downloads-grid .geniatech-download-item {
        flex-direction: column;
        text-align: center;
        overflow: visible; /* 网格模式不需要滑动 */
    }
    
    .geniatech-downloads-grid .geniatech-download-info {
        flex-direction: column;
        white-space: normal;
        min-width: auto;
    }
    
    .geniatech-downloads-grid .geniatech-download-title,
    .geniatech-downloads-grid .geniatech-download-category,
    .geniatech-downloads-grid .geniatech-download-date {
        min-width: auto;
        white-space: normal;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .geniatech-downloads-grid.columns-2,
    .geniatech-downloads-grid.columns-3,
    .geniatech-downloads-grid.columns-4 {
        grid-template-columns: 1fr;
    }
    
    .geniatech-downloads-title {
        font-size: 18px;
        flex-direction: row;
        text-align: left;
        gap: 8px;
    }
    
    .geniatech-downloads-title-icon {
        font-size: 16px;
    }
    
    .geniatech-download-group-title {
        font-size: 16px;
    }
    
    /* 小屏幕下进一步调整内容宽度比例 */
    .geniatech-download-title {
        width: 140px; /* 约40% */
        max-width: 140px;
        font-size: 13px;
    }
    
    .geniatech-download-category {
        width: 100px; /* 约30% */
        max-width: 100px;
        font-size: 11px;
    }
    
    .geniatech-download-date {
        width: 100px; /* 约30% */
        max-width: 100px;
        font-size: 11px;
    }
    
    .geniatech-download-button {
        padding: 6px;
        min-width: 32px;
        font-size: 11px;
    }
    
    .geniatech-download-button-icon {
        font-size: 11px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .geniatech-download-item {
        background: #2c2c2c;
        border-color: #404040;
        color: #fff;
    }
    
    .geniatech-download-title {
        color: #fff;
    }
    
    .geniatech-download-description {
        color: #ccc;
    }
    
    .geniatech-download-meta {
        color: #999;
    }
    
    .geniatech-downloads-title,
    .geniatech-download-group-title {
        color: #fff;
    }
}

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

.geniatech-download-item {
    animation: fadeInUp 0.5s ease forwards;
}

.geniatech-download-group:nth-child(1) .geniatech-download-item {
    animation-delay: 0.1s;
}

.geniatech-download-group:nth-child(2) .geniatech-download-item {
    animation-delay: 0.2s;
}

.geniatech-download-group:nth-child(3) .geniatech-download-item {
    animation-delay: 0.3s;
}

/* 打印样式 */
@media print {
    .geniatech-download-button {
        display: none;
    }
    
    .geniatech-download-item {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
