/* APK应用中心专用样式 - 避免与现有样式冲突 */
.apk-card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    max-width: 650px;
    margin-bottom: 20px;
}

.apk-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.apk-card-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.apk-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
    margin: 0;
}

.apk-card-body {
    padding: 20px;
}

.apk-card-footer {
    padding: 15px;
    border-top: 1px solid var(--border);
    background-color: rgba(0, 0, 0, 0.01);
}

/* 应用列表样式 */
.apk-list-app-list {
    margin: 0;
}

.apk-list-app-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
}

.apk-list-app-item:last-child {
    border-bottom: none;
}

.apk-list-app-icon-wrapper {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    overflow: hidden;
    margin-right: 15px;
    flex-shrink: 0;
}

.apk-list-app-icon-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.apk-list-app-info {
    flex: 1;
    max-width: calc(100% - 165px); /* 减去图标宽度和按钮区域的宽度 */
    overflow: hidden; /* 确保内容不会溢出 */
}

.apk-list-app-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--dark);
    width: 100%; /* 确保名称占据可用空间 */
}

.apk-list-app-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
    color: var(--gray);
}

.apk-list-app-category,
.apk-list-app-downloads,
.apk-list-app-version,
.apk-list-app-date {
    display: inline-flex;
    align-items: center;
}

.apk-list-app-category i,
.apk-list-app-downloads i,
.apk-list-app-version i,
.apk-list-app-date i {
    margin-right: 4px;
}

.apk-list-app-desc {
    margin-top: 8px;
    font-size: 14px;
    color: var(--gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%; /* 确保描述占据可用空间 */
}

.apk-list-app-actions {
    display: flex;
    align-items: center;
    margin-left: 10px;
    flex-shrink: 0;
}

.apk-list-app-actions .btn {
    padding: 8px 16px;
    min-width: 80px;
}

/* 分页容器 */
.apk-list-pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.apk-list-pagination-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 15px;
    background: #f0f7ff;
    color: #3b82f6;
    border-radius: var(--border-radius);
    text-decoration: none;
    transition: var(--transition);
}

.apk-list-pagination-info {
    margin: 0 15px;
    color: var(--gray);
}

/* 搜索结果为空时的样式 */
.apk-list-empty-result {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray);
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.apk-list-empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
    color: var(--border);
}

.apk-list-empty-result h3 {
    font-size: 18px;
    color: var(--dark);
    margin-bottom: 10px;
}

.apk-list-empty-result p {
    margin-bottom: 15px;
}

.apk-list-empty-result ul {
    display: inline-block;
    text-align: left;
    margin: 0 auto;
    padding-left: 20px;
}

.apk-list-empty-result li {
    margin-bottom: 5px;
}

.apk-list-next-btn .fa-angle-right {
    margin-left: 5px;  /* 左边距，让箭头与文字有间隔 */
}

.apk-list-prev-btn .fa-angle-left {
    margin-right: 5px;  /* 右边距，让箭头与文字有间隔 */
}

/* 响应式调整 */
@media (max-width: 767px) {
    .apk-list-app-item {
        flex-direction: row; /* 保持水平布局 */
        align-items: center;
        padding: 10px;
        max-width: 100%;
    }
    
    .apk-list-app-icon-wrapper {
        width: 50px;
        height: 50px;
        margin-right: 10px;
    }
    
    .apk-list-app-info {
        flex: 1;
        max-width: calc(100% - 140px); /* 为图标和下载按钮留出空间 */
    }
    
    .apk-list-app-name {
        margin: 0;
        font-size: 16px;
    }
    
    .apk-list-app-meta,
    .apk-list-app-desc {
        display: none; /* 隐藏元数据和描述 */
    }
    
    .apk-list-app-actions {
        margin-left: 10px;
    }
    
    .apk-list-app-actions .btn {
        padding: 6px 12px;
        min-width: 70px;
        font-size: 13px;
    }
}

/* 空应用列表样式 */
.apk-list-empty-apps-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    width: 100%;
    padding: 40px 20px;
}

.apk-list-empty-apps-content {
    text-align: center;
    max-width: 400px;
}

.apk-list-empty-apps-icon {
    font-size: 5rem;
    color: #e0e0e0;
    margin-bottom: 20px;
}

.apk-list-empty-apps-icon i {
    animation: floating 3s ease-in-out infinite;
}

.apk-list-empty-apps-text h4 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #505050;
}

.apk-list-empty-apps-text p {
    color: #888;
    font-size: 16px;
}

/* 投稿按钮样式 */
.apk-list-category-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.apk-list-category-submit-btn {
    padding: 6px 15px;
    font-size: 14px;
    border-radius: 4px;
    margin-left: 15px;
}

/* 空应用容器中也添加投稿按钮 */
.apk-list-empty-apps-action {
    margin-top: 20px;
}

.apk-list-empty-apps-action .btn {
    padding: 8px 20px;
}

/* 保留原有的分类描述样式 */
.category-description {
    padding: 20px;
    background: white;
    margin-top: 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.category-description h2 {
    font-size: 20px;
    margin-bottom: 15px;
    color: var(--dark);
}

.category-description p {
    color: var(--gray);
    line-height: 1.6;
    margin-bottom: 10px;
}

/* 分页按钮悬停和活跃状态 */
.apk-list-pagination-btn:hover,
.apk-list-pagination-btn:active,
.apk-list-pagination-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

/* 下一页和上一页按钮的特殊样式 */
.apk-list-next-btn:hover,
.apk-list-prev-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

@keyframes floating {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* 软件投稿区域样式 - 新增 */
.apk-submit-container {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background-image: linear-gradient(135deg, rgba(249, 115, 22, 0.1), rgba(16, 185, 129, 0.1));
    max-width: 650px;
}

.apk-submit-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
}

.apk-submit-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.apk-submit-icon {
    width: 60px;
    height: 60px;
    background-color: #f97316;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.apk-submit-text h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    color: #1f2937;
}

.apk-submit-text p {
    margin: 0;
    font-size: 0.9rem;
    color: #6b7280;
    max-width: 300px;
}

.apk-submit-button {
    padding: 0.8rem 1.5rem;
    background-color: #f97316;
    color: white;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.apk-submit-button:hover {
    background-color: #ea580c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.2);
}

.section-action.highlight {
    color: #3b82f6;
    font-weight: 500;
}

.section-action.highlight:hover {
    color: #2563eb;
}

/* 分类网格布局 */
.apk-category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 改为一行两个 */
    gap: 1rem;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.apk-category-item {
    text-decoration: none;
    display: flex;
    flex-direction: row; /* 改为水平布局 */
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    background-color: rgba(0, 0, 0, 0.02);
}

.apk-category-item:hover {
    background-color: rgba(59, 130, 246, 0.05);
    transform: translateY(-3px);
}

.apk-category-icon {
    width: 60px;
    height: 60px;
    flex-shrink: 0; /* 防止图标缩小 */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    overflow: hidden;
    background-color: #f3f4f6;
}

.apk-category-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 新增：名称和介绍的容器 */
.apk-category-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* 左对齐 */
    text-align: left;
}

.apk-category-name {
    font-size: 0.9rem;
    color: #4b5563;
    font-weight: 500;
    margin-bottom: 0.25rem;
    text-align: left;
}

.apk-category-desc {
    font-size: 0.75rem;
    color: #6b7280;
    text-align: left;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

/* 应用网格 */
.apk-app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* 减小最小宽度 */
    gap: 1rem;
    max-width: 900px; /* 增加容器宽度 */
    margin-left: auto;
    margin-right: auto;
}


.apk-app-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    background-color: rgba(0, 0, 0, 0.02);
}

.apk-app-item:hover {
    background-color: rgba(59, 130, 246, 0.05);
}

.apk-app-icon {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    background-color: #f3f4f6;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.apk-app-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.apk-app-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.apk-app-name {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.apk-app-name a {
    text-decoration: none;
    color: #111827;
    transition: all 0.3s ease;
}

.apk-app-name a:hover {
    color: #3b82f6;
}

.apk-app-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: #6b7280;
}

.apk-app-category, .apk-app-version, .apk-app-downloads {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.apk-app-desc {
    font-size: 0.9rem;
    color: #4b5563;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.apk-app-button {
    align-self: flex-start;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    background-color: #3b82f6;
    color: white;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    margin-top: 0.5rem;
}

.apk-app-button:hover {
    background-color: #2563eb;
}

/* 平台介绍样式 */
.apk-announcement {
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.apk-announcement p {
    margin-bottom: 1rem;
}

.apk-announcement ul {
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
    list-style-type: disc;
}

.apk-announcement li {
    margin-bottom: 0.5rem;
    position: relative;
}

.apk-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px dashed #e5e7eb;
    text-align: center;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.stats-item {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stats-num {
    font-size: 1.8rem;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 0.5rem;
    position: relative;
}

.stats-num::after {
    content: "+";
    position: absolute;
    font-size: 1rem;
    top: 0;
    right: -12px;
}

.stats-label {
    font-size: 0.9rem;
    color: #6b7280;
}

@media (max-width: 767px) {
    .apk-card {
        width: 100%;
        max-width: 100%;
    }
    
    .apk-list-app-item {
        flex-direction: row; /* 保持水平布局 */
        align-items: center;
        padding: 10px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .apk-list-app-icon-wrapper {
        width: 50px;
        height: 50px;
        margin-right: 10px;
    }
    
    .apk-list-app-info {
        flex: 1;
        max-width: calc(100% - 140px); /* 为图标和下载按钮留出空间 */
    }
    
    .apk-list-app-name {
        margin: 0;
        font-size: 16px;
    }
    
    .apk-list-app-meta,
    .apk-list-app-desc {
        display: none; /* 隐藏元数据和描述 */
    }
    
    .apk-list-app-actions {
        margin-left: 10px;
    }
    
    .apk-list-app-actions .btn {
        padding: 6px 12px;
        min-width: 70px;
        font-size: 13px;
    }
    
    .category-description,
    .section-header,
    .apk-list-pagination-container {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* 分页按钮样式 - 让按钮换行显示 */
    .apk-list-pagination-container {
        flex-direction: row;
        flex-wrap: wrap; /* 允许元素换行 */
        justify-content: center;
        gap: 10px; /* 按钮之间的间距 */
    }
    
    .apk-list-pagination-info {
        width: 100%; /* 让信息占据整行 */
        text-align: center;
        margin: 5px 0;
        order: -1; /* 让信息显示在最上面 */
    }
    
    .apk-list-pagination-btn {
        margin: 5px 0; /* 设置上下边距 */
    }
    
    /* 分类网格适配 */
    .apk-category-grid {
        grid-template-columns: 1fr; /* 改为单列显示 */
    }
    
    /* 软件投稿区域移动端适配 */
    .apk-submit-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .apk-submit-button {
        align-self: stretch;
        text-align: center;
        justify-content: center;
    }
    
    .apk-submit-text p {
        max-width: 100%;
    }
}
