/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #f7f7f7;
    color: #333;
    overflow: hidden;
    height: 100vh;
    -webkit-user-select: none;
    user-select: none;
}

/* 闲聊应用容器 */
.wechat-app {
    width: 100%;
    height: 100vh;
    position: relative;
    background-color: #f7f7f7;
    overflow: hidden;
}

/* 页面容器 */
.page {
    width: 100%;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
    background-color: #f7f7f7;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 顶部导航栏 */
.top-bar {
    height: 60px;
    background-color: #393a3f;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    color: white;
    position: relative;
    z-index: 100;
    flex-shrink: 0;
}

.top-bar-title {
    font-size: 18px;
    font-weight: 500;
    color: white;
}

.top-bar-actions {
    display: flex;
    gap: 20px;
}

.top-bar-actions i {
    font-size: 18px;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.top-bar-actions i:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 聊天列表页面 */
.chat-list {
    flex: 1;
    overflow-y: auto;
    background-color: white;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.chat-item:hover {
    background-color: #f5f5f5;
}

.chat-item:active {
    background-color: #e5e5e5;
}

.chat-avatar {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    margin-right: 12px;
    flex-shrink: 0;
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-info {
    flex: 1;
    min-width: 0;
}

.chat-name {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-message {
    font-size: 14px;
    color: #999;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.chat-time {
    font-size: 12px;
    color: #999;
}

.chat-badge {
    background-color: #fa5151;
    color: white;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 14px;
}

/* 通讯录页面 */
.contacts-content {
    flex: 1;
    overflow-y: auto;
    background-color: #f7f7f7;
    padding: 10px;
}

.contacts-section {
    background-color: white;
    border-radius: 12px;
    margin-bottom: 10px;
    overflow: hidden;
}

.contacts-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.contacts-item:last-child {
    border-bottom: none;
}

.contacts-item:hover {
    background-color: #f8f8f8;
}

.contacts-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
}

.contacts-icon i {
    font-size: 18px;
}

.contacts-text {
    flex: 1;
    font-size: 16px;
    color: #333;
}

.contacts-badge {
    background-color: #ff4757;
    color: white;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 14px;
}

.contacts-divider {
    height: 10px;
    background-color: #f7f7f7;
}

.contacts-search {
    background: white;
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 12px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 20px;
    padding: 8px 15px;
}

.search-box i {
    color: #999;
    margin-right: 10px;
    font-size: 14px;
}

.search-box input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    color: #333;
}

.search-box input::placeholder {
    color: #999;
}

/* 搜索建议样式 */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-suggestion-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-suggestion-item:hover {
    background-color: #f8f9fa;
}

.search-suggestion-item:last-child {
    border-bottom: none;
}

.search-suggestion-icon {
    color: #666;
    font-size: 12px;
    width: 16px;
    text-align: center;
}

.search-suggestion-text {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.search-suggestion-type {
    font-size: 12px;
    color: #888;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 10px;
}

/* 在线状态指示器样式 */
.friend-avatar {
    position: relative;
}

.online-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.online-indicator.online {
    background-color: #4CAF50;
    animation: pulse 2s infinite;
}

.online-indicator.offline {
    background-color: #9E9E9E;
}

/* 在线状态文字样式 */
.friend-status.online {
    color: #4CAF50;
    font-weight: 500;
}

.friend-status.offline {
    color: #9E9E9E;
}

/* 在线指示器脉冲动画 */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(76, 175, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

.contacts-list {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
}

.contacts-letter {
    padding: 8px 20px;
    background-color: #f8f8f8;
    font-size: 14px;
    color: #666;
    font-weight: bold;
    border-bottom: 1px solid #f0f0f0;
}

.contacts-friend {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.contacts-friend:last-child {
    border-bottom: none;
}

.contacts-friend:hover {
    background-color: #f8f8f8;
}

.friend-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.btn-chat, .btn-detail {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.btn-chat {
    background-color: #07c160;
    color: white;
}

.btn-chat:hover {
    background-color: #06ad56;
}

.btn-detail {
    background-color: #f0f0f0;
    color: #666;
}

.btn-detail:hover {
    background-color: #e0e0e0;
}

.friend-avatar {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    margin-right: 15px;
    flex-shrink: 0;
}

.friend-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.friend-info {
    flex: 1;
}

.friend-name {
    font-size: 16px;
    color: #333;
    margin-bottom: 2px;
}

.friend-status {
    font-size: 12px;
    color: #999;
}

/* 发现页面 */
.discover-content {
    flex: 1;
    overflow-y: auto;
    background-color: #f7f7f7;
    padding: 0;
}

.discover-section {
    background-color: white;
    margin-bottom: 10px;
}

.discover-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
}

.discover-item:last-child {
    border-bottom: none;
}

.discover-item:hover {
    background-color: #f8f8f8;
}

.discover-icon {
    width: 24px;
    height: 24px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.discover-icon i {
    font-size: 20px;
}

.discover-text {
    flex: 1;
    font-size: 16px;
    color: #333;
}

.discover-badge {
    background: #ff3b30;
    color: white;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-right: 10px;
    min-width: 18px;
    text-align: center;
}

.discover-arrow {
    color: #c7c7cc;
    font-size: 14px;
}

.discover-divider {
    height: 10px;
    background: #f0f0f0;
}

/* 我的页面 */
.profile-content {
    flex: 1;
    overflow-y: auto;
    background-color: #f7f7f7;
}

.profile-header {
    background-color: white;
    padding: 20px 16px;
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.profile-header:hover {
    background-color: #f5f5f5;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    margin-right: 16px;
    flex-shrink: 0;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-name {
    font-size: 18px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-id {
    font-size: 14px;
    color: #999;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-qr {
    margin-right: 12px;
    color: #c7c7cc;
    font-size: 20px;
    cursor: pointer;
    transition: color 0.2s;
}

.profile-qr:hover {
    color: #999;
}

.profile-arrow {
    color: #c7c7cc;
    font-size: 14px;
}

.profile-section {
    background-color: white;
    margin-bottom: 10px;
}

.profile-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
}

.profile-item:last-child {
    border-bottom: none;
}

.profile-item:hover {
    background-color: #f5f5f5;
}

.profile-item:active {
    background-color: #e5e5e5;
}

.profile-icon {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.profile-icon i {
    font-size: 20px;
    color: #666;
}

.profile-text {
    flex: 1;
    font-size: 16px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-badge {
    background-color: #fa5151;
    color: white;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-right: 8px;
    min-width: 18px;
    text-align: center;
    line-height: 14px;
}

.function-badge {
    background-color: #fa5151;
    color: white;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto;
    min-width: 18px;
    text-align: center;
    line-height: 14px;
}

.profile-arrow-icon {
    color: #c7c7cc;
    font-size: 14px;
    margin-left: auto;
}

.profile-divider {
    height: 10px;
    background-color: #f7f7f7;
}

.profile-logout {
    padding: 20px 16px;
    background-color: white;
    margin-top: 20px;
}

.logout-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: #fa5151;
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.logout-btn:hover {
    background-color: #e04444;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(250, 81, 81, 0.3);
}

.logout-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(250, 81, 81, 0.3);
}

/* 聊天详情页面 */
.chat-detail-page {
    z-index: 200;
}

.chat-header {
    height: 60px;
    background: linear-gradient(135deg, #07c160 0%, #06ad56 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    color: white;
    position: relative;
    z-index: 100;
    flex-shrink: 0;
    box-shadow: 0 2px 12px rgba(7,193,96,0.2);
}

.chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
}

.chat-header-left,
.chat-header-right {
    width: 60px;
    display: flex;
    justify-content: center;
    z-index: 1;
}

.chat-header-left i,
.chat-header-right i {
    font-size: 18px;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
}

.chat-header-left i:hover,
.chat-header-right i:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.chat-header-title {
    flex: 1;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    z-index: 1;
}

/* 消息容器 */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: linear-gradient(to bottom, #f8f9fa 0%, #e9ecef 100%);
    position: relative;
}

.messages-container::-webkit-scrollbar {
    width: 6px;
}

.messages-container::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05);
    border-radius: 3px;
}

.messages-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #07c160 0%, #06ad56 100%);
    border-radius: 3px;
    transition: all 0.2s ease;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #06ad56 0%, #059c4f 100%);
}
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><defs><pattern id="grid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="%23f0f0f0" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
}

/* 消息样式 */
.message {
    display: flex;
    margin-bottom: 16px;
    align-items: flex-start;
}

.message.own {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 8px;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.8);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.message-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-color: #07c160;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-content {
    max-width: 70%;
    display: flex;
    flex-direction: column;
}

.message.own .message-content {
    align-items: flex-end;
}

.message-sender {
    font-size: 12px;
    color: #999;
    margin-bottom: 4px;
    padding: 0 12px;
}

.message-bubble {
    background-color: white;
    border-radius: 18px;
    padding: 12px 16px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    word-wrap: break-word;
    max-width: 100%;
    transition: all 0.2s ease;
    animation: messageSlideIn 0.3s ease-out;
}

.message.own .message-bubble {
    background: linear-gradient(135deg, #95ec69 0%, #7dd55c 100%);
    color: #333;
}

.message-bubble:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 图片消息样式 */
.message-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s;
    display: block;
}

.message-image:hover {
    transform: scale(1.02);
}

/* 视频消息样式 */
.message-video {
    max-width: 250px;
    max-height: 200px;
    border-radius: 6px;
    display: block;
}

/* 图片模态框样式 */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    cursor: pointer;
}

.image-modal img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* 表情选择器样式 */
.emoji-picker {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 12px;
    z-index: 1000;
    max-width: 280px;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 4px;
    max-height: 200px;
    overflow-y: auto;
}

.emoji-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 4px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.emoji-btn:hover {
    background-color: #f5f5f5;
}

.emoji-btn:active {
    background-color: #e0e0e0;
}

.message-bubble::before {
    content: '';
    position: absolute;
    top: 12px;
    width: 0;
    height: 0;
    border: 6px solid transparent;
}

.message:not(.own) .message-bubble::before {
    left: -12px;
    border-right-color: white;
}

.message.own .message-bubble::before {
    right: -12px;
    border-left-color: #95ec69;
}

.message-text {
    font-size: 16px;
    line-height: 1.4;
    color: #333;
}

.message-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 6px;
    cursor: pointer;
}

/* 聊天输入容器 */
.chat-input-container {
    background: linear-gradient(to bottom, rgba(255,255,255,0.95), white);
    padding: 16px;
    border-top: 1px solid rgba(0,0,0,0.05);
    flex-shrink: 0;
    backdrop-filter: blur(10px);
}

.chat-tools {
    display: flex;
    gap: 12px;
    padding: 8px 12px;
    justify-content: center;
    margin-bottom: 12px;
}

.tool-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tool-btn:hover {
    background: linear-gradient(135deg, #07c160 0%, #06ad56 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(7,193,96,0.3);
}

.input-group {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 4px;
    background: white;
    border-radius: 25px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
}

.message-input {
    flex: 1;
    min-height: 20px;
    max-height: 100px;
    padding: 12px 16px;
    border: none;
    border-radius: 20px;
    font-size: 15px;
    resize: none;
    outline: none;
    background: transparent;
    line-height: 1.4;
}

.message-input:focus {
    outline: none;
}

.message-input::placeholder {
    color: #999;
    font-size: 14px;
}

.send-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #07c160 0%, #06ad56 100%);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 4px;
}

.send-btn:hover {
    background: linear-gradient(135deg, #06ad56 0%, #059c4f 100%);
    transform: scale(1.05);
}

.send-btn:active {
    transform: scale(0.95);
}

/* 输入区域 */
.input-container {
    background-color: #f7f7f7;
    padding: 8px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    border-top: 1px solid #e5e5e5;
    flex-shrink: 0;
}

.input-tools {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tool-btn {
    width: 36px;
    height: 36px;
    border: none;
    background-color: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.tool-btn:hover {
    background-color: #f5f5f5;
}

.tool-btn i {
    font-size: 16px;
    color: #666;
}

.message-form {
    flex: 1;
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

#messageInput {
    flex: 1;
    min-height: 36px;
    max-height: 100px;
    padding: 8px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    font-size: 16px;
    resize: none;
    outline: none;
    background-color: white;
    line-height: 1.4;
}

#messageInput:focus {
    border-color: #07c160;
}

.send-btn {
    width: 36px;
    height: 36px;
    border: none;
    background-color: #07c160;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.send-btn:hover {
    background-color: #06ad56;
}

.send-btn i {
    font-size: 14px;
    color: white;
}

/* 底部导航栏 */
.bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background-color: #f7f7f7;
    border-top: 1px solid #e5e5e5;
    display: flex;
    z-index: 1000;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s;
    padding: 12px 8px;
}

.nav-item:hover {
    background-color: #f0f0f0;
}

.nav-item i {
    font-size: 24px;
    color: #999;
    margin-bottom: 6px;
    transition: color 0.2s;
}

.nav-item span {
    font-size: 14px;
    color: #999;
    transition: color 0.2s;
}

.nav-item.active i,
.nav-item.active span {
    color: #07c160;
}

.nav-badge {
    position: absolute;
    top: 4px;
    right: 20px;
    background-color: #fa5151;
    color: white;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 8px;
    min-width: 16px;
    text-align: center;
    line-height: 12px;
}

.nav-dot {
    position: absolute;
    top: 8px;
    right: 24px;
    width: 8px;
    height: 8px;
    background-color: #fa5151;
    border-radius: 50%;
}

/* 页面内容区域调整 */
.page:not(.chat-detail-page) {
    padding-bottom: 70px;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .top-bar {
        height: 50px;
        padding: 0 12px;
    }
    
    .top-bar-title {
        font-size: 16px;
    }
    
    .top-bar-actions i {
        font-size: 16px;
        padding: 6px;
    }
    
    .chat-item {
        padding: 10px 12px;
    }
    
    .chat-avatar {
        width: 45px;
        height: 45px;
    }
    
    .chat-name {
        font-size: 15px;
    }
    
    .chat-message {
        font-size: 13px;
    }
    
    .bottom-nav {
        height: 60px;
    }
    
    .nav-item i {
        font-size: 20px;
    }
    
    .nav-item span {
        font-size: 11px;
    }
    
    .page:not(.chat-detail-page) {
        padding-bottom: 60px;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #c7c7cc;
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 动画效果 */
.page {
    transition: transform 0.3s ease-in-out;
}

.page.slide-left {
    transform: translateX(-100%);
}

.page.slide-right {
    transform: translateX(100%);
}

/* 加载动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

.message {
    animation: fadeIn 0.3s ease-out;
}

/* 改进消息提示样式 */
.message.success {
    background-color: #28a745;
    border-left: 4px solid #1e7e34;
}

.message.error {
    background-color: #dc3545;
    border-left: 4px solid #c82333;
}

.message.info {
    background-color: #17a2b8;
    border-left: 4px solid #138496;
}

/* 按钮悬停效果改进 */
.add-friend-btn:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,123,255,0.3);
}

.user-result:hover {
    background-color: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 输入框焦点效果 */
input[type="text"]:focus,
textarea:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
    outline: none;
}

/* 点击反馈 */
.chat-item:active,
.contacts-item:active,
.discover-item:active,
.profile-item:active,
.nav-item:active {
    background-color: #e5e5e5;
    transform: scale(0.98);
    transition: all 0.1s;
}

/* 安全区域适配 */
@supports (padding: max(0px)) {
    .bottom-nav {
        padding-bottom: max(0px, env(safe-area-inset-bottom));
    }
    
    .top-bar {
        padding-top: max(0px, env(safe-area-inset-top));
        height: calc(60px + max(0px, env(safe-area-inset-top)));
    }
}

/* 通讯录模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    background-color: #393a3f;
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
}

.close {
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

/* 搜索区域样式 */
.search-section {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-section input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.search-section input:focus {
    border-color: #07c160;
}

.search-btn {
    padding: 10px 20px;
    background-color: #07c160;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.search-btn:hover {
    background-color: #06ad56;
}

/* 表单样式 */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #07c160;
}

.create-btn {
    width: 100%;
    padding: 12px;
    background-color: #07c160;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.create-btn:hover {
    background-color: #06ad56;
}

/* 好友申请项样式 */
.friend-request-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.friend-request-item:last-child {
    border-bottom: none;
}

.friend-request-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    overflow: hidden;
}

.friend-request-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.friend-request-info {
    flex: 1;
}

.friend-request-name {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
}

.friend-request-message {
    font-size: 14px;
    color: #666;
}

.friend-request-actions {
    display: flex;
    gap: 8px;
}

.accept-btn,
.reject-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.accept-btn {
    background-color: #07c160;
    color: white;
}

.accept-btn:hover {
    background-color: #06ad56;
}

.reject-btn {
    background-color: #f5f5f5;
    color: #666;
}

.reject-btn:hover {
    background-color: #e5e5e5;
}

/* 用户搜索结果样式 */
.user-search-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.user-search-item:last-child {
    border-bottom: none;
}

.user-search-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    overflow: hidden;
}

.user-search-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-search-info {
    flex: 1;
}

.user-search-name {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
}

.user-search-email {
    font-size: 14px;
    color: #666;
}

.add-friend-btn {
    padding: 6px 16px;
    background-color: #07c160;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.add-friend-btn:hover {
    background-color: #06ad56;
}

.add-friend-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* 群聊列表项样式 */
.group-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.group-item:hover {
    background-color: #f5f5f5;
}

.group-item:last-child {
    border-bottom: none;
}

.group-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    margin-right: 12px;
    background-color: #ff9500;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.group-info {
    flex: 1;
}

.group-name {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
}

.group-members {
    font-size: 14px;
    color: #666;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    color: #ddd;
}

.empty-state p {
    font-size: 16px;
    margin: 0;
}

/* 好友申请模态框样式 */
.friend-request-info {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.friend-request-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.friend-request-user img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e9ecef;
}

.friend-request-details h4 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 16px;
}

.friend-request-details p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.friend-request-message {
    margin-bottom: 20px;
}

.friend-request-message label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.friend-request-message textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.friend-request-message textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.message-counter {
    text-align: right;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

.friend-request-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.friend-request-actions .btn {
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.friend-request-actions .btn-secondary {
    background: #6c757d;
    color: white;
}

.friend-request-actions .btn-primary {
    background: #007bff;
    color: white;
}

.friend-request-actions .btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* 好友详情样式 */
.friend-detail-info {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.friend-detail-avatar {
    margin-right: 15px;
}

.friend-detail-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e9ecef;
}

.friend-detail-basic h4 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 18px;
}

.friend-detail-basic p {
    margin: 5px 0;
    color: #666;
    font-size: 14px;
}

.friend-detail-nickname {
    font-style: italic;
    color: #888 !important;
}

.friend-detail-status {
    display: flex;
    align-items: center;
    gap: 5px;
}

.friend-detail-status .fa-circle.online {
    color: #28a745;
}

.friend-detail-status .fa-circle.offline {
    color: #6c757d;
}

.friend-detail-since {
    font-size: 12px !important;
    color: #999 !important;
}

.friend-detail-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.friend-detail-actions .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.friend-detail-actions .btn-primary {
    background: #007bff;
    color: white;
}

.friend-detail-actions .btn-danger {
    background: #dc3545;
    color: white;
}

.friend-detail-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* 好友分组管理样式 */
.friend-groups-container {
    max-height: 400px;
    overflow-y: auto;
}

.friend-group-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    margin-bottom: 8px;
    background-color: #fff;
    transition: all 0.2s ease;
}

.friend-group-item:hover {
    background-color: #f8f9fa;
    border-color: #07c160;
}

.friend-group-info {
    flex: 1;
}

.friend-group-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.friend-group-desc {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.friend-group-count {
    font-size: 12px;
    color: #999;
}

.friend-group-actions {
    display: flex;
    gap: 8px;
}

.friend-group-actions .btn {
    padding: 6px 12px;
    font-size: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-edit {
    background-color: #17a2b8;
    color: white;
}

.btn-edit:hover {
    background-color: #138496;
}

.btn-manage {
    background-color: #6f42c1;
    color: white;
}

.btn-manage:hover {
    background-color: #5a32a3;
}

.btn-delete {
    background-color: #dc3545;
    color: white;
}

.btn-delete:hover {
    background-color: #c82333;
}

.btn-delete:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* 分组好友列表样式 */
.group-friends-container {
    max-height: 350px;
    overflow-y: auto;
}

.group-friend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    margin-bottom: 6px;
    background-color: #fff;
    transition: background-color 0.2s ease;
}

.group-friend-item:hover {
    background-color: #f8f9fa;
}

.group-friend-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.group-friend-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #07c160;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.group-friend-name {
    font-weight: 500;
    color: #333;
}

.btn-remove {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-remove:hover {
    background-color: #c82333;
}

/* 添加好友到分组样式 */
.available-friends-container {
    max-height: 300px;
    overflow-y: auto;
}

.available-friend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    margin-bottom: 6px;
    background-color: #fff;
    transition: background-color 0.2s ease;
}

.available-friend-item:hover {
    background-color: #f8f9fa;
}

.available-friend-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.available-friend-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.available-friend-name {
    font-weight: 500;
    color: #333;
}

.btn-add-to-group {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-add-to-group:hover {
    background-color: #218838;
}

/* 好友分组表单样式 */
.friend-group-form .form-group {
    margin-bottom: 16px;
}

.friend-group-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
}

.friend-group-form input,
.friend-group-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.friend-group-form input:focus,
.friend-group-form textarea:focus {
    border-color: #07c160;
}

.friend-group-form textarea {
    resize: vertical;
    min-height: 80px;
}

.friend-group-form .form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.friend-group-form .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.friend-group-form .btn-primary {
    background-color: #07c160;
    color: white;
}

.friend-group-form .btn-primary:hover {
    background-color: #06ad56;
}

.friend-group-form .btn-secondary {
    background-color: #6c757d;
    color: white;
}

.friend-group-form .btn-secondary:hover {
    background-color: #5a6268;
}

/* 登录页面样式 - 闲聊手机端风格 */
body.login-page {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #ededed;
    min-height: 100vh;
    overflow: auto;
    height: auto;
    -webkit-user-select: auto;
    user-select: auto;
    width: 100%;
    max-width: 414px;
    margin: 0 auto;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.login-container {
    min-height: 100vh;
    background: #ededed;
    display: flex;
    flex-direction: column;
    padding: 0;
    position: relative;
}

.login-form {
    background: #ffffff;
    padding: 40px 30px 30px 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: auto;
}

.login-form h2 {
    text-align: center;
    margin: 0 0 40px 0;
    color: #333;
    font-size: 22px;
    font-weight: 600;
    position: relative;
}

.login-form h2::before {
    content: '';
    display: block;
    width: 70px;
    height: 70px;
    margin: 0 auto 20px auto;
    background: #07c160;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 4px 15px rgba(7, 193, 96, 0.2);
}

.login-form h2::after {
    content: '💬';
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 28px;
    z-index: 1;
}

.form-group {
    margin: 0 0 20px 0;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-size: 16px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 15px 16px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 17px;
    background: #ffffff;
    outline: none;
    box-sizing: border-box;
    font-weight: 400;
    color: #333;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.form-group input:focus {
    border-color: #07c160;
    box-shadow: 0 0 0 2px rgba(7, 193, 96, 0.1);
}

.form-group input::placeholder {
    color: #999;
    font-size: 16px;
}

.login-btn {
    width: 100%;
    margin: 30px 0 20px 0;
    padding: 16px;
    background: #07c160;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    text-transform: none;
    letter-spacing: 0.3px;
    -webkit-appearance: none;
    appearance: none;
}

.login-btn:active {
    background: #06ad56;
    transform: scale(0.98);
}

.form-links {
    text-align: center;
    margin: 15px 0 25px 0;
    padding: 0 20px;
}

.form-links a {
    color: #07c160;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.form-links a:active {
    color: #06ad56;
}

.error-message {
    background: #fef2f2;
    color: #dc2626;
    padding: 12px 16px;
    margin: 15px 0;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    border-radius: 6px;
    border: 1px solid #fecaca;
}

.success-message {
    background: #f0fdf4;
    color: #16a34a;
    padding: 12px 16px;
    margin: 15px 0;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    border-radius: 6px;
    border: 1px solid #bbf7d0;
}

/* 闲聊手机端适配 */
@media (max-width: 375px) {
    .login-form {
        margin: 40px 15px 0 15px;
        padding: 30px 20px 25px 20px;
        width: calc(100% - 30px);
    }
    
    .login-form h2 {
        font-size: 20px;
        margin-bottom: 30px;
    }
    
    .login-form h2::before {
        width: 60px;
        height: 60px;
        margin-bottom: 15px;
    }
    
    .login-form h2::after {
        font-size: 24px;
        top: 12px;
    }
    
    .form-group {
        margin-bottom: 18px;
    }
    
    .form-group input {
        padding: 13px 14px;
        font-size: 16px;
    }
    
    .login-btn {
        padding: 14px;
        font-size: 17px;
        margin: 25px 0 15px 0;
    }
}

/* 聊天记录页面样式 */
.top-bar-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.top-bar-back:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.top-bar-back i {
    font-size: 18px;
    color: white;
}

/* 底部安全区域适配 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .login-container {
        padding-bottom: env(safe-area-inset-bottom);
    }
}