/* ==========================================
   软件和插件卡片组件样式 - software-plugin-cards.css
   包含软件卡片、插件卡片及其相关组件的所有样式
   可在多个页面中重复使用
   ========================================== */

/* ==========================================
   通用筛选容器和按钮样式
   ========================================== */
.filter-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 3rem;
    padding: 0 1rem;
}

.filter-btn {
    border: 2px solid var(--border-primary);
    color: var(--text-secondary);
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    outline: none;
}

.filter-btn:hover {
    border-color: var(--border-secondary);
    color: var(--text-primary);
}

.filter-btn:active {
    border-color: var(--border-secondary);
    color: var(--text-primary);
    transform: translateY(1px);
}

.filter-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(77, 125, 255, 0.3);
}

.filter-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-inverse);
    box-shadow: 0 4px 12px var(--shadow-primary);
}

.filter-btn.active:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.filter-btn.active:active {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(1px);
}

.filter-btn.active:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(77, 125, 255, 0.4);
}



/* ==========================================
   软件卡片网格布局
   ========================================== */
.software-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    justify-content: start;
    margin-bottom: 2rem;
}

/* ==========================================
   软件卡片样式
   ========================================== */
.software-card {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-small);
    /* 高度由内容撑开，不固定 */
    height: auto;
}

.software-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-large);
}

/* 软件预览区域 */
.software-preview {
    position: relative;
    background: linear-gradient(135deg, var(--bg-accent) 0%, var(--bg-secondary) 100%);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 80px;
}

.software-logo {
    width: 48px;
    height: 48px;
    background: var(--bg-primary);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-medium);
}

.software-logo i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.software-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.software-badges {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
}

/* 软件内容区域 */
.software-content {
    padding: 1rem;
    padding-bottom: 0.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.software-header {
    margin-bottom: 1rem;
}

.software-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.2;
    /* 软件名称最多一行，超出省略 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.software-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.software-meta .version {
    background: var(--bg-accent);
    color: var(--primary-color);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

.software-meta .platform {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    /* 右侧对齐，超出显示省略号 */
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.software-description {
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.8rem;
    font-size: 0.85rem;
    /* 软件描述最多两行，超出省略 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 软件特性标签 */
.software-features {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 1rem;
}

.feature-tag {
    background: var(--bg-secondary);
    color: var(--text-tertiary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid var(--border-secondary);
}



/* 软件操作按钮 */
.software-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 1rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-secondary);
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    outline: none;
}

.action-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(77, 125, 255, 0.3);
}

.action-btn:active {
    transform: translateY(1px);
}

.action-btn.primary {
    background: var(--primary-color);
    color: var(--text-inverse);
    border-color: var(--primary-color);
}

.action-btn.primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.action-btn.primary:active {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(1px);
}

.action-btn.primary:focus {
    box-shadow: 0 0 0 2px rgba(77, 125, 255, 0.4);
}

.action-btn.secondary {
    background: var(--bg-accent);
    color: var(--primary-color);
    border-color: var(--border-primary);
}

.action-btn.secondary:hover {
    background: var(--primary-color);
    color: var(--text-inverse);
    border-color: var(--primary-color);
}

.action-btn.secondary:active {
    background: var(--primary-color);
    color: var(--text-inverse);
    border-color: var(--primary-color);
    transform: translateY(1px);
}

.action-btn.secondary:focus {
    box-shadow: 0 0 0 2px rgba(77, 125, 255, 0.3);
}

.action-btn.outline {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-primary);
}

.action-btn.outline:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--border-secondary);
}

.action-btn.outline:active {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--border-secondary);
    transform: translateY(1px);
}

.action-btn.outline:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(77, 125, 255, 0.3);
}

/* ==========================================
   插件卡片网格布局
   ========================================== */
.plugins-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
    justify-content: start;
    margin-bottom: 2rem;
}

/* ==========================================
   插件卡片样式
   ========================================== */
.plugin-card {
    width: 100%;
    min-width: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    padding: 1.5rem;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.plugin-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-hover);
}

.plugin-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
    height: 60px;
}

.plugin-icon {
    width: 50px;
    height: 50px;
    background: var(--bg-accent);
    border: 1px solid var(--border-accent);
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

.plugin-icon i {
    font-size: 1.4rem;
    color: var(--primary-color);
}

.plugin-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.plugin-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.plugin-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    min-width: 0;
}

.plugin-info h3 a {
    color: inherit;
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    min-width: 0;
    width: 100%;
}

.plugin-info h3 a:hover {
    color: var(--primary-color);
}

.plugin-meta {
    display: flex;
    gap: 8px;
    align-items: center;
}

.plugin-version {
    background: var(--bg-accent);
    color: var(--primary-color);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 500;
}

.plugin-status {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 500;
}

.plugin-status.verified {
    background: var(--success-bg);
    color: var(--success-color);
}

.plugin-description {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.plugin-description p {
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.plugin-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: var(--bg-accent);
    color: var(--primary-color);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.plugin-downloads {
    margin-top: auto;
}

.plugin-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    height: 32px;
}

.plugin-actions-left,
.plugin-actions-right {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* 下载按钮样式 */
.download-btn,
.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 12px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    box-sizing: border-box;
    white-space: nowrap;
}

.download-btn.primary {
    background: var(--primary-color);
    color: var(--text-inverse);
    border: 1px solid var(--primary-color);
}

.download-btn.primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.download-btn.primary:active {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(1px);
}

.download-btn.primary:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(77, 125, 255, 0.4);
}

.download-btn:not(.primary) {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
}

.download-btn:not(.primary):hover {
    background: var(--border-primary);
    border-color: var(--border-secondary);
}

.download-btn:not(.primary):active {
    background: var(--border-primary);
    border-color: var(--border-secondary);
    transform: translateY(1px);
}

.download-btn:not(.primary):focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(77, 125, 255, 0.3);
}

.share-btn {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
    cursor: pointer;
    min-width: 32px;
    outline: none;
    transition: all 0.2s ease;
}

.share-btn:hover {
    background: var(--border-primary);
    border-color: var(--border-secondary);
}

.share-btn:active {
    background: var(--border-primary);
    border-color: var(--border-secondary);
    transform: translateY(1px);
}

.share-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(77, 125, 255, 0.3);
}

.download-btn i,
.share-btn i {
    margin-right: 4px;
    font-size: 0.8rem;
}

.share-btn i {
    margin-right: 0;
}

.plugin-tutorial-link {
    width: 100%;
    text-align: center;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-secondary);
}

.tutorial-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 2px solid var(--primary-color);
    background: var(--primary-color);
    color: var(--text-inverse);
    width: 100%;
    outline: none;
}

.tutorial-link:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.tutorial-link:active {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(1px);
}

.tutorial-link:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(77, 125, 255, 0.4);
}

.tutorial-link i {
    font-size: 0.85rem;
}

/* ==========================================
   通用"查看全部"引导样式
   ========================================== */
.more-hint {
    text-align: center;
    padding: 1.5rem;
    margin-top: 2rem;
    color: var(--text-tertiary);
    font-size: 0.95rem;
}

.more-hint .separator {
    margin: 0 8px;
}

.more-hint .view-all-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.more-hint .view-all-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.more-hint .view-all-link i {
    font-size: 0.8rem;
    margin-left: 4px;
}

/* ==========================================
   响应式布局 - 平板设备 (768px - 1023px)
   ========================================== */
@media (max-width: 1023px) {
    .software-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .plugins-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .filter-container {
        margin-bottom: 2rem;
    }
    
    .filter-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* ==========================================
   响应式布局 - 移动设备 (最大767px)
   ========================================== */
@media (max-width: 767px) {
    .software-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 1rem;
    }
    
    .plugins-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 1rem;
    }
    
    .filter-container {
        gap: 8px;
        margin-bottom: 1.5rem;
        padding: 0 0.5rem;
    }
    
    .filter-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .software-preview {
        padding: 0.8rem;
        min-height: 70px;
    }
    
    .software-logo {
        width: 40px;
        height: 40px;
    }
    
    .software-content {
        padding: 0.8rem;
        padding-bottom: 0.5rem;
    }
    
    .software-actions {
        padding: 0 0.8rem 0.8rem 0.8rem;
        padding-top: 0;
        gap: 8px;
        flex-direction: row;
    }
    
    .action-btn {
        padding: 10px 12px;
        font-size: 0.75rem;
        flex: 1;
        height: 36px;
        min-height: 36px;
    }
    
    .share-btn {
        padding: 10px 12px;
        font-size: 0.75rem;
        flex: 1;
        height: 36px;
        min-height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .plugin-card {
        padding: 1rem;
    }
    
    .plugin-header {
        height: 50px;
        margin-bottom: 0.8rem;
    }
    
    .plugin-icon {
        width: 40px;
        height: 40px;
        margin-right: 0.8rem;
    }
    
    .plugin-actions {
        flex-direction: column;
        height: auto;
        gap: 0.5rem;
    }
    
    .plugin-actions-left,
    .plugin-actions-right {
        width: 100%;
        justify-content: center;
    }
    
    .download-btn,
    .share-btn {
        flex: 1;
    }
    
    /* 移动端只显示前3个软件卡片 */
    .software-card:nth-child(n+4) {
        display: none !important;
    }
    
    /* 移动端只显示前3个插件卡片 */
    .plugin-card:nth-child(n+4) {
        display: none !important;
    }
} 