

.chat-container {
	width: 100%;
	max-width: 800px;
	height: 100vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	margin: auto;
	padding-top: 50px;
}


.controls {
	display: flex;
	gap: 10px;
	margin-top: 10px;
	justify-content: center;
	flex-wrap: wrap;
}

.model-select, .control-btn {
	padding: 8px 15px;
	border: none;
	border-radius: 20px;
	background: rgba(255, 255, 255, 0.2);
	color: white;
	cursor: pointer;
	font-size: 14px;
	transition: all 0.3s;
}

.model-select:hover, .control-btn:hover {
	background: rgba(255, 255, 255, 0.3);
}

.chat-messages {
	flex: 1;
	padding: 20px 20px 0;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 15px;
}

.message {
	max-width: 80%;
	padding: 12px 18px;
	border-radius: 18px;
	line-height: 1.4;
	position: relative;
	animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: translateY(0); }
}

.user-message {
	align-self: flex-end;
	background: #eddfcc;
	color: #333;
	border-bottom-right-radius: 5px;
}

.ai-message {
	align-self: flex-start;
	background: #fbfbfb;
	color: #333;
	border-bottom-left-radius: 5px;
}

.message-info {
	font-size: 11px;
	opacity: 0.7;
	margin-top: 5px;
	text-align: right;
}

.chat-input-container {
	padding: 20px;
	border-top: 1px solid #eee;
}

.chat-input-wrapper {
	display: flex;
	gap: 10px;
	align-items: center;
}

#chat-input {
	flex: 1;
	padding: 12px 15px;
	border: 1px solid #ddd;
	border-radius: 25px;
	outline: none;
	font-size: 16px;
	transition: border 0.3s;
}

#chat-input:focus {
	border-color: #a7a7a7;
}

#send-btn {
	padding: 8px 5px;
	background: #c57200;
	color: white;
	border: none;
	border-radius: 25px;
	cursor: pointer;
	font-size: 20px;
	transition: background 0.3s;
	width: 50px;
}

#send-btn:hover {
	background: #b36800;
}

#send-btn:disabled {
	background: #ccc;
	cursor: not-allowed;
}

/* 语音按钮样式 - 修复显示问题 */
#voice-btn {
	/* 默认在移动端显示，桌面端隐藏 */
	display: none;
	width: 45px;
	height: 45px;
	border-radius: 50%;
	background: #434343;
	color: white;
	border: none;
	cursor: pointer;
	transition: all 0.3s;
	align-items: center;
	justify-content: center;
	position: relative;
}

#voice-btn:hover {
	background: #7d7d7d;
}

#voice-btn.listening {
	background: #ff4757;
	animation: pulse 1.5s infinite;
}

@keyframes pulse {
	0% { transform: scale(1); }
	50% { transform: scale(1.1); }
	100% { transform: scale(1); }
}

.voice-wave {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 100%;
	height: 100%;
	border-radius: 50%;
	border: 2px solid transparent;
	opacity: 0;
}

.voice-wave.active {
	animation: wave 1.5s infinite;
}

@keyframes wave {
	0% {
		width: 100%;
		height: 100%;
		border-color: #4facfe;
		opacity: 1;
	}
	100% {
		width: 150%;
		height: 150%;
		border-color: transparent;
		opacity: 0;
	}
}

.typing-indicator {
	display: none;
	align-self: flex-start;
	background: #f1f3f4;
	padding: 12px 18px;
	border-radius: 18px;
	border-bottom-left-radius: 5px;
}

.typing-dots {
	display: flex;
	gap: 3px;
}

.typing-dot {
	width: 8px;
	height: 8px;
	background: #999;
	border-radius: 50%;
	animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
	animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
	animation-delay: 0.4s;
}

@keyframes typing {
	0%, 60%, 100% { transform: translateY(0); }
	30% { transform: translateY(-5px); }
}

.stream-content {
	white-space: pre-wrap;
}

/* 语音识别状态显示 */
.voice-status {
	display: none;
	text-align: center;
	padding: 10px;
	background: #f8f9fa;
	border-radius: 10px;
	margin-bottom: 10px;
	font-size: 14px;
	color: #666;
}

.voice-status.listening {
	display: block;
	background: #fff3cd;
	color: #856404;
}

.voice-status.processing {
	display: block;
	background: #d1ecf1;
	color: #0c5460;
}

/* 移动端响应式设计 - 修复媒体查询 */
/* 平板和手机 */
@media (max-width: 1024px) {


	.chat-container {
		height: 100vh;
		border-radius: 10px;
		max-width: 100%;
		padding-top: 50px;
	}

	.chat-header {
		padding: 15px;
	}

	.chat-header h1 {
		font-size: 20px;
	}

	.controls {
		flex-direction: column;
		align-items: center;
		gap: 8px;
	}

	.message {
		max-width: 90%;
	}

	.chat-input-container {
		padding: 15px;
	}

	/* 在平板和手机端显示语音按钮 */
	#voice-btn {
		display: flex !important; /* 使用important确保显示 */
	}

	/* 调整输入区域布局 */
	.chat-input-wrapper {
		gap: 8px;
	}

	#send-btn {
		padding: 6px 0px;
	}
}

/* 小屏手机 */
@media (max-width: 480px) {


	.controls {
		font-size: 12px;
	}

	.model-select, .control-btn {
		padding: 6px 12px;
		font-size: 12px;
	}

	.chat-messages {
		padding: 15px;
	}

	.message {
		padding: 10px 14px;
		font-size: 14px;
		max-width: 95%;
	}

	#chat-input {
		padding: 10px 12px;
		font-size: 14px;
	}

	#send-btn {
		padding: 6px 10px;
		font-size: 16px;
		width: 40px;
	}

	#voice-btn {
		width: 40px;
		height: 40px;
	}

	/* 在小屏手机上调整输入区域布局 */
	.chat-input-wrapper {
		gap: 5px;
	}
}

/* 横屏手机 */
@media (max-height: 500px) and (orientation: landscape) {
	.chat-container {
		height: 98vh;
	}


	.chat-header .subtitle {
		font-size: 12px;
	}

	.chat-messages {
		padding: 10px;
	}

	.chat-input-container {
		padding: 10px;
	}
}

/* 语音按钮图标 */
.voice-icon {
	width: 20px;
	height: 20px;
	position: relative;
}

.voice-icon::before {
	content: "";
	position: absolute;
	width: 8px;
	height: 12px;
	background: white;
	border-radius: 4px;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
}

.voice-icon::after {
	content: "";
	position: absolute;
	width: 12px;
	height: 8px;
	background: white;
	border-radius: 4px;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
}

/* 语音识别结果预览 */
.voice-preview {
	display: none;
	padding: 10px;
	background: #e9ecef;
	border-radius: 10px;
	margin-bottom: 10px;
	font-size: 14px;
	color: #495057;
}

.voice-preview.show {
	display: block;
}

/* 强制移动端显示语音按钮的类 */
.mobile-device #voice-btn {
	display: flex !important;
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
	#voice-btn, #send-btn, .control-btn {
		min-height: 44px; /* 苹果推荐的最小触摸目标尺寸 */
		min-width: 44px;
	}

	#voice-btn {
		min-width: 44px;
		min-height: 44px;
	}
}