.page {
    min-height: 100vh;
    background: linear-gradient(180deg, #fff 0%, #f0f1f6 60%, #f0f1f6 100%);
    display: flex;
    flex-direction: column;
}

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #fff;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    padding-left: 24rpx;
    padding-right: 24rpx;
    padding-bottom: 16rpx;
    box-sizing: border-box;
    z-index: 100;
}

.nav-back {
    width: 60rpx;
    height: 64rpx;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-back-icon {
    width: 20rpx;
    height: 20rpx;
    border-left: 4rpx solid #333;
    border-bottom: 4rpx solid #333;
    transform: rotate(45deg);
}

.nav-title {
    font-size: 30rpx;
    font-weight: 600;
    color: #222;
    margin-left: 16rpx;
    line-height: 64rpx;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 160rpx;
    flex-shrink: 0;
}

.nav-right {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    // 小程序需要为右侧胶囊按钮留出空间
    // /* #ifdef MP-WEIXIN */
    // padding-right: 100px;
    // /* #endif */
}

.nav-btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 10px;
    height: 28px;
    background: rgba(107, 186, 231, 0.8);
    border: none;
    border-radius: 14px;
    box-sizing: border-box;
    white-space: nowrap;
    flex-shrink: 0;
    margin: 0;
    line-height: 1;
}

.nav-btn::after {
    border: none;
}

.nav-btn-text {
    color: #173294;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
}

.meeting-btn {
    background: linear-gradient(90deg, #52c41a 0%, #73d13d 100%);
}

.meeting-text {
    color: #fff;
}

// 工具栏（人员数量 + 按钮）
.room-toolbar {
    position: fixed;
    left: 0;
    right: 0;
    height: 44px;
    background: #fff;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0 24rpx;
    box-sizing: border-box;
    z-index: 99;
    border-bottom: 1rpx solid #f0f0f0;
}

.member-count {
    padding: 8rpx 20rpx;
    border: 2rpx solid #ff4d4f;
    border-radius: 8rpx;
}

.member-count-text {
    font-size: 24rpx;
    color: #ff4d4f;
    font-weight: 500;
}

.toolbar-right {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16rpx;
}

.toolbar-btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 8rpx 24rpx;
    height: 56rpx;
    border: 2rpx solid #ff4d4f;
    border-radius: 8rpx;
    background: #fff;
    box-sizing: border-box;
    margin: 0;
    line-height: 1;
}

.toolbar-btn::after {
    border: none;
}

.toolbar-btn-text {
    color: #ff4d4f;
    font-size: 24rpx;
    font-weight: 500;
    line-height: 1;
}

.toolbar-btn.meeting-btn {
    background: #fff;
    border-color: #ff4d4f;
}

.toolbar-btn.meeting-btn .meeting-text {
    color: #ff4d4f;
}

// 人员弹窗
.members-popup-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 200;
}

.members-popup {
    position: absolute;
    left: 24rpx;
    width: 300rpx;
    background: #fff;
    border-radius: 16rpx;
    box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.15);
    padding: 16rpx 0;
    max-height: 400rpx;
    overflow-y: auto;
}

.members-list {
    display: flex;
    flex-direction: column;
}

.member-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 16rpx 24rpx;
    gap: 16rpx;
}

.member-avatar {
    width: 56rpx;
    height: 56rpx;
    border-radius: 50%;
    background: linear-gradient(145deg, #e8f7ff 0%, #c5e4ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.member-avatar-text {
    font-size: 24rpx;
    font-weight: 600;
    color: #173294;
}

.member-name {
    flex: 1;
    font-size: 26rpx;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-status {
    width: 16rpx;
    height: 16rpx;
    border-radius: 50%;
    flex-shrink: 0;
}

.member-status.online {
    background: #52c41a;
}

.member-status.offline {
    background: #d9d9d9;
}

.members-empty {
    padding: 32rpx 24rpx;
    display: flex;
    align-items: center;
    justify-content: center;
}

.members-empty-text {
    font-size: 26rpx;
    color: #999;
}

.loading-mask {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f4f5f7;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20rpx;
}

.loading-text {
    font-size: 28rpx;
    color: #999;
}

.loading-more {
    padding: 20rpx;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-more-text {
    font-size: 24rpx;
    color: #999;
}

.chat-area {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 120rpx;
    padding: 24rpx;
    overflow-y: auto;
}

.message-list {
    display: flex;
    flex-direction: column;
}

.msg {
    display: flex;
    margin-bottom: 20rpx;
}

.msg.ai {
    justify-content: flex-start;
}

.msg.user {
    justify-content: flex-end;
}

.message-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 16rpx;
    width: 100%;
}

.other-row {
    justify-content: flex-start;
}

.self-row {
    justify-content: flex-end;
}

.avatar {
    width: 72rpx;
    height: 72rpx;
    border-radius: 50%;
    background: linear-gradient(145deg, #e8f7ff 0%, #c5e4ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.self-avatar {
    background: linear-gradient(145deg, #e9f1ff 0%, #c5d9ff 100%);
}

.avatar-text {
    font-size: 28rpx;
    font-weight: 600;
    color: #173294;
}

.message-content {
    display: flex;
    flex-direction: column;
    max-width: 70%;
    min-width: 0;  // 允许flex子元素收缩
}

// 会议卡片需要更宽的空间
.message-content.meeting-card-wrapper {
    max-width: 80%;
}

.self-row .message-content {
    align-items: flex-end;
}

.sender-name {
    font-size: 24rpx;
    color: #999;
    margin-bottom: 8rpx;
}

.bubble {
    max-width: 100%;
    padding: 18rpx 20rpx;
    border-radius: 18rpx;
    font-size: 28rpx;
    line-height: 1.6;
    word-break: break-all;  // 长单词/URL换行
    overflow-wrap: break-word;
}

.other-bubble {
    background: #fff;
    color: #222;
}

.self-bubble {
    background: #e9f1ff;
    color: #173294;
}

.message-text {
    font-size: 28rpx;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
    display: block;
}

.message-rich-text {
    font-size: 28rpx;
    line-height: 1.6;
    word-break: break-all;
    overflow-wrap: break-word;
}

.message-time {
    font-size: 22rpx;
    color: #999;
    margin-top: 8rpx;
}

.footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f0f1f6;
    padding: 20rpx 24rpx 40rpx;
    z-index: 50;
}

.input-row {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    background: #fff;
    border-radius: 48rpx;
    padding: 8rpx;
    box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.04);
}

.chat-input {
    flex: 1;
    height: 80rpx;
    padding: 0 32rpx;
    background: transparent;
    border: none;
    font-size: 28rpx;
    color: #333;
}

.chat-input::placeholder {
    color: #999;
}

.send-btn {
    width: 80rpx;
    height: 80rpx;
    border-radius: 40rpx;
    background: linear-gradient(135deg, #e9f1ff 0%, #d4e4ff 100%);
    border: 2rpx solid #8dbbff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.send-icon {
    font-size: 36rpx;
    color: #4b87ff;
}
// ==================== 系统消息样式 ====================
.system-row {
    justify-content: center;
    margin-bottom: 48rpx;
}

.system-message-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16rpx;
    max-width: 80%;
}

.system-message-text {
    padding: 16rpx 32rpx;
    background: rgba(148, 163, 184, 0.15);
    border-radius: 32rpx;
    font-size: 26rpx;
    color: #64748b;
    text-align: center;
}
