* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background-color: #f5f5f5;
}

.chat-container {
    max-width: 800px;
    margin: 20px auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.chat-header {
    background: #1890ff;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-link, .back-link {
    color: white;
    text-decoration: none;
    background: rgba(255,255,255,0.2);
    padding: 5px 10px;
    border-radius: 5px;
}

.chat-messages {
    height: 500px;
    overflow-y: auto;
    padding: 20px;
}

.message {
    margin-bottom: 15px;
    display: flex;
}

.user-message {
    justify-content: flex-end;
}

.bot-message {
    justify-content: flex-start;
}

.message-content {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 10px;
    position: relative;
}

.user-message .message-content {
    background: #1890ff;
    color: white;
}

.bot-message .message-content {
    background: #f0f0f0;
    color: #333;
}

.source-badge {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 5px;
}

.source-badge.template {
    background: #52c41a;
    color: white;
}

.source-badge.ai {
    background: #faad14;
    color: white;
}

.chat-input {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

.chat-input input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    outline: none;
}

.chat-input button {
    background: #1890ff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

.admin-container {
    max-width: 800px;
    margin: 20px auto;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.template-form {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 5px;
}

.template-form input,
.template-form textarea {
    width: 100%;
    padding: 10px;
    margin: 5px 0 15px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.template-form textarea {
    height: 80px;
    resize: vertical;
}

.template-form button {
    background: #52c41a;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

.template-item {
    border: 1px solid #eee;
    padding: 15px;
    margin: 10px 0;
    border-radius: 5px;
}

.template-item h4 {
    color: #1890ff;
    margin-bottom: 10px;
}

.template-item button {
    background: #1890ff;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    margin-right: 5px;
}

.delete-btn {
    background: #ff4d4f !important;
}