/* /style.css */
/* 全局样式 */
body, html {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    height: 100vh;
    overflow: hidden;
    background-color: #f0f2f5;
}

.hidden {
    display: none !important;
}

/* 登录弹窗样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    text-align: center;
    width: 300px;
}

.login-box h2 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #333;
}

.login-box input {
    width: calc(100% - 20px);
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
}

.login-box button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 4px;
    background-color: #007bff;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.login-box button:hover {
    background-color: #0056b3;
}

.error-message {
    color: #d9534f;
    margin-top: 10px;
    height: 20px;
}

/* 主应用布局 */
#app-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.app-header {
    flex-shrink: 0;
    background-color: #fff;
    padding: 0 20px;
    height: 50px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.app-header h1 {
    font-size: 18px;
    margin: 0;
}
#agent-info {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.main-layout {
    display: flex;
    flex-grow: 1;
    height: calc(100vh - 51px);
    width: 100vw;
}

/* 左侧边栏 */
.sidebar {
    width: 340px; /* 默认宽度 */
    min-width: 250px; /* 最小可调宽度 */
    max-width: 600px; /* 最大可调宽度 */
    background-color: #ffffff;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.resizer {
    flex-shrink: 0;
    width: 5px;
    background: #f0f2f5;
    cursor: col-resize;
    transition: background-color 0.2s;
}
.resizer:hover {
    background: #007bff;
}

.sidebar-header {
    padding: 10px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.store-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.store-tab {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 20px;
    background-color: #f0f0f0;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.store-tab.active, .store-tab:hover {
    background-color: #ffe60f; /* 闲鱼黄 */
    border-color: #ffe60f;
    color: #333;
    font-weight: bold;
}

.conversation-list {
    flex-grow: 1;
    overflow-y: auto;
}

.conversation-item {
    display: flex;
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.conversation-item.active, .conversation-item:hover {
    background-color: #f5f5f5;
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #ccc;
    margin-right: 12px;
    flex-shrink: 0;
}

.conversation-details {
    flex-grow: 1;
    overflow: hidden;
}

.conv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.conv-name {
    font-weight: bold;
    color: #333;
    white-space: nowrap;
}

.conv-time {
    font-size: 12px;
    color: #999;
    flex-shrink: 0;
    margin-left: 8px;
}

.conv-preview {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 4px;
}

.unread-badge {
    background-color: #f44336;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 12px;
    margin-left: 5px;
}

.lock-info {
    font-size: 12px;
    color: #ff9800;
    font-style: italic;
    margin-top: 4px;
}

/* 右侧聊天窗口 */
.chat-window {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: #f5f7f9;
    min-width: 400px;
}

.chat-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    background-color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 21px;
}

#chat-title {
    font-size: 18px;
    font-weight: bold;
}

.message-list {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.welcome-message {
    text-align: center;
    margin: auto;
    color: #999;
}

.message {
    margin-bottom: 20px;
    display: flex;
    max-width: 70%;
}

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

.message .avatar {
    width: 40px;
    height: 40px;
    margin: 0 10px;
    align-self: flex-start;
}

.message-bubble {
    display: flex;
    flex-direction: column;
}

.message.from-me .message-bubble {
    align-items: flex-end;
}
.message.from-customer .message-bubble {
    align-items: flex-start;
}


.message-content {
    padding: 10px 15px;
    border-radius: 18px;
    background-color: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    word-break: break-word;
}

.message-meta {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.message.from-me .message-content {
    background-color: #ffe60f; /* 闲鱼黄 */
}

.chat-footer {
    padding: 10px 20px;
    border-top: 1px solid #e0e0e0;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.lock-status {
    text-align: center;
    color: #e91e63;
    font-weight: bold;
    padding-bottom: 5px;
    font-size: 14px;
}


#message-input {
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 10px;
    font-size: 16px;
    resize: none;
    height: 80px;
    margin-bottom: 10px;
}

#message-input:disabled {
    background-color: #f8f8f8;
    cursor: not-allowed;
}


#send-button {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    background-color: #ffc107;
    color: #333;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    align-self: flex-end;
}

#send-button:hover {
    background-color: #ffca2c;
}

#send-button:disabled {
    background-color: #e0e0e0;
    cursor: not-allowed;
}