/* 聊天系统统一样式文件（chat.php 和 staff.php 共用） - 统一配色方案 */

@import url('../../css/variables.css');

/* ========== 基础样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.7;
}

/* ========== 访客聊天页面样式（chat.php） ========== */
/* chat.php 的 body 需要居中显示 */
body.chat-page {
    height: 100vh;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.chat-container {
    width: 100%;
    max-width: 800px;
    height: 600px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-container .chat-header {
    background: var(--primary-gradient);
    color: var(--text-white);
    padding: 20px;
    text-align: center;
}

.chat-container .chat-header h1 {
    font-size: 20px;
    font-weight: 500;
}

.status-indicator {
    font-size: 12px;
    margin-top: 5px;
    opacity: 0.9;
}

.chat-container .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--bg-tertiary);
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.waiting-message {
    text-align: center;
    color: var(--text-tertiary);
    padding: 20px;
    font-size: 14px;
}

.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-medium);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== 客服工作台样式（staff.php） ========== */
/* staff.php 的 body 需要全屏显示 */
body.staff-page {
    height: 100vh;
    overflow: hidden;
}

/* 登录页面样式 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: var(--bg-secondary);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-primary);
    font-size: 24px;
}

.login-box .form-group {
    margin-bottom: 20px;
}

.login-box .form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.login-box .form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-medium);
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

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

.login-button {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.login-button:hover {
    background: #5568d3;
}

.login-box .error-message {
    color: var(--error-color);
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
}

/* 工作台容器 */
.staff-container {
    display: none;
    height: 100vh;
    flex-direction: column;
}

.staff-container.active {
    display: flex;
}

.staff-header {
    background: var(--primary-gradient);
    color: var(--text-white);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.staff-info {
    font-size: 16px;
    white-space: nowrap;
}

/* 公司信息栏 */
.company-info-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    flex: 1;
    justify-content: center;
    margin: 0 20px;
}

.company-info-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
}

.company-info-label {
    opacity: 0.9;
    font-weight: 500;
}

.company-info-value {
    font-weight: 600;
    background: rgba(255,255,255,0.15);
    padding: 4px 10px;
    border-radius: 4px;
}

.renewal-button {
    background: rgba(255,255,255,0.25);
    color: white;
    border: 1px solid rgba(255,255,255,0.4);
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s;
    white-space: nowrap;
}

.renewal-button:hover {
    background: rgba(255,255,255,0.35);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.logout-button {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

.logout-button:hover {
    background: rgba(255,255,255,0.3);
}

/* 响应式：小屏幕时调整布局 */
@media (max-width: 768px) {
    .staff-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .company-info-bar {
        margin: 10px 0;
        justify-content: flex-start;
    }
    
    .staff-info,
    .logout-button {
        width: 100%;
        text-align: center;
    }
}

.staff-main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* 会话列表侧边栏 */
.conversations-sidebar {
    width: 300px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    font-weight: 500;
    background: var(--bg-tertiary);
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px;
    background: #f7f9fc;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-sizing: border-box;
}

.conversation-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.conversation-section-title {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #718096;
    display: flex;
    align-items: center;
    gap: 6px;
}

.conversation-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
    opacity: 0.6;
}

.conversation-item {
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    background: #fff;
    transition: background 0.2s, border-color 0.2s;
}

.conversation-item:hover {
    background: #edf2fb;
}

.conversation-item.active {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.08);
}

/* 会话状态样式 */
.conversation-item-mine {
    opacity: 1;
}

.conversation-item-others {
    opacity: 0.9;
}

.conversation-item-others:hover {
    opacity: 1;
}

.conversation-status-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
}

.conversation-status-badge.status-waiting {
    background: var(--warning-color);
    color: white;
}

.conversation-status-badge.status-mine {
    background: var(--success-color);
    color: white;
}

.conversation-status-badge.status-others {
    background: var(--info-color);
    color: white;
}

.conversation-status-badge.status-chatting {
    background: var(--text-tertiary);
    color: white;
}

.conversation-guest {
    font-weight: 500;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

/* 未读消息徽章（右上角红色圆点） */
.unread-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: #f44336;
    color: white;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    font-size: 11px;
    font-weight: bold;
    text-align: center;
    padding: 0 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 10;
    white-space: nowrap;
}

.unread-badge[data-count] {
    min-width: 20px;
}

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

.conversation-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.conversation-meta {
    font-size: 10px;
    color: #5f6b7c;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    align-items: center;
}

.conversation-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
}

.conversation-meta-label {
    color: #aaa;
    font-size: 10px;
}

.conversation-meta-value {
    color: var(--text-secondary);
    font-weight: 500;
}

.conversation-id {
    font-family: 'Courier New', monospace;
    font-size: 10px;
}

.conversation-ip {
    font-family: 'Courier New', monospace;
    font-size: 10px;
}

/* 聊天区域 */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-tertiary);
}

.staff-container .chat-header {
    background: var(--bg-secondary);
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.chat-header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.chat-guest-info {
    flex: 1;
}

.chat-guest-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
}

.chat-guest-details {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-secondary);
}

.chat-guest-detail-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-guest-detail-label {
    color: var(--text-tertiary);
}

.chat-guest-detail-value {
    color: var(--text-primary);
    font-weight: 500;
}

.flag-icon {
    font-size: 14px;
    margin-right: 3px;
}

.staff-container .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.empty-chat {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: var(--text-tertiary);
}

.close-button {
    margin-left: 10px;
    padding: 4px 12px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.close-button:hover {
    background: #d32f2f;
}

/* ========== 共用消息样式 ========== */
.message {
    margin-bottom: 15px;
    display: flex;
    animation: fadeIn 0.3s;
}

.message-content {
    max-width: 75%;
    flex: 0 1 75%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    min-width: 0;
}

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

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

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

/* 访客聊天页面：访客消息在右侧 */
.chat-container .message.guest {
    justify-content: flex-end;
}

/* 访客聊天页面：客服消息在左侧 */
.chat-container .message.staff {
    justify-content: flex-start;
}

/* 客服工作台：访客消息在左侧 */
.staff-container .message.guest {
    justify-content: flex-start;
}

/* 客服工作台：客服消息在右侧 */
.staff-container .message.staff {
    justify-content: flex-end;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.5;
    white-space: normal;
    display: inline-block;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 15px;
}

/* 访客聊天页面的消息气泡 */
.chat-container .message.guest .message-bubble {
    background: var(--primary-color);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-container .message.staff .message-bubble {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* 客服工作台的消息气泡 */
.staff-container .message.guest .message-bubble {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.staff-container .message.staff .message-bubble {
    background: var(--primary-color);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-time {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 5px;
}

/* System message style (centered, neutral) */
.chat-container .message.system,
.staff-container .message.system {
    justify-content: center;
}

.message.system .message-bubble {
    background: rgba(102, 126, 234, 0.1);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 10px 14px;
    box-shadow: none;
    line-height: 1.6;
    font-weight: 500;
    border-left: 3px solid #667eea;
}

.message.system .message-bubble a {
    color: #667eea;
    text-decoration: underline;
    font-weight: 500;
}

.message.system .message-bubble a:hover {
    color: #5568d3;
    text-decoration: none;
}

/* 访客聊天页面 */
.chat-container .message-time {
    text-align: right;
}

.chat-container .message.staff .message-time {
    text-align: left;
}

/* 客服工作台 */
.staff-container .message.guest .message-time {
    text-align: left;
}

.staff-container .message.staff .message-time {
    text-align: right;
}

/* ========== 共用输入区域样式 ========== */
.chat-input-area {
    border-top: 1px solid #e0e0e0;
    background: var(--bg-secondary);
    width: 100%;
    box-sizing: border-box;
}

.chat-container .chat-input-area {
    padding: 12px;
    display: flex;
    gap: 6px;
    align-items: center;
    overflow: hidden;
}

.chat-input-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* 常用短语弹出窗口（仅 staff.php 使用） */
.quick-reply-wrapper {
    position: relative;
    flex-shrink: 0;
    flex-grow: 0;
}

.quick-reply-popup {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 10px;
    width: 750px;
    max-width: 90vw;
    background: #fff;
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 400px;
    display: flex;
    flex-direction: column;
}

.quick-reply-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
    background: #f9f9f9;
    border-radius: 8px 8px 0 0;
}

.quick-reply-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    transition: color 0.2s;
}

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

.quick-reply-popup-content {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    max-height: 300px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-content: flex-start;
}

.quick-reply-item {
    padding: 8px 14px;
    background: #f0f0f0;
    border: 1px solid var(--border-medium);
    border-radius: 16px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quick-reply-item:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.quick-reply-item:active {
    transform: translateY(0);
}

.quick-reply-popup-footer {
    padding: 10px 15px;
    border-top: 1px solid #e0e0e0;
    background: #f9f9f9;
    border-radius: 0 0 8px 8px;
}

.quick-reply-add-btn {
    width: 100%;
    padding: 8px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.quick-reply-add-btn:hover {
    background: #5568d3;
}

/* 按钮样式 */
.image-button, .emoji-button, .quick-reply-button {
    background: #f0f0f0;
    border: none;
    border-radius: 24px;
    padding: 8px 10px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-button:hover, .emoji-button:hover, .quick-reply-button:hover {
    background: #e0e0e0;
}

.image-button:disabled, .emoji-button:disabled {
    background: var(--bg-tertiary);
    cursor: not-allowed;
    opacity: 0.5;
}

/* Emoji Picker Styles */
.emoji-picker {
    position: absolute;
    bottom: 70px;
    left: 15px;
    width: 260px;
    max-height: 220px;
    background: var(--bg-secondary);
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.emoji-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.emoji-picker-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: color 0.2s;
}

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

.emoji-picker-content {
    padding: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 180px;
    justify-content: flex-start;
    align-content: flex-start;
}

.emoji-item {
    background: none;
    border: none;
    font-size: 20px;
    padding: 6px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.emoji-item:hover {
    background: #f0f0f0;
    transform: scale(1.15);
}

.emoji-item:active {
    transform: scale(1.05);
}

/* Make emojis larger in chat messages */
.message-bubble .emoji-in-message {
    font-size: 20px;
    vertical-align: middle;
    display: inline;
    margin: 0 2px;
    line-height: 1;
}

.quick-reply-button.active {
    background: var(--primary-color);
    color: #fff;
}

.chat-input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--border-medium);
    border-radius: 24px;
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

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

.send-button {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 24px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    flex-shrink: 0;
    flex-grow: 0;
    white-space: nowrap;
    transition: background 0.3s;
    min-width: 60px;
    font-weight: 500;
}

.send-button:hover:not(:disabled) {
    background: #5568d3;
}

.send-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ========== 图片预览和消息样式（共用） ========== */
.chat-image-preview {
    padding: 12px 15px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.image-preview-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.image-preview-container img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    display: block;
}

.image-preview-cancel {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.image-preview-cancel:hover {
    background: #cc0000;
}

.image-preview-info {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* 图片消息样式 */
.message-image {
    padding: 4px;
}

.message-image img {
    max-width: 300px;
    max-height: 400px;
    display: block;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.3s;
}

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

.staff-container .message.staff .message-image img {
    max-width: 250px;
}

.chat-container .message.staff .message-image img {
    max-width: 250px;
}

/* ========== 通用工具类 ========== */
.hidden {
    display: none !important;
}

.hidden-element {
    display: none;
}

/* ========== 模态框样式（用于新增快捷回复，仅 staff.php 使用） ========== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.max-width-500 {
    max-width: 500px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.modal .form-group {
    margin-bottom: 15px;
}

.modal .form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.modal .form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

.modal .form-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.modal .form-actions .btn-cancel {
    padding: 8px 16px;
    background: #ccc;
    color: #333;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.modal .form-actions .btn-cancel:hover {
    background: #bbb;
}

.modal .form-actions .btn-primary {
    padding: 8px 16px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.modal .form-actions .btn-primary:hover {
    background: #5568d3;
}

.modal-padding {
    padding: 20px;
}

/* ========== 连接状态样式 ========== */
.connection-status {
    margin-left: 20px;
    font-size: 14px;
    opacity: 0.9;
}

/* ========== 公司信息栏样式 ========== */
.company-info-bar.hidden {
    display: none;
}

.company-info-bar .renewal-button {
    margin-left: 15px;
}

/* ========== 快速回复加载状态 ========== */
.quick-reply-loading {
    text-align: center;
    padding: 20px;
    color: #999;
}

.quick-reply-empty {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 13px;
    width: 100%;
}

/* ========== 聊天输入区域样式 ========== */
.chat-input-area.hidden {
    display: none;
}

.chat-header.hidden {
    display: none;
}

/* ========== 图片输入隐藏 ========== */
.image-input-hidden {
    display: none;
}

/* ========== 快速回复包装器相对定位 ========== */
.quick-reply-wrapper-relative {
    position: relative;
}

/* ========== 访客聊天页面移动端适配 ========== */
@media (max-width: 768px) {
    body.chat-page {
        height: auto;
        min-height: 100vh;
        align-items: stretch;
        padding: 0;
    }
    
    .chat-container {
        height: 100vh;
        max-height: none;
        max-width: 100%;
        border-radius: 0;
        box-shadow: none;
    }
    
    .chat-container .chat-messages {
        padding: 15px;
        gap: 10px;
    }
    
    .message-content {
        max-width: 85%;
        flex: 0 1 85%;
    }
    
    .chat-container .chat-input-area {
        padding: 10px;
        gap: 4px;
    }
    
    .image-button,
    .emoji-button {
        min-width: 32px;
        height: 32px;
        padding: 6px 8px;
    }
    
    .chat-input {
        font-size: 13px;
    }
    
    .send-button {
        min-width: 56px;
        padding: 8px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .message-content {
        max-width: 90%;
        flex: 0 1 90%;
    }
    
    .chat-container .chat-messages {
        padding: 12px;
    }
    
    .chat-container .message-bubble {
        max-width: 100%;
        width: auto;
    }
}

/* iOS Safari viewport fix */
@supports (-webkit-touch-callout: none) {
    body.chat-page {
        min-height: -webkit-fill-available;
    }
    
    .chat-container {
        height: -webkit-fill-available;
    }
}

