/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
header {
    text-align: center;
    padding: 20px 0;
    margin-bottom: 30px;
    background-color: #4CAF50;
    color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 主内容区域 */
main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

/* 消息输入区域 */
.message-input-section {
    background-color: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.message-input-section h2 {
    color: #4CAF50;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

#sendBtn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1.1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#sendBtn:hover {
    background-color: #45a049;
}

#sendBtn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    font-weight: 600;
    display: none;
}

.status.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.status.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* 历史消息区域 */
.message-history-section {
    background-color: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.message-history-section h2 {
    color: #4CAF50;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.message-history {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 15px;
}

.message-item {
    padding: 12px;
    margin-bottom: 15px;
    background-color: #f9f9f9;
    border-radius: 4px;
    border-left: 4px solid #4CAF50;
}

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

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.message-sender {
    font-weight: 600;
    color: #4CAF50;
}

.message-time {
    color: #999;
}

.message-content {
    color: #555;
    line-height: 1.5;
}

/* 底部样式 */
footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
    color: #666;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 2rem;
    }

    .message-input-section,
    .message-history-section {
        padding: 20px;
    }

    .message-history {
        max-height: 300px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.6rem;
    }

    header p {
        font-size: 1rem;
    }

    .message-input-section h2,
    .message-history-section h2 {
        font-size: 1.5rem;
    }

    #sendBtn {
        width: 100%;
        padding: 14px;
    }
}

/* 滚动条样式 */
.message-history::-webkit-scrollbar {
    width: 8px;
}

.message-history::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.message-history::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.message-history::-webkit-scrollbar-thumb:hover {
    background: #555;
}