body {
    margin: 0;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    height: 100vh;
    -webkit-tap-highlight-color: transparent;
}

.container {
    display: flex;
    height: 100%;
}

.group-list {
    width: 240px;
    background: #f5f5f5;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
}

.nav-header {
    padding: 32px 16px;
    background: #001f3f;
    color: white;
    font-size: 25px;
    font-weight: bold;
    text-align: center;
    height: 80px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-box {
    padding: 12px;
    border-bottom: 1px solid #ddd;
    background: #fff;
}

#groupSearch {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
}

.group-container {
    flex: 1;
    overflow-y: auto;
}

.group-item {
    padding: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.2s;
    border-radius: 6px;
    margin: 4px;
    background: #fff;
}

.group-item:active {
    background: #e6f7ff !important;
}

.group-item.active {
    background: #1890ff;
    color: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.group-number {
    width: 24px;
    text-align: right;
    margin-right: 8px;
    opacity: 0.8;
}

.group-name {
    flex: 1;
}

.add-group-btn {
    padding: 12px;
    margin: 8px;
    background: #1890ff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    position: sticky;
    bottom: 0;
}

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
}

/* 修改后的聊天头部样式 */
.chat-header {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #248f56;
    color: white;
    border-bottom: 1px solid #ddd;
    position: relative;
    justify-content: space-between;
}

#currentGroupName {
    font-size: 20px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    text-align: center;
    margin: 0 20px;
}

.mobile-back-btn {
    color: white;
    background: none;
    border: none;
    font-size: 20px;
    padding: 8px;
    display: none;
    flex-shrink: 0;
}

.header-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.edit-group-btn {
    padding: 8px;
    cursor: pointer;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f0f0f0;
}

.message-input {
    height: 120px;
    padding: 16px;
    border-top: 1px solid #ddd;
    background: #fff;
    display: flex;
    align-items: center;
}

#inputText {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-right: 12px;
    resize: none;
    height: 100%;
    font-size: 14px;
}

.send-btn {
    padding: 12px 24px;
    background: #07c160;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 30px;
}

.message-bubble {
    max-width: 70%;
    margin: 8px 0;
    padding: 12px 16px;
    border-radius: 8px;
}

.my-message {
    background: #95ec69;
    margin-left: auto;
}

.other-message {
    background: white;
}

/* 编辑弹窗样式 */
.edit-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    width: 80%;
    max-width: 400px;
}

.edit-modal h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #333;
}

#addGroupNameInput, #editGroupNameInput, #addGroupPathInput, #editGroupPathInput {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 16px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
}

.modal-actions button {
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.modal-actions button:last-child {
    background: #1890ff;
    color: white;
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
        position: relative;
        overflow: hidden;
    }

    .group-list {
        width: 100%;
        height: 100%;
        position: absolute;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 2;
    }

    .group-list.active {
        transform: translateX(0);
    }

    .chat-area {
        width: 100%;
        height: 100%;
        position: absolute;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .chat-area.active {
        transform: translateX(0);
    }

    .mobile-back-btn {
        display: block;
    }

    .message-input {
        height: auto;
        padding: 12px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }

    #inputText {
        height: 60px;
    }

    .nav-header {
        padding: 24px 12px;
        font-size: 16px;
    }

    .search-box {
        padding: 8px;
    }

    #currentGroupName {
        font-size: 18px;
        max-width: 50%;
    }

    .edit-modal {
        width: 90%;
        max-width: none;
        padding: 20px;
    }
}