#cherish-ai-bubble {
	position: fixed;
	right: 80px;
	bottom: 24px;
	width: 56px;
	height: 56px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--themecolor, #5e72e4);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 2147483002;
	box-shadow: 0 10px 28px rgba(94, 114, 228, .35);
	transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}
#cherish-ai-bubble:hover {
	transform: translateY(-2px) scale(1.03);
	box-shadow: 0 14px 34px rgba(94, 114, 228, .45);
}
#cherish-ai-bubble svg {
	width: 26px;
	height: 26px;
	display: block;
}

#cherish-ai-panel {
	position: fixed;
	right: 24px;
	bottom: 92px;
	width: 380px;
	height: 560px;
	max-height: calc(100vh - 120px);
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 24px 64px rgba(30, 34, 60, .24);
	z-index: 2147483003;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px);
	transition: opacity .18s ease, transform .18s ease, visibility .18s;
	font-family: inherit;
	color: #32325d;
}
#cherish-ai-panel.open {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
#cherish-ai-panel,
#cherish-ai-panel * {
	box-sizing: border-box;
}

.cherish-ai-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 14px 16px;
	background: linear-gradient(135deg, var(--themecolor, #5e72e4), #7b8cf0);
	color: #fff;
	flex: 0 0 auto;
}
.cherish-ai-title {
	font-size: 15px;
	font-weight: 700;
	letter-spacing: .3px;
}
.cherish-ai-actions {
	display: flex;
	gap: 6px;
}
.cherish-ai-iconbtn {
	width: 28px;
	height: 28px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: rgba(255, 255, 255, .16);
	color: #fff;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .15s ease;
}
.cherish-ai-iconbtn:hover {
	background: rgba(255, 255, 255, .28);
}

.cherish-ai-messages {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 16px;
	background: #f6f7fb;
	display: flex;
	flex-direction: column;
	gap: 12px;
	scroll-behavior: smooth;
}
.cherish-ai-msg {
	display: flex;
	width: 100%;
}
.cherish-ai-msg.user {
	justify-content: flex-end;
}
.cherish-ai-msg.assistant {
	justify-content: flex-start;
}
.cherish-ai-text {
	max-width: 84%;
	padding: 10px 13px;
	border-radius: 12px;
	font-size: 14px;
	line-height: 1.65;
	white-space: pre-wrap;
	word-break: break-word;
}
.cherish-ai-msg.user .cherish-ai-text {
	background: var(--themecolor, #5e72e4);
	color: #fff;
	border-bottom-right-radius: 4px;
}
.cherish-ai-msg.assistant .cherish-ai-text {
	background: #fff;
	color: #32325d;
	box-shadow: 0 1px 2px rgba(50, 50, 93, .08);
	border-bottom-left-radius: 4px;
}
.cherish-ai-msg.error .cherish-ai-text {
	background: #fff1f2;
	color: #c53030;
	box-shadow: none;
}

.cherish-ai-typing {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 12px 14px;
	background: #fff;
	border-radius: 12px;
	border-bottom-left-radius: 4px;
	box-shadow: 0 1px 2px rgba(50, 50, 93, .08);
}
.cherish-ai-typing span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #aab2bd;
	animation: cherish-ai-bounce 1s infinite;
}
.cherish-ai-typing span:nth-child(2) { animation-delay: .15s; }
.cherish-ai-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes cherish-ai-bounce {
	0%, 60%, 100% { transform: translateY(0); opacity: .5; }
	30% { transform: translateY(-4px); opacity: 1; }
}

.cherish-ai-inputbar {
	flex: 0 0 auto;
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 12px;
	background: #fff;
	border-top: 1px solid #eef0f4;
}
#cherish-ai-input {
	flex: 1 1 auto;
	min-height: 42px;
	max-height: 120px;
	resize: none;
	border: 1px solid #e3e7ef;
	border-radius: 10px;
	background: #f8f9fc;
	color: #32325d;
	padding: 10px 12px;
	font-size: 14px;
	line-height: 1.5;
	font-family: inherit;
	outline: none;
	transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
#cherish-ai-input:focus {
	border-color: var(--themecolor, #5e72e4);
	background: #fff;
	box-shadow: 0 0 0 3px rgba(94, 114, 228, .12);
}
#cherish-ai-input::placeholder {
	color: #aab2bd;
}
.cherish-ai-send {
	flex: 0 0 auto;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: var(--themecolor, #5e72e4);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity .15s ease, transform .15s ease;
}
.cherish-ai-send:hover:not(:disabled) {
	transform: translateY(-1px);
}
.cherish-ai-send:disabled {
	opacity: .45;
	cursor: not-allowed;
}
.cherish-ai-send svg {
	width: 18px;
	height: 18px;
	display: block;
}

/* 深色模式 */
html.darkmode #cherish-ai-panel {
	background: #1f2129;
	color: #e6e8ef;
}
html.darkmode .cherish-ai-messages {
	background: #171920;
}
html.darkmode .cherish-ai-msg.assistant .cherish-ai-text,
html.darkmode .cherish-ai-typing {
	background: #262932;
	color: #e6e8ef;
	box-shadow: none;
}
html.darkmode .cherish-ai-msg.error .cherish-ai-text {
	background: #3a1f24;
	color: #ff9aa2;
}
html.darkmode .cherish-ai-inputbar {
	background: #1f2129;
	border-top-color: #2c3040;
}
html.darkmode #cherish-ai-input {
	background: #262932;
	border-color: #343a4d;
	color: #e6e8ef;
}
html.darkmode #cherish-ai-input::placeholder {
	color: #8a91a6;
}

/* 手机 */
@media screen and (max-width: 640px) {
	#cherish-ai-bubble {
		right: 78px;
		bottom: 16px;
		width: 52px;
		height: 52px;
	}
	#cherish-ai-panel {
		right: 0;
		bottom: 0;
		width: 100%;
		height: 100%;
		max-height: none;
		border-radius: 0;
	}
	.cherish-ai-messages {
		padding: 14px;
	}
}
