* {
    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%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

.persona-selector {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.persona-selector h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.persona-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.persona-btn {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.persona-btn:hover {
    border-color: #3498db;
    transform: translateY(-2px);
}

.persona-btn.active {
    border-color: #3498db;
    background: #e3f2fd;
}

.persona-icon {
    font-size: 2em;
    display: block;
    margin-bottom: 5px;
}

.persona-name {
    font-weight: bold;
    color: #2c3e50;
    display: block;
}

.persona-desc {
    font-size: 0.9em;
    color: #6c757d;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 500px;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #34495e;
    color: white;
}

.chat-header h3 {
    margin: 0;
}

.btn-clear {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-clear:hover {
    background: #c0392b;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #fafafa;
}

.message {
    margin-bottom: 20px;
    max-width: 80%;
}

.user-message {
    margin-left: auto;
}

.user-message .message-content {
    background: #3498db;
    color: white;
    border-radius: 15px 15px 5px 15px;
}

.assistant-message .message-content {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 15px 15px 15px 5px;
}

.message-content {
    padding: 12px 15px;
    line-height: 1.5;
}

.timestamp {
    font-size: 0.8em;
    color: #6c757d;
    margin-bottom: 5px;
}

.loading .message-content {
    color: #6c757d;
    font-style: italic;
}

.chat-input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid #e9ecef;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

#message-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    resize: none;
    font-family: inherit;
    font-size: 14px;
}

.btn-send {
    background: #27ae60;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
    align-self: flex-end;
}

.btn-send:hover {
    background: #219a52;
}

.input-hint {
    color: #6c757d;
    font-size: 0.9em;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        border-radius: 10px;
    }

    header {
        padding: 20px;
    }

    header h1 {
        font-size: 2em;
    }

    .persona-buttons {
        grid-template-columns: 1fr;
    }

    .message {
        max-width: 90%;
    }

    .input-group {
        flex-direction: column;
    }

    .btn-send {
        align-self: stretch;
    }
}