/* 全局设置，防止溢出 */
html, body {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* 防止水平滚动 */
}

/* 容器宽度限制 */
.max-w-6xl {
    max-width: 100%; /* 手机端全宽，电脑端限制最大宽度 */
    width: 100%;
    box-sizing: border-box; /* 包含 padding 和 border 在宽度计算中 */
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 1280px) {
    .max-w-6xl {
        max-width: 1152px; /* 电脑端恢复 Tailwind 的 max-w-6xl 默认值 */
    }
}

/* 分类卡片过渡效果 */
.category-item {
    transition: all 0.3s ease;
    width: 100%; /* 确保铺满容器 */
    box-sizing: border-box;
}

.category-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

/* 软件卡片样式 */
.software-card {
    transition: all 0.3s ease;
    width: 100%; /* 确保卡片宽度不超 */
    box-sizing: border-box;
}

.software-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

/* 今天更新的软件 */
.software-card.today-update {
    background-color: rgba(254, 242, 242, 0.6);
}

.software-card.today-update:hover {
    background-color: rgba(254, 242, 242, 0.8);
    box-shadow: 0 6px 12px rgba(253, 88, 88, 0.1);
}

/* 模糊背景层 */
.blur-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.5);
    z-index: 1;
}

/* 公告弹窗 */
.announcement-modal {
    position: relative;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 2;
    width: 100%;
    max-width: 320px; /* 限制最大宽度 */
    box-sizing: border-box;
}

/* 标题区域可点击 */
.software-card a {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    display: flex; /* 使用 flex 确保内部元素布局正确 */
    width: 100%;
}

/* 隐藏滚动条但保留滚动功能 */
.scrollbar-hidden::-webkit-scrollbar {
    display: none;
}

.scrollbar-hidden {
    -ms-overflow-style: none;
    scrollbar-width: none;
    overflow-x: auto;
    max-width: 100%;
    display: block;
}

/* 超小文本尺寸 - 移动端使用 */
.text-2xs {
    font-size: 0.65rem;
    line-height: 1rem;
}

/* 内容包装器 */
.content-wrapper {
    max-width: calc(100% - 96px); /* 桌面端留出按钮空间 */
    overflow: hidden;
}

/* 信息行 */
.content-wrapper p {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 描述容器样式 */
.description-container {
    max-width: 100%;
    margin-top: 2px;
    display: block;
}

/* 描述文本基础样式 */
.description-text {
    max-width: 100%;
    word-break: break-all;
    overflow-wrap: break-word;
    white-space: normal;
    line-height: 1.2;
}

/* 移动端优化 */
@media (max-width: 640px) {
    /* 全局容器全宽 */
    .max-w-6xl {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .category-item .overflow-x-auto,
    .software-card .overflow-x-auto {
        width: 100%;
        padding-bottom: 2px;
    }
    
    .category-item {
        border-radius: 12px;
        width: 100%;
        box-sizing: border-box;
    }

    /* 移动端更紧凑的卡片内边距 */
    .software-card {
        padding: 0.7rem 0.75rem;
    }
    
    /* 调整移动端字体大小 */
    .software-card h3 {
        font-size: 0.875rem;
        line-height: 1.25rem;
    }
    
    .software-card p {
        font-size: 0.75rem;
        line-height: 1rem;
    }
    
    /* 调整移动端图标尺寸 */
    .software-card .fas {
        font-size: 1rem;
    }
    
    .category-item .fas {
        font-size: 1rem;
    }
    
    /* 调整分类卡片文字大小 */
    .category-item h3 {
        font-size: 0.875rem;
        line-height: 1.25rem;
    }
    
    .category-item p {
        font-size: 0.75rem;
        line-height: 1rem;
    }
    
    /* 减小标题文字间距 */
    .software-card h3,
    .category-item h3 {
        letter-spacing: -0.01em;
    }

    /* 移动端内容包装器 */
    .content-wrapper {
        max-width: calc(100% - 70px); /* 调整按钮空间 */
    }

    /* 移动端描述容器 */
    .description-container {
        margin-top: 1px;
    }

    /* 移动端调整弹窗圆角 */
    .announcement-modal {
        border-radius: 12px;
        max-width: 300px; /* 适配小屏幕 */
    }
}

/* 桌面端优化 */
@media (min-width: 641px) {
    .category-item h3 {
        font-size: 1rem;
        line-height: 1.5rem;
    }

    .category-item p {
        font-size: 0.875rem;
        line-height: 1.25rem;
    }

    /* 调整内容包装器 */
    .content-wrapper {
        max-width: calc(100% - 80px); /* 按钮空间 */
    }
}