:root {
  --primary-bg: #FFFFFF;          /* 白色背景，仿微信 */
  --secondary-bg: #F8F8F8;        /* 微信灰色背景 */
  --border-color: #E5E5E5;        /* 浅灰色边框 */
  --text-primary: #1A1A1A;        /* 主要文字 - 近黑色 */
  --text-secondary: #888888;      /* 次要文字 - 中灰色 */
  --text-muted: #B2B2B2;          /* 弱化文字 - 浅灰色 */
  --accent-color: #07C160;        /* 强调色改为微信绿色 */
  --user-bubble: #95EC69;         /* 用户气泡改为微信浅绿色 */
  --staff-bubble: #212529;        /* 客服气泡保持深色 */
  --system-bubble: #F8F8F8;       /* 系统气泡改为微信灰色 */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --sum-color: #FA5151;           /* 求和颜色改为微信红色 */
  
  /* 新增链接颜色变量 - 使用微信风格 */
  --link-color: #576B95;          /* 微信蓝灰色链接 */
  --link-hover: #07C160;          /* 悬停使用微信绿 */
  --link-active: #06AD56;         /* 激活使用深微信绿 */
  --link-visited: #7D7D7D;        /* 已访问使用中灰色 */
  --link-focus-ring: rgba(7, 193, 96, 0.3); /* 微信绿透明光环 */
  
  /* 原有的其他变量保持不变 */
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-container {
  max-width: auto;
  width: 100%;
  height: 90vh;
  max-height: 100vh;
  margin: 2rem auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--secondary-bg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  border: 1px solid var(--border-color);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative; /* 为内部元素定位做准备 */
}

.chat-messages {
  height: 500px;
  overflow-y: auto;
  padding: 1.25rem;
  background: var(--primary-bg);
  scroll-behavior: smooth;
}
    .message-list {
        max-height: 70vh;
        overflow-y: auto;
        padding: 20px;
        display: flex;
        flex-direction: column;
    }
    
    .message {
        margin-bottom: 15px;
        padding: 15px;
        border-radius: 12px;
        max-width: 70%;
        animation: fadeInUp 0.3s ease-in;
    }


    .message-user {
        align-self: flex-end;
    }

.message-user .message-text {
  background: var(--accent-color);
  color: white;
  border-top-right-radius: var(--radius-sm);
}
    .message-staff {
        align-self: flex-start;
        border-bottom-left-radius: 4px;
    }
.message-staff .message-text {
  background: var(--user-bubble);
  color: var(--text-primary);
  border-top-left-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
    .message-system {
        background: #f5f5f5;
        align-self: center;
        max-width: 90%;
        text-align: center;
        margin: 10px 0;
    }
    
    .message-avatar {
        float: left;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: #fff;
        text-align: center;
        line-height: 40px;
        margin-right: 10px;
    }
    
    .message-user .message-avatar {
        float: right;
        margin-right: 0;
        margin-left: 10px;
    }
    
.message-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.message-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.message-sender {
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
    
.message-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.8;
}
    
.message-text {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
  transition: var(--transition);
}
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* 滚动条样式 */
    .message-list::-webkit-scrollbar {
        width: 6px;
    }
    
    .message-list::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 3px;
    }
    
    .message-list::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 3px;
    }
    
    .message-list::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8;
    }
	
	#new-message-notification {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4CAF50;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1000;
    align-items: center; /* 确保内容垂直居中 */
}

/* 图标基础样式 */
#new-message-notification .icon {
    display: inline-block;
    font-size: 16px; /* 可根据实际情况调整 */
    line-height: 1;
    vertical-align: middle;
}

/* 铃铛图标样式 */
#new-message-notification .icon-bell {
    margin-right: 10px;
    width: 20px; /* 如果使用字体图标可省略 */
    height: 20px;
}

/* 关闭按钮样式 */
#close-notification {
    background: none;
    border: none;
    color: white;
    margin-left: 15px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 关闭图标样式 */
#close-notification .icon-close {
    width: 16px;
    height: 16px;
    position: relative;
    transition: transform 0.2s ease;
    /* 如果是字体图标：
    font-family: "icon-font";
    content: "\e901"; */
}

/* 悬停效果 */
#close-notification:hover .icon-close {
    transform: scale(1.1);
}

/* 如果需要创建X形状的关闭图标（使用CSS绘制） */
#close-notification .icon-close::before,
#close-notification .icon-close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: currentColor;
}

#close-notification .icon-close::before {
    transform: rotate(45deg);
}

#close-notification .icon-close::after {
    transform: rotate(-45deg);
}

/* 动画效果（可选） */
#new-message-notification {
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
    #new-message-notification {
        animation: slideInRight 0.5s ease-out;
    }
    
    @keyframes slideInRight {
        from {
            transform: translateX(100%);
            opacity: 0;
        }
        to {
            transform: translateX(0);
            opacity: 1;
        }
    }
    
.icon-comment-o,
.icon-wechat,
.icon-comments-o,
.icon-comment {
    color: #b71c1c;
    width: 1.2em;
    text-align: center;
}

/* 深色模式 - 仿微信聊天深色主题 */
@media (prefers-color-scheme: dark) {
@media (prefers-color-scheme: dark) {
  :root {
    --primary-bg: #1A1A1A;        /* 微信深色模式主背景色 */
    --secondary-bg: #121212;      /* 更深一点的背景色 */
    --border-color: #2D2D2D;      /* 深色边框 */
    --text-primary: #E0E0E0;      /* 主文本颜色 */
    --text-secondary: #B0B0B0;    /* 次要文本颜色 */
    --text-muted: #888888;        /* 弱化文本颜色 */
    --accent-color: #07C160;      /* 微信绿色保持不变 */
    --user-bubble: #2A6E3F;       /* 用户消息气泡改为深墨绿色 */
    --staff-bubble: #2D2D2D;      /* 客服消息气泡改为深灰色 */
    --system-bubble: #333333;     /* 系统消息气泡改为灰黑色 */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.5);
    --sum-color: #FF6B6B;         /* 求和相关颜色调整为亮红色 */
    
    /* 深色模式链接颜色 */
    --link-color: #7D9DCC;        /* 浅蓝灰色链接 */
    --link-hover: #5CD189;        /* 悬停使用微信浅绿 */
    --link-active: #07C160;       /* 激活使用微信绿 */
    --link-visited: #A0A0A0;      /* 已访问使用浅灰色 */
    --link-focus-ring: rgba(92, 209, 137, 0.4); /* 浅绿透明光环 */
  }
}

.chat-container {
  max-width: auto;
  width: 100%;
  height: 90vh;
  max-height: 100vh;
  margin: 2rem auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--secondary-bg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  border: 1px solid var(--border-color);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative; /* 为内部元素定位做准备 */
}

.chat-messages {
  height: 500px;
  overflow-y: auto;
  padding: 1.25rem;
  background: var(--primary-bg);
  scroll-behavior: smooth;
}
    .message-list {
        max-height: 70vh;
        overflow-y: auto;
        padding: 20px;
        display: flex;
        flex-direction: column;
    }
    
    .message {
        margin-bottom: 15px;
        padding: 15px;
        border-radius: 12px;
        max-width: 70%;
        animation: fadeInUp 0.3s ease-in;
    }


    .message-user {
        align-self: flex-end;
    }

.message-user .message-text {
  background: var(--accent-color);
  color: white;
  border-top-right-radius: var(--radius-sm);
}
    .message-staff {
        align-self: flex-start;
        border-bottom-left-radius: 4px;
    }
.message-staff .message-text {
  background: var(--user-bubble);
  color: var(--text-primary);
  border-top-left-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
    .message-system {
        background: var(--system-bubble);
        align-self: center;
        max-width: 90%;
        text-align: center;
        margin: 10px 0;
        color: var(--text-primary);
    }
    
    .message-avatar {
        float: left;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: var(--secondary-bg);
        text-align: center;
        line-height: 40px;
        margin-right: 10px;
        border: 1px solid var(--border-color);
    }
    
    .message-user .message-avatar {
        float: right;
        margin-right: 0;
        margin-left: 10px;
    }
    
.message-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.message-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.message-sender {
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
    
.message-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.8;
}
    
.message-text {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
  transition: var(--transition);
}
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* 滚动条样式 - 深色模式适配 */

    .message-list::-webkit-scrollbar {
        width: 6px;
    }
    
    .message-list::-webkit-scrollbar-track {
        background: var(--secondary-bg);
        border-radius: 3px;
    }
    
    .message-list::-webkit-scrollbar-thumb {
        background: var(--border-color);
        border-radius: 3px;
    }
    
    .message-list::-webkit-scrollbar-thumb:hover {
        background: var(--text-muted);
    }
    
    /* 深色模式下的滚动条 */
    @media (prefers-color-scheme: dark) {
        .message-list::-webkit-scrollbar-track {
            background: #2d2d2d;
        }
        
        .message-list::-webkit-scrollbar-thumb {
            background: #4a4a4a;
        }
        
        .message-list::-webkit-scrollbar-thumb:hover {
            background: #5a5a5a;
        }
    }
    
    #new-message-notification {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4CAF50;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1000;
    align-items: center; /* 确保内容垂直居中 */
}

/* 深色模式下的通知样式 */
@media (prefers-color-scheme: dark) {
    #new-message-notification {
        background: #2d2d2d;
        border: 1px solid #3d3d3d;
        box-shadow: 0 4px 12px rgba(0,0,0,0.6);
    }
}

/* 图标基础样式 */
#new-message-notification .icon {
    display: inline-block;
    font-size: 16px; /* 可根据实际情况调整 */
    line-height: 1;
    vertical-align: middle;
}

/* 铃铛图标样式 */
#new-message-notification .icon-bell {
    margin-right: 10px;
    width: 20px; /* 如果使用字体图标可省略 */
    height: 20px;
}

/* 关闭按钮样式 */
#close-notification {
    background: none;
    border: none;
    color: white;
    margin-left: 15px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 关闭图标样式 */
#close-notification .icon-close {
    width: 16px;
    height: 16px;
    position: relative;
    transition: transform 0.2s ease;
    /* 如果是字体图标：
    font-family: "icon-font";
    content: "\e901"; */
}

/* 悬停效果 */
#close-notification:hover .icon-close {
    transform: scale(1.1);
}

/* 如果需要创建X形状的关闭图标（使用CSS绘制） */
#close-notification .icon-close::before,
#close-notification .icon-close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: currentColor;
}

#close-notification .icon-close::before {
    transform: rotate(45deg);
}

#close-notification .icon-close::after {
    transform: rotate(-45deg);
}

/* 动画效果（可选） */
#new-message-notification {
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
    #new-message-notification {
        animation: slideInRight 0.5s ease-out;
    }
    
    @keyframes slideInRight {
        from {
            transform: translateX(100%);
            opacity: 0;
        }
        to {
            transform: translateX(0);
            opacity: 1;
        }
    }
    
.icon-comment-o,
.icon-wechat,
.icon-comments-o,
.icon-comment {
    color: #b71c1c;
    width: 1.2em;
    text-align: center;
}

/* 深色模式下的图标颜色 */
@media (prefers-color-scheme: dark) {
    .icon-comment-o,
    .icon-wechat,
    .icon-comments-o,
    .icon-comment {
        color: #ff6b6b;
    }
}

/* 自定义细滚动条 - 只在滚动时显示 */
.chat-container {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  overflow-y: auto;
}

.chat-container::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.chat-container::-webkit-scrollbar-track {
  background: transparent;
}

.chat-container::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 2px;
  opacity: 0.3;
}

.chat-container::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
  opacity: 0.5;
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
  .chat-container::-webkit-scrollbar-thumb {
    background: var(--text-muted);
  }
}

/* 文本区域的细滚动条 */
.chat-group textarea::-webkit-scrollbar {
  width: 4px;
}

.chat-group textarea::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 2px;
}