/* 四象 AI CMS — 前端样式 */

/* 相关阅读 */
.sxai-related {
	margin: 2.5em 0 1em;
	padding: 1.2em 1.4em;
	border: 1px solid #e2e0d8;
	border-radius: 10px;
	background: #faf9f5;
}
.sxai-related h3 {
	margin: 0 0 .6em;
	font-size: 1.05em;
}
.sxai-related ul {
	margin: 0;
	padding-left: 1.2em;
}
.sxai-related li {
	margin: .35em 0;
}

/* 对话组件 */
.sxai-chat-floating {
	position: fixed;
	right: 22px;
	bottom: 22px;
	z-index: 99990;
}
.sxai-chat-toggle {
	width: 54px;
	height: 54px;
	border-radius: 50%;
	border: none;
	background: #534ab7;
	color: #fff;
	font-size: 24px;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(83, 74, 183, .35);
	transition: transform .15s ease;
}
.sxai-chat-toggle:hover {
	transform: scale(1.06);
}
.sxai-chat-inline .sxai-chat-toggle {
	display: none;
}

.sxai-chat-panel {
	width: 340px;
	max-width: calc(100vw - 32px);
	height: 460px;
	max-height: calc(100vh - 120px);
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid #e2e0d8;
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
}
.sxai-chat-floating .sxai-chat-panel {
	position: absolute;
	right: 0;
	bottom: 66px;
}
.sxai-chat-inline .sxai-chat-panel {
	position: relative;
	height: 420px;
}

.sxai-chat-head {
	padding: 12px 16px;
	background: #534ab7;
	color: #fff;
	font-weight: 600;
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.sxai-chat-close {
	background: none;
	border: none;
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.sxai-chat-log {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	background: #f7f6f2;
}
.sxai-msg {
	margin: 8px 0;
	padding: 9px 13px;
	border-radius: 12px;
	max-width: 85%;
	line-height: 1.55;
	font-size: 14px;
	white-space: pre-wrap;
	word-break: break-word;
}
.sxai-msg-user {
	margin-left: auto;
	background: #534ab7;
	color: #fff;
	border-bottom-right-radius: 3px;
}
.sxai-msg-assistant {
	margin-right: auto;
	background: #fff;
	border: 1px solid #e2e0d8;
	color: #2c2c2a;
	border-bottom-left-radius: 3px;
}
.sxai-msg.is-thinking {
	opacity: .55;
	font-style: italic;
}

.sxai-chat-form {
	display: flex;
	border-top: 1px solid #e2e0d8;
	background: #fff;
}
.sxai-chat-input {
	flex: 1;
	border: none;
	padding: 12px 14px;
	font-size: 14px;
	outline: none;
}
.sxai-chat-send {
	border: none;
	background: #534ab7;
	color: #fff;
	padding: 0 18px;
	cursor: pointer;
	font-size: 14px;
}
.sxai-chat-send:disabled {
	opacity: .5;
	cursor: default;
}

@media (prefers-color-scheme: dark) {
	.sxai-related { background: #232320; border-color: #3d3d3a; }
	.sxai-chat-panel { background: #1f1f1d; border-color: #3d3d3a; }
	.sxai-chat-log { background: #181816; }
	.sxai-msg-assistant { background: #2a2a27; border-color: #3d3d3a; color: #d8d6cc; }
	.sxai-chat-form { background: #1f1f1d; border-color: #3d3d3a; }
	.sxai-chat-input { background: #1f1f1d; color: #d8d6cc; }
}
