:root {
    --primary-color: #4F46E5;
    --secondary-color: #6366F1;
    --nav-height: 4rem;  /* 减小导航栏高度 */
}

/* 基础布局 */
.main-container {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
    min-height: calc(100vh - var(--nav-height));
}

/* 左侧导航 */
.category-nav {
    position: sticky;
    top: calc(var(--nav-height) + 1rem);  /* 减小与顶部的距离 */
    height: fit-content;
    background: white;
    padding: 1rem;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    z-index: 10;  /* 添加合适的层级 */
}

/* 调整主容器位置 */
.main-container {
    margin-top: calc(var(--nav-height) + 1rem);
    position: relative;
    z-index: 1;
    padding-top: 1rem;  /* 添加顶部内边距 */
}

/* 分类标题调整 */
.category-title {
    scroll-margin-top: calc(var(--nav-height) + 3rem);  /* 调整滚动定位位置 */
}

.nav-item {
    display: block;
    padding: 0.75rem 1rem;
    margin: 0.5rem 0;
    border-radius: 0.75rem;
    color: #4B5563;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--primary-color);
    transition: height 0.3s ease;
}

.nav-item:hover::before,
.nav-item.active::before {
    height: 70%;
}

.nav-item:hover,
.nav-item.active {
    color: var(--primary-color);
    background: #F8FAFC;
    padding-left: 1.5rem;
}

/* 内容区域 */
.content-area {
    padding: 1rem 0;
}

.category-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1F2937;
    padding: 2rem 0 1rem;
    scroll-margin-top: calc(var(--nav-height) + 2rem);
}

/* 软件卡片网格 */
.software-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.75rem;
    padding: 0.5rem;
}

/* 软件卡片基础样式 */
.software-card {
    background: white;
    padding: 1rem;
    border-radius: 1rem;
    display: flex;
    box-shadow: 0 10px 20px rgba(160, 160, 160, 0.1);
    align-items: center;  /* 修改为居中对齐 */
    gap: 0.6rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    max-width: 280px;
    margin: 0 auto;
    width: 100%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 软件图标 */
.software-card img {
    width: 2.75rem;  /* 稍微调小图标尺寸 */
    height: 2.75rem;
    object-fit: contain;
    border-radius: 0.75rem;
    flex-shrink: 0;
}

/* 卡片内容 */
.software-card .content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.software-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.software-card .description {
    color: #64748B;
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0.5rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 统计信息 */
.card-stats,
.software-card .stats {
    display: flex;
    align-items: center;
    margin-top: 0.375rem;
    color: #94A3B8;
    font-size: 0.75rem;
}

.card-stats {
    gap: 0.5rem;
}

.software-card .stats {
    gap: 1rem;
    margin-top: 0.75rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: inherit;
    font-size: inherit;
}

.stat-item .icon {
    width: 0.875rem;
    height: 0.875rem;
    opacity: 0.6;
}

.stats .dot {
    width: 3px;
    height: 3px;
    background: currentColor;
    border-radius: 50%;
}

/* 响应式调整 */
@media (max-width: 640px) {
    .software-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .software-card {
        max-width: 280px;
    }
}

/* 软件卡片悬停效果 */
.software-card:hover {
    background-color: #eeeeee;
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-color: transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 软件图标 */
.software-card img {
    width: 3.8rem;
    height: 3.8rem;
    object-fit: contain;
    border-radius: 0.75rem;
    flex-shrink: 0;
}

/* 卡片内容 */
.software-card .content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.software-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.software-card .description {
    color: #64748B;
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0.5rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.software-card .description {
    color: #64748B;
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0.5rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 180px 1fr;
    }
}

@media (max-width: 768px) {
    .main-container {
        grid-template-columns: 1fr;
    }
    
    .category-nav {
        position: sticky;
        top: var(--nav-height);
        padding: 0.75rem;
        margin-bottom: 1rem;
        display: flex;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-item {
        margin: 0 0.5rem;
        flex-shrink: 0;
    }
}

/* 顶部导航栏 */
/* 导航栏基础样式 */
.navbar {
    position: fixed;
    top: 0.8rem;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    transform: translateZ(0);
    will-change: backdrop-filter, background-color;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-content {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;  
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transform: translateZ(0);
    transition: all 1.0s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: none;
}

/* 滚动效果 */
.navbar.scrolled .nav-content {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

/* 导航链接样式 */
.nav-link {
    color: #4B5563;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    border-radius: 2px;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link.active::after {
    width: 20px;
    opacity: 1;
}

.nav-link:not(.active):hover::after {
    width: 15px;
    opacity: 0.5;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.no-results {
    text-align: center;
    padding: 3rem 0;
    color: #6B7280;
    font-size: 1rem;
    width: 100%;
    grid-column: 1 / -1;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* 修改整体背景色 */
body {
    background-color: #f2f4f7;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* 分类区域卡片样式 */
.content-area > div > div {
    background-color: #ffffff;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* 调整分类标题样式 */
.category-title {
    margin-top: 0;
    padding-top: 0;
    margin-bottom: 0-rem;
}

/* 调整软件网格间距 */
.software-grid {
    padding: 0;
}

/* 软件卡片样式调整 */
.software-card {
    background: #f9f9f9;
    border: 1px solid rgb(242, 242, 242);
}

/* 调整内容区域padding */
.content-area {
    padding: 0;
}

/* Logo样式 */
.logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.logo-img {
    height: 4rem;
    width: auto;
    transition: opacity 0.3s ease;
}

.navbar.scrolled .logo-img {
    opacity: 0.9;
}

/* 搜索框容器 */
.search-box {
    flex: 0 1 300px;
    position: relative;
}

/* 搜索框样式 */
#searchInput {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border-radius: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background-color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    color: #1F2937;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

#searchInput::placeholder {
    color: #9CA3AF;
}

#searchInput:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: white;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* 搜索图标 */
.search-box::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239CA3AF'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
}

/* 滚动时的搜索框样式 */
.navbar.scrolled #searchInput {
    background-color: white;
    border-color: rgba(0, 0, 0, 0.05);
}