/* 
 * Copyright 2011-2016 mengkunsoft, Inc.
 * Licensed under MIT 
 */
 
/* CSS变量定义 - 现代化主题管理 */
:root {
    --primary-color: #5e7ce0;
    --primary-light: #e0e7ff;
    --primary-dark: #4a65d0;
    --secondary-color: #6c757d;
    --success-color: #2dd4bf;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --border-color: #e5e7eb;
    --hover-bg-color: #f3f4f6;
    --input-bg-color: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --text-color: #333333;
}

/* 基础样式重置 */
*, ::before, ::after {
    box-sizing: border-box;
}

html {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-primary);
    line-height: 1.5;
}

body {
    max-width: 850px;
    margin: 0 auto;
    background: var(--bg-secondary);
    box-shadow: var(--shadow-xl);
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* 聊天窗口样式 */
.mk-chat-box {
    font-family: inherit;
    font-size: 16px;
    width: 100%;
    padding: 20px;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
    background-color: var(--bg-secondary);
    background-image: 
        radial-gradient(circle at 25px 25px, var(--border-color) 2px, transparent 0),
        radial-gradient(circle at 75px 75px, var(--border-color) 2px, transparent 0);
    background-size: 100px 100px;
}

/* 顶部和底部样式 */
.top {
    padding: 0 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    height: 60px;
    line-height: 60px;
    text-align: center;
    color: white;
    font-weight: 600;
    font-size: 18px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.top::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiPjxkZWZzPjxwYXR0ZXJuIGlkPSJwYXR0ZXJuIiB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHBhdGggZD0iTTUwIDUwIEwwIDUwIEwwIDAgTDUwIDAgWiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZmZmZmZmMjAiIHN0cm9rZS13aWR0aD0iMiIvPjwvcGF0dGVybj48L2RlZnM+PHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idXJsKCNwYXR0ZXJuKSIvPjwvc3ZnPg==');
    opacity: 0.3;
}

.foot {
    line-height: 40px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    background-color: white;
    border-top: 1px solid var(--border-color);
}

/* 输入区域样式 */
.write {
    height: auto;
    min-height: 60px;
    width: 100%;
    padding: 8px 20px;
    background-color: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

/* 引用指示器样式 */
#quote-indicator {
    display: none;
    width: 100%;
    background: var(--bg-tertiary);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    border-left: 4px solid var(--primary-color);
    position: relative;
    z-index: 10;
    transition: var(--transition);
}

/* 引用文本样式 */
#quote-text {
    color: #333;
    word-break: break-word;
    line-height: 1.4;
    font-size: 14px;
}

/* 输入和发送按钮容器 */
.input-send-container {
    display: flex;
    width: 100%;
    gap: 12px;
    align-items: center;
    padding-bottom: 4px;
    position: relative;
}

/* 输入容器 */
.input-container {
    position: relative;
    display: flex;
    flex: 1;
    gap: 12px;
    align-items: center;
    padding: 0 8px 6px;
    transition: var(--transition);
}

/* 其他功能栏样式 */
.other-functions {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    position: relative;
    padding: 2px 0;
}

/* 功能按钮组 */
.function-buttons {
    display: flex;
    gap: 10px;
    padding: 4px 0;
}

/* 功能按钮样式 */
.function-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border-color);
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.function-btn:hover {
    background-color: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.function-btn:active {
    transform: scale(0.97);
    box-shadow: none;
}

/* 表情包面板样式 */
.emoji-panel {
    position: absolute;
    bottom: 100%;
    left: 0;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 380px;
    max-height: 320px;
    margin-bottom: 10px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transform-origin: bottom left;
    animation: fadeInUp 0.3s ease;
}

/* 表情包标签页 */
.emoji-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    padding: 12px 12px 0;
    gap: 4px;
}

.emoji-tab {
    padding: 8px 16px;
    border: none;
    background-color: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.emoji-tab:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.emoji-tab.active {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-bottom: 3px solid var(--primary-color);
    margin-bottom: -1px;
    color: var(--primary-color);
    font-weight: 600;
}

/* 表情包内容区域 */
.emoji-content {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-tertiary);
}

.emoji-content::-webkit-scrollbar {
    width: 6px;
}

.emoji-content::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.emoji-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.emoji-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* 表情包分类区域 */
.emoji-category {
    display: none;
    font-size: 24px;
    line-height: 1.6;
    word-break: break-all;
}

.emoji-category.active {
    display: block;
}

.emoji-category span {
    display: inline-block;
    padding: 4px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.emoji-category span:hover {
    background-color: var(--hover-bg-color);
}

.write input, .write textarea {
    font-size: 15px;
    flex: 1;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    outline: none;
    transition: var(--transition);
    background: var(--bg-tertiary);
    height: 44px;
    resize: none;
    font-family: inherit;
    line-height: 1.5;
    max-height: 120px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.write input::placeholder,
.write textarea::placeholder {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 14px;
    text-align: left;
    line-height: 40px;
}

/* 设置placeholder提示文字水平靠左、上下居中显示 */
.write input::placeholder,
.write textarea::placeholder {
    text-align: left;
    line-height: 40px; /* 确保上下居中 */
}

.write input:focus, .write textarea:focus {
    border-color: var(--primary-color);
    background-color: var(--bg-primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.write input {
    height: 44px;
    padding: 0 18px;
}

#fresh {
    color: white;
}

/* 发送按钮样式 */
.send {
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    background-color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    text-align: center;
    border-radius: var(--radius-lg);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.send:hover:not(.disabled) {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.send:active:not(.disabled) {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.send.disabled {
    background-color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.6;
}

/* 消息容器样式 */
.mk-chat-box .msg {
    margin: 12px 0;
    position: relative;
    min-height: 52px;
    animation: fadeIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transition: transform 0.2s ease;
}

.mk-chat-box .msg:hover {
    transform: translateY(-1px);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mk-chat-box .right {
    text-align: right;
    margin-left: 64px;
}

.mk-chat-box .left {
    text-align: left;
    margin-right: 64px;
}

/* 头像样式 */
.mk-chat-box img.head {
    width: 44px;
    height: 44px;
    top: 0;
    position: absolute;
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
    user-select: none;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    overflow: hidden;
    background: var(--bg-tertiary);
}

.mk-chat-box img.head:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.mk-chat-box .right img.head {
    right: 0;
}

.mk-chat-box .left img.head {
    left: 0;
}

/* 昵称和时间容器 */
.mk-chat-box .name-time-container {
    margin-bottom: 4px;
}

/* 昵称样式 */
.mk-chat-box .name {
    color: var(--text-muted);
    font-size: 12px;
    display: inline-block;
    line-height: 18px;
    opacity: 0.8;
}

.mk-chat-box .right .name-time-container {
    margin: 0 56px 4px 0;
    text-align: right;
}

.mk-chat-box .left .name-time-container {
    margin: 0 0 4px 56px;
    text-align: left;
}

/* 消息内容样式 */
.mk-chat-box .content {
    word-break: break-all;
    word-wrap: break-word;
    text-align: left;
    position: relative;
    display: inline-block;
    font-size: 15px;
    padding: 12px 16px;
    line-height: 1.5;
    border-radius: var(--radius-lg);
    min-width: 24px;
    min-height: 20px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    max-width: calc(100% - 16px);
    cursor: pointer;
    font-family: inherit;
    overflow: hidden;
}

/* Markdown元素样式 */
.mk-chat-box .content h1,
.mk-chat-box .content h2,
.mk-chat-box .content h3 {
    margin: 16px 0 10px 0;
    padding: 0;
    font-weight: 600;
    line-height: 1.3;
    color: inherit;
}

.mk-chat-box .content h1 {
    font-size: 22px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 4px;
}

.mk-chat-box .content h2 {
    font-size: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 3px;
}

.mk-chat-box .content h3 {
    font-size: 18px;
}

.mk-chat-box .content p {
    margin: 8px 0;
    padding: 0;
}

.mk-chat-box .content blockquote {
    margin: 10px 0;
    padding: 8px 12px;
    background-color: rgba(0, 0, 0, 0.05);
    border-left: 3px solid var(--primary-color);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 14px;
    line-height: 1.5;
}

.mk-chat-box .content code {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    white-space: nowrap;
}

.mk-chat-box .content ul,
.mk-chat-box .content ol {
    margin: 10px 0;
    padding-left: 20px;
}

.mk-chat-box .content li {
    margin: 4px 0;
    padding: 0;
}

.mk-chat-box .content strong {
    font-weight: 600;
}

.mk-chat-box .content em {
    font-style: italic;
}

.mk-chat-box .content s {
    text-decoration: line-through;
}

/* 消息时间样式 */
.mk-chat-box .time {
    font-size: 11px;
    color: var(--text-secondary);
    margin-left: 8px;
    display: inline-block;
    vertical-align: middle;
    opacity: 1;
}

/* 修改右侧消息中时间的样式，使其与其他用户发送时间颜色相同，确保时间显示清晰可见，同时调整margin以适应时间显示在名字左边的布局 */
.mk-chat-box .right .time {
    color: var(--text-secondary);
    margin-left: 0;
    margin-right: 8px;
    opacity: 1;
}

/* 引用消息样式 */
.mk-chat-box .quote {
    margin: 0 0 12px 0;
    padding: 8px 14px;
    background-color: rgba(0, 0, 0, 0.05);
    border-left: 3px solid var(--primary-color);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-secondary);
    font-style: italic;
    transition: var(--transition);
}

/* 引用块分隔符样式 */
.blockquote-separator {
    display: block;
    height: 4px;
    content: "";
}

/* 确保相邻blockquote之间有适当间距 */
.mk-chat-box .content blockquote {
    margin: 10px 0;
    padding: 8px 12px;
    background-color: rgba(0, 0, 0, 0.05);
    border-left: 3px solid var(--primary-color);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.mk-chat-box .quote .quote-name {
    font-weight: 600;
    color: var(--primary-color);
}

.mk-chat-box .right .quote {
    background-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
}

.mk-chat-box .right .quote .quote-name {
    color: white;
}

.mk-chat-box .content:hover {
    box-shadow: var(--shadow-md);
}

/* 消息中的图片和链接 */
.mk-chat-box .content img {
    width: 100%;
    max-width: 280px;
    height: auto;
    border-radius: var(--radius-md);
    margin: 8px 0;
    transition: all 0.3s ease;
    display: block;
    box-shadow: var(--shadow-sm);
}

.mk-chat-box .content img:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-sm);
}

/* 消息中的链接样式 */
.mk-chat-box .content a {
    color: var(--primary-color);
    margin: 0 2px;
    text-decoration: none;
    border-bottom: 1px solid var(--primary-light);
    transition: var(--transition);
    position: relative;
    display: inline-block;
    padding: 2px 0;
}

/* 消息中的链接悬停样式 */
.mk-chat-box .content a:hover {
    border-bottom-color: var(--primary-color);
    color: var(--primary-dark);
}

.mk-chat-box .content a::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--transition);
}

.mk-chat-box .content a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* 右侧消息样式 */
.mk-chat-box .right .content {
    margin: 0 56px 0 0;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-lg);
    border-bottom-right-radius: 8px;
    box-shadow: var(--shadow-md);
}
/* 右侧消息箭头样式 - 使用更现代的设计 */
.mk-chat-box .right .content:after {
    content: "";
    position: absolute;
    right: -6px;
    top: 16px;
    width: 14px;
    height: 14px;
    background-color: var(--primary-color);
    transform: rotate(45deg);
    z-index: -1;
}

/* 左侧消息样式 */
.mk-chat-box .left .content {
    margin: 0 0 0 56px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    border-bottom-left-radius: 8px;
    box-shadow: var(--shadow-md);
}
/* 左侧消息箭头样式 - 使用更现代的设计 */
.mk-chat-box .left .content:after {
    content: "";
    position: absolute;
    left: -6px;
    top: 16px;
    width: 14px;
    height: 14px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    transform: rotate(45deg);
    z-index: -1;
}

/* 系统提示样式 */
.mk-chat-box .tips {
    margin: 20px 0;
    text-align: center;
    font-size: 12px;
    animation: slideIn 0.5s ease;
}

.mk-chat-box .tips span {
    display: inline-block;
    padding: 4px 12px;
    background-color: var(--text-muted);
    color: white;
    border-radius: 20px;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.mk-chat-box .tips .tips-primary {
    background-color: var(--primary-color);
}

.mk-chat-box .tips .tips-success {
    background-color: var(--success-color);
}

.mk-chat-box .tips .tips-info {
    background-color: var(--info-color);
}

.mk-chat-box .tips .tips-warning {
    background-color: var(--warning-color);
    color: var(--text-primary);
}

.mk-chat-box .tips .tips-danger {
    background-color: var(--danger-color);
}

/* 滚动条美化 */
.mk-chat-box::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.mk-chat-box::-webkit-scrollbar-track {
    background-color: transparent;
}

.mk-chat-box::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
    transition: var(--transition);
}

.mk-chat-box::-webkit-scrollbar-thumb:hover,
.mk-chat-box::-webkit-scrollbar-thumb:active {
    background-color: rgba(0, 0, 0, 0.3);
}

/* 登录区域样式 */
.login {
    margin-top: 20px;
}

/* 登录容器 - 全屏居中显示 */
.login-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* 登录框样式 */
.login-box {
    max-width: 420px;
    width: 90%;
    padding: 40px;
    background-color: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    text-align: center;
    animation: slideUp 0.5s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 标题样式 */
.login-box h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 副标题样式 */
.login-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 30px;
}

/* 输入框容器 */
.login-input-wrapper {
    margin-bottom: 24px;
    position: relative;
    transition: var(--transition);
}

/* 输入框样式 */
.login-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    transition: var(--transition);
    background-color: white;
    box-shadow: var(--shadow-sm);
}

.login-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-light);
    outline: none;
}

.login-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 14px;
}

.login-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-light);
    outline: none;
}

.login-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

/* 登录按钮样式 */
.login-btn {
    display: inline-block;
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color), #3a5bd4);
    color: white;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    margin-bottom: 12px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 108, 247, 0.3);
}

.login-btn:active {
    transform: translateY(0);
}

/* 底部提示文字 */
.login-footer {
    color: var(--text-muted);
    font-size: 12px;
    margin: 0;
}

/* 展开编辑器按钮样式 */
.expand-editor-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--primary-light);
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
    opacity: 1;
    box-shadow: var(--shadow-sm);
}

.expand-editor-btn:hover {
    background-color: var(--primary-light);
    opacity: 1;
}

/* 富文本编辑器样式 - 覆盖布局，高度为屏幕高度的一半 */
.rich-text-editor {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    z-index: 1001;
    height: 60vh;
    margin: 0;
    overflow: hidden;
    animation: fadeInScale 0.3s ease;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* 富文本头部 */
.rich-text-header {
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.rich-text-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-light), var(--primary-dark));
}

.rich-text-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.close-editor-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.close-editor-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* 富文本工具栏 */
.rich-text-toolbar {
    padding: 12px 16px;
    background-color: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    position: relative;
}

/* 工具栏按钮 */
.toolbar-btn {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--primary-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-sm);
}

/* 工具栏按钮悬停样式 */
.toolbar-btn:hover {
    background-color: var(--primary-light);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* 工具栏按钮激活样式 */
.toolbar-btn:active {
    transform: scale(0.97);
    box-shadow: var(--shadow-sm);
}

.toolbar-divider {
    width: 1px;
    height: 20px;
    background-color: var(--border-color);
    margin: 0 4px;
}

/* 编辑器内容区域 */
.rich-text-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    min-height: 200px;
    background: var(--bg-primary);
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-tertiary);
}

.rich-text-content::-webkit-scrollbar {
    width: 6px;
}

.rich-text-content::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.rich-text-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.rich-text-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

#editor-content {
    width: 100%;
    min-height: 200px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    outline: none;
    font-size: 16px;
    line-height: 1.6;
    font-family: inherit;
    resize: vertical;
    background-color: white;
}

#editor-content:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.editor-content {
    width: 100%;
    min-height: 200px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    outline: none;
    font-size: 16px;
    line-height: 1.6;
    font-family: inherit;
    resize: vertical;
    background-color: white;
}

.editor-content:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-light);
}

/* 富文本底部按钮 */
.rich-text-footer {
    padding: 16px 24px;
    background-color: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* 插入按钮样式 */
.insert-rich-text-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* 插入按钮悬停样式 */
.insert-rich-text-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark), #2a49b4);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.insert-rich-text-btn:active {
    transform: translateY(0);
}

/* 响应式调整 */
@media (max-width: 480px) {
    /* 登录区域响应式 */
    .login-box {
        padding: 30px 20px;
        margin: 20px;
        border-radius: var(--radius-lg);
    }
    
    .login-box h2 {
        font-size: 24px;
    }
    
    .login-input,
    .login-btn {
        padding: 14px;
        font-size: 15px;
    }
    
    /* 聊天界面响应式 */
    .mk-chat-box .msg {
        margin: 10px 0;
    }
    
    .mk-chat-box img.head {
        width: 40px;
        height: 40px;
        margin: 0 8px;
    }
    
    .mk-chat-box .content {
        font-size: 14px;
        padding: 10px 14px;
    }
    
    .mk-chat-box .left .content,
    .mk-chat-box .right .content {
        margin-left: 48px;
        margin-right: 48px;
    }
    
    /* 富文本编辑器响应式 */
    .rich-text-editor {
        width: 95%;
        height: 80vh;
        max-height: 80vh;
        border-radius: var(--radius-md);
    }
    
    .rich-text-header,
    .rich-text-footer {
        padding: 12px 16px;
    }
    
    .rich-text-content {
        padding: 16px;
    }
    
    .toolbar-btn {
        padding: 6px 10px;
        font-size: 13px;
        gap: 4px;
    }
    
    /* 输入区域响应式 - 最大化输入框空间 */
    .input-wrapper {
        gap: 2px;
        padding: 0 4px 4px;
    }
    
    .input-send-container {
        gap: 4px;
    }
    
    .input-container {
        gap: 4px;
        padding: 0 4px 4px;
    }
    
    .function-buttons {
        gap: 4px;
        padding: 2px 0;
    }
    
    .message-input {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .send-button {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    /* 功能按钮响应式 */
    .function-btn {
        width: 32px;
        height: 32px;
        border-width: 1px;
    }
    
    /* 发送按钮响应式 */
    .send {
        padding: 10px 14px;
        font-size: 13px;
        min-width: 60px;
    }
}