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

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #ededed;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.wechat-container {
    max-width: 414px;
    height: 100%;
    height: 100dvh;
    margin: 0 auto;
    background-color: #ededed;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.header {
    min-height: 50px;
    height: calc(50px + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
    background-color: #f7f7f7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 15px;
    padding-right: 15px;
    padding-bottom: 0;
    border-bottom: 1px solid #e5e5e5;
    position: relative;
    z-index: 100;
}

.back-btn, .profile-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    cursor: pointer;
}

.back-btn svg, .profile-btn svg {
    width: 24px;
    height: 24px;
}

.title {
    font-size: 17px;
    font-weight: 500;
    color: #333;
}

.chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.chat-area::-webkit-scrollbar {
    width: 0;
    background: transparent;
}

.message {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
}

.message.user-message {
    flex-direction: row-reverse;
}

.message.system-message .message-content {
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    max-width: calc(85% - 20px);
    font-size: 15px;
    line-height: 1.6;
    color: #333;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.message.user-message .message-content {
    background-color: #95ec69;
    padding: 10px 15px;
    border-radius: 8px;
    max-width: 70%;
    font-size: 15px;
    line-height: 1.5;
    color: #333;
    margin-right: 10px;
    position: relative;
}

.message.user-message .message-content::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 10px;
    border-width: 8px;
    border-style: solid;
    border-color: transparent transparent transparent #95ec69;
}

.message.user-message .avatar {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
}

.message.system-message .avatar {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background-color: #ffffff;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #000000;
    text-align: center;
}

.message-content p {
    margin-bottom: 10px;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.bottom-menu {
    min-height: 55px;
    height: calc(55px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background-color: #f7f7f7;
    border-top: 1px solid #e5e5e5;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 100;
}

.menu-left {
    width: 50px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    cursor: pointer;
}

.menu-left svg {
    width: 28px;
    height: 28px;
}

.menu-left img {
    width: 28px;
    height: 28px;
}

.menu-middle {
    flex: 1;
    display: flex;
    height: 100%;
}

.menu-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #333;
    border-right: 1px solid #e5e5e5;
    cursor: pointer;
    position: relative;
}

.menu-item:last-child {
    border-right: none;
}

.menu-item span {
    margin-right: 5px;
}

.menu-item svg {
    width: 12px;
    height: 12px;
    transform: translateY(2px);
    color: #999;
}

.menu-dropdown {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    min-width: 140px;
    display: none;
    z-index: 200;
}

.menu-dropdown::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px;
    border-style: solid;
    border-color: #fff transparent transparent transparent;
}

.menu-dropdown.active {
    display: block;
}

.dropdown-item {
    padding: 12px 20px;
    font-size: 14px;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dropdown-item img {
    width: 12px;
    height: 12px;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background-color: #f5f5f5;
}

.input-area {
    min-height: 55px;
    height: calc(55px + env(safe-area-inset-bottom, 0px));
    background-color: #f7f7f7;
    border-top: 1px solid #e5e5e5;
    display: flex;
    align-items: center;
    padding: 0 10px calc(env(safe-area-inset-bottom, 0px) + 0px) 10px;
    position: relative;
    z-index: 100;
}

.input-left, .input-voice-left, .input-emoji, .input-add {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    cursor: pointer;
}

.input-left svg, .input-voice-left svg, .input-emoji svg, .input-add svg {
    width: 26px;
    height: 26px;
}

.input-left img, .input-voice-left img, .input-emoji img, .input-add img {
    width: 26px;
    height: 26px;
}

.input-wrapper {
    flex: 1;
    margin: 0 8px;
    position: relative;
}

#messageInput {
    width: 100%;
    height: 40px;
    border: 1px solid #dcdcdc;
    border-radius: 5px;
    padding: 0 40px 0 15px;
    font-size: 15px;
    outline: none;
    background-color: #fff;
}

#messageInput:focus {
    border-color: #dcdcdc;
}

.input-mic {
    position: absolute;
    right: 10px;
    top: 58%;
    transform: translateY(-50%);
    color: #999;
    cursor: pointer;
}

.input-mic svg {
    width: 18px;
    height: 18px;
}

.input-send {
    width: 60px;
    height: 36px;
    background-color: #07c160;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.input-send span {
    color: #fff;
    font-size: 15px;
}

.qrcode-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 1000;
    display: none;
}

.qrcode-modal.active {
    display: block;
}

.qrcode-content {
    width: 100%;
    height: 100%;
    position: relative;
}

.qrcode-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 32px;
    color: #fff;
    cursor: pointer;
    z-index: 1001;
    line-height: 1;
}

.qrcode-content h3 {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    text-align: center;
    margin: 0;
    font-size: 18px;
    color: #fff;
    z-index: 1001;
}

.qrcode-tip {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    text-align: center;
    margin: 0;
    font-size: 14px;
    color: #fff;
    z-index: 1001;
}

#qr-reader {
    width: 100%;
    height: 100%;
}
