/* =========================================
   聊天窗口样式
   ========================================= */

.chat-window {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    background: var(--background-color);
}

/* PC端聊天窗口 - 完全填充 */
@media (min-width: 769px) {
    .chat-window {
        width: 100%;
        height: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 0;
    }
    
    /* PC端聊天消息区 - 优化背景 */
    .chat-messages {
        /* 原硬编码 #f0f0f0，深色模式下不跟随主题（聊天区会突然发白） */
        background: var(--bg-chat);
        padding: 20px 40px;
    }
    
    /* PC端消息气泡优化 */
    .message-bubble {
        max-width: 50%;
    }
}

.chat-header {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: relative;
    z-index: 100;
}

.back-btn {
    background: none;
    border: none;
    font-size: 17px;
    cursor: pointer;
    padding: 8px 12px 8px 0;
    color: var(--text-primary);
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    gap: 4px;
}

.back-btn:active {
    opacity: 0.6;
    transform: translateX(-2px);
}

.chat-title {
    flex: 1;
    text-align: center;
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.chat-title-group-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    vertical-align: middle;
    margin-left: 6px;
}

.chat-title-owner-badge {
    width: 18px;
    height: 18px;
    object-fit: contain;
    vertical-align: middle;
    margin-left: 4px;
}

.owner-badge {
    width: 16px;
    height: 16px;
    object-fit: contain;
    vertical-align: middle;
    margin-left: 4px;
}

/* 群聊菜单 */
.group-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    background: transparent;
}

.group-menu {
    position: absolute;
    top: 60px;
    right: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 280px;
    max-width: 400px;
    max-height: 70vh;
    overflow: hidden;
    z-index: 10002;
    display: flex;
    flex-direction: column;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    color: var(--text-primary-color);
    font-size: 15px;
}

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

.menu-item i {
    width: 20px;
    text-align: center;
    color: var(--text-secondary-color);
}

.menu-item.danger {
    color: #ff3b30;
}

.menu-item.danger i {
    color: #ff3b30;
}

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

/* 群成员列表 */
.menu-section {
    padding: 12px 0;
}

.menu-section-title {
    padding: 0 16px 8px;
    font-size: 13px;
    color: var(--text-secondary-color);
    font-weight: 500;
}

.members-list {
    max-height: 300px;
    overflow-y: auto;
}

.member-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s;
}

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

.member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.member-info {
    flex: 1;
    min-width: 0;
}

.member-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary-color);
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.member-badge {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

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

.member-arrow {
    color: var(--text-tertiary-color);
    font-size: 12px;
    flex-shrink: 0;
}

.loading-members {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary-color);
    font-size: 14px;
}

/* 群聊图标 */
.group-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    vertical-align: middle;
    margin-left: 6px;
}

/* 查找聊天内容弹窗 */
.search-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 400px;
    max-width: 600px;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    z-index: 10003;
}

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

.search-modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary-color);
    margin: 0;
}

.search-modal-header .close-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-secondary-color);
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-modal-header .close-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary-color);
}

.search-modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
}

.search-input-wrapper {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.search-input-field {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary-color);
}

.search-input-field:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-btn {
    padding: 10px 20px;
    background: var(--primary-fill);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.search-btn:hover {
    opacity: 0.9;
}

.search-results {
    margin-top: 16px;
}

.search-results-header {
    font-size: 13px;
    color: var(--text-secondary-color);
    margin-bottom: 12px;
}

.search-results-list {
    max-height: 400px;
    overflow-y: auto;
}

.search-result-item {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: var(--hover-bg);
}

.search-result-item:last-child {
    border-bottom: none;
}

.result-sender {
    font-size: 12px;
    color: var(--text-secondary-color);
    margin-bottom: 4px;
}

.result-content {
    font-size: 14px;
    color: var(--text-primary-color);
    line-height: 1.5;
    margin-bottom: 4px;
}

.result-content mark {
    background: #ffeb3b;
    color: #000;
    padding: 0 2px;
    border-radius: 2px;
}

.result-time {
    font-size: 12px;
    color: var(--text-tertiary-color);
}

.search-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-secondary-color);
}

.search-empty i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.search-empty p {
    margin: 0;
    font-size: 14px;
}

/* 高亮消息 */
.highlight-message {
    background: rgba(255, 235, 59, 0.2) !important;
    animation: highlightPulse 2s;
}

@keyframes highlightPulse {
    0%, 100% {
        background: rgba(255, 235, 59, 0.2);
    }
    50% {
        background: rgba(255, 235, 59, 0.4);
    }
}

.chat-actions {
    display: flex;
    gap: 10px;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    color: var(--text-secondary-color);
    transition: all 0.2s ease;
    border-radius: 6px;
    -webkit-tap-highlight-color: transparent;
}

.icon-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary-color);
}

.icon-btn:active {
    transform: scale(0.95);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    background: var(--bg-chat);
    -webkit-overflow-scrolling: touch;
}

/* PC端聊天消息区背景 */
@media (min-width: 769px) {
    .chat-messages {
        background: var(--bg-chat);
    }
}

.message-item {
    display: flex;
    margin-bottom: 16px;
    align-items: flex-start;
}

.message-item.sent {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 42px;
    height: 42px;
    border-radius: 4px;
    margin: 0 8px;
    object-fit: cover;
    flex-shrink: 0;
    /* 主题底色：避免默认头像（白底图）在深色模式下出现白方块 */
    background: var(--bg-tertiary);
    box-shadow: 0 0 0 1px rgba(128, 128, 128, 0.12);
}

.message-content {
    max-width: 65%;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.message-item.sent .message-content {
    align-items: flex-end;
}

.message-item.received .message-content {
    align-items: flex-start;
}

.message-sender {
    font-size: 12px;
    color: var(--text-secondary-color);
    margin-bottom: 4px;
    padding: 0 4px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.message-bubble {
    padding: 10px 14px;
    border-radius: 0;
    word-wrap: break-word;
    word-break: break-word;
    margin-bottom: 4px;
    max-width: 100%;
    display: inline-block;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message-bubble.text {
    background: var(--message-bubble-received);
    /* ⚠️ 必须显式指定文字色，不能依赖继承。
       原先桌面端没有这两条 color 声明（移动端分支有），于是气泡文字继承了
       页面正文色 —— 夜间模式下正文是浅色，压在亮绿发送气泡上只有 2.60:1，
       而且会让人误以为"改了 --bubble-text-sent 却没生效"。
       两个分支现在保持一致。 */
    color: var(--message-text-received);
    border: none;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-word;
}

.message-item.sent .message-bubble.text {
    background: var(--message-bubble-sent);
    color: var(--message-text-sent);
    border: none;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-word;
}

/* 消息气泡圆角 - 左侧消息 */
.message-item.received .message-bubble.text {
    border-radius: 0 8px 8px 8px;
}

/* 消息气泡圆角 - 右侧消息 */
.message-item.sent .message-bubble.text {
    border-radius: 8px 0 8px 8px;
}

/* 连续消息的圆角优化 */
.message-item.received + .message-item.received .message-bubble {
    border-radius: 0 4px 4px 4px;
}

.message-item.sent + .message-item.sent .message-bubble {
    border-radius: 4px 0 4px 4px;
}

.message-bubble.image {
    padding: 0;
    background: none;
}

.message-revoked {
    color: var(--text-secondary-color);
    font-size: 13px;
    font-style: italic;
}

.message-time {
    font-size: 11px;
    color: var(--text-tertiary-color);
    padding: 0 4px;
    margin-top: 2px;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 消息已读未读状态 */
.message-read-status {
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    font-size: 12px;
}

.message-read-status .read-icon {
    color: #07c160;
    opacity: 0.8;
}

.message-read-status .unread-icon {
    color: var(--text-tertiary-color);
    opacity: 0.6;
}

.chat-input-area {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.input-toolbar {
    display: flex;
    gap: 10px;
    padding: 6px 12px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    min-height: 36px;
}

.toolbar-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 6px;
    color: var(--text-secondary-color);
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    border-radius: 4px;
}

.toolbar-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary-color);
}

.toolbar-btn:active {
    background: var(--hover-bg);
    transform: scale(0.95);
}

.input-box {
    padding: 8px 12px;
    background: var(--bg-secondary);
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.input-text-wrapper {
    flex: 1;
    min-width: 0;   /* 不加它 flex 子项不会收缩，长文本会把输入框撑破 */
    position: relative;
}

.input-text-display {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    min-height: 36px;
    max-height: 120px;
    overflow-y: auto;
    background: var(--bg-tertiary);
    border-radius: 6px;
    padding: 8px 12px;
    line-height: 1.4;
    font-size: 15px;
    color: var(--text-primary-color);
    word-wrap: break-word;
    white-space: pre-wrap;
    pointer-events: none;
    z-index: 1;
}

.input-text-display .input-emoji {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    display: inline-block;
    margin: 0 2px;
    object-fit: contain;
}

.input-textarea-hidden {
    position: relative;
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    font-size: 15px;
    font-family: inherit;
    background: transparent;
    color: transparent;
    caret-color: var(--text-primary-color);
    padding: 8px 12px;
    min-height: 36px;
    max-height: 120px;
    line-height: 1.4;
    overflow: hidden;
    z-index: 2;
}

.input-textarea-hidden::placeholder {
    color: var(--text-tertiary-color);
}

.input-textarea-hidden:focus + .input-text-display {
    background: var(--bg-primary);
}

.btn-send {
    padding: 8px 20px;
    background: var(--primary-gradient);
    color: var(--text-inverse);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(7, 193, 96, 0.25);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
    height: 36px;
    align-self: flex-end;
}

.btn-send:active:not(:disabled) {
    transform: scale(0.96);
    box-shadow: 0 1px 4px rgba(7, 193, 96, 0.3);
}

.btn-send:disabled {
    background: #d0d0d0;
    cursor: not-allowed;
    opacity: 0.5;
    box-shadow: none;
}

.input-actions {
    display: none;
}

/* =========================================
   好友详情样式
   ========================================= */

.friend-detail,
.profile-container,
.discover-container,
.moments-container {
    height: 100%;
    overflow-y: auto;
    background: var(--bg-primary);
}

.detail-header {
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.detail-title {
    flex: 1;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
}

.detail-body {
    padding: 15px;
}

.friend-info-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    box-shadow: var(--shadow-sm);
}

.friend-detail-avatar {
    width: 60px;
    height: 60px;
    border-radius: 5px;
    margin-right: 15px;
}

.friend-detail-info h3 {
    margin-bottom: 5px;
}

.info-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

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

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--text-primary-color);
    font-size: 14px;
}

.info-value {
    color: var(--text-secondary-color);
    font-size: 14px;
}

.action-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.action-btn {
    padding: 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    font-weight: 500;
    color: var(--text-primary-color);
}

.action-btn:hover {
    background: var(--hover-bg);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.action-btn.danger {
    color: var(--red-badge);
}

.action-btn.danger:hover {
    background: rgba(255, 107, 107, 0.08);
    border-color: var(--red-badge);
}

/* =========================================
   发现页面样式
   ========================================= */

.discover-item {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.discover-item:hover {
    background: var(--hover-bg);
    padding-left: 25px;
}

.discover-item:first-child {
    border-top: 1px solid var(--border-color);
}

.discover-icon {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-right: 15px;
    color: white;
    box-shadow: var(--shadow-sm);
}

.discover-label {
    flex: 1;
    font-size: 15px;
}

.discover-arrow {
    font-size: 20px;
    color: var(--text-secondary);
}

/* =========================================
   个人中心样式
   ========================================= */

.profile-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.profile-header h2 {
    flex: 1;
    text-align: center;
}

.profile-body {
    padding-top: 10px;
}

.profile-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.profile-item:first-child {
    border-top: 1px solid var(--border-color);
}

.profile-label {
    font-size: 14px;
}

.profile-value {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary-color);
    font-size: 14px;
}

.profile-arrow {
    font-size: 18px;
}

/* =========================================
   浮动按钮
   ========================================= */

.fab-button,
.publish-btn {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: var(--text-inverse);
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 100;
}

/* =========================================
   移动端优化
   ========================================= */

@media (max-width: 768px) {
    .chat-messages {
        padding: 16px 12px;
        background: var(--chat-bg);
        /* 优化滚动性能 */
        -webkit-overflow-scrolling: touch;
        overflow-scrolling: touch;
    }
    
    .message-item {
        margin-bottom: 14px;
        align-items: flex-start;
        /* 移动端：增大触摸区域，确保可以长按 */
        min-height: 44px;
        padding: 4px 8px;
        position: relative;
        -webkit-tap-highlight-color: transparent;
        touch-action: pan-y; /* 允许垂直滚动 */
    }
    
    .message-avatar {
        width: 40px;
        height: 40px;
        border-radius: 4px;
        flex-shrink: 0;
    }
    
    /* 接收消息头像 */
    .message-item.received .message-avatar {
        margin-right: 8px;
        margin-left: 0;
    }
    
    /* 发送消息头像 */
    .message-item.sent .message-avatar {
        margin-left: 8px;
        margin-right: 0;
    }
    
    .message-content {
        max-width: 72%;
    }
    
    .message-bubble {
        padding: 11px 14px;
        font-size: 16px;
        line-height: 1.5;
        word-break: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
    }
    
    .message-bubble.text {
        display: inline-block;
        white-space: pre-wrap;
        word-wrap: break-word;
        word-break: break-word;
    }
    
    .chat-input-area {
        padding: 8px 12px;
    }
    
    .input-toolbar {
        padding: 8px 0;
    }
    
    .toolbar-btn {
        min-width: 44px;
        min-height: 44px;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    .input-box {
        padding: 0 8px 8px;
    }
    
    .btn-send {
        padding: 8px 20px;
        font-size: 14px;
        min-height: 36px;
    }
    
    .back-btn {
        font-size: 15px;
        min-width: 44px;
        min-height: 44px;
    }
    
    /* 移动端右键菜单优化 */
    .context-menu {
        min-width: 180px;
        font-size: 16px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    }
    
    .context-menu-item {
        padding: 14px 18px;
        font-size: 16px;
        min-height: 48px;
    }
    
    .context-menu-item i {
        font-size: 18px;
        width: 24px;
    }
    
    /* 移动端表情回复优化 */
    .emoji-replies-container {
        padding: 6px 10px;
    }
    
    .emoji-reply-icon {
        width: 18px;
        height: 18px;
    }
    
    /* 移动端引用消息预览优化 */
    .quote-message-preview {
        padding: 10px 12px;
        margin-bottom: 8px;
    }
    
    .quote-sender {
        font-size: 13px;
    }
    
    .quote-content {
        font-size: 14px;
    }
    
    /* 移动端转发弹窗优化 */
    .forward-modal-header {
        padding: 16px 18px;
    }
    
    .forward-modal-header h3 {
        font-size: 18px;
    }
    
    .forward-modal-body {
        padding: 10px;
    }
    
    .forward-modal-footer {
        padding: 14px 18px;
    }
    
    .forward-modal-footer button {
        min-height: 44px;
        padding: 10px 24px;
        font-size: 16px;
    }
    
    /* 接收消息气泡 */
    .message-item.received .message-bubble.text {
        background: var(--message-bubble-received);
        border: none;
        border-radius: 0 8px 8px 8px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        color: var(--message-text-received);
    }
    
    /* 发送消息气泡 */
    .message-item.sent .message-bubble.text {
        background: var(--message-bubble-sent);
        color: var(--message-text-sent);
        border: none;
        border-radius: 8px 0 8px 8px;
        box-shadow: 0 1px 3px rgba(149, 236, 105, 0.3);
    }
    
    .message-time {
        font-size: 11px;
        margin-top: 3px;
        opacity: 0.7;
    }
    
    .message-item.sent .message-time {
        text-align: right;
    }
    
    .message-item.received .message-time {
        text-align: left;
    }
    
    /* 消息发送者（群聊） */
    .message-sender {
        font-size: 12px;
        margin-bottom: 4px;
        opacity: 0.8;
    }
    
    /* 聊天输入区 */
    .chat-input-area {
        padding-bottom: env(safe-area-inset-bottom, 0);
        background: var(--bg-secondary);
    }
    
    .input-toolbar {
        padding: 10px 14px 8px;
        background: var(--bg-secondary);
    }
    
    .toolbar-btn {
        font-size: 24px;
        padding: 6px;
        color: var(--text-secondary-color);
    }
    
    .input-box {
        padding: 0 14px 8px;
        background: var(--bg-secondary);
    }
    
    .input-box textarea {
        font-size: 16px;
        min-height: 40px;
        background: var(--bg-tertiary);
        border-radius: 8px;
        padding: 10px 12px;
        border: none;
        color: var(--text-primary-color);
    }
    
    .input-box textarea::placeholder {
        color: var(--text-tertiary-color);
    }
    
    .input-box textarea:focus {
        background: var(--bg-primary);
    }
    
    .input-actions {
        padding: 8px 14px 12px;
        background: var(--bg-secondary);
    }
    
    .btn-send {
        padding: 10px 26px;
        border-radius: 20px;
        font-size: 15px;
        font-weight: 500;
    }
    
    /* 引用消息预览 */
    .quote-message-preview {
        margin-bottom: 6px;
        padding: 8px 10px;
        background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
        border-left: 3px solid var(--primary-color);
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.2s;
        position: relative;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        /* 移动端优化 */
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    .quote-message-preview:hover {
        background: linear-gradient(135deg, var(--hover-bg) 0%, var(--bg-tertiary) 100%);
        transform: translateX(2px);
    }
    
    @media (max-width: 768px) {
        .quote-message-preview:active {
            background: linear-gradient(135deg, var(--hover-bg) 0%, var(--bg-tertiary) 100%);
            transform: translateX(2px);
        }
    }
    
    .quote-message-preview::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 3px;
        background: var(--primary-color);
        border-radius: 3px 0 0 3px;
    }
    
    .quote-divider {
        height: 1px;
        background: var(--border-color);
        margin-bottom: 6px;
        opacity: 0.5;
    }
    
    .quote-sender {
        font-size: 12px;
        color: var(--primary-color);
        font-weight: 500;
        margin-bottom: 4px;
        padding-left: 2px;
    }
    
    .quote-content {
        font-size: 13px;
        color: var(--text-secondary-color);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        line-height: 1.4;
        padding-left: 2px;
    }
    
    .quote-input-preview {
        display: flex;
        align-items: center;
        padding: 10px 12px;
        background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
        border-left: 3px solid var(--primary-color);
        border-radius: 6px;
        margin: 8px 14px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        position: relative;
        /* 移动端优化 */
        -webkit-tap-highlight-color: transparent;
    }
    
    @media (max-width: 768px) {
        .quote-input-preview {
            margin: 8px 10px;
            padding: 10px;
        }
    }
    
    .quote-input-preview::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 3px;
        background: var(--primary-color);
        border-radius: 3px 0 0 3px;
    }
    
    .quote-preview-content {
        flex: 1;
        padding-left: 8px;
    }
    
    .quote-preview-sender {
        font-size: 13px;
        color: var(--primary-color);
        font-weight: 500;
        margin-bottom: 4px;
    }
    
    .quote-preview-text {
        font-size: 13px;
        color: var(--text-secondary-color);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        line-height: 1.4;
    }
    
    .quote-close-btn {
        margin-left: 8px;
        padding: 4px;
        background: transparent;
        border: none;
        color: var(--text-tertiary-color);
        cursor: pointer;
        font-size: 14px;
    }
    
    .quote-close-btn:hover {
        color: var(--text-primary-color);
    }
    
    /* 表情回复容器 */
    .emoji-replies-container {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-top: 6px;
        padding: 4px 8px;
        background: var(--bg-tertiary);
        border-radius: 4px;
        align-items: center;
    }
    
    .emoji-reply-item {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        position: relative;
    }
    
    .emoji-reply-icon {
        width: 16px;
        height: 16px;
        object-fit: contain;
    }
    
    .emoji-reply-count {
        font-size: 11px;
        color: var(--text-tertiary-color);
        font-weight: 500;
        min-width: 12px;
        text-align: center;
    }
    
    /* 转发弹窗 */
    .forward-modal {
        max-width: 560px;
        width: 90vw;
        max-height: 85vh;
        background: var(--bg-primary);
        border-radius: 12px;
        display: flex;
        flex-direction: column;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
        overflow: hidden;
        /* 移动端优化 */
        position: relative;
        margin: auto;
    }
    
    @media (max-width: 768px) {
        .forward-modal {
            width: 95vw;
            max-height: 90vh;
            border-radius: 12px 12px 0 0;
            position: fixed;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            max-width: 100%;
            box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3);
        }
    }
    
    .forward-modal-header {
        padding: 18px 20px;
        border-bottom: 1px solid var(--border-color);
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: var(--bg-secondary);
    }
    
    .forward-modal-header h3 {
        margin: 0;
        font-size: 17px;
        font-weight: 600;
        color: var(--text-primary-color);
    }
    
    .forward-modal-body {
        flex: 1;
        overflow-y: auto;
        padding: 12px;
        background: var(--bg-primary);
    }
    
    .forward-search {
        padding: 8px 0;
        margin-bottom: 8px;
        position: sticky;
        top: 0;
        background: var(--bg-primary);
        z-index: 10;
    }
    
    .forward-search-input {
        width: 100%;
        padding: 10px 14px;
        border: 1px solid var(--border-color);
        border-radius: 6px;
        background: var(--bg-secondary);
        color: var(--text-primary-color);
        font-size: 14px;
        transition: all 0.2s;
    }
    
    .forward-search-input:focus {
        outline: none;
        border-color: var(--primary-color);
        background: var(--bg-tertiary);
    }
    
    .forward-conversations {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }
    
    .forward-item {
        display: flex;
        align-items: center;
        padding: 14px 12px;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.2s;
        background: var(--bg-secondary);
        /* 移动端优化 */
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        min-height: 60px;
    }
    
    .forward-item:hover {
        background: var(--hover-bg);
        transform: translateX(2px);
    }
    
    @media (max-width: 768px) {
        .forward-item {
            padding: 16px 12px;
            min-height: 64px;
        }
        
        .forward-item:active {
            background: var(--hover-bg);
            transform: translateX(2px);
        }
    }
    
    .forward-avatar {
        width: 44px;
        height: 44px;
        border-radius: 6px;
        margin-right: 12px;
        flex-shrink: 0;
    }
    
    .forward-info {
        flex: 1;
        min-width: 0;
    }
    
    .forward-name {
        font-size: 15px;
        color: var(--text-primary-color);
        font-weight: 500;
        margin-bottom: 4px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .forward-type {
        font-size: 12px;
        color: var(--text-tertiary-color);
    }
    
    .forward-checkbox {
        width: 22px;
        height: 22px;
        border: 2px solid var(--border-color);
        border-radius: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s;
        flex-shrink: 0;
        background: var(--bg-primary);
        /* 移动端优化 */
        min-width: 22px;
        min-height: 22px;
    }
    
    @media (max-width: 768px) {
        .forward-checkbox {
            width: 24px;
            height: 24px;
            min-width: 24px;
            min-height: 24px;
        }
    }
    
    .forward-item:hover .forward-checkbox {
        border-color: var(--primary-color);
    }
    
    .forward-checkbox.checked {
        background: var(--primary-fill);
        border-color: var(--primary-color);
        color: white;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
    
    .forward-checkbox i {
        font-size: 12px;
        opacity: 0;
        transition: opacity 0.2s;
    }
    
    .forward-checkbox.checked i {
        opacity: 1;
    }
    
    .forward-modal-footer {
        padding: 16px 20px;
        border-top: 1px solid var(--border-color);
        display: flex;
        justify-content: flex-end;
        gap: 12px;
        background: var(--bg-secondary);
    }
    
    .forward-modal-footer button:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }
    
    /* 图片消息 */
    .message-bubble.image {
        padding: 2px;
        background: transparent;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    }
    
    .message-bubble.image img {
        max-width: 200px;
        max-height: 200px;
        border-radius: 6px;
        display: block;
        object-fit: cover;
    }
    
    .chat-header {
        padding: 0 14px;
    }
    
    .back-btn {
        font-size: 17px;
        padding: 8px 10px 8px 0;
    }
}

/* 超小屏幕优化 */
@media (max-width: 375px) {
    .chat-messages {
        padding: 10px 6px;
    }
    
    .message-content {
        max-width: 75%;
    }
    
    .message-bubble {
        padding: 9px 11px;
        font-size: 15px;
    }
    
    .message-avatar {
        width: 36px;
        height: 36px;
    }
    
    .message-item.received .message-avatar {
        margin-right: 8px;
    }
    
    .message-item.sent .message-avatar {
        margin-left: 8px;
    }
    
    .chat-header {
        padding: 0 10px;
        height: 56px;
    }
    
    .chat-title {
        font-size: 16px;
    }
    
    .back-btn {
        font-size: 15px;
    }
}

@media (min-width: 769px) {
    .fab-button,
    .publish-btn {
        bottom: 20px;
    }
}

