/* 微信配色和基础样式 */
:root {
    /* 微信主色调 */
    --primary-color: #07c160;
    /* 微信绿 */
    --primary-light: #4cd080;
    /* 浅绿色 */
    --primary-dark: #059748;
    /* 深绿色 */

    /* 背景色 */
    --bg-primary: #f5f5f5;
    /* 主背景 */
    --bg-secondary: #ffffff;
    /* 次要背景 */
    --bg-chat: #f0f0f0;
    /* 聊天背景 */
    --bg-message-self: #95e675;
    /* 自己消息背景 */
    --bg-message-other: #ffffff;
    /* 他人消息背景 */

    /* 文字颜色 */
    --text-primary: #191919;
    /* 主要文字 */
    --text-secondary: #888888;
    /* 次要文字 */
    --text-light: #ffffff;
    /* 浅色文字 */
    --text-muted: #999999;
    /* 禁用文字 */

    /* 边框和分割线 */
    --border-light: #e6e6e6;
    /* 浅色边框 */
    --border-medium: #d0d0d0;
    /* 中等边框 */
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.15);

    /* 尺寸 */
    --header-height: 60px;
    --footer-height: auto;
    --border-radius: 8px;
    --message-radius: 12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow: hidden;
}

/* 登录页面样式 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    padding: 20px;
}

.login-box {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: 0 10px 30px var(--shadow-medium);
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.login-header i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.login-header h1 {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.login-header p {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.input-group {
    position: relative;
}

.login-form .input-group {
    position: relative;
    margin-bottom: 20px;
}



.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 18px;
}

.input-group input {
    width: 100%;
    padding: 15px 50px;
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    font-size: 16px;
    background: var(--bg-secondary);
    outline: none;
    transition: border-color 0.3s;
}

.input-group input:focus {
    border-color: var(--primary-color);
}

.login-btn {
    width: 100%;
    padding: 15px;
    background: var(--primary-color);
    color: var(--text-light);
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.3s;
    margin-bottom: 20px;
}

.login-btn:hover {
    background: var(--primary-dark);
}

.login-tips {
    text-align: left;
    background: var(--bg-primary);
    padding: 20px;
    border-radius: var(--border-radius);
    font-size: 14px;
}

.login-tips p {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-weight: 500;
    color: var(--text-secondary);
}

.login-tips ul {
    list-style: none;
    margin-left: 24px;
}

.login-tips li {
    margin-bottom: 5px;
    color: var(--text-secondary);
    position: relative;
}

.login-tips li::before {
    content: "•";
    color: var(--primary-color);
    margin-right: 8px;
}

/* 聊天主界面 */
.chat-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-chat);
}

/* 头部导航 */
.chat-header {
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 2px 4px var(--shadow-light);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.header-btn:hover {
    background: var(--bg-primary);
}

.room-info h3 {
    font-size: 18px;
    margin-bottom: 2px;
    color: var(--text-primary);
}

.online-count {
    font-size: 12px;
    color: var(--text-secondary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 消息区域 */
.chat-main {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.message-list {
    height: 100%;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

/* 消息样式 */
.message-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 80%;
    opacity: 0;
    transform: translateY(20px);
    animation: messageSlideIn 0.3s ease-out forwards;
}

@keyframes messageSlideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-item.self {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-weight: bold;
    flex-shrink: 0;
    font-size: 14px;
}

.message-content {
    min-width: fit-content;
    position: relative;
    max-width: 100%;
}

.message-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.message-item.self .message-info {
    justify-content: flex-end;
}

.message-username {
    font-weight: 500;
}

.message-time {
    color: var(--text-muted);
}

.message-bubble {
    background: var(--bg-message-other);
    padding: 12px 16px;
    border-radius: 6px;
    box-shadow: 0 1px 3px var(--shadow-light);
    position: relative;
    word-wrap: break-word;
    cursor: pointer;
    transition: background-color 0.2s;
}

.message-item.self .message-bubble {
    background: var(--bg-message-self);
}

.message-bubble:hover {
    filter: brightness(0.95);
}

/* 消息类型样式 */
.message-text {
    line-height: 1.4;
}

.message-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: transform 0.2s;
    background: white;
    /* 为SVG提供背景 */
}

.message-image:hover {
    transform: scale(1.02);
}

/* SVG图片特殊处理 */
.message-image.svg-image,
.message-image[data-mime-type="image/svg+xml"] {
    background: white;
    padding: 8px;
    border: 1px solid var(--border-light);
    box-sizing: border-box;
}

/* 模态框中的SVG图片 */
.modal-body .svg-image,
#previewImage[data-mime-type="image/svg+xml"] {
    background: white;
    padding: 16px;
    border: 1px solid var(--border-light);
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

/* 音频和视频媒体消息样式 */
.message-media {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    padding: 12px;
    margin: 4px 0;
    max-width: 350px;
}

.message-media.audio {
    border-left: 4px solid #e91e63;
}

.message-media.video {
    border-left: 4px solid #f44336;
}

.media-info {
    margin-bottom: 8px;
}

.media-title {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 2px;
    word-break: break-word;
}

.media-size {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 音频播放器样式 */
.audio-player {
    width: 100%;
    height: 40px;
    background: var(--bg-primary);
    border-radius: 4px;
    outline: none;
}

.audio-player::-webkit-media-controls-panel {
    background-color: var(--bg-primary);
}

.audio-player::-webkit-media-controls-play-button,
.audio-player::-webkit-media-controls-pause-button {
    background-color: var(--primary-color);
    border-radius: 50%;
}

/* 视频播放器样式 */
.video-player {
    width: 100%;
    max-width: 100%;
    max-height: 300px;
    background: #000;
    border-radius: 4px;
    outline: none;
}

.video-player::-webkit-media-controls-panel {
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
}

/* 移动端优化 */
@media (max-width: 768px) {
    .message-media {
        max-width: 100%;
    }

    .video-player {
        max-height: 200px;
    }

    .audio-player {
        height: 36px;
    }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    .message-media {
        padding: 8px;
    }

    .video-player {
        max-height: 180px;
    }

    .media-title {
        font-size: 13px;
    }
}

.message-file {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px;
}

.file-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 18px;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 500;
    margin-bottom: 2px;
    font-size: 14px;
}

.file-size {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 增强的文件类型样式 */
.message-file {
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    padding: 12px;
    background: var(--bg-secondary);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.message-file:hover {
    border-color: var(--border-medium);
    box-shadow: 0 2px 8px var(--shadow-light);
}

.file-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
    gap: 8px;
}

.file-type-label {
    padding: 2px 6px;
    border-radius: 4px;
    color: white;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

.file-warning {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    margin-top: 8px;
    font-size: 12px;
    color: #856404;
}

.file-warning i {
    color: #f39c12;
}

.file-preview-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--primary-color);
}

.file-install-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.install-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    width: 100%;
    justify-content: center;
}

.install-btn:hover {
    background: linear-gradient(135deg, #ee5a52, #ff4757);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(238, 90, 82, 0.3);
}

/* 不同文件类型的特殊样式 */
.message-file.application {
    border-left: 4px solid #ff5722;
}

.message-file.image {
    border-left: 4px solid #4caf50;
}

.message-file.video {
    border-left: 4px solid #f44336;
}

.message-file.audio {
    border-left: 4px solid #e91e63;
}

.message-file.document {
    border-left: 4px solid #2196f3;
}

.message-file.code {
    border-left: 4px solid #ff9800;
}

.message-file.archive {
    border-left: 4px solid #9c27b0;
}

.message-file.text {
    border-left: 4px solid #607d8b;
}

/* 文件图标的悬停效果 */
.message-file .file-icon {
    transition: all 0.2s ease;
}

.message-file:hover .file-icon {
    transform: scale(1.1);
}

/* 应用程序文件特殊动画 */
.message-file.application .file-icon {
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* 消息操作按钮样式 */
.message-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    margin-top: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
    padding: 0 4px;
}

/* 鼠标悬停时显示按钮 */
.message-item:hover .message-actions {
    opacity: 1;
}

/* 触摸设备上始终显示按钮（避免悬停问题） */
@media (hover: none) and (pointer: coarse) {
    .message-actions {
        opacity: 0.7;
    }

    .message-item:active .message-actions {
        opacity: 1;
    }


}

.message-action-btn {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    font-size: 14px;
    min-width: 32px;
    min-height: 32px;
    /* 确保触摸目标足够大 */
    position: relative;
    overflow: hidden;
}

.message-action-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.message-action-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 按钮点击动画效果 */
.message-action-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(7, 193, 96, 0.3);
}

.message-action-btn::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.message-action-btn:active::after {
    width: 120%;
    height: 120%;
}

/* 不同操作按钮的特殊颜色 */
.message-action-btn[data-action="copy"]:hover {
    background: #4CAF50;
}

.message-action-btn[data-action="reply"]:hover {
    background: var(--primary-color);
}

.message-action-btn[data-action="edit"]:hover {
    background: #FF9800;
}

.message-action-btn[data-action="withdraw"]:hover {
    background: #F44336;
}

/* 自己的消息操作按钮居左显示 */
.message-item.self .message-actions {
    justify-content: flex-start;
}

/* 小屏幕适配 */
@media (max-width: 768px) {
    .message-actions {
        opacity: 0.6;
        gap: 8px;
    }

    .message-action-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
        min-width: 36px;
        min-height: 36px;
    }
}

/* 超小屏幕适配 */
@media (max-width: 480px) {
    .message-actions {
        opacity: 0.8;
        margin-top: 8px;
    }

    .message-action-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
        min-width: 40px;
        min-height: 40px;
    }
}

.system {
    align-self: center;
    max-width: none;
}

.system .message-bubble {
    background: var(--text-muted);
    color: var(--bg-chat);
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    text-align: center;
}

.message-deleted .message-bubble {
    background: var(--bg-primary);
    color: var(--text-muted);
    font-style: italic;
    opacity: 0.7;
}

.message-edited {
    position: relative;
}

.message-edited::after {
    content: "已编辑";
    position: absolute;
    right: -8px;
    top: -8px;
    background: var(--text-secondary);
    color: var(--text-light);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
}

/* 回复消息样式 */
.reply-reference {
    background: var(--bg-primary);
    padding: 8px 12px;
    border-radius: var(--border-radius);
    margin-bottom: 8px;
    border-left: 3px solid var(--primary-color);
    font-size: 12px;
}

.reply-author {
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 2px;
}

.reply-text {
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 加载更多按钮 */
.load-more-container {
    text-align: center;
    padding: 10px;
}

.load-more-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    padding: 8px 16px;
    border-radius: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 auto;
    transition: all 0.3s;
}

.load-more-btn:hover {
    background: var(--bg-primary);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* 输入区域 */
.chat-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
    padding: 15px 20px;
}

.input-container {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.input-btn {
    background: var(--bg-primary);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
    flex-shrink: 0;
}

.input-btn:hover {
    background: var(--primary-color);
    color: var(--text-light);
}

.text-input-wrapper {
    flex: 1;
    background: var(--bg-primary);
    border-radius: 18px;
    padding: 8px 16px;
    min-height: 36px;
    display: flex;
    align-items: center;
}

#messageInput {
    width: 100%;
    border: none;
    background: none;
    outline: none;
    resize: none;
    font-size: 16px;
    color: var(--text-primary);
    line-height: 1.4;
    min-height: 20px;
    max-height: 120px;
}

#messageInput::placeholder {
    color: var(--text-muted);
}

.send-btn {
    background: var(--primary-color);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    flex-shrink: 0;
}

.send-btn:hover {
    background: var(--primary-dark);
}

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

/* 回复预览 */
.reply-preview {
    background: var(--bg-primary);
    padding: 12px 16px;
    margin: 8px 0;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 3px solid var(--primary-color);
}

.reply-content {
    flex: 1;
}

.reply-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.reply-label {
    font-size: 12px;
    color: var(--primary-color);
    font-weight: 500;
}

.reply-username {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.reply-message {
    font-size: 14px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cancel-reply-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.cancel-reply-btn:hover {
    background: var(--bg-secondary);
}

/* 侧边面板 */
.side-panel {
    position: fixed;
    top: 0;
    right: -350px;
    width: 350px;
    height: 100vh;
    background: var(--bg-secondary);
    box-shadow: -2px 0 10px var(--shadow-light);
    transition: right 0.3s ease-out;
    z-index: 1000;
}

.side-panel.open {
    right: 0;
}

.panel-header {
    height: var(--header-height);
    padding: 0 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
}

.panel-header h3 {
    font-size: 18px;
    color: var(--text-primary);
}

.close-panel-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.close-panel-btn:hover {
    background: var(--bg-primary);
}

.panel-content {
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
    padding: 20px;
}

/* 用户列表 */
.user-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--border-radius);
    transition: background-color 0.3s;
}

.user-item:hover {
    background: var(--bg-primary);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 2px;
}

.user-status {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.online-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
}

/* 设置面板 */
.setting-group {
    margin-bottom: 30px;
}

.setting-group h4 {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.setting-item {
    margin-bottom: 15px;
}

.setting-item label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.setting-item input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    font-size: 14px;
    background: var(--bg-secondary);
    outline: none;
    transition: border-color 0.3s;
}

.setting-item input[type="text"]:focus {
    border-color: var(--primary-color);
}

.setting-item input[type="checkbox"] {
    margin-right: 8px;
    accent-color: var(--primary-color);
}

.mini-btn {
    margin-top: 10px;
    background: var(--primary-color);
    border: none;
    color: var(--text-light);
    padding: 6px 10px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s;
}

.btn-danger {
    background: #ff4757;
    border: none;
    color: #fff;
    padding: 6px 10px;
    border-radius: var(--border-radius);
}

.mini-btn:hover {
    background: var(--primary-dark);
}

.about-info {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}



/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    max-width: 90%;
    max-height: 90%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 18px;
    font-weight: 500;
}

.modal-close {
    cursor: pointer;
    font-size: 24px;
    color: var(--text-secondary);
    transition: color 0.3s;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    flex: 1;
    padding: 20px;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body img {
    max-width: 100%;
    max-height: 100%;
    border-radius: var(--border-radius);
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-light);
    text-align: right;
}

.modal-btn {
    background: var(--primary-color);
    color: var(--text-light);
    border: none;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    transition: background-color 0.3s;
}

.modal-btn:hover {
    background: var(--primary-dark);
}

.modal-btn.secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
}

.modal-btn.secondary:hover {
    background: var(--bg-primary);
    border-color: var(--border-medium);
}

.file-info {
    text-align: center;
    padding: 20px;
}

.file-info .file-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    font-size: 36px;
}

.file-info h3 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.file-info p {
    color: var(--text-secondary);
    margin-bottom: 4px;
}

/* Loading遮罩 */
.loading-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    text-align: center;
}

.loading-spinner i {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.loading-spinner p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Toast通知 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px var(--shadow-medium);
    min-width: 300px;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateX(350px);
    animation: toastSlideIn 0.3s ease-out forwards;
}

.toast.success {
    border-left: 4px solid var(--primary-color);
}

.toast.error {
    border-left: 4px solid #ff4757;
}

.toast.warning {
    border-left: 4px solid #ffa502;
}

.toast.info {
    border-left: 4px solid #3742fa;
}

@keyframes toastSlideIn {
    to {
        transform: translateX(0);
    }
}

.toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 14px;
}

.toast-close {
    cursor: pointer;
    font-size: 16px;
    color: var(--text-secondary);
    transition: color 0.3s;
}

.toast-close:hover {
    color: var(--text-primary);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .login-box {
        padding: 30px 20px;
        margin: 20px;
    }

    .chat-header {
        padding: 0 15px;
    }

    .message-list {
        padding: 15px;
    }

    .chat-footer {
        padding: 12px 15px;
    }

    .message-item {
        max-width: 85%;
    }

    .side-panel {
        width: 100%;
        right: -100%;
    }

    .modal-content {
        margin: 20px;
        max-width: calc(100% - 40px);
        max-height: calc(100% - 40px);
    }

    .toast {
        min-width: 280px;
    }

    .message-bubble {
        min-width: 100%;
        word-break: break-all;
    }

    .message-action-btn {
        width: 24px;
        height: 24px;
        min-width: 24px;
        min-height: 24px;
        padding: 2px;
    }

    .message-action-btn i {
        font-size: 12px;
    }
}

/* 自定义滚动条 */
.message-list::-webkit-scrollbar,
.panel-content::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
    width: 6px;
}

.message-list::-webkit-scrollbar-track,
.panel-content::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.message-list::-webkit-scrollbar-thumb,
.panel-content::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 3px;
}

.message-list::-webkit-scrollbar-thumb:hover,
.panel-content::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* 输入框自适应高度 */
.text-input-wrapper {
    transition: min-height 0.2s;
}

#messageInput:not(:placeholder-shown) {
    min-height: 20px;
}

/* 消息状态指示器 */
.message-status {
    margin-left: 4px;
    font-size: 10px;
    color: var(--text-muted);
}

.message-status.sending {
    color: #ffa502;
}

.message-status.sent {
    color: var(--primary-color);
}

.message-status.failed {
    color: #ff4757;
    cursor: pointer;
}

/* 新消息提示 */
.new-message-indicator {
    position: absolute;
    bottom: 80px;
    right: 20px;
    background: var(--primary-color);
    color: var(--text-light);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--shadow-medium);
    transform: translateY(50px);
    opacity: 0;
    transition: all 0.3s ease-out;
}

.new-message-indicator.show {
    transform: translateY(0);
    opacity: 1;
}

/* 打字指示器 */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 14px;
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dot {
    width: 4px;
    height: 4px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typingDot 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0s;
}

@keyframes typingDot {

    0%,
    80%,
    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}