/* 软件列表布局 */
.software-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0;
    width: 100%;
    justify-content: flex-start;
}

.software-item {
    display: flex;
    gap: 1.25rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.05);
    width: calc((100% - 4rem) / 4);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.software-icon-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 90px;
    flex-shrink: 0;
    align-self: stretch;
    border-right: 1px solid rgba(0,0,0,0.06);
    padding-right: 1rem;
    position: relative;
}

.software-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    flex-shrink: 0;
    object-fit: cover;
}

.free-badge {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 40px 40px 0 0;
    border-color: var(--primary) transparent transparent transparent;
    z-index: 1;
    border-top-left-radius: 12px;
}

.free-badge span {
    position: absolute;
    top: -33px;
    left: 4px;
    color: white;
    font-size: 0.65rem;
    font-weight: 500;
    transform: rotate(-45deg);
    text-align: center;
    white-space: nowrap;
}

.software-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 0.25rem 0;
}

.software-title-wrapper {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.625rem;
}

.group-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.software-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    letter-spacing: -0.01em;
    position: relative;
}

.software-desc {
    color: #999;
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-family: "LXGW WenKai", "Noto Serif SC", "Source Han Serif SC", "Source Han Serif CN", STSong, "Songti SC", SimSun, serif;
    letter-spacing: 0.3px;
    opacity: 0.9;
    font-weight: 500;
}

/* 搜索框样式 */
.search-container {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    margin-bottom: 0.75rem;
    background: var(--gray-50);
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 0.5rem 2rem 0.5rem 0.75rem;  /* 右侧留出空间给清除按钮 */
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--gray-800);
    transition: all 0.2s;
    background: #fff;
}

.search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    cursor: pointer;
    border-radius: 50%;
    background: var(--gray-100);
    transition: all 0.2s;
}

.search-clear:hover {
    background: var(--gray-200);
    color: var(--gray-600);
}

.search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border: none;
    background: var(--primary);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    min-width: 32px;
}

/* 系统分组导航 */
.system-groups {
    border-radius: 4px;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-start;
    padding: 0.375rem;
    margin-bottom: 0.375rem;
    gap: 0.375rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.system-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    color: var(--gray-700);
    font-size: 0.75rem;
    font-weight: 600;
}

.system-item:hover,
.system-item.active {
    background: var(--gray-50);
    color: var(--primary);
}

.system-icon {
    width: 28px;
    height: 28px;
}

.system-name {
    font-size: 0.7rem;
    font-weight: bold;
}

/* 热榜图标特殊样式 */
.system-item:first-child .system-icon {
    color: #f43f5e;
    stroke-width: 1.5;
}

.system-item:first-child:hover .system-icon,
.system-item:first-child.active .system-icon {
    color: var(--primary);
}

/* 热榜图标特殊样式 */
.system-item:nth-child(2) .system-icon {
    color: #f43f5e;
    stroke-width: 1.5;
}

.system-item:nth-child(2):hover .system-icon,
.system-item:nth-child(2).active .system-icon {
    color: var(--primary);
}

/* 标签列表样式 */
.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
}

.tag-item {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--gray-200);
    border-radius: 3px;
    font-size: 0.675rem;
    color: var(--gray-700);
    cursor: pointer;
    font-weight: normal;
    line-height: 1;
    background: var(--gray-50);
    display: inline-flex;
    align-items: center;
    height: 20px;
    white-space: nowrap;
}

.tag-item:hover,
.tag-item.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    font-weight: 500;
}

/* 软件列表样式 */
.software-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    width: 100%;
}

.software-content {
    flex: 1;
    min-width: 0;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* 暂无数据提示样式 */
.empty-state {
    width: 100%;
    padding: 3rem 1rem;
    text-align: center;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.empty-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    color: var(--gray-400);
}

.empty-text {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

/* 分页样式 */
.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    width: 100%;
}

.pagination {
    display: inline-flex;
    gap: 0.375rem;
    align-items: center;
    justify-content: center;
}

.page-item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 0.25rem;
    border-radius: 4px;
    color: var(--gray-600);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.page-item:hover {
    color: var(--primary);
}

.page-item.active {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

.page-item.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.page-item svg {
    width: 14px;
    height: 14px;
    stroke-width: 2;
}

/* 移动端适配 */
@media (max-width: 1600px) {
    .software-item {
        width: calc((100% - 3rem) / 4);
    }
}

@media (max-width: 1280px) {
    .software-item {
        width: calc((100% - 2rem) / 3);
    }
}

@media (max-width: 768px) {
    .software-grid {
        gap: 0.5rem;
        padding: 0.375rem;
    }

    .software-item {
        width: 100%;
        padding: 0.75rem;
    }

    .software-icon {
        width: 36px;
        height: 36px;
    }

    .software-title {
        font-size: 0.875rem;
    }

    .software-meta {
        font-size: 0.7rem;
    }

    .software-desc {
        font-size: 0.75rem;
    }

    .pagination-container {
        margin-top: 1.5rem;
    }

    .pagination {
        gap: 0.25rem;
    }

    .page-item {
        min-width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }

    .page-item svg {
        width: 12px;
        height: 12px;
    }

    .hot-tag {
        font-size: 0.65rem;
        padding: 0.2rem 0;
    }

    .tooltip {
        max-width: 250px;
        font-size: 11px;
        padding: 6px 10px;
    }

    .software-content {
        display: flex;
        flex-direction: column;
    }

    .software-grid {
        order: 1;  /* 列表显示在最前 */
    }

    .pagination-container {
        order: 2;  /* 分页显示在中间 */
        margin-bottom: 0;  /* 移除底部间距 */
    }
}

.hot-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0;
    font-size: 0.7rem;
    color: #10b981;
    margin-bottom: 0.5rem;
    font-weight: 500;
    line-height: 1.2;
}

.hot-tag:hover {
    color: #059669;
}

.tooltip {
    position: fixed;
    padding: 8px 12px;
    font-size: 12px;
    line-height: 1.4;
    min-width: 10px;
    background: #303133;
    color: #fff;
    border-radius: 4px;
    z-index: 2000;
    word-wrap: break-word;
    max-width: 300px;
}

.tooltip::after {
    content: "";
    display: block;
    position: absolute;
    width: 0;
    height: 0;
    border: 6px solid transparent;
}

.tooltip[data-popper-placement^='top']::after {
    border-top-color: #303133;
    bottom: -12px;
    left: 50%;
    margin-left: -6px;
}

.tooltip[data-popper-placement^='bottom']::after {
    border-bottom-color: #303133;
    top: -12px;
    left: 50%;
    margin-left: -6px;
}

