* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

body {
    background-color: #ededed;
    color: #333;
    max-width: 500px;
    margin: 0 auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

/* 顶部导航 */
.top-bar {
    background-color: #2e2e2e;
    color: white;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar .title {
    font-size: 18px;
    font-weight: 500;
}

.top-bar .icons i {
    margin-left: 15px;
    font-size: 18px;
}

/* 搜索栏 */
.search-bar {
    background-color: #f6f6f6;
    padding: 8px 15px;
    position: sticky;
    top: 50px;
    z-index: 99;
}

.search-box {
    background-color: #fff;
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding: 5px 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.search-box i {
    color: #b2b2b2;
    margin-right: 8px;
}

.search-box input {
    border: none;
    background: transparent;
    flex: 1;
    padding: 5px;
    outline: none;
    font-size: 14px;
}

/* 聊天列表 */
.chat-list {
    flex: 1;
    overflow-y: auto;
    background-color: #fff;
}

.chat-item {
    display: flex;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    cursor: pointer;
}

.chat-item:active {
    background-color: #f9f9f9;
}

.chat-avatar {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #07c160, #05a049);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    overflow: hidden; /* 新增: 隐藏溢出内容 */
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 新增: 确保图片覆盖整个容器 */
}

.chat-info {
    flex: 1;
    margin-left: 12px;
    overflow: hidden;
}

.chat-info h3 {
    font-size: 16px;
    font-weight: normal;
    margin-bottom: 4px;
    color: #000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-info p {
    font-size: 13px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.chat-time {
    font-size: 11px;
    color: #b2b2b2;
    margin-bottom: 5px;
}

.chat-unread {
    background-color: #f44336;
    color: white;
    font-size: 12px;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

/* 底部导航 */
.bottom-nav {
    display: flex;
    background-color: #f9f9f9;
    border-top: 1px solid #e0e0e0;
    padding: 5px 0;
    position: fixed; /* 固定位置 */
    bottom: 0; /* 固定在底部 */
    width: 100%; /* 宽度占满屏幕 */
    z-index: 100; /* 确保在其他内容之上 */
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
    padding: 5px 0;
    font-size: 12px;
    min-width: 0; /* 新增：防止文本溢出 */
}

.nav-item i {
    font-size: 20px; /* 修改：减小图标大小 */
    margin-bottom: 3px;
}

/* 管理面板 */
.admin-panel {
    background-color: #fff;
    padding: 15px;
    border-radius: 10px;
    margin: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.admin-panel h2 {
    color: #07c160;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    font-size: 18px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #666;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.btn {
    background-color: #07c160;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    width: 100%;
    margin-top: 5px;
}

.btn:hover {
    background-color: #05a049;
}

.btn-secondary {
    background-color: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background-color: #e0e0e0;
}

/* 标签页 */
.tabs {
    display: flex;
    background-color: #f9f9f9;
    margin-bottom: 15px;
    border-radius: 5px;
    overflow: hidden;
}

.tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    background-color: #f0f0f0;
    cursor: pointer;
}

.tab.active {
    background-color: #07c160;
    color: white;
}

/* 数据库信息 */
.db-info {
    background-color: #f0f9eb;
    border: 1px solid #e1f3d8;
    border-radius: 4px;
    padding: 10px;
    margin: 15px;
    font-size: 13px;
    color: #666;
}

.db-info h3 {
    color: #07c160;
    margin-bottom: 8px;
    font-size: 14px;
}

.db-info p {
    margin-bottom: 5px;
}

/* 响应式调整 */
@media (max-width: 480px) {
    body {
        max-width: 100%;
    }
    
    .chat-item {
        padding: 10px;
    }
}

/* 提示框 */
.alert {
    padding: 10px 15px;
    margin: 10px;
    border-radius: 4px;
    font-size: 14px;
}

.alert.success {
    background-color: #f0f9eb;
    color: #67c23a;
    border: 1px solid #e1f3d8;
}

/* 新增：搜索高亮样式 */
.search-highlight {
    background-color: #ffeb3b;
    padding: 0 2px;
    border-radius: 2px;
}

/* 新增加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0,0,0,0.1);
    border-radius: 50%;
    border-top-color: #07c160;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 添加新的样式 */
.stats-section {
    width: 100%;
    max-width: 500px;
    margin-bottom: 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 15px;
}

/* 更新 .stats-grid 样式 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.stat-item {
    padding: 10px;
    border-radius: 5px;
    background-color: #f8f9fa;
    text-align: center;
}

.stat-value {
    font-size: 18px;
    font-weight: bold;
    color: #07c160;
}

.stat-label {
    font-size: 12px;
    color: #666;
}

.user-wechat span {
    display: inline-block;
    margin-right: 10px;
    background-color: #f0f9eb;
    padding: 2px 6px;
    border-radius:-
3px;
    font-size: 12px;
    color: #07c160;
}

.user-wechat {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.logout-btn {
    margin-top: 10px;
    padding: 5px 10px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius:-
4px;
    cursor: pointer;
    font-size: 14px;
}

.logout-btn:hover {
    background-color: #d32f2f;
}
