/* 问答助手页面样式 */
.qa-page {
	background: #f5f7fa;
	padding: 15px 0 20px;
	min-height: calc(100vh - 180px);
}

.qa-container {
	width: 900px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	height: calc(100vh - 200px);
	min-height: 500px;
}

/* 顶部律师介绍 */
.qa-header {
	display: flex;
	align-items: center;
	padding: 15px 20px;
	background: #fff;
	border-radius: 8px;
	margin-bottom: 12px;
	box-shadow: 0 1px 4px rgba(0,0,0,0.06);
	flex-shrink: 0;
}

.qa-avatar {
	flex-shrink: 0;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	overflow: hidden;
	margin-right: 15px;
	border: 2px solid #458ccc;
}

.qa-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.qa-intro h2 {
	font: 500 16px/24px "Microsoft Yahei";
	color: #333;
	margin-bottom: 4px;
}

.qa-intro p {
	font-size: 12px;
	line-height: 20px;
	color: #666;
	margin: 0;
}

.qa-intro .qa-tip {
	color: #999;
	font-size: 11px;
	margin-top: 2px;
}

/* 聊天区域 */
.qa-chat {
	flex: 1;
	overflow-y: auto;
	background: #fff;
	border-radius: 8px;
	padding: 16px;
	margin-bottom: 12px;
	box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.qa-messages {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.qa-message {
	display: flex;
	max-width: 75%;
}

.qa-message-user {
	align-self: flex-end;
}

.qa-message-bot {
	align-self: flex-start;
}

.qa-message-content {
	padding: 10px 14px;
	border-radius: 10px;
	font-size: 13px;
	line-height: 22px;
	word-break: break-word;
}

.qa-message-user .qa-message-content {
	background: #458ccc;
	color: #fff;
	border-bottom-right-radius: 3px;
}

.qa-message-bot .qa-message-content {
	background: #f0f5fa;
	color: #333;
	border: 1px solid #e2ecf5;
	border-bottom-left-radius: 3px;
}

/* 打字机效果 */
.qa-typing {
	min-height: 22px;
	cursor: pointer;
}

.typing-cursor {
	display: inline-block;
	width: 2px;
	height: 14px;
	background: #458ccc;
	margin-left: 1px;
	vertical-align: text-bottom;
	animation: cursorBlink 0.8s infinite;
}

@keyframes cursorBlink {
	0%, 50% { opacity: 1; }
	51%, 100% { opacity: 0; }
}

.qa-message-bot .qa-message-content h2,
.qa-message-bot .qa-message-content h3,
.qa-message-bot .qa-message-content h4 {
	margin: 6px 0 3px;
	font-size: 14px;
	color: #333;
}

.qa-message-bot .qa-message-content li {
	margin-left: 16px;
	list-style: disc;
}

.qa-message-bot .qa-message-content strong {
	color: #2a6496;
}

.qa-message-bot .qa-message-content code {
	background: #e8eef4;
	padding: 1px 5px;
	border-radius: 3px;
	font-size: 12px;
}

.qa-message-bot .qa-message-content pre {
	background: #f5f5f5;
	padding: 8px;
	border-radius: 4px;
	overflow-x: auto;
	margin: 6px 0;
}

/* 加载动画 */
.qa-loading {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 10px 16px !important;
}

.qa-loading .dot {
	display: inline-block;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #458ccc;
	animation: dotBounce 1.4s infinite ease-in-out both;
}

.qa-loading .dot:nth-child(1) { animation-delay: -0.32s; }
.qa-loading .dot:nth-child(2) { animation-delay: -0.16s; }
.qa-loading .dot:nth-child(3) { animation-delay: 0; }

@keyframes dotBounce {
	0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
	40% { transform: scale(1); opacity: 1; }
}

/* 输入区域 */
.qa-input-area {
	background: #fff;
	border-radius: 8px;
	padding: 12px 14px;
	box-shadow: 0 1px 4px rgba(0,0,0,0.06);
	flex-shrink: 0;
}

.qa-input-wrap {
	display: flex;
	gap: 10px;
	align-items: flex-end;
}

.qa-input-wrap textarea {
	flex: 1;
	border: 1px solid #ddd;
	border-radius: 6px;
	padding: 8px 12px;
	font-size: 13px;
	line-height: 20px;
	resize: none;
	outline: none;
	font-family: "Microsoft Yahei", arial, sans-serif;
	transition: border-color 0.2s;
	min-height: 36px;
	max-height: 100px;
}

.qa-input-wrap textarea:focus {
	border-color: #458ccc;
	box-shadow: 0 0 0 2px rgba(69, 140, 204, 0.1);
}

.qa-input-wrap button {
	flex-shrink: 0;
	width: 72px;
	height: 36px;
	background: #458ccc;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 13px;
	font-family: "Microsoft Yahei";
	cursor: pointer;
	transition: background 0.2s;
}

.qa-input-wrap button:hover {
	background: #3a7ab8;
}

.qa-input-wrap button:disabled {
	background: #99c2e0;
	cursor: not-allowed;
}

.qa-input-hint {
	font-size: 11px;
	color: #aaa;
	margin-top: 6px;
	text-align: right;
}

/* 滚动条 */
.qa-chat::-webkit-scrollbar {
	width: 5px;
}

.qa-chat::-webkit-scrollbar-track {
	background: transparent;
}

.qa-chat::-webkit-scrollbar-thumb {
	background: #d0d0d0;
	border-radius: 3px;
}

.qa-chat::-webkit-scrollbar-thumb:hover {
	background: #aaa;
}

/* 响应式 */
@media (max-width: 960px) {
	.qa-container {
		width: 95%;
		margin: 0 auto;
	}
}

@media (max-width: 768px) {
	.qa-header {
		flex-direction: column;
		text-align: center;
	}
	.qa-avatar {
		margin: 0 0 10px 0;
	}
	.qa-message {
		max-width: 88%;
	}
	.qa-container {
		height: calc(100vh - 160px);
	}
}
