/**
 * 企业微信插件前端样式
 */

/* 容器 */
#ewc-conversations-container,
#ewc-messages-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 加载状态 */
.ewc-loading {
    text-align: center;
    padding: 40px;
}

.ewc-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2271b1;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: ewc-spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes ewc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ewc-loading p {
    color: #646970;
    font-size: 14px;
}

/* 空状态 */
.ewc-empty {
    text-align: center;
    padding: 60px 20px;
    color: #646970;
    font-size: 16px;
    background: #f9f9f9;
    border-radius: 4px;
}

/* 错误状态 */
.ewc-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
}

/* 搜索框 */
.ewc-search-input {
    width: 100%;
    max-width: 400px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 20px;
}

.ewc-search-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.1);
}

/* 会话列表 */
.ewc-conversations-list {
    display: grid;
    gap: 15px;
}

.ewc-conversation-item {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ewc-conversation-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    border-color: #2271b1;
}

.ewc-conv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.ewc-conv-name {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2271b1;
}

.ewc-conv-type {
    background: #f0f6fc;
    color: #2271b1;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.ewc-conv-info {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 13px;
    color: #646970;
}

.ewc-conv-owner,
.ewc-conv-members,
.ewc-conv-time {
    display: flex;
    align-items: center;
}

.ewc-conv-owner::before {
    content: '👤';
    margin-right: 5px;
}

.ewc-conv-members::before {
    content: '👥';
    margin-right: 5px;
}

.ewc-conv-time::before {
    content: '🕒';
    margin-right: 5px;
}

/* 消息列表 */
.ewc-messages-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ewc-message-item {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 15px;
}

.ewc-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.ewc-message-from {
    font-weight: 600;
    color: #2271b1;
    font-size: 14px;
}

.ewc-message-time {
    font-size: 12px;
    color: #646970;
}

.ewc-message-content {
    color: #333;
    font-size: 14px;
    line-height: 1.6;
}

/* 消息类型样式 */
.ewc-message-voice,
.ewc-message-video {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f0f6fc;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 13px;
    color: #2271b1;
}

.ewc-message-file {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f6f8fa;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 13px;
    color: #24292e;
}

.ewc-message-image {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ewc-message-link {
    color: #2271b1;
    text-decoration: none;
    word-break: break-all;
}

.ewc-message-link:hover {
    text-decoration: underline;
}

/* 分页 */
.ewc-pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.ewc-page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #e5e5e5;
    background: #fff;
    color: #333;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ewc-page-btn:hover {
    background: #f6f8fa;
    border-color: #2271b1;
}

.ewc-page-btn.active {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

/* 响应式 */
@media (max-width: 768px) {
    #ewc-conversations-container,
    #ewc-messages-container {
        padding: 10px;
    }
    
    .ewc-conv-info {
        flex-direction: column;
        gap: 8px;
    }
    
    .ewc-search-input {
        max-width: 100%;
    }
}

/* 动画效果 */
.ewc-conversation-item,
.ewc-message-item {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
