/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

body {
  background-color: #f5f5f5;
  color: #333;
}

.container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

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

header h1 {
  color: #1890ff;
  font-size: 24px;
}

/* 聊天容器样式 */
.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin-bottom: 20px;
}

.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.message {
  padding: 12px 15px;
  border-radius: 8px;
  max-width: 80%;
  word-wrap: break-word;
}

.message.user {
  align-self: flex-end;
  background-color: #1890ff;
  color: white;
}

.message.assistant {
  align-self: flex-start;
  background-color: #f0f0f0;
  color: #333;
}

.message.system {
  align-self: center;
  background-color: #f9f9f9;
  color: #666;
  font-style: italic;
  max-width: 90%;
}

.message.error {
  align-self: center;
  background-color: #fff2f0;
  color: #ff4d4f;
  border: 1px solid #ffccc7;
  max-width: 90%;
}

.message.tool {
  align-self: flex-start;
  background-color: #e6f7ff;
  color: #096dd9;
  border: 1px solid #91d5ff;
  font-family: monospace;
  white-space: pre-wrap;
}

.chat-input {
  display: flex;
  padding: 15px;
  border-top: 1px solid #e8e8e8;
  background-color: #fafafa;
}

.chat-input textarea {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  resize: none;
  height: 60px;
  font-size: 14px;
  transition: all 0.3s;
}

.chat-input textarea:focus {
  outline: none;
  border-color: #40a9ff;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.chat-input button {
  margin-left: 10px;
  padding: 0 20px;
  height: 60px;
  background-color: #1890ff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
}

.chat-input button:hover {
  background-color: #40a9ff;
}

.chat-input button:active {
  background-color: #096dd9;
}

/* 设置面板样式 */
.settings-panel {
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 15px;
  margin-bottom: 20px;
}

.settings-panel h3 {
  margin-bottom: 15px;
  color: #333;
}

.setting-item {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.setting-item label {
  width: 150px;
  flex-shrink: 0;
}

.setting-item input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  transition: all 0.3s;
}

.setting-item input:focus {
  outline: none;
  border-color: #40a9ff;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.setting-item button {
  margin-left: 10px;
  padding: 8px 15px;
  background-color: #1890ff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
}

.setting-item button:hover {
  background-color: #40a9ff;
}

/* 底部样式 */
footer {
  text-align: center;
  padding: 15px 0;
  color: #999;
  font-size: 12px;
}

/* 加载动画 */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.loading::after {
  content: "正在思考";
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { content: "正在思考"; }
  33% { content: "正在思考."; }
  66% { content: "正在思考.."; }
  100% { content: "正在思考..."; }
}

/* 响应式布局 */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }
  
  .setting-item {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .setting-item label {
    width: 100%;
    margin-bottom: 5px;
  }
  
  .setting-item input {
    width: 100%;
  }
  
  .setting-item button {
    margin-left: 0;
    margin-top: 10px;
  }
}
