:root {
	--ai-color: #6c5ce7;
	--user-color: #00b894;
	--bg-gradient: linear-gradient(135deg, #2d3436 0%, #000000 100%);
	--glass-bg: rgba(255, 255, 255, 0.05);
	--text-primary: rgba(255, 255, 255, 0.9);
	--text-secondary: rgba(255, 255, 255, 0.6);
	--shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
	--border-radius: 20px;
	--spacing: 1.2rem;
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body {
	min-height: 100vh;
	background: var(--bg-gradient);
	font-family: 'Segoe UI', system-ui, sans-serif;
	color: var(--text-primary);
	display: flex;
	flex-direction: column;
}

.chat-container {
	flex: 1;
	max-width: 1200px;
	margin: 0 auto;
	width: 100%;
	padding: var(--spacing);
	display: flex;
	flex-direction: column;
	gap: var(--spacing);
}

.chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: var(--spacing);
	display: flex;
	flex-direction: column;
	gap: var(--spacing);
	scroll-behavior: smooth;
}

/* 消息通用样式 */
.message {
	display: flex;
	gap: 1rem;
	max-width: 75%;
	animation: messageAppear 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
	transition: transform 0.3s ease;
}

.message:hover {
	transform: translateX(5px);
}

/* AI消息样式 */
.message.ai {
	align-self: flex-start;
}

/* 用户消息样式 */
.message.user {
	align-self: flex-end;
	flex-direction: row-reverse;
}
.MessageText{
	word-break: break-all; /* 允许在单词内换行 */
}

/* 头像样式 */
.avatar {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
	border: 2px solid;
	box-shadow: var(--shadow);
}

.message.ai .avatar {
	border-color: var(--ai-color);
}

.message.user .avatar {
	border-color: var(--user-color);
}

/* 消息内容容器 */
.message-content {
	padding: 1.2rem;
	border-radius: var(--border-radius);
	position: relative;
	line-height: 1.6;
	backdrop-filter: blur(12px);
	box-shadow: var(--shadow);
	max-width: 80%;
	min-width: 240px;
}

/* AI消息内容 */
.message.ai .message-content {
	background: linear-gradient(145deg, 
			rgba(108, 92, 231, 0.15) 0%,
			rgba(108, 92, 231, 0.05) 100%);
	border: 1px solid rgba(108, 92, 231, 0.2);
	margin-left: 1rem;
}

/* 用户消息内容 */
.message.user .message-content {
	background: linear-gradient(145deg, 
			rgba(0, 184, 148, 0.15) 0%,
			rgba(0, 184, 148, 0.05) 100%);
	border: 1px solid rgba(0, 184, 148, 0.2);
	margin-right: 1rem;
}

/* 时间戳样式 */
.timestamp {
	font-size: 0.75rem;
	color: var(--text-secondary);
	margin-bottom: 0.8rem;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.timestamp::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: currentColor;
}

/* 输入区域 */
.input-container {
	position: sticky;
	bottom: 0;
	background: var(--glass-bg);
	padding: var(--spacing);
	backdrop-filter: blur(16px);
	border-radius: var(--border-radius);
	margin: 0 var(--spacing);
}

.input-wrapper {
	position: relative;
	max-width: 800px;
	margin: 0 auto;
}

textarea {
	width: 100%;
	padding: 1.2rem 5rem 1.2rem 1.8rem;
	border: none;
	border-radius: 2.5rem;
	background: rgba(255, 255, 255, 0.08);
	color: var(--text-primary);
	resize: none;
	min-height: 3.8rem;
	max-height: 12rem;
	transition: all 0.3s ease;
	font-size: 1rem;
}

textarea::-webkit-scrollbar {
	width: 0px;
}
textarea:focus {
	outline: none;
	background: rgba(255, 255, 255, 0.12);
	box-shadow: 0 0 0 2px var(--user-color);
}

textarea::placeholder {
	color: var(--text-secondary);
	letter-spacing: 0.5px;
}

button {
	position: absolute;
	right: 0.8rem;
	bottom: 0.7rem;
	padding: 0.8rem 1.8rem;
	border: none;
	border-radius: 2rem;
	background: var(--user-color);
	color: white;
	cursor: pointer;
	transition: all 0.3s ease;
	font-weight: 500;
	display: flex;
	align-items: center;
	gap: 0.6rem;
	opacity: 0.5;
}

button:hover {
	background: #00ce9d;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 184, 148, 0.3);
	opacity: 1;
}

button svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

/* 响应式设计 */
@media (max-width: 768px) {
	:root {
			--spacing: 1rem;
	}

	.message {
			max-width: 88%;
			gap: 0.8rem;
	}

	.avatar {
			width: 48px;
			height: 48px;
	}

	.message-content {
			padding: 1rem;
			font-size: 0.95rem;
	}

	textarea {
			padding-right: 4.5rem;
			font-size: 0.95rem;
	}

	button {
			padding: 0.2rem 1rem;
			font-size: 0.9rem;
			opacity: 1;
	}
}

@keyframes messageAppear {
	from {
			opacity: 0;
			transform: translateY(1.5rem) scale(0.95);
	}
	to {
			opacity: 1;
			transform: translateY(0) scale(1);
	}
}

/* 自定义滚动条 */
::-webkit-scrollbar {
	width: 8px;
}

::-webkit-scrollbar-track {
	background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.2);
	border-radius: 4px;
}