* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    /* 隐藏滚动条但保留滚动功能 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

/* 隐藏 html 元素的 Webkit 滚动条 */
html::-webkit-scrollbar {
    display: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: #fff;
    color: #333;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    /* 隐藏滚动条但保留滚动功能 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

/* 隐藏 Webkit 浏览器的滚动条 */
body::-webkit-scrollbar {
    display: none;
}

/* 通用滚动条隐藏 */
*::-webkit-scrollbar {
    display: none;
}

* {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* 导航栏 */
.nav-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 14px 14px;
    background-color: #fff;
    position: relative;
    height: 50px;
}

.nav-title {
    font-size: 16px;
    font-weight: 400;
    color: #000;
    letter-spacing: -0.18px;
}

.discover-group {
    position: absolute;
    right: 28px;
    width: 80px;
    height: 32px;
    background-image: url('./发现群聊.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
    transition: opacity 0.1s ease;
}

.discover-group:active {
    opacity: 0.7;
}

/* 功能区块 */
.function-blocks {
    display: flex;
    justify-content: space-around;
    padding: 20px 14px;
    background-color: #fff;
    margin-bottom: 0;
}

.function-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.function-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.heart-icon {
    background-image: url('./赞和收藏.png');
}

.follow-icon {
    background-image: url('./新增关注.png');
}

.comment-icon {
    background-image: url('./评论和@.png');
}

.function-text {
    font-size: 13px;
    color: #333;
    font-weight: 600;
}

/* 功能区块角标样式 */
.function-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ff2442;
    color: white;
    border-radius: 50%;
    padding: 2px 5px;
    font-size: 11px;
    font-weight: 500;
    min-width: 16px;
    height: 16px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(255, 36, 66, 0.3);
}

/* 消息列表 */
.message-list {
    background-color: #fff;
    margin-top: 12px;
}

.message-item {
    display: flex;
    align-items: center;
    padding: 16px 18px;
    position: relative;
    min-height: 80px;
    background-color: #fff;
}

.message-item:active {
    background-color: #f8f8f8;
}

.avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    margin-right: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.stranger-avatar {
    background-image: url('./陌生人消息.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.activity-avatar {
    background-image: url('./活动消息.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.craft-avatar {
    background-color: #8b4513;
    color: white;
    font-size: 8px;
    line-height: 1;
}

.craft-logo {
    color: white;
    font-size: 8px;
    line-height: 1;
    text-align: center;
    font-weight: 500;
}

.bear-avatar {
    background-color: #ff9500;
    font-size: 20px;
}

.hamster-avatar {
    background-color: #ffb366;
    font-size: 20px;
}

.cat-avatar {
    background-color: #333;
    color: white;
    font-size: 8px;
    line-height: 1;
}

.cat-logo {
    color: white;
    font-size: 8px;
    line-height: 1;
    text-align: center;
    font-weight: 500;
}

.dog-avatar {
    background-color: #8d6e63;
    font-size: 20px;
}

.wind-avatar {
    background-color: #d32f2f;
    color: white;
    font-size: 8px;
    line-height: 1;
}

.wind-logo {
    color: white;
    font-size: 8px;
    line-height: 1;
    text-align: center;
    font-weight: 500;
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.sender-name {
    font-size: 17px;
    font-weight: 500;
    color: #000;
    letter-spacing: -0.15px;
}

.message-time {
    font-size: 13px;
    color: #999;
    font-weight: 400;
}

.message-preview {
    font-size: 14px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
    margin-top: 2px;
    padding-right: 40px;
}

/* 未读消息标识 */
.unread-count {
    background-color: #ff2442;
    color: white;
    border-radius: 50px;
    padding: 2px 6px;
    font-size: 13px;
    font-weight: 400;
    min-width: 20px;
    height: 20px;
    text-align: center;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 10px;
    bottom: 16px;
}

.unread-count.small {
    padding: 1px 5px;
    font-size: 11px;
    font-weight: 400;
    border-radius: 50px;
    min-width: 17px;
    height: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 10px;
    bottom: 16px;
}

.unread-dot {
    width: 6px;
    height: 6px;
    background-color: #ff2442;
    border-radius: 50%;
    position: absolute;
    right: 13px;
    bottom: 23px;
}

/* 底部导航栏 */
.bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 6px 0 10px 0;
    background-color: #fff;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    box-shadow: 0 -1px 0 0 #f0f0f0;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: relative;
    min-width: 40px;
    height: 100%;
}

.nav-item.add-button {
    background-color: #ff2442;
    border-radius: 11px;
    width: 48px;
    height: 36px;
    justify-content: center;
    color: white;
    margin-top: 0;
    box-shadow: 0 2px 8px rgba(255, 36, 66, 0.3);
}

.nav-item.add-button .nav-icon {
    font-size: 34px;
    font-weight: 600;
    line-height: 1;
    color: white;
    transform: translateY(-1px);
}

.nav-icon {
    font-size: 18px;
    color: #999;
}

.nav-text {
    font-size: 16px;
    color: #999;
    font-weight: 600;
}

.nav-item.active .nav-text {
    color: #000;
    font-weight: 700;
}

.nav-item.active .nav-icon {
    color: #ff2442;
}

.message-badge {
    position: absolute;
    top: 2px;
    right: -16px;
    background-color: #ff2442;
    color: white;
    border-radius: 11px;
    padding: 2px 5px;
    font-size: 10px;
    font-weight: 500;
    min-width: 19px;
    height: 19px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* 响应式设计 */
@media (max-width: 375px) {
    .function-blocks {
        padding: 16px 12px;
    }
    
    .function-icon {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .message-item {
        padding: 10px 12px;
    }
    
    .avatar {
        width: 44px;
        height: 44px;
        margin-right: 10px;
    }
}

/* 滚动区域 */
body {
    padding-bottom: 56px; /* 为底部导航栏留出空间 */
}

/* 优化字体显示 */
.sender-name {
    color: #000;
    max-width: 200px;
}

.message-preview {
    color: #999;
    margin-top: 2px;
    line-height: 1.3;
}

.message-time {
    flex-shrink: 0;
}

/* 优化触摸体验 */
.function-item {
    cursor: pointer;
    transition: transform 0.1s ease;
}

.function-item:active {
    transform: scale(0.95);
}

.nav-item {
    cursor: pointer;
    transition: opacity 0.1s ease;
}

.nav-item:active {
    opacity: 0.7;
}

