* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    color: #333;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1em;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.card {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.card h2 {
    color: #667eea;
    margin-bottom: 15px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    margin-top: 15px;
    transition: background 0.3s;
}

.btn:hover {
    background: #764ba2;
}

.api-docs {
    margin-top: 40px;
}

.api-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.api-item code {
    background: #667eea;
    color: white;
    padding: 5px 15px;
    border-radius: 5px;
    display: inline-block;
    margin: 10px 0;
}

.api-item pre {
    background: #2d3748;
    color: #68d391;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-top: 10px;
}

/* 聊天界面样式 */
.chat-container {
    max-width: 800px;
    margin: 0 auto;
}

.test-buttons {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.test-buttons button {
    padding: 10px 20px;
    margin: 5px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.test-buttons button:hover {
    background: #764ba2;
    transform: scale(1.05);
}

.chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 20px;
}

.message {
    margin-bottom: 15px;
    animation: fadeIn 0.3s;
    position: relative;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-content {
    display: inline-block;
    padding: 12px 18px;
    border-radius: 18px;
    max-width: 80%;
}

.user-message .message-content {
    background: #667eea;
    color: white;
    float: right;
}

.bot-message .message-content {
    background: white;
    color: #333;
    border: 1px solid #e2e8f0;
}

.input-area {
    display: flex;
    gap: 10px;
}

.input-area input {
    flex: 1;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    font-size: 16px;
}

.input-area button {
    padding: 15px 30px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
}

.status-bar {
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    gap: 20px;
    font-size: 14px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot.green { background: #48bb78; }
.dot.red { background: #f56565; }
.dot.gray { background: #cbd5e0; }

.back-link {
    color: #667eea;
    text-decoration: none;
    font-size: 16px;
}

footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    color: #666;
}

/* New styles for agent routing visualization */
.agent-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 8px;
}

.agent-badge.customer-service {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.agent-badge.weather {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.agent-badge.purchase {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 1px solid rgba(255,255,255,0.3);
}

.agent-switch-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
    z-index: 1000;
}

.agent-switch-notification.fade-out {
    animation: fadeOut 0.5s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.routing-stats {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.routing-stats button {
    margin-top: 10px;
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
}

#stats-content {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.stat-item {
    background: white;
    padding: 10px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-name {
    font-weight: bold;
    color: #4a5568;
}

.stat-count {
    color: #667eea;
    font-size: 1.2em;
    font-weight: bold;
}
