* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    height: 100vh;
    max-width: 1600px;
    margin: 0 auto;
}

/* 侧边栏 */
.sidebar {
    width: 280px;
    background: rgba(255, 255, 255, 0.95);
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.sidebar-header h2 {
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
}

.session-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.session-item {
    padding: 12px 15px;
    margin-bottom: 8px;
    background: #f5f5f5;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.session-item:hover {
    background: #e3e3e3;
}

.session-item.active {
    background: #667eea;
    color: white;
}

.session-item-info {
    font-size: 14px;
    margin-bottom: 5px;
}

.session-item-meta {
    font-size: 12px;
    color: #666;
}

.session-item.active .session-item-meta {
    color: #ddd;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
}

/* 主内容区 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
}

.chat-header {
    padding: 20px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h1 {
    font-size: 24px;
    color: #333;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
}

.status-dot.online {
    background: #4caf50;
    animation: pulse 2s infinite;
}

.status-dot.offline {
    background: #f44336;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 聊天区域 */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 20px 30px;
    background: #f8f9fa;
}

.message {
    margin-bottom: 20px;
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.user {
    justify-content: flex-end;
}

.message.assistant {
    justify-content: flex-start;
}

.message.system {
    justify-content: center;
}

.message-content {
    max-width: 70%;
    padding: 15px 20px;
    border-radius: 15px;
    font-size: 15px;
    line-height: 1.5;
}

.message.user .message-content {
    background: #667eea;
    color: white;
    border-bottom-right-radius: 5px;
}

.message.assistant .message-content {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 5px;
}

.message.system .message-content {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}

.message-time {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.message.user .message-time {
    text-align: right;
}

/* 输入区域 */
.chat-input-area {
    padding: 20px 30px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.input-wrapper input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s;
}

.input-wrapper input:focus {
    border-color: #667eea;
}

.input-wrapper button {
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 15px;
}

.quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.quick-btn {
    padding: 8px 16px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.quick-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 调试面板 */
.debug-panel {
    background: #2d2d2d;
    color: #f8f8f2;
    max-height: 250px;
    overflow: hidden;
}

.debug-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: #1e1e1e;
}

.debug-header h3 {
    font-size: 14px;
    font-weight: normal;
}

.debug-content {
    padding: 15px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    overflow-y: auto;
}

.debug-section h4 {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.debug-value {
    font-size: 13px;
    font-family: 'Courier New', monospace;
    background: #1e1e1e;
    padding: 10px;
    border-radius: 5px;
    word-break: break-all;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-warning {
    background: #ffc107;
    color: #333;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-small {
    padding: 5px 10px;
    font-size: 12px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: 200px;
    }

    .message-content {
        max-width: 85%;
    }

    .debug-content {
        grid-template-columns: 1fr;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}