/* RPA 测试平台样式 */

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    padding: 0;
    margin: 0;
    background: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部区域 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

h2 {
    color: #333;
    margin: 0;
    font-size: 24px;
    font-weight: 500;
}

.status-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

#status {
    font-size: 14px;
    color: #666;
    padding: 6px 12px;
    background: #f0f0f0;
    border-radius: 4px;
}

#status.connected {
    background: #e8f5e8;
    color: #2d7d32;
}

#status.error {
    background: #ffebee;
    color: #c62828;
}

/* 两栏布局 */
.main-layout {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

/* 左侧群列表 */
.contacts-panel {
    flex: 0 0 450px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.contacts-header {
    padding: 16px 20px;
    background: #07c160;
    color: white;
    font-weight: 500;
}

#list {
    height: 500px;
    overflow-y: auto;
    padding: 0;
}

.section-title {
    padding: 12px 20px 8px;
    font-weight: 500;
    color: #999;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #fafafa;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 10;
}

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

.item:hover {
    background: #f8f8f8;
}

.item.selected {
    background: #e7f3ff;
}

.item input[type="radio"] {
    margin-right: 12px;
    cursor: pointer;
}

.item-content {
    flex: 1;
    min-width: 0;
}

.item span.name {
    display: block;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.item span.meta {
    display: block;
    color: #999;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 右侧发送面板 */
.send-panel {
    flex: 1;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 24px;
}

.send-header {
    margin-bottom: 20px;
}

#chosen {
    font-size: 16px;
    color: #333;
    margin-bottom: 4px;
    font-weight: 500;
}

.send-to-label {
    font-size: 13px;
    color: #999;
    margin-bottom: 16px;
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #666;
    font-size: 14px;
}

#robotWxId {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
}

#robotWxId:focus {
    outline: none;
    border-color: #07c160;
}

#content {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

#content:focus {
    outline: none;
    border-color: #07c160;
}

button {
    padding: 10px 24px;
    font-size: 14px;
    background: #07c160;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    margin-right: 10px;
}

button:hover {
    background: #06ad56;
}

button:active {
    background: #059a4c;
}

#resp {
    margin-top: 16px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 4px;
    font-size: 13px;
    color: #666;
    white-space: pre-wrap;
    max-height: 120px;
    overflow-y: auto;
}

/* 消息日志 */
.log-panel {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.log-panel h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 500;
    color: #333;
}

#log {
    height: 300px;
    overflow-y: auto;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 16px;
    font-size: 13px;
    line-height: 1.5;
    color: #333;
}

.message-item {
    margin-bottom: 8px;
    padding: 8px 12px;
    background: white;
    border-radius: 4px;
    border-left: 3px solid #07c160;
}

.message-type {
    font-size: 12px;
    color: #999;
    margin-right: 8px;
}

.message-name {
    font-weight: 500;
    color: #333;
    margin-right: 8px;
}

.message-content {
    color: #666;
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-left: 8px;
}

/* 二维码弹窗样式 */
.qr-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: 1000;
}

.qr-modal-content {
    background: white;
    border-radius: 12px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.qr-modal-content h3 {
    margin: 0 0 16px 0;
    color: #333;
    font-size: 20px;
    font-weight: 500;
}

.qr-modal-content p {
    margin: 0 0 24px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.qr-image-container {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.qr-image-container img {
    max-width: 250px;
    max-height: 250px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.qr-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

.qr-actions button {
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0;
}

/* 响应式 */
@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
    }

    .contacts-panel {
        flex: 1;
    }
    
    .qr-modal-content {
        margin: 20px;
        padding: 24px;
    }
    
    .qr-actions {
        flex-direction: column;
    }
}
