/* =========================
   聊天室样式
   兼容低版本浏览器和iOS设备
   支持三种主题配色
========================= */

/* 聊天室弹窗遮罩 */
.chat-room-overlay,
.chat-room-overlay * {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.chat-room-overlay input,
.chat-room-overlay textarea,
.chat-room-overlay .chat-room-input,
.chat-room-overlay .chat-room-input *,
.chat-room-overlay .chat-input,
.chat-room-overlay .chat-input *,
.chat-room-overlay .redpacket-amount-input,
.chat-room-overlay .redpacket-count-input,
.chat-room-overlay .pay-password-input {
    -webkit-touch-callout: default;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
    touch-action: manipulation;
}

html.chat-overlay-guard,
html.chat-overlay-guard body {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    touch-action: none;
}

html.chat-overlay-guard .chat-room-overlay input,
html.chat-overlay-guard .chat-room-overlay textarea,
html.chat-overlay-guard .chat-room-overlay .chat-room-input,
html.chat-overlay-guard .chat-room-overlay .chat-room-input *,
html.chat-overlay-guard .chat-room-overlay .chat-input,
html.chat-overlay-guard .chat-room-overlay .chat-input *,
html.chat-overlay-guard .chat-room-overlay .redpacket-amount-input,
html.chat-overlay-guard .chat-room-overlay .redpacket-count-input,
html.chat-overlay-guard .chat-room-overlay .pay-password-input {
    -webkit-touch-callout: default;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
    touch-action: manipulation;
}

.chat-room-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: block;
    visibility: hidden;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    /* 未激活时允许页面滚动，不影响底层页面 */
    touch-action: auto;
    -webkit-transition: opacity 0.3s ease, visibility 0s linear 0.3s;
    -moz-transition: opacity 0.3s ease, visibility 0s linear 0.3s;
    -o-transition: opacity 0.3s ease, visibility 0s linear 0.3s;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
}

.chat-room-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    /* 激活时背景层阻止默认触摸行为，防止页面滚动 */
    touch-action: none;
    -webkit-transition-delay: 0s;
    -moz-transition-delay: 0s;
    -o-transition-delay: 0s;
    transition-delay: 0s;
}


/* 聊天室弹窗主体 */
.chat-room-modal {
    background: #1a1a1a;
    width: 100%;
    max-width: 600px;
    height: 100%;
    min-height: 100%;
    border-radius: 0;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0 auto;
    overflow: hidden;
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -moz-box-orient: vertical;
    -moz-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-transform: translate3d(0, 100%, 0);
    -moz-transform: translate3d(0, 100%, 0);
    -ms-transform: translateY(100%);
    -o-transform: translateY(100%);
    transform: translate3d(0, 100%, 0);
    -webkit-transition: -webkit-transform 0.3s ease;
    -moz-transition: -moz-transform 0.3s ease;
    -o-transition: -o-transform 0.3s ease;
    transition: transform 0.3s ease;
}

.chat-room-overlay.active .chat-room-modal {
    -webkit-transform: translate3d(0, 0, 0);
    -moz-transform: translate3d(0, 0, 0);
    -ms-transform: translateY(0);
    -o-transform: translateY(0);
    transform: translate3d(0, 0, 0);
}

/* 弹窗内容区域允许垂直滚动 */
.chat-room-messages,
.chat-room-input-area {
    touch-action: pan-y;
    pointer-events: auto;
}

/* 弹窗主体容器也允许滚动 */
.chat-room-modal {
    touch-action: pan-y;
}

/* 返回按钮 */
.chat-room-back {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 40px;
    height: 40px;
    border: none;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.2) 0%, rgba(255, 143, 0, 0.2) 100%);
    color: #FFC107;
    cursor: pointer;
    -webkit-border-radius: 12px;
    -moz-border-radius: 12px;
    border-radius: 12px;
    z-index: 1000;
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -moz-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -moz-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -o-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
    -webkit-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    -moz-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.chat-room-back:hover {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.3) 0%, rgba(255, 143, 0, 0.3) 100%);
    color: #FFD700;
    -webkit-transform: translateX(-2px) scale(1.05);
    -moz-transform: translateX(-2px) scale(1.05);
    -ms-transform: translateX(-2px) scale(1.05);
    -o-transform: translateX(-2px) scale(1.05);
    transform: translateX(-2px) scale(1.05);
    -webkit-box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
    -moz-box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.chat-room-back:active {
    -webkit-transform: translateX(-2px) scale(0.98);
    -moz-transform: translateX(-2px) scale(0.98);
    -ms-transform: translateX(-2px) scale(0.98);
    -o-transform: translateX(-2px) scale(0.98);
    transform: translateX(-2px) scale(0.98);
}

.chat-room-back .back-icon {
    width: 20px;
    height: 20px;
    pointer-events: none; /* 确保点击事件传递到按钮 */
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
}

.chat-room-back:hover .back-icon {
    -webkit-transform: translateX(-2px);
    -moz-transform: translateX(-2px);
    -ms-transform: translateX(-2px);
    -o-transform: translateX(-2px);
    transform: translateX(-2px);
}

/* 聊天室头部 */
.chat-room-header {
    padding: 15px 20px;
    padding-left: 70px; /* 为返回按钮留出空间 */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    -webkit-box-flex: 0;
    -moz-box-flex: 0;
    -ms-flex: 0 0 auto;
    flex: 0 0 auto;
    /* 确保头部始终在视频之上 */
    position: relative;
    z-index: 5; /* 降低z-index，确保返回按钮在上方 */
    isolation: isolate;
}

.chat-room-title {
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -moz-box-orient: vertical;
    -moz-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -moz-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    margin-bottom: 10px;
    position: relative;
}

.chat-room-title h3 {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    text-align: center;
}

.chat-room-online {
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -moz-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 5px;
}

.online-dot {
    width: 8px;
    height: 8px;
    background: #4CAF50;
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%;
    margin-right: 6px;
    -webkit-animation: chatPulse 2s ease-in-out infinite;
    -moz-animation: chatPulse 2s ease-in-out infinite;
    animation: chatPulse 2s ease-in-out infinite;
}

@-webkit-keyframes chatPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@-moz-keyframes chatPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes chatPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chat-room-announcement {
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    -webkit-border-radius: 6px;
    -moz-border-radius: 6px;
    border-radius: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
}

.announcement-icon {
    margin-right: 8px;
    font-size: 16px;
}

.announcement-text {
    -webkit-box-flex: 1;
    -moz-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    line-height: 1.4;
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-flex-wrap: nowrap;
    -moz-flex-wrap: nowrap;
    -ms-flex-wrap: nowrap;
    flex-wrap: nowrap;
    min-width: 0;
}

.announcement-content {
    -webkit-box-flex: 0;
    -moz-box-flex: 0;
    -ms-flex: 0 1 auto;
    flex: 0 1 auto;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.announcement-close {
    margin-left: 8px;
    -webkit-box-flex: 0;
    -moz-box-flex: 0;
    -ms-flex: 0 0 auto;
    flex: 0 0 auto;
    padding: 0;
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%;
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -moz-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-transition: background 0.2s, color 0.2s;
    -moz-transition: background 0.2s, color 0.2s;
    -o-transition: background 0.2s, color 0.2s;
    transition: background 0.2s, color 0.2s;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.announcement-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 1);
}

.announcement-close:active {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.95);
}

/* 消息列表区域 */
.chat-room-messages {
    -webkit-box-flex: 1;
    -moz-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 15px;
    -webkit-overflow-scrolling: touch;
    /* 确保消息区域有正确的定位和层级 */
    position: relative;
    z-index: 1;
    /* 确保内容不会超出容器边界 */
    contain: layout style paint;
    /* 创建层叠上下文边界 */
    isolation: isolate;
}

.chat-loading,
.chat-empty {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

/* 消息项 */
.chat-message {
    margin-bottom: 15px;
    padding: 0;
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -moz-box-orient: vertical;
    -moz-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    /* 防止媒体内容溢出容器 */
    position: relative;
    z-index: 1;
    overflow: visible;
    isolation: isolate;
    contain: layout style;
}

/* 自己发送的消息 - 右对齐 */
.chat-message-own {
    -webkit-box-align: flex-end;
    -moz-box-align: flex-end;
    -ms-flex-align: flex-end;
    align-items: flex-end;
}

.chat-message-content {
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -webkit-flex-direction: row;
    -moz-box-orient: horizontal;
    -moz-box-direction: normal;
    -ms-flex-direction: row;
    flex-direction: row;
    -webkit-box-align: flex-start;
    -moz-box-align: flex-start;
    -ms-flex-align: flex-start;
    align-items: flex-start;
    max-width: 85%;
    min-width: 0;
    width: auto;
    /* 防止媒体内容溢出容器 */
    position: relative;
    z-index: 1;
    overflow: visible;
    isolation: isolate;
    contain: layout style;
}

/* 自己发送的消息内容 - 靠右对齐，头像在右边 */
.chat-message-own .chat-message-content {
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -webkit-flex-direction: row;
    -moz-box-orient: horizontal;
    -moz-box-direction: normal;
    -ms-flex-direction: row;
    flex-direction: row;
    margin-left: auto;
    margin-right: 0;
}

/* 自己发送的消息 - 头像在右边，需要左边距 */
.chat-message-own .chat-message-avatar {
    margin-right: 0;
    margin-left: 10px;
}

.chat-message-avatar {
    width: 40px;
    height: 40px;
    -webkit-box-flex: 0;
    -moz-box-flex: 0;
    -ms-flex: 0 0 40px;
    flex: 0 0 40px;
    position: relative;
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    margin-right: 10px;
}

.chat-message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%;
}

.chat-message-avatar .avatar-placeholder {
    width: 100%;
    height: 100%;
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -moz-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: #ffffff;
    background: rgba(33, 150, 243, 0.6);
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%;
}

.chat-message-info {
    -webkit-box-flex: 1;
    -moz-box-flex: 1;
    -ms-flex: 1 1 auto;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    width: auto;
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -moz-box-orient: vertical;
    -moz-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: flex-start;
    -moz-box-align: flex-start;
    -ms-flex-align: flex-start;
    align-items: flex-start;
    /* 防止媒体内容溢出容器 */
    position: relative;
    z-index: 1;
    overflow: visible;
    isolation: isolate;
    contain: layout style;
}

/* 自己发送的消息 - 右对齐 */
.chat-message-own .chat-message-info {
    -webkit-box-align: flex-end;
    -moz-box-align: flex-end;
    -ms-flex-align: flex-end;
    align-items: flex-end;
}

.chat-message-user {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 4px;
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -webkit-flex-direction: row;
    -moz-box-orient: horizontal;
    -moz-box-direction: normal;
    -ms-flex-direction: row;
    flex-direction: row;
}

/* VIP等级徽章 */
.chat-vip-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
    line-height: 1.2;
    -webkit-border-radius: 3px;
    -moz-border-radius: 3px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
}

.chat-admin-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 2px 12px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    border-radius: 999px;
    letter-spacing: 0.5px;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    background: linear-gradient(115deg, #1f8b4c 0%, #1fb663 45%, #1f8b4c 90%);
    background-size: 200% 100%;
    border: 1px solid rgba(8, 70, 36, 0.45);
    box-shadow: 0 2px 10px rgba(31, 139, 76, 0.45), inset 0 0 12px rgba(255, 255, 255, 0.25);
    overflow: hidden;
    animation: chat-admin-gradient 3s ease-in-out infinite, chat-admin-glow 2.5s ease-in-out infinite;
}

.chat-admin-badge::after {
    content: '';
    position: absolute;
    top: 0;
    left: -130%;
    width: 60%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.7), transparent);
    transform: skewX(-25deg);
    animation: chat-admin-shine 3s ease-in-out infinite;
}

.chat-admin-badge .badge-icon {
    width: 14px;
    height: 14px;
    margin-right: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: #ffffff;
    font-family: "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
    animation: chat-admin-icon-pulse 1.8s ease-in-out infinite;
}

.chat-admin-badge .badge-text {
    position: relative;
    line-height: 1.2;
    font-weight: 700;
    color: #ffffff;
    z-index: 1;
}

@keyframes chat-admin-gradient {
    0% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 100% 0%;
    }
    100% {
        background-position: 0% 0%;
    }
}

@keyframes chat-admin-glow {
    0%, 100% {
        box-shadow: 0 2px 10px rgba(31, 139, 76, 0.45), inset 0 0 8px rgba(255, 255, 255, 0.25);
    }
    50% {
        box-shadow: 0 4px 14px rgba(22, 120, 65, 0.55), inset 0 0 14px rgba(255, 255, 255, 0.35);
    }
}

@keyframes chat-admin-shine {
    0% {
        left: -130%;
    }
    60%, 100% {
        left: 130%;
    }
}

@keyframes chat-admin-icon-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.8;
    }
}

/* VIP1 - 青铜色 */
.chat-vip-1 {
    background: linear-gradient(135deg, #cd7f32 0%, #b87333 100%);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 1px 3px rgba(205, 127, 50, 0.4);
}

/* VIP2 - 银白色 */
.chat-vip-2 {
    background: linear-gradient(135deg, #c0c0c0 0%, #a8a8a8 100%);
    color: #333333;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
    box-shadow: 0 1px 3px rgba(192, 192, 192, 0.4);
}

/* VIP3 - 金黄色 */
.chat-vip-3 {
    background: linear-gradient(135deg, #ffd700 0%, #ffb300 100%);
    color: #8b6914;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
    box-shadow: 0 1px 3px rgba(255, 215, 0, 0.5);
}

/* VIP4 - 蓝色 */
.chat-vip-4 {
    background: linear-gradient(135deg, #4169e1 0%, #1e3a8a 100%);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 1px 3px rgba(65, 105, 225, 0.5);
}

/* VIP5 - 紫色 */
.chat-vip-5 {
    background: linear-gradient(135deg, #9370db 0%, #6a0dad 100%);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 1px 3px rgba(147, 112, 219, 0.5);
}

/* VIP6 - 红色 */
.chat-vip-6 {
    background: linear-gradient(135deg, #ff6b6b 0%, #c92a2a 100%);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 1px 3px rgba(255, 107, 107, 0.5);
}

/* VIP7 - 橙色 */
.chat-vip-7 {
    background: linear-gradient(135deg, #ff8c42 0%, #ff6b35 100%);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 1px 3px rgba(255, 140, 66, 0.5);
}

/* VIP8 - 翠绿色 */
.chat-vip-8 {
    background: linear-gradient(135deg, #51cf66 0%, #2b8a3e 100%);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 1px 3px rgba(81, 207, 102, 0.5);
}

/* VIP9 - 青色 */
.chat-vip-9 {
    background: linear-gradient(135deg, #20bf6b 0%, #0a7c59 100%);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 1px 3px rgba(32, 191, 107, 0.5);
}

/* VIP10 - 深蓝色 */
.chat-vip-10 {
    background: linear-gradient(135deg, #4dabf7 0%, #1971c2 100%);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 1px 3px rgba(77, 171, 247, 0.5);
}

/* VIP11 - 粉红色 */
.chat-vip-11 {
    background: linear-gradient(135deg, #f783ac 0%, #c2255c 100%);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 1px 3px rgba(247, 131, 172, 0.5);
    animation: vip-glow-pink 2s ease-in-out infinite alternate;
}

/* VIP12 - 靛蓝色 */
.chat-vip-12 {
    background: linear-gradient(135deg, #845ef7 0%, #5f3dc4 100%);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 1px 3px rgba(132, 94, 247, 0.5);
    animation: vip-glow-purple 2s ease-in-out infinite alternate;
}

/* VIP13 - 深红色 */
.chat-vip-13 {
    background: linear-gradient(135deg, #fa5252 0%, #c92a2a 100%);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 1px 3px rgba(250, 82, 82, 0.5);
    animation: vip-glow-red 2s ease-in-out infinite alternate;
}

/* VIP14 - 深紫色 */
.chat-vip-14 {
    background: linear-gradient(135deg, #ae3ec9 0%, #862e9c 100%);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 1px 3px rgba(174, 62, 201, 0.5);
    animation: vip-glow-violet 2s ease-in-out infinite alternate;
}

/* VIP15 - 深蓝色 */
.chat-vip-15 {
    background: linear-gradient(135deg, #339af0 0%, #1864ab 100%);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 1px 3px rgba(51, 154, 240, 0.5);
    animation: vip-glow-blue 2s ease-in-out infinite alternate;
}

/* VIP16 - 彩虹渐变 */
.chat-vip-16 {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffd93d 25%, #6bcf7f 50%, #4dabf7 75%, #ae3ec9 100%);
    background-size: 200% 200%;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: 0 1px 3px rgba(255, 107, 107, 0.5);
    animation: vip-rainbow 3s ease-in-out infinite;
}

/* VIP17 - 金色发光 */
.chat-vip-17 {
    background: linear-gradient(135deg, #ffd700 0%, #ffb300 50%, #ffd700 100%);
    color: #8b6914;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
    box-shadow: 0 1px 3px rgba(255, 215, 0, 0.5);
    animation: vip-glow-gold 2s ease-in-out infinite alternate;
}

/* VIP18 - 钻石色 */
.chat-vip-18 {
    background: linear-gradient(135deg, #e0e0e0 0%, #b0b0b0 50%, #e0e0e0 100%);
    color: #333333;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    box-shadow: 0 1px 3px rgba(224, 224, 224, 0.5);
    animation: vip-glow-diamond 2s ease-in-out infinite alternate;
}

/* VIP19 - 火焰色 */
.chat-vip-19 {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 50%, #ff6b35 100%);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: 0 1px 3px rgba(255, 107, 53, 0.5);
    animation: vip-glow-fire 2s ease-in-out infinite alternate;
}

/* VIP20 - 至尊色（多重渐变+强发光） */
.chat-vip-20 {
    background: linear-gradient(135deg, #ff006e 0%, #8338ec 25%, #3a86ff 50%, #06ffa5 75%, #ffbe0b 100%);
    background-size: 200% 200%;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), 0 0 10px rgba(255, 255, 255, 0.5);
    box-shadow: 0 1px 5px rgba(255, 0, 110, 0.6);
    animation: vip-ultimate 2s ease-in-out infinite;
}

/* VIP高级等级发光效果 */
@keyframes vip-glow-pink {
    from {
        box-shadow: 0 1px 3px rgba(247, 131, 172, 0.5);
    }
    to {
        box-shadow: 0 1px 8px rgba(247, 131, 172, 0.8), 0 0 12px rgba(247, 131, 172, 0.4);
    }
}

@keyframes vip-glow-purple {
    from {
        box-shadow: 0 1px 3px rgba(132, 94, 247, 0.5);
    }
    to {
        box-shadow: 0 1px 8px rgba(132, 94, 247, 0.8), 0 0 12px rgba(132, 94, 247, 0.4);
    }
}

@keyframes vip-glow-red {
    from {
        box-shadow: 0 1px 3px rgba(250, 82, 82, 0.5);
    }
    to {
        box-shadow: 0 1px 8px rgba(250, 82, 82, 0.8), 0 0 12px rgba(250, 82, 82, 0.4);
    }
}

@keyframes vip-glow-violet {
    from {
        box-shadow: 0 1px 3px rgba(174, 62, 201, 0.5);
    }
    to {
        box-shadow: 0 1px 8px rgba(174, 62, 201, 0.8), 0 0 12px rgba(174, 62, 201, 0.4);
    }
}

@keyframes vip-glow-blue {
    from {
        box-shadow: 0 1px 3px rgba(51, 154, 240, 0.5);
    }
    to {
        box-shadow: 0 1px 8px rgba(51, 154, 240, 0.8), 0 0 12px rgba(51, 154, 240, 0.4);
    }
}

@keyframes vip-rainbow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes vip-glow-gold {
    from {
        box-shadow: 0 1px 3px rgba(255, 215, 0, 0.5);
    }
    to {
        box-shadow: 0 1px 10px rgba(255, 215, 0, 0.9), 0 0 15px rgba(255, 215, 0, 0.5);
    }
}

@keyframes vip-glow-diamond {
    from {
        box-shadow: 0 1px 3px rgba(224, 224, 224, 0.5);
    }
    to {
        box-shadow: 0 1px 10px rgba(255, 255, 255, 0.9), 0 0 15px rgba(255, 255, 255, 0.6);
    }
}

@keyframes vip-glow-fire {
    from {
        box-shadow: 0 1px 3px rgba(255, 107, 53, 0.5);
    }
    to {
        box-shadow: 0 1px 10px rgba(255, 107, 53, 0.9), 0 0 15px rgba(255, 107, 53, 0.5);
    }
}

@keyframes vip-ultimate {
    0% {
        background-position: 0% 50%;
        box-shadow: 0 1px 5px rgba(255, 0, 110, 0.6);
    }
    25% {
        box-shadow: 0 1px 10px rgba(131, 56, 236, 0.8), 0 0 20px rgba(131, 56, 236, 0.5);
    }
    50% {
        background-position: 100% 50%;
        box-shadow: 0 1px 10px rgba(58, 134, 255, 0.8), 0 0 20px rgba(58, 134, 255, 0.5);
    }
    75% {
        box-shadow: 0 1px 10px rgba(6, 255, 165, 0.8), 0 0 20px rgba(6, 255, 165, 0.5);
    }
    100% {
        background-position: 0% 50%;
        box-shadow: 0 1px 10px rgba(255, 190, 11, 0.8), 0 0 20px rgba(255, 190, 11, 0.5);
    }
}

.chat-message-text {
    font-size: 14px;
    color: #ffffff;
    line-height: 1.5;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    border-radius: 8px;
    display: inline-block;
    max-width: 100%;
    width: auto;
    min-width: 0;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    white-space: pre-wrap;
    /* 使用break-word确保长文本可以正常换行（iOS兼容） */
    overflow-wrap: break-word;
    -webkit-overflow-wrap: break-word;
    /* word-wrap是overflow-wrap的旧属性，使用break-word作为降级（iOS兼容） */
    word-wrap: break-word;
    -webkit-word-wrap: break-word;
    /* 使用normal而不是keep-all，允许在合适的地方换行，同时配合overflow-wrap处理长单词 */
    /* 这样可以确保长文本可以正常换行，同时不会在CJK字符之间强制断行 */
    word-break: normal;
    -webkit-word-break: normal;
    -moz-word-break: normal;
    -ms-word-break: normal;
    /* 防止emoji被单独换行 */
    line-break: strict;
    -webkit-line-break: strict;
    -webkit-hyphens: none;
    -moz-hyphens: none;
    hyphens: none;
    /* 确保零宽非断行空格能够防止换行 */
    unicode-bidi: embed;
    /* 禁止长按时出现系统复制菜单 */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* 自己发送的消息气泡 - 不同背景色 */
.chat-message-own .chat-message-text {
    background: rgba(33, 150, 243, 0.3);
    color: #ffffff;
}

/* 消息气泡容器（用于包装消息文本） */
.chat-message-bubble {
    display: inline-block;
    max-width: 100%;
    width: auto;
    position: relative !important;
    z-index: 1 !important;
    overflow: hidden !important;
    isolation: isolate !important;
}

/* 媒体消息样式（图片/视频） */
.chat-message-media {
    margin: 4px 0;
    max-width: 100%;
    display: block;
    position: relative !important;
    z-index: 1 !important;
    overflow: hidden !important;
    isolation: isolate !important;
}

.chat-message-image img {
    max-width: 250px;
    max-height: 300px;
    border-radius: 8px;
    cursor: pointer;
    display: block;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.1);
}

.chat-message-image img.chat-image-expanded {
    max-width: 90vw;
    max-height: 80vh;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.chat-message-image img.chat-image-clickable {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.chat-message-image img.chat-image-clickable:hover {
    opacity: 0.9;
}

/* 图片预览模态框 */
.image-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    -webkit-transition: opacity 0.3s ease, visibility 0s linear 0.3s;
    -moz-transition: opacity 0.3s ease, visibility 0s linear 0.3s;
    -o-transition: opacity 0.3s ease, visibility 0s linear 0.3s;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.image-preview-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    -webkit-transition-delay: 0s;
    -moz-transition-delay: 0s;
    -o-transition-delay: 0s;
    transition-delay: 0s;
}

.image-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.image-preview-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    overflow: hidden;
    cursor: grab;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.image-preview-container.dragging {
    cursor: grabbing;
}

.image-preview-img {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.8);
    display: block;
    transition: transform 0.1s ease-out;
    transform-origin: center center;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.image-preview-img.zoomed {
    transition: none;
    cursor: grab;
}

.image-preview-img.zoomed.dragging {
    cursor: grabbing;
}

.image-preview-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    -webkit-transition: background 0.2s ease;
    -moz-transition: background 0.2s ease;
    -o-transition: background 0.2s ease;
    transition: background 0.2s ease;
    z-index: 2;
}

.image-preview-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.image-preview-close:active {
    background: rgba(255, 255, 255, 0.4);
}

.chat-message-video {
    position: relative;
}

.chat-message-video video {
    max-width: 300px;
    max-height: 400px;
    border-radius: 8px;
    display: block;
    background: rgba(0, 0, 0, 0.1);
}

/* 媒体消息和文本同时存在时的间距 */
.chat-message-bubble .chat-message-media + .chat-message-text {
    margin-top: 8px;
}

.chat-message-bubble .chat-message-text + .chat-message-media {
    margin-top: 8px;
}

/* 已撤回的消息样式 */
.chat-message-recalled {
    opacity: 0.6;
}

.chat-message-recalled .recalled-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    border-radius: 8px;
    display: inline-block;
}

.chat-message-own .chat-message-recalled .recalled-text {
    background: rgba(33, 150, 243, 0.15);
    color: rgba(255, 255, 255, 0.6);
}

.chat-message-time {
    display: none;
}

/* 红包消息卡片 */
.chat-redpacket-card {
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    padding: 12px;
    background: -webkit-linear-gradient(135deg, #ff6b6b, #ee5a6f);
    background: -moz-linear-gradient(135deg, #ff6b6b, #ee5a6f);
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    border-radius: 8px;
    cursor: pointer;
    /* 禁止长按时出现系统复制菜单 */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-transition: all 0.2s ease;
    -moz-transition: all 0.2s ease;
    -o-transition: all 0.2s ease;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    max-width: none;
    width: auto;
    min-width: 200px;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

.chat-redpacket-card:active {
    -webkit-transform: scale(0.95);
    -moz-transform: scale(0.95);
    -ms-transform: scale(0.95);
    -o-transform: scale(0.95);
    transform: scale(0.95);
}

.redpacket-card-icon {
    font-size: 32px;
    margin-right: 10px;
}

.redpacket-card-info {
    -webkit-box-flex: 1;
    -moz-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
}

.redpacket-card-type {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 2px;
}

.redpacket-card-status {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

/* 输入区域 */
.chat-room-input-area {
    padding: 12px 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    -webkit-box-flex: 0;
    -moz-box-flex: 0;
    -ms-flex: 0 0 auto;
    flex: 0 0 auto;
    /* 确保输入区域始终在视频之上 */
    position: relative;
    z-index: 10;
    isolation: isolate;
}

.chat-input-toolbar {
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    margin-bottom: 8px;
}

.chat-tool-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: #ffffff;
    font-size: 18px;
    -webkit-border-radius: 6px;
    -moz-border-radius: 6px;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 8px;
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -moz-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-transition: all 0.2s ease;
    -moz-transition: all 0.2s ease;
    -o-transition: all 0.2s ease;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.chat-tool-btn:active {
    opacity: 0.7;
    -webkit-transform: scale(0.95);
    -moz-transform: scale(0.95);
    -ms-transform: scale(0.95);
    -o-transform: scale(0.95);
    transform: scale(0.95);
}

.chat-redpacket-btn {
    background: transparent;
}

.chat-input-wrapper {
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: flex-end;
    -moz-box-align: flex-end;
    -ms-flex-align: flex-end;
    align-items: flex-end;
}

.chat-input {
    -webkit-box-flex: 1;
    -moz-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    min-height: 40px;
    max-height: 120px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    border-radius: 8px;
    color: #ffffff;
    font-size: 16px;
    font-family: inherit;
    resize: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    outline: none;
}

.chat-input::-webkit-input-placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.chat-input::-moz-placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.chat-input:-ms-input-placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.chat-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.chat-send-btn {
    margin-left: 8px;
    padding: 10px 20px;
    background: -webkit-linear-gradient(135deg, #FFC107, #FF8F00);
    background: -moz-linear-gradient(135deg, #FFC107, #FF8F00);
    background: linear-gradient(135deg, #FFC107, #FF8F00);
    color: #ffffff;
    border: none;
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    -webkit-transition: all 0.2s ease;
    -moz-transition: all 0.2s ease;
    -o-transition: all 0.2s ease;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}

.chat-send-btn:active {
    -webkit-transform: scale(0.95);
    -moz-transform: scale(0.95);
    -ms-transform: scale(0.95);
    -o-transform: scale(0.95);
    transform: scale(0.95);
}

/* 红包弹窗样式 */
.redpacket-modal-overlay,
.pay-password-modal-overlay,
.redpacket-grab-modal-overlay,
.emoji-picker-overlay,
.chat-nickname-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: block;
    visibility: hidden;
    z-index: 3000;
    opacity: 0;
    pointer-events: none;
    -webkit-transition: opacity 0.3s ease, visibility 0s linear 0.3s;
    -moz-transition: opacity 0.3s ease, visibility 0s linear 0.3s;
    -o-transition: opacity 0.3s ease, visibility 0s linear 0.3s;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.redpacket-modal-overlay.active,
.pay-password-modal-overlay.active,
.redpacket-grab-modal-overlay.active,
.emoji-picker-overlay.active,
.chat-nickname-modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    -webkit-transition-delay: 0s;
    -moz-transition-delay: 0s;
    -o-transition-delay: 0s;
    transition-delay: 0s;
}

.redpacket-modal,
.pay-password-modal,
.redpacket-grab-modal,
.emoji-picker-modal,
.chat-nickname-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    -webkit-transform: translate(-50%, -50%);
    -moz-transform: translate(-50%, -50%);
    -ms-transform: translate(-50%, -50%);
    -o-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    background: #1a1a1a;
    -webkit-border-radius: 12px;
    -moz-border-radius: 12px;
    border-radius: 12px;
    padding: 20px;
    -webkit-box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    -moz-box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.redpacket-modal-close,
.pay-password-modal-close,
.redpacket-grab-modal-close,
.emoji-picker-close,
.chat-nickname-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%;
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -moz-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.redpacket-modal-header,
.pay-password-modal-header,
.emoji-picker-header {
    margin-bottom: 20px;
}

.redpacket-modal-header h3,
.pay-password-modal-header h3,
.emoji-picker-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    text-align: center;
}

/* 昵称设置弹窗 */
.chat-nickname-modal {
    max-width: 360px;
    padding: 26px 24px 28px;
    background: -webkit-linear-gradient(135deg, #1b1b1f, #111215);
    background: -moz-linear-gradient(135deg, #1b1b1f, #111215);
    background: linear-gradient(135deg, #1b1b1f, #111215);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-nickname-header {
    text-align: center;
    margin-bottom: 18px;
}

.chat-nickname-icon {
    font-size: 40px;
    margin-bottom: 8px;
    display: inline-block;
}

.chat-nickname-header h3 {
    font-size: 20px;
    margin: 0;
    color: #fff;
    font-weight: 600;
}

.chat-nickname-header p {
    margin: 8px 0 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.6;
}

.chat-nickname-body label {
    display: block;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
}

.chat-nickname-input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
    border-radius: 10px;
    color: #fff;
    font-size: 16px;
    outline: none;
    -webkit-transition: border-color 0.2s ease;
    -moz-transition: border-color 0.2s ease;
    -o-transition: border-color 0.2s ease;
    transition: border-color 0.2s ease;
}

.chat-nickname-input:focus {
    border-color: #FFC107;
    background: rgba(255, 255, 255, 0.12);
}

.chat-nickname-error {
    margin-top: 8px;
    font-size: 12px;
    color: #FF7676;
}

.chat-nickname-actions {
    margin-top: 22px;
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: justify;
    -moz-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
    gap: 12px;
}

.chat-nickname-btn {
    -webkit-box-flex: 1;
    -moz-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    padding: 12px 0;
    border: none;
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    -webkit-transition: all 0.2s ease;
    -moz-transition: all 0.2s ease;
    -o-transition: all 0.2s ease;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.chat-nickname-btn-cancel {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.75);
}

.chat-nickname-btn-confirm {
    background: -webkit-linear-gradient(135deg, #FFC107, #FF8F00);
    background: -moz-linear-gradient(135deg, #FFC107, #FF8F00);
    background: linear-gradient(135deg, #FFC107, #FF8F00);
    color: #1a1a1a;
    box-shadow: 0 10px 25px rgba(255, 193, 7, 0.25);
}

.chat-nickname-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.redpacket-form-group,
.pay-password-form-group {
    margin-bottom: 20px;
}

.redpacket-form-group label,
.pay-password-form-group label {
    display: block;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

.redpacket-amount-input-wrapper {
    position: relative;
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    align-items: center;
}

.redpacket-currency {
    position: absolute;
    left: 12px;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.6);
    z-index: 1;
}

.redpacket-amount-input,
.redpacket-count-input,
.pay-password-input {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    border-radius: 8px;
    color: #ffffff;
    font-size: 16px;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.pay-password-input {
    padding-left: 12px;
    text-align: center;
    letter-spacing: 8px;
    font-size: 20px;
}

.redpacket-type-options {
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -moz-box-orient: vertical;
    -moz-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
}

.redpacket-type-option {
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    border-radius: 8px;
    cursor: pointer;
    -webkit-transition: all 0.2s ease;
    -moz-transition: all 0.2s ease;
    -o-transition: all 0.2s ease;
    transition: all 0.2s ease;
    margin-bottom: 12px;
}

.redpacket-type-option:last-child {
    margin-bottom: 0;
}

.redpacket-type-option input[type="radio"] {
    position: relative;
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: 2px solid rgba(255, 255, 255, 0.4);
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%;
    background: transparent;
    -webkit-transition: all 0.2s ease;
    -moz-transition: all 0.2s ease;
    -o-transition: all 0.2s ease;
    transition: all 0.2s ease;
    vertical-align: middle;
    flex-shrink: 0;
}

.redpacket-type-option input[type="radio"]:checked {
    border-color: #ff6b6b;
    background: #ff6b6b;
}

.redpacket-type-option input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%;
    background: #ffffff;
    -webkit-transform: translate(-50%, -50%);
    -moz-transform: translate(-50%, -50%);
    -ms-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
}

.redpacket-type-option span {
    -webkit-box-flex: 1;
    -moz-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    font-size: 14px;
    color: #ffffff;
    font-weight: 600;
}

.redpacket-type-option small {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
}

.redpacket-form-actions,
.pay-password-form-actions {
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    margin-top: 20px;
}

.redpacket-btn,
.pay-password-btn {
    -webkit-box-flex: 1;
    -moz-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    padding: 12px;
    border: none;
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    -webkit-transition: all 0.2s ease;
    -moz-transition: all 0.2s ease;
    -o-transition: all 0.2s ease;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    margin-right: 12px;
}

.redpacket-btn:last-child,
.pay-password-btn:last-child {
    margin-right: 0;
}

.redpacket-btn-cancel,
.pay-password-btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.redpacket-btn-confirm,
.pay-password-btn-confirm {
    /* 默认主题（dark）- 黄色渐变，与发送按钮保持一致 */
    background: -webkit-linear-gradient(135deg, #FFC107, #FF8F00);
    background: -moz-linear-gradient(135deg, #FFC107, #FF8F00);
    background: linear-gradient(135deg, #FFC107, #FF8F00);
    color: #ffffff;
    -webkit-box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
    -moz-box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.redpacket-btn-confirm:active,
.pay-password-btn-confirm:active {
    background: -webkit-linear-gradient(135deg, #FF8F00, #F57C00);
    background: -moz-linear-gradient(135deg, #FF8F00, #F57C00);
    background: linear-gradient(135deg, #FF8F00, #F57C00);
}

.pay-password-error {
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(255, 77, 79, 0.2);
    border: 1px solid rgba(255, 77, 79, 0.4);
    -webkit-border-radius: 6px;
    -moz-border-radius: 6px;
    border-radius: 6px;
    font-size: 12px;
    color: #ff4d4f;
    text-align: center;
}

/* 抢红包弹窗 */
.redpacket-grab-content {
    text-align: center;
    padding: 20px 0;
}

.redpacket-grab-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.redpacket-grab-info {
    margin-bottom: 20px;
}

.redpacket-grab-from,
.redpacket-grab-type,
.redpacket-grab-stats {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

.redpacket-grab-btn {
    width: 120px;
    height: 120px;
    margin: 20px auto;
    background: -webkit-linear-gradient(135deg, #ff6b6b, #ee5a6f);
    background: -moz-linear-gradient(135deg, #ff6b6b, #ee5a6f);
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: #ffffff;
    border: none;
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%;
    font-size: 24px;
    font-weight: 600;
    cursor: pointer;
    -webkit-transition: all 0.2s ease;
    -moz-transition: all 0.2s ease;
    -o-transition: all 0.2s ease;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.redpacket-grab-btn:active {
    -webkit-transform: scale(0.9);
    -moz-transform: scale(0.9);
    -ms-transform: scale(0.9);
    -o-transform: scale(0.9);
    transform: scale(0.9);
}

.redpacket-grab-result {
    margin: 20px 0;
}

.redpacket-grab-amount {
    font-size: 36px;
    font-weight: 600;
    color: #ffd700;
    margin-bottom: 10px;
}

.redpacket-grab-message {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.redpacket-grab-records {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 200px;
    overflow-y: auto;
    text-align: left;
}

.redpacket-records-title {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 10px;
}

.redpacket-record-item {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    align-items: center;
}

.redpacket-record-avatar {
    width: 32px;
    height: 32px;
    -webkit-box-flex: 0;
    -moz-box-flex: 0;
    -ms-flex: 0 0 32px;
    flex: 0 0 32px;
    position: relative;
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    margin-right: 10px;
}

.redpacket-record-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%;
}

.redpacket-record-avatar .avatar-placeholder {
    width: 100%;
    height: 100%;
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -moz-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: #ffffff;
    background: rgba(33, 150, 243, 0.6);
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%;
}

.redpacket-record-content {
    -webkit-box-flex: 1;
    -moz-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    min-width: 0;
}

.redpacket-record-name {
    color: rgba(255, 255, 255, 0.9);
}

/* 表情选择器样式 */
.emoji-picker-body {
    max-height: 400px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.emoji-picker-grid {
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-wrap: wrap;
    -moz-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 0;
}

.emoji-item {
    width: 46px;
    height: 46px;
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -moz-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    font-size: 30px;
    cursor: pointer;
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    border-radius: 8px;
    -webkit-transition: all 0.2s ease;
    -moz-transition: all 0.2s ease;
    -o-transition: all 0.2s ease;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.emoji-item:hover {
    background: rgba(255, 255, 255, 0.1);
    -webkit-transform: scale(1.1);
    -moz-transform: scale(1.1);
    -ms-transform: scale(1.1);
    -o-transform: scale(1.1);
    transform: scale(1.1);
}

.emoji-item:active {
    background: rgba(255, 255, 255, 0.2);
    -webkit-transform: scale(0.95);
    -moz-transform: scale(0.95);
    -ms-transform: scale(0.95);
    -o-transform: scale(0.95);
    transform: scale(0.95);
}

/* 白色主题适配 */
#theme-light:checked ~ .chat-room-overlay .chat-room-modal {
    background: #ffffff;
}

#theme-light:checked ~ .chat-room-overlay .chat-room-back {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1) 0%, rgba(69, 160, 73, 0.1) 100%);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.2);
    -webkit-box-shadow: 0 2px 8px rgba(76, 175, 80, 0.15);
    -moz-box-shadow: 0 2px 8px rgba(76, 175, 80, 0.15);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.15);
}

#theme-light:checked ~ .chat-room-overlay .chat-room-back:hover {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2) 0%, rgba(69, 160, 73, 0.2) 100%);
    color: #388e3c;
    border-color: rgba(76, 175, 80, 0.3);
    -webkit-box-shadow: 0 4px 12px rgba(76, 175, 80, 0.25);
    -moz-box-shadow: 0 4px 12px rgba(76, 175, 80, 0.25);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.25);
}

#theme-light:checked ~ .chat-room-overlay .chat-room-back:active {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.15) 0%, rgba(69, 160, 73, 0.15) 100%);
    -webkit-box-shadow: 0 2px 6px rgba(76, 175, 80, 0.2);
    -moz-box-shadow: 0 2px 6px rgba(76, 175, 80, 0.2);
    box-shadow: 0 2px 6px rgba(76, 175, 80, 0.2);
}

#theme-light:checked ~ .chat-room-overlay .chat-room-header {
    border-bottom-color: #e0e0e0;
    background: #f5f5f5;
}

#theme-light:checked ~ .chat-room-overlay .chat-room-title h3 {
    color: #212121;
}

#theme-light:checked ~ .chat-room-overlay .chat-room-online {
    color: #666;
}

#theme-light:checked ~ .chat-room-overlay .chat-room-announcement {
    background: rgba(255, 193, 7, 0.15);
    border-color: rgba(255, 193, 7, 0.3);
    color: #333;
}

#theme-light:checked ~ .chat-room-overlay .chat-message-avatar {
    background: rgba(0, 0, 0, 0.05);
}

#theme-light:checked ~ .chat-room-overlay .chat-message-avatar .avatar-placeholder {
    background: rgba(33, 150, 243, 0.3);
    color: #1976d2;
}

#theme-light:checked ~ .chat-room-overlay .chat-message-user {
    color: #666;
}

#theme-light:checked ~ .chat-room-overlay .chat-message-text {
    background: #f0f0f0;
    color: #333;
}

#theme-light:checked ~ .chat-room-overlay .chat-message-time {
    color: #999;
}

#theme-light:checked ~ .chat-room-overlay .chat-room-input-area {
    border-top-color: #e0e0e0;
    background: #f5f5f5;
}

#theme-light:checked ~ .chat-room-overlay .chat-tool-btn {
    background: transparent;
    color: #333;
}

#theme-light:checked ~ .chat-room-overlay .chat-input {
    background: #ffffff;
    border-color: #e0e0e0;
    color: #333;
}

#theme-light:checked ~ .chat-room-overlay .chat-input::-webkit-input-placeholder {
    color: #999;
}

#theme-light:checked ~ .chat-room-overlay .chat-input::-moz-placeholder {
    color: #999;
}

#theme-light:checked ~ .chat-room-overlay .chat-input:-ms-input-placeholder {
    color: #999;
}

#theme-light:checked ~ .chat-room-overlay .chat-input::placeholder {
    color: #999;
}

#theme-light:checked ~ .chat-room-overlay .chat-send-btn {
    background: -webkit-linear-gradient(135deg, #4CAF50, #45a049);
    background: -moz-linear-gradient(135deg, #4CAF50, #45a049);
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: #ffffff;
    -webkit-box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
    -moz-box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

#theme-light:checked ~ .chat-room-overlay .chat-send-btn:active {
    background: -webkit-linear-gradient(135deg, #45a049, #388e3c);
    background: -moz-linear-gradient(135deg, #45a049, #388e3c);
    background: linear-gradient(135deg, #45a049, #388e3c);
}

#theme-light:checked ~ .redpacket-modal-overlay .redpacket-modal,
#theme-light:checked ~ .pay-password-modal-overlay .pay-password-modal,
#theme-light:checked ~ .redpacket-grab-modal-overlay .redpacket-grab-modal,
#theme-light:checked ~ .emoji-picker-overlay .emoji-picker-modal,
#theme-light:checked ~ .chat-nickname-modal-overlay .chat-nickname-modal {
    background: #ffffff;
}

#theme-light:checked ~ .redpacket-modal-overlay .redpacket-modal-header h3,
#theme-light:checked ~ .pay-password-modal-overlay .pay-password-modal-header h3,
#theme-light:checked ~ .emoji-picker-overlay .emoji-picker-header h3,
#theme-light:checked ~ .chat-nickname-modal-overlay .chat-nickname-header h3 {
    color: #212121;
}

#theme-light:checked ~ .chat-nickname-modal-overlay .chat-nickname-header p {
    color: rgba(0, 0, 0, 0.6);
}

#theme-light:checked ~ .chat-nickname-modal-overlay .chat-nickname-icon {
    color: #FFC107;
}

#theme-light:checked ~ .redpacket-modal-overlay .redpacket-form-group label,
#theme-light:checked ~ .pay-password-modal-overlay .pay-password-form-group label,
#theme-light:checked ~ .chat-nickname-modal-overlay .chat-nickname-body label {
    color: #666;
}

#theme-light:checked ~ .redpacket-modal-overlay .redpacket-amount-input,
#theme-light:checked ~ .redpacket-modal-overlay .redpacket-count-input,
#theme-light:checked ~ .pay-password-modal-overlay .pay-password-input,
#theme-light:checked ~ .chat-nickname-modal-overlay .chat-nickname-input {
    background: #f5f5f5;
    border-color: #e0e0e0;
    color: #333;
}

#theme-light:checked ~ .chat-nickname-modal-overlay .chat-nickname-input:focus {
    border-color: #4CAF50;
}

#theme-light:checked ~ .chat-nickname-modal-overlay .chat-nickname-error {
    color: #d32f2f;
}

#theme-light:checked ~ .redpacket-modal-overlay .redpacket-type-option {
    background: #f5f5f5;
    border-color: #e0e0e0;
}

#theme-light:checked ~ .redpacket-modal-overlay .redpacket-type-option span {
    color: #333;
}

#theme-light:checked ~ .redpacket-modal-overlay .redpacket-type-option small {
    color: #999;
}

#theme-light:checked ~ .redpacket-modal-overlay .redpacket-btn-cancel,
#theme-light:checked ~ .pay-password-modal-overlay .pay-password-btn-cancel,
#theme-light:checked ~ .chat-nickname-modal-overlay .chat-nickname-btn-cancel {
    background: #f0f0f0;
    color: #666;
}

/* 确认按钮主题配色 - 浅色主题 */
#theme-light:checked ~ .redpacket-modal-overlay .redpacket-btn-confirm,
#theme-light:checked ~ .pay-password-modal-overlay .pay-password-btn-confirm,
#theme-light:checked ~ .chat-nickname-modal-overlay .chat-nickname-btn-confirm {
    background: -webkit-linear-gradient(135deg, #4CAF50, #45a049);
    background: -moz-linear-gradient(135deg, #4CAF50, #45a049);
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: #ffffff;
    -webkit-box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
    -moz-box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

#theme-light:checked ~ .redpacket-modal-overlay .redpacket-btn-confirm:active,
#theme-light:checked ~ .pay-password-modal-overlay .pay-password-btn-confirm:active,
#theme-light:checked ~ .chat-nickname-modal-overlay .chat-nickname-btn-confirm:active {
    background: -webkit-linear-gradient(135deg, #45a049, #388e3c);
    background: -moz-linear-gradient(135deg, #45a049, #388e3c);
    background: linear-gradient(135deg, #45a049, #388e3c);
}

#theme-light:checked ~ .redpacket-grab-modal-overlay .redpacket-grab-from,
#theme-light:checked ~ .redpacket-grab-modal-overlay .redpacket-grab-type,
#theme-light:checked ~ .redpacket-grab-modal-overlay .redpacket-grab-stats {
    color: #666;
}

#theme-light:checked ~ .redpacket-grab-modal-overlay .redpacket-records-title {
    color: #999;
}

#theme-light:checked ~ .redpacket-grab-modal-overlay .redpacket-grab-message {
    color: #666;
}

#theme-light:checked ~ .redpacket-grab-modal-overlay .redpacket-record-item {
    color: #666;
    border-bottom-color: #e0e0e0;
}

#theme-light:checked ~ .redpacket-grab-modal-overlay .redpacket-record-name {
    color: #333;
}

/* 红包金额红色样式 */
.redpacket-amount-text {
    color: #ff4444;
    font-weight: bold;
    font-size: 1.2em;
}

/* 关闭按钮主题配色 - 浅色主题 */
#theme-light:checked ~ .redpacket-modal-overlay .redpacket-modal-close,
#theme-light:checked ~ .pay-password-modal-overlay .pay-password-modal-close,
#theme-light:checked ~ .redpacket-grab-modal-overlay .redpacket-grab-modal-close,
#theme-light:checked ~ .emoji-picker-overlay .emoji-picker-close,
#theme-light:checked ~ .chat-nickname-modal-overlay .chat-nickname-close,
#theme-light:checked ~ .chat-room-overlay .announcement-close {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

#theme-light:checked ~ .redpacket-modal-overlay .redpacket-modal-close:hover,
#theme-light:checked ~ .pay-password-modal-overlay .pay-password-modal-close:hover,
#theme-light:checked ~ .redpacket-grab-modal-overlay .redpacket-grab-modal-close:hover,
#theme-light:checked ~ .emoji-picker-overlay .emoji-picker-close:hover,
#theme-light:checked ~ .chat-nickname-modal-overlay .chat-nickname-close:hover,
#theme-light:checked ~ .chat-room-overlay .announcement-close:hover {
    background: rgba(0, 0, 0, 0.15);
    color: #000;
}

#theme-light:checked ~ .chat-room-overlay .announcement-close:active {
    color: #333;
}

/* 引用回复主题配色 - 白色主题 */
#theme-light:checked ~ .chat-room-overlay .chat-message-reply {
    background: rgba(0, 0, 0, 0.06);
    border-left-color: rgba(255, 152, 0, 0.6);
}

#theme-light:checked ~ .chat-room-overlay .chat-message-reply-label {
    color: #666;
}

#theme-light:checked ~ .chat-room-overlay .chat-message-reply-content {
    color: #555;
}

/* 引用预览主题配色 - 白色主题 */
#theme-light:checked ~ .chat-room-overlay .chat-reply-preview {
    background: transparent;
    border-left: none;
}

#theme-light:checked ~ .chat-room-overlay .chat-reply-preview-label {
    color: #666;
}

#theme-light:checked ~ .chat-room-overlay .chat-reply-preview-text {
    color: #555;
}

#theme-light:checked ~ .chat-room-overlay .chat-reply-preview-close {
    background: rgba(0, 0, 0, 0.15);
    color: #333;
}

#theme-light:checked ~ .chat-room-overlay .chat-reply-preview-close:hover,
#theme-light:checked ~ .chat-room-overlay .chat-reply-preview-close:active {
    background: rgba(0, 0, 0, 0.25);
}

/* 关闭按钮主题配色 - 蓝色主题 */
#theme-blue:checked ~ .redpacket-modal-overlay .redpacket-modal-close,
#theme-blue:checked ~ .pay-password-modal-overlay .pay-password-modal-close,
#theme-blue:checked ~ .redpacket-grab-modal-overlay .redpacket-grab-modal-close,
#theme-blue:checked ~ .emoji-picker-overlay .emoji-picker-close,
#theme-blue:checked ~ .chat-nickname-modal-overlay .chat-nickname-close,
#theme-blue:checked ~ .chat-room-overlay .announcement-close {
    background: rgba(25, 118, 210, 0.2);
    color: #0d47a1;
}

#theme-blue:checked ~ .redpacket-modal-overlay .redpacket-modal-close:hover,
#theme-blue:checked ~ .pay-password-modal-overlay .pay-password-modal-close:hover,
#theme-blue:checked ~ .redpacket-grab-modal-overlay .redpacket-grab-modal-close:hover,
#theme-blue:checked ~ .emoji-picker-overlay .emoji-picker-close:hover,
#theme-blue:checked ~ .chat-nickname-modal-overlay .chat-nickname-close:hover,
#theme-blue:checked ~ .chat-room-overlay .announcement-close:hover {
    background: rgba(25, 118, 210, 0.3);
    color: #1565c0;
}

#theme-blue:checked ~ .chat-room-overlay .announcement-close:active {
    color: #0d47a1;
}

/* 蓝色主题适配 */
#theme-blue:checked ~ .chat-room-overlay .chat-room-modal {
    background: #e3f2fd;
}

#theme-blue:checked ~ .chat-room-overlay .chat-room-back {
    background: linear-gradient(135deg, rgba(25, 118, 210, 0.2) 0%, rgba(13, 71, 161, 0.2) 100%);
    color: #ffffff;
    border: 1px solid rgba(25, 118, 210, 0.3);
    -webkit-box-shadow: 0 2px 8px rgba(25, 118, 210, 0.2);
    -moz-box-shadow: 0 2px 8px rgba(25, 118, 210, 0.2);
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.2);
}

#theme-blue:checked ~ .chat-room-overlay .chat-room-back:hover {
    background: linear-gradient(135deg, rgba(25, 118, 210, 0.35) 0%, rgba(13, 71, 161, 0.35) 100%);
    color: #ffffff;
    border-color: rgba(25, 118, 210, 0.4);
    -webkit-box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
    -moz-box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
}

#theme-blue:checked ~ .chat-room-overlay .chat-room-back:active {
    background: linear-gradient(135deg, rgba(25, 118, 210, 0.25) 0%, rgba(13, 71, 161, 0.25) 100%);
    -webkit-box-shadow: 0 2px 6px rgba(25, 118, 210, 0.25);
    -moz-box-shadow: 0 2px 6px rgba(25, 118, 210, 0.25);
    box-shadow: 0 2px 6px rgba(25, 118, 210, 0.25);
}

#theme-blue:checked ~ .chat-room-overlay .chat-room-header {
    border-bottom-color: rgba(25, 118, 210, 0.15);
    background: rgba(25, 118, 210, 0.05);
}

#theme-blue:checked ~ .chat-room-overlay .chat-room-title h3 {
    color: #0d47a1;
}

#theme-blue:checked ~ .chat-room-overlay .chat-room-online {
    color: rgba(13, 71, 161, 0.7);
}

#theme-blue:checked ~ .chat-room-overlay .chat-room-announcement {
    background: rgba(255, 193, 7, 0.2);
    border-color: rgba(255, 193, 7, 0.4);
    color: #0d47a1;
}

#theme-blue:checked ~ .chat-room-overlay .chat-message-avatar {
    background: rgba(25, 118, 210, 0.1);
}

#theme-blue:checked ~ .chat-room-overlay .chat-message-avatar .avatar-placeholder {
    background: rgba(25, 118, 210, 0.4);
    color: #ffffff;
}

#theme-blue:checked ~ .chat-room-overlay .chat-message-user {
    color: rgba(13, 71, 161, 0.6);
}

#theme-blue:checked ~ .chat-room-overlay .chat-message-text {
    background: rgba(25, 118, 210, 0.1);
    color: #0d47a1;
}

#theme-blue:checked ~ .chat-room-overlay .chat-message-time {
    color: rgba(13, 71, 161, 0.5);
}

#theme-blue:checked ~ .chat-room-overlay .chat-room-input-area {
    border-top-color: rgba(25, 118, 210, 0.15);
    background: rgba(25, 118, 210, 0.05);
}

#theme-blue:checked ~ .chat-room-overlay .chat-tool-btn {
    background: transparent;
    color: #0d47a1;
}

#theme-blue:checked ~ .chat-room-overlay .chat-input {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(25, 118, 210, 0.3);
    color: #0d47a1;
}

#theme-blue:checked ~ .chat-room-overlay .chat-input::-webkit-input-placeholder {
    color: rgba(13, 71, 161, 0.5);
}

#theme-blue:checked ~ .chat-room-overlay .chat-input::-moz-placeholder {
    color: rgba(13, 71, 161, 0.5);
}

#theme-blue:checked ~ .chat-room-overlay .chat-input:-ms-input-placeholder {
    color: rgba(13, 71, 161, 0.5);
}

#theme-blue:checked ~ .chat-room-overlay .chat-input::placeholder {
    color: rgba(13, 71, 161, 0.5);
}

#theme-blue:checked ~ .chat-room-overlay .chat-send-btn {
    background: -webkit-linear-gradient(135deg, #1976d2, #1565c0);
    background: -moz-linear-gradient(135deg, #1976d2, #1565c0);
    background: linear-gradient(135deg, #1976d2, #1565c0);
    color: #ffffff;
    -webkit-box-shadow: 0 2px 8px rgba(25, 118, 210, 0.4);
    -moz-box-shadow: 0 2px 8px rgba(25, 118, 210, 0.4);
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.4);
}

#theme-blue:checked ~ .chat-room-overlay .chat-send-btn:active {
    background: -webkit-linear-gradient(135deg, #1565c0, #0d47a1);
    background: -moz-linear-gradient(135deg, #1565c0, #0d47a1);
    background: linear-gradient(135deg, #1565c0, #0d47a1);
}

#theme-blue:checked ~ .redpacket-modal-overlay .redpacket-modal,
#theme-blue:checked ~ .pay-password-modal-overlay .pay-password-modal,
#theme-blue:checked ~ .redpacket-grab-modal-overlay .redpacket-grab-modal,
#theme-blue:checked ~ .emoji-picker-overlay .emoji-picker-modal,
#theme-blue:checked ~ .chat-nickname-modal-overlay .chat-nickname-modal {
    background: #e3f2fd;
}

#theme-blue:checked ~ .redpacket-modal-overlay .redpacket-modal-header h3,
#theme-blue:checked ~ .pay-password-modal-overlay .pay-password-modal-header h3,
#theme-blue:checked ~ .emoji-picker-overlay .emoji-picker-header h3,
#theme-blue:checked ~ .chat-nickname-modal-overlay .chat-nickname-header h3 {
    color: #0d47a1;
}

#theme-blue:checked ~ .chat-nickname-modal-overlay .chat-nickname-header p {
    color: rgba(13, 71, 161, 0.7);
}

#theme-blue:checked ~ .chat-nickname-modal-overlay .chat-nickname-icon {
    color: #1976d2;
}

#theme-blue:checked ~ .redpacket-modal-overlay .redpacket-form-group label,
#theme-blue:checked ~ .pay-password-modal-overlay .pay-password-form-group label,
#theme-blue:checked ~ .chat-nickname-modal-overlay .chat-nickname-body label {
    color: rgba(13, 71, 161, 0.8);
}

#theme-blue:checked ~ .redpacket-modal-overlay .redpacket-amount-input,
#theme-blue:checked ~ .redpacket-modal-overlay .redpacket-count-input,
#theme-blue:checked ~ .pay-password-modal-overlay .pay-password-input,
#theme-blue:checked ~ .chat-nickname-modal-overlay .chat-nickname-input {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(25, 118, 210, 0.3);
    color: #0d47a1;
}

#theme-blue:checked ~ .chat-nickname-modal-overlay .chat-nickname-input:focus {
    border-color: rgba(25, 118, 210, 0.6);
}

#theme-blue:checked ~ .chat-nickname-modal-overlay .chat-nickname-error {
    color: #c62828;
}

#theme-blue:checked ~ .redpacket-modal-overlay .redpacket-type-option {
    background: rgba(25, 118, 210, 0.1);
    border-color: rgba(25, 118, 210, 0.2);
}

#theme-blue:checked ~ .redpacket-modal-overlay .redpacket-type-option span {
    color: #0d47a1;
}

#theme-blue:checked ~ .redpacket-modal-overlay .redpacket-type-option small {
    color: rgba(13, 71, 161, 0.6);
}

#theme-blue:checked ~ .redpacket-modal-overlay .redpacket-btn-cancel,
#theme-blue:checked ~ .pay-password-modal-overlay .pay-password-btn-cancel,
#theme-blue:checked ~ .chat-nickname-modal-overlay .chat-nickname-btn-cancel {
    background: rgba(25, 118, 210, 0.1);
    color: rgba(13, 71, 161, 0.8);
}

/* 确认按钮主题配色 - 蓝色主题 */
#theme-blue:checked ~ .redpacket-modal-overlay .redpacket-btn-confirm,
#theme-blue:checked ~ .pay-password-modal-overlay .pay-password-btn-confirm,
#theme-blue:checked ~ .chat-nickname-modal-overlay .chat-nickname-btn-confirm {
    background: -webkit-linear-gradient(135deg, #1976d2, #1565c0);
    background: -moz-linear-gradient(135deg, #1976d2, #1565c0);
    background: linear-gradient(135deg, #1976d2, #1565c0);
    color: #ffffff;
    -webkit-box-shadow: 0 2px 8px rgba(25, 118, 210, 0.4);
    -moz-box-shadow: 0 2px 8px rgba(25, 118, 210, 0.4);
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.4);
}

#theme-blue:checked ~ .redpacket-modal-overlay .redpacket-btn-confirm:active,
#theme-blue:checked ~ .pay-password-modal-overlay .pay-password-btn-confirm:active,
#theme-blue:checked ~ .chat-nickname-modal-overlay .chat-nickname-btn-confirm:active {
    background: -webkit-linear-gradient(135deg, #1565c0, #0d47a1);
    background: -moz-linear-gradient(135deg, #1565c0, #0d47a1);
    background: linear-gradient(135deg, #1565c0, #0d47a1);
}

#theme-blue:checked ~ .redpacket-grab-modal-overlay .redpacket-grab-from,
#theme-blue:checked ~ .redpacket-grab-modal-overlay .redpacket-grab-type,
#theme-blue:checked ~ .redpacket-grab-modal-overlay .redpacket-grab-stats {
    color: rgba(13, 71, 161, 0.8);
}

#theme-blue:checked ~ .redpacket-grab-modal-overlay .redpacket-records-title {
    color: rgba(13, 71, 161, 0.6);
}

#theme-blue:checked ~ .redpacket-grab-modal-overlay .redpacket-grab-message {
    color: rgba(13, 71, 161, 0.8);
}

#theme-blue:checked ~ .redpacket-grab-modal-overlay .redpacket-record-item {
    color: rgba(13, 71, 161, 0.8);
    border-bottom-color: rgba(25, 118, 210, 0.1);
}

#theme-blue:checked ~ .redpacket-grab-modal-overlay .redpacket-record-name {
    color: rgba(13, 71, 161, 0.95);
}

/* 引用回复主题配色 - 蓝色主题 */
#theme-blue:checked ~ .chat-room-overlay .chat-message-reply {
    background: rgba(25, 118, 210, 0.08);
    border-left-color: rgba(25, 118, 210, 0.5);
}

#theme-blue:checked ~ .chat-room-overlay .chat-message-reply-label {
    color: rgba(13, 71, 161, 0.7);
}

#theme-blue:checked ~ .chat-room-overlay .chat-message-reply-content {
    color: rgba(13, 71, 161, 0.6);
}

/* 引用预览主题配色 - 蓝色主题 */
#theme-blue:checked ~ .chat-room-overlay .chat-reply-preview {
    background: transparent;
    border-left: none;
}

#theme-blue:checked ~ .chat-room-overlay .chat-reply-preview-label {
    color: rgba(13, 71, 161, 0.8);
}

#theme-blue:checked ~ .chat-room-overlay .chat-reply-preview-text {
    color: rgba(13, 71, 161, 0.7);
}

#theme-blue:checked ~ .chat-room-overlay .chat-reply-preview-close {
    background: rgba(25, 118, 210, 0.2);
    color: #0d47a1;
}

#theme-blue:checked ~ .chat-room-overlay .chat-reply-preview-close:hover,
#theme-blue:checked ~ .chat-room-overlay .chat-reply-preview-close:active {
    background: rgba(25, 118, 210, 0.3);
}

/* iOS设备兼容性 - 间距优化 */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .chat-room-messages {
        padding: 15px;
        -webkit-overflow-scrolling: touch;
    }
    
    .chat-input {
        -webkit-appearance: none;
        appearance: none;
        -webkit-border-radius: 8px;
        border-radius: 8px;
    }
    
    .chat-room-input-area {
        padding-bottom: 12px;
        /* 低版本iOS不支持env()，使用固定值作为降级 */
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }
    
    /* 确保消息间距在低版本iOS上正常显示 */
    .chat-message {
        margin-bottom: 15px;
    }
    
    /* 确保头像和内容之间的间距 */
    .chat-message-avatar {
        margin-right: 10px;
    }
    
    .chat-message-own .chat-message-avatar {
        margin-right: 0;
        margin-left: 10px;
    }
    
    /* 确保输入工具栏按钮间距 */
    .chat-tool-btn {
        margin-right: 8px;
    }
    
    .chat-tool-btn:last-child {
        margin-right: 0;
    }
    
    /* 确保红包类型选项间距 */
    .redpacket-type-option {
        margin-bottom: 12px;
    }
    
    .redpacket-type-option:last-child {
        margin-bottom: 0;
    }
    
    /* 确保表单按钮间距 */
    .redpacket-btn,
    .pay-password-btn {
        margin-right: 12px;
    }
    
    .redpacket-btn:last-child,
    .pay-password-btn:last-child {
        margin-right: 0;
    }
}

/* 响应式设计 - 小屏幕 */
@media (max-width: 480px) {
    .chat-room-modal {
        max-width: 100%;
    }
    
    .chat-room-header {
        padding: 12px 15px;
    }
    
    .chat-room-title h3 {
        font-size: 16px;
    }
    
    .chat-room-messages {
        padding: 12px;
    }
    
    .chat-message-text {
        max-width: 100%;
        /* 使用break-word确保长文本可以正常换行 */
        word-break: break-word;
        -webkit-word-break: break-word;
        /* 使用break-word确保长文本可以正常换行 */
        overflow-wrap: break-word;
        -webkit-overflow-wrap: break-word;
        /* word-wrap是overflow-wrap的旧属性，使用break-word作为降级 */
        word-wrap: break-word;
        -webkit-word-wrap: break-word;
        min-width: 0;
    }
    
    .chat-room-input-area {
        padding: 10px 12px;
    }
    
    .redpacket-modal,
    .pay-password-modal,
    .redpacket-grab-modal {
        width: 95%;
        padding: 15px;
    }
}

/* iOS 特定修复 - 确保长文本能够自动换行 */
@supports (-webkit-touch-callout: none) {
    .chat-message-text {
        /* 使用break-word确保长文本可以正常换行（iOS兼容） */
        word-break: break-word;
        -webkit-word-break: break-word;
        /* 使用break-word确保长文本可以正常换行 */
        overflow-wrap: break-word;
        -webkit-overflow-wrap: break-word;
        /* word-wrap是overflow-wrap的旧属性，使用break-word作为降级（iOS兼容） */
        word-wrap: break-word;
        -webkit-word-wrap: break-word;
        min-width: 0;
        max-width: 100%;
        width: auto;
        display: inline-block;
        white-space: pre-wrap;
        -webkit-hyphens: none;
        hyphens: none;
        line-break: strict;
        -webkit-line-break: strict;
        /* 确保零宽非断行空格能够防止换行 */
        unicode-bidi: embed;
    }
    
    .chat-message-info {
        min-width: 0;
        max-width: 100%;
        width: auto;
    }
    
    .chat-message-content {
        min-width: 0;
        max-width: 85%;
    }
}

/* 引用消息样式（显示在消息气泡下面） */
.chat-message-reply {
    margin-top: 6px;
    margin-left: 0;
    margin-right: 0;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.08);
    -webkit-border-radius: 4px;
    -moz-border-radius: 4px;
    border-radius: 4px;
    font-size: 12px;
    display: inline-block;
    max-width: 100%;
    width: auto;
    min-width: 0;
    overflow: hidden;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    -webkit-align-self: flex-start;
    -moz-align-self: flex-start;
    -ms-flex-item-align: start;
    align-self: flex-start;
}

.chat-message-own .chat-message-info .chat-message-reply {
    -webkit-align-self: flex-end;
    -moz-align-self: flex-end;
    -ms-flex-item-align: end;
    align-self: flex-end;
    margin-left: auto;
    margin-right: 0;
    text-align: right;
}

.chat-message-reply-label {
    color: rgba(255, 255, 255, 0.7);
    margin-right: 6px;
    font-weight: 500;
    display: inline;
}

.chat-message-reply-content {
    color: rgba(255, 255, 255, 0.6);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline;
}

/* 引用预览样式（显示在工具栏中，红包按钮后面） */
.chat-reply-preview {
    display: none;
    -webkit-box-flex: 1;
    -moz-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    margin-left: 8px;
    padding: 8px 32px 8px 10px;
    background: transparent;
    border-left: none;
    -webkit-border-radius: 6px;
    -moz-border-radius: 6px;
    border-radius: 6px;
    position: relative;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    min-width: 0;
    -webkit-box-align: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    align-items: center;
}

.chat-reply-preview-content {
    min-width: 0;
    -webkit-box-flex: 1;
    -moz-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
}

.chat-reply-preview-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-reply-preview-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-reply-preview-close {
    position: absolute;
    top: 50%;
    right: 6px;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    padding: 0;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    -webkit-transition: all 0.2s ease;
    -moz-transition: all 0.2s ease;
    -o-transition: all 0.2s ease;
    transition: all 0.2s ease;
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -moz-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-flex: 0;
    -moz-box-flex: 0;
    -ms-flex: 0 0 auto;
    flex: 0 0 auto;
}

.chat-reply-preview-close:hover,
.chat-reply-preview-close:active {
    background: rgba(255, 255, 255, 0.3);
    -webkit-transform: scale(1.1);
    -moz-transform: scale(1.1);
    -ms-transform: scale(1.1);
    -o-transform: scale(1.1);
    transform: scale(1.1);
}

/* 长按菜单样式 */
.chat-longpress-menu {
    position: fixed;
    z-index: 10000;
    background: rgba(30, 30, 30, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    padding: 4px;
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -webkit-flex-direction: row;
    -moz-flex-direction: row;
    -ms-flex-direction: row;
    flex-direction: row;
    -webkit-box-align: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

.chat-longpress-menu-item {
    padding: 10px 16px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    cursor: pointer;
    -webkit-border-radius: 6px;
    -moz-border-radius: 6px;
    border-radius: 6px;
    -webkit-transition: all 0.2s ease;
    -moz-transition: all 0.2s ease;
    -o-transition: all 0.2s ease;
    transition: all 0.2s ease;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    white-space: nowrap;
}

.chat-longpress-menu-item:hover,
.chat-longpress-menu-item:active {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.chat-longpress-menu-item:not(:last-child) {
    margin-right: 2px;
}

/* @提示样式 - 定位在聊天框右下角 */
.chat-mention-notification {
    position: absolute;
    bottom: 180px;
    right: 20px;
    z-index: 100;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.chat-mention-notification-content {
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -moz-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.95) 0%, rgba(255, 143, 0, 0.95) 100%);
    color: #ffffff;
    padding: 10px 16px;
    -webkit-border-radius: 25px;
    -moz-border-radius: 25px;
    border-radius: 25px;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
    -webkit-box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
    -moz-box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    min-width: 100px;
}

.chat-mention-notification-content:hover {
    -webkit-transform: scale(1.05);
    -moz-transform: scale(1.05);
    -ms-transform: scale(1.05);
    -o-transform: scale(1.05);
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(255, 193, 7, 0.5);
    -webkit-box-shadow: 0 6px 16px rgba(255, 193, 7, 0.5);
    -moz-box-shadow: 0 6px 16px rgba(255, 193, 7, 0.5);
}

.chat-mention-notification-content:active {
    -webkit-transform: scale(0.98);
    -moz-transform: scale(0.98);
    -ms-transform: scale(0.98);
    -o-transform: scale(0.98);
    transform: scale(0.98);
}

.mention-notification-icon {
    font-weight: bold;
    margin-right: 6px;
    font-size: 16px;
    color: #ffffff;
}

.mention-notification-text {
    margin-right: 4px;
    font-weight: bold;
    color: #ffffff;
}

.mention-notification-count {
    background: rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 2px 8px;
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

/* 浅色主题下的@提示样式 */
#theme-light:checked ~ .chat-room-overlay .chat-mention-notification-content {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.95) 0%, rgba(69, 160, 73, 0.95) 100%);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    -webkit-box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    -moz-box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    color: #ffffff;
}

#theme-light:checked ~ .chat-room-overlay .mention-notification-icon,
#theme-light:checked ~ .chat-room-overlay .mention-notification-text {
    color: #ffffff;
}

#theme-light:checked ~ .chat-room-overlay .chat-mention-notification-content:hover {
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
    -webkit-box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
    -moz-box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

/* 蓝色主题下的@提示样式 */
#theme-blue:checked ~ .chat-room-overlay .chat-mention-notification-content {
    background: linear-gradient(135deg, rgba(25, 118, 210, 0.95) 0%, rgba(13, 71, 161, 0.95) 100%);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
    -webkit-box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
    -moz-box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
    color: #ffffff;
}

#theme-blue:checked ~ .chat-room-overlay .mention-notification-icon,
#theme-blue:checked ~ .chat-room-overlay .mention-notification-text {
    color: #ffffff;
}

#theme-blue:checked ~ .chat-room-overlay .chat-mention-notification-content:hover {
    box-shadow: 0 6px 16px rgba(25, 118, 210, 0.4);
    -webkit-box-shadow: 0 6px 16px rgba(25, 118, 210, 0.4);
    -moz-box-shadow: 0 6px 16px rgba(25, 118, 210, 0.4);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .chat-mention-notification {
        bottom: 160px;
        right: 15px;
    }
    
    .chat-mention-notification-content {
        padding: 8px 14px;
        font-size: 13px;
        min-width: 90px;
    }
    
    .mention-notification-icon {
        font-size: 15px;
        margin-right: 5px;
    }
}

