/* WebSocket 测试工具专用样式 */
.nav {
    margin-bottom: 0;
}

.container {
    max-width: 1200px;
}

.config-main {
    width: 400px;
    flex: none;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.main {
    display: flex;
    gap: 20px;
}
.ws-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* 配置区域样式 */
.config-section {
    width: 100%;
}

.config-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
}

.config-card h3 {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
}

.config-row {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    gap: 0.75rem;
}

.config-row label {
    min-width: 80px;
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
}

.config-row input[type="text"] {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

.config-row input[type="text"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.config-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* 连接状态样式 */
.status-disconnected {
    color: #dc2626;
    font-weight: 500;
}

.status-connecting {
    color: #f59e0b;
    font-weight: 500;
}

.status-connected {
    color: #059669;
    font-weight: 500;
}

/* 发送区域样式 */
.send-section {
    width: 100%;
}

.send-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
}

.send-card h3 {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
}

.send-config {
    margin-bottom: 1rem;
}

.send-config label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #374151;
}

.send-config input[type="checkbox"] {
    margin: 0;
}

.send-config input[type="number"] {
    width: 60px;
    padding: 0.25rem 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.message-input {
    margin-bottom: 1rem;
}

.message-input textarea {
    width: 100%;
    min-height: 100px;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-family: 'Courier New', monospace;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.message-input textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.send-actions {
    display: flex;
    gap: 0.75rem;
}

/* 消息显示区域样式 */
.messages-section {
    width: 100%;
    height: 100%;
}

.messages-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
}

.messages-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.messages-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
}

.messages-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.messages-actions label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: #374151;
}

.messages-container {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    padding: 1rem;
    height: 441px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    flex: none;
    font-size: 12.8px;
}

.message-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
    flex-wrap: wrap;
}

.message-item:last-child {
    margin-bottom: 0;
}

.message-item .timestamp {
    color: #6b7280;
    font-size: 0.75rem;
    min-width: 60px;
}

.message-item .direction {
    color: #374151;
    font-weight: 500;
    min-width: 20px;
}

.message-item .message-type {
    flex: none;
}

.max-w-full {
    width: 100%;
}

.message-item .content {
    flex: 1;
    word-break: break-all;
}

.message-item.system .content {
    color: #059669;
}

.message-item.sent .content {
    color: #dc2626;
}

.message-item.received .content {
    color: #3b82f6;
}

.message-item.error .content {
    color: #dc2626;
    font-weight: 500;
}

/* 按钮样式 */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #2563eb;
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #4b5563;
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

/* 信息卡片样式 */
.info-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    margin-top: 1.5rem;
}

.info-section {
    margin-bottom: 1.5rem;
}

.info-section:last-child {
    margin-bottom: 0;
}

.info-section h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}

.info-section ul {
    margin: 0;
    padding-left: 1.25rem;
    color: #374151;
}

.info-section li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.info-section li:last-child {
    margin-bottom: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .messages-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .main {
        flex-direction: column;
        gap: 1rem;
    }
    .config-main {
        width: 100%;
    }
    
    .messages-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .config-actions,
    .send-actions {
        flex-direction: column;
    }
    
    .config-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .config-row label {
        min-width: auto;
    }
    
    .config-row input[type="text"] {
        width: 100%;
    }
}

/* 滚动条样式 */
.messages-container::-webkit-scrollbar {
    width: 6px;
}

.messages-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.messages-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}