/* ================= 基础 ================= */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, sans-serif;
	overflow: hidden;
}

.ai-chat {
	background: linear-gradient(180deg, #F6FAFF 0%, #FAFCFF 40.38%, #FFF 100%);
	height: 100vh;
	display: flex;
	flex-direction: column;
}

/* ================= 头部 ================= */
.header {
	display: flex;
	align-items: center;
	padding: 0 12px;
	height: 48px;
	position: relative;
	border-bottom: 1px solid #e0e0e0;
}

.header-left,
.header-right {
	display: flex;
	align-items: center;
	gap: 4px;
	margin-right: 8px;
}

.header-title {
	flex: 1;
	text-align: center;
	font-size: 16px;
	color: #333;
	font-weight: 500;
}

.header-icon {
	width: 16px;
	height: 16px;
	cursor: pointer;
	opacity: 1;
	transition: opacity 0.2s;
}

.header-icon:hover {
	opacity: 0.7;
}

.header-icon-disabled {
	opacity: 0.35;
	cursor: not-allowed;
	pointer-events: none;
}

/* ================= 聊天容器 ================= */
.chat-container {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.chat-container::-webkit-scrollbar {
	width: 6px;
}

.chat-container::-webkit-scrollbar-track {
	background: transparent;
}

.chat-container::-webkit-scrollbar-thumb {
	background-color: #ccc;
	border-radius: 3px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
	background-color: #aaa;
}

/* ================= 消息气泡 ================= */
.message {
	width: 100%;
	padding: 0 8px;
	border-radius: 8px;
	line-height: 1.6;
	word-wrap: break-word;
}

.message.ai {
	align-self: flex-start;
	color: #212121;
	font-size: 14px;
}

.message.user {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
	background-color: #2970FF;
	border-radius: 12px 2px 12px 12px;
	max-width: 80%;
	width: auto;
	word-break: break-word;
	justify-content: flex-end;
	align-self: flex-end;
	font-size: 14px;
}

.message.user .message-content {
	color: #FFF;
	font-size: 16px;
}

/* 用户消息使用 pre 标签，需要还原牵引换行和不破坏字体 */
pre.message-content {
	margin: 0;
	white-space: pre-wrap;
	word-break: break-word;
	overflow-wrap: anywhere;
	font-family: "Microsoft YaHei";
}

.message-label {
	display: none;
}

/* ================= Markdown 内容 ================= */
.message-content {
	color: rgba(0, 0, 0, 0.64);
	font-family: "Microsoft YaHei";
	font-size: 12px;
	font-weight: 400;
	line-height: 18px;
}

.message-content ol,
.message-content ul {
	padding-left: 2em;
	white-space: normal;
}

.message-content pre {
	white-space: pre;
	word-break: normal;
	overflow-wrap: normal;
	tab-size: 4;
	background-color: rgba(0, 0, 0, 0.03);
	padding: 8px 12px;
	border-radius: 8px;
	overflow: auto;
	scrollbar-width: thin;
	scrollbar-color: #ccc transparent;
}

/* 消息输出完成后，限制过长代码/脚本的高度 */
.complete_message .message-content pre {
	max-height: 300px;
}

.message-content pre::-webkit-scrollbar {
	width: 6px;
	height: 6px;
}

.message-content pre::-webkit-scrollbar-track,
.message-content pre::-webkit-scrollbar-corner {
	background: transparent;
}

.message-content pre::-webkit-scrollbar-thumb {
	background-color: #ccc;
	border-radius: 3px;
}

.message-content pre::-webkit-scrollbar-thumb:hover {
	background-color: #aaa;
}

.message-content code {
	background-color: #f6f8fa;
	padding: 2px 4px;
	border-radius: 3px;
	font-size: 12px;
	font-family: Microsoft YaHei;
}

.message-content pre code {
	background: none;
	padding: 0;
	font-family: Consolas, 'Courier New', monospace;
	font-size: 12px;
	line-height: 1.6;
	white-space: break-spaces;
  word-break: break-all;
}

.message-content table {
	border-collapse: collapse;
	margin: 0.5em 0;
}

.message-content th,
.message-content td {
	border: 1px solid #ddd;
	padding: 4px 8px;
	font-size: 12px;
}

.message-content blockquote {
	border-left: 3px solid #ddd;
	padding-left: 1em;
	color: #666;
	margin: 0.4em 0;
}

/* ================= 输入区 ================= */
.input-area {
	background-repeat: no-repeat;
	background-size: contain;
	border-radius: 16px;
	position: relative;
	margin: 0 16px 12px;
}

.input-area::before {
	background: linear-gradient(90deg, #f7b500, #b620e0 25%, #73cbf0 50%, #9156f6 75%, #32c5ff);
	border-radius: 16px;
	content: "";
	position: absolute;
	top: -1px;
	left: -1px;
	right: -1px;
	bottom: -1px;
	z-index: 1;
}

.input-area::after {
	background: linear-gradient(90deg, rgba(247, 181, 0, .3), rgba(182, 32, 224, .3) 25%, rgba(115, 203, 240, .3) 50%, rgba(145, 86, 246, .3) 75%, rgba(50, 197, 255, .3));
	border-radius: 16px;
	content: "";
	filter: blur(10px);
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: -5px;
	opacity: .7;
	transform: translateY(5px);
	z-index: 1;
}

.input-area-content {
	background-color: #fff;
	border-radius: 16px;
	display: flex;
	flex-direction: column;
	height: 100%;
	width: 100%;
	position: relative;
	z-index: 2;
}

.input-area-container {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	overflow: hidden;
	padding: 12px 0;
	position: relative;
}

.user-input {
	min-height: 40px;
	max-height: 500px;
	flex: 1;
	width: 100%;
	border: none;
	outline: none;
	background: transparent;
	font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
	font-size: 16px;
	line-height: 24px;
	color: #212121;
	resize: none;
	overflow-y: auto;
	padding: 0 16px;
}

.btnContainer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 24px;
	padding: 0 16px;
}

.submit-btn {
	display: flex;
	justify-content: center;
	align-items: center;
	width: 24px;
	height: 24px;
	padding: 0;
	border: none;
	background: transparent;
	border-radius: 50%;
	cursor: pointer;
	flex-shrink: 0;
}

.submit-btn:disabled {
	opacity: 0.35;
	cursor: not-allowed;
	pointer-events: none;
}

/* ================= 自动执行开关 & 总结技能按钮 ================= */
.auto-exec-toggle {
	display: flex;
	align-items: center;
	gap: 5px;
}

.auto-exec-toggle button {
	display: flex;
	align-items: center;
	background-color: transparent;
	border: 0;
	padding: 0;
	color: #2970FF;
	font-size: 14px;
	line-height: 1;
	cursor: pointer;
	white-space: nowrap;
	flex-shrink: 0;
}

/* 自动执行开关与右侧按钮的竖线分隔 */
.auto-exec-container-div {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-left: 6px;
	padding-left: 12px;
	border-left: 1px solid rgba(0, 0, 0, 0.12);
	height: 14px;
}

.auto-exec-container {
	margin: 0;
}

.auto-exec-container .input-area-content {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	padding: 0;
	gap: 4px;
}

.aibtn {
	width: 15.333px;
	height: 15.333px;
}

.toggle-label {
	font-size: 12px;
	color: #999;
	cursor: pointer;
	user-select: none;
}

.toggle-switch {
	position: relative;
	display: inline-block;
	width: 28px;
	height: 16px;
	flex-shrink: 0;
}

.toggle-switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

.toggle-slider {
	position: absolute;
	cursor: pointer;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: rgba(0, 0, 0, 0.28);
	border-radius: 16px;
	transition: background-color 0.3s;
}

.toggle-slider::before {
	content: "";
    position: absolute;
    height: 12px;
    width: 12px;
    left: 2px;
    bottom: 2px;
    background-color: #fff;
    border-radius: 50%;
    transition: transform 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
	background-color: #007bff;
}

.toggle-switch input:checked + .toggle-slider::before {
	transform: translateX(12px);
}

/* ================= 时间轴 ================= */
.timeline {
	display: flex;
	flex-direction: column;
}

.tl-node {
	display: flex;
	position: relative;
	padding-bottom: 4px;
}

.tl-node:not(:last-child)::after {
	content: "";
	position: absolute;
	left: 7px;
	top: 32px;
	bottom: 10px;
	width: 1px;
	background-color: #dcd8d8;
}

.tl-node-plain::after {
	display: none !important;
	content: none !important;
}

.tl-dot {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
	margin-top: 5px;
	margin-right: 8px;
	position: relative;
	z-index: 1;
}

.tl-dot-error {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	flex-shrink: 0;
	margin-top: 2px;
	margin-right: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	z-index: 1;
	background-color: #fff;
	border: 2px solid #ff4d4f;
}

.tl-dot-error::after {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background-color: #ff4d4f;
}

.tl-body {
	flex: 1;
	min-width: 0;
	padding-bottom: 8px;
}

.tl-header {
	display: flex;
	align-items: center;
	cursor: pointer;
	padding: 2px 0;
	user-select: none;
	gap: 6px;
}

.tl-title {
	font-size: 14px;
	color: rgba(0, 0, 0, 0.46);
	line-height: 20px;
	font-weight: 600;
}

.tl-toggle {
	font-size: 12px;
	color: #999;
	transition: transform 0.2s;
}

.tl-content {
	display: flex;
	flex-direction: column;
	gap: 8px;
	overflow: hidden;
	transition: max-height 0.3s ease, opacity 0.3s ease;
}

.tl-content-open {
	/*max-height: 5000px; 这里导致AI输出太长时无法显示*/
	opacity: 1;
	margin-top: 6px;
}

.tl-content-closed {
	max-height: 0;
	opacity: 0;
	margin-top: 0;
}

.tl-content-bold {
	font-weight: 600;
	font-size: 14px;
}

.tl-content hr {
	border: 0;
}

.tl-content h2 {
	color: rgba(0, 0, 0, 0.94);
	font-family: "Microsoft YaHei";
	font-size: 16px;
	font-weight: 600;
	line-height: 24px;
}

.tl-content h3 {
	color: rgba(0, 0, 0, 0.94);
	font-family: "Microsoft YaHei";
	font-size: 14px;
	font-weight: 600;
	line-height: 22px;
}

.tl-content p,
.tl-content ol,
.tl-content ul {
	color: rgba(0, 0, 0, 0.94);
	font-weight: 400;
}

/* ================= 工具调用卡片 ================= */
.tl-fc-card {
	background-color: #FFF;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 8px;
	padding: 8px 12px;
	margin-bottom: 12px;
}

.tl-fc-header {
	display: flex;
	align-items: center;
	gap: 8px;
	user-select: none;
}

.tl-fc-icon {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}

.tl-fc-title {
	flex: 1;
	font-size: 12px;
	color: rgba(0, 0, 0, 0.64);
	line-height: 20px;
	font-weight: 400;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.tl-fc-title b {
	font-weight: 600;
	color: rgba(0, 0, 0, 0.88);
}

/* 工具描述问号图标 */
.tl-fc-help {
	width: 14px;
	height: 14px;
	cursor: default;
	flex-shrink: 0;
	user-select: none;
	vertical-align: middle;
	margin: -3px 0 0 5px;
}

/* JS 浮层 tooltip */
#fcHelpTooltip {
	display: none;
	position: fixed;
	z-index: 9999;
	background: #fff;
	color: rgba(0, 0, 0, 0.88);
	font-size: 12px;
	line-height: 1.5;
	padding: 8px 21px;
	border-radius: 3px;
	box-shadow: 0 1px 6px 0 rgba(0, 0, 0, 0.3);
	white-space: normal;
	word-break: break-all;
	width: 240px;
	max-width: 320px;
	pointer-events: none;
	text-align: left;
	font-weight: 400;
	transition: opacity 0.3s ease-out;
	max-height: calc(50vh - 24px);
}

/* 三角形在底部（tooltip 在图标上方，三角指向下） */
#fcHelpTooltip.arrow-below::after {
	content: '';
	position: absolute;
	bottom: -6px;
	left: var(--arrow-left, 50%);
	transform: translateX(-50%);
	border: 6px solid transparent;
	border-bottom: none;
	border-top: 6px solid #fff;
	filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.08));
}

/* 三角形在顶部（tooltip 在图标下方，三角指向上） */
#fcHelpTooltip.arrow-above::after {
	content: '';
	position: absolute;
	top: -6px;
	left: var(--arrow-left, 50%);
	transform: translateX(-50%);
	border: 6px solid transparent;
	border-top: none;
	border-bottom: 6px solid #fff;
	filter: drop-shadow(0 -2px 2px rgba(0, 0, 0, 0.08));
}

.tl-fc-args {
	display: flex;
	padding: 8px 12px;
	justify-content: flex-start;
	align-items: center;
	border-radius: 6px;
	background-color: #FAFBFC;
	color: rgba(0, 0, 0, 0.64);
	font-family: "Microsoft YaHei";
	font-size: 12px;
	font-weight: 400;
	line-height: 18px;
	word-break: break-all;
}

/* 完成后才限制最大高度并允许滚动，避免流式输出中频繁出现滚动条 */
.tl-fc-args-done {
	max-height: 200px;
	overflow-y: auto;
}

/* 工具调用参数悬停复制 */
.tl-fc-args-wrap {
	position: relative;
}

.tl-fc-args-copy {
	position: absolute;
	bottom: -20px;
  left: 6px;
	width: 16px;
	height: 16px;
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.2s;
	background-color: #FAFBFC;
	border-radius: 4px;
	padding: 2px;
	box-sizing: content-box;
}

.tl-fc-args-wrap:hover .tl-fc-args-copy {
	opacity: 1;
}

.tl-fc-args-copy:hover {
	opacity: 0.75;
}

/* ================= 操作按钮 ================= */
.tl-actions {
	display: flex;
	gap: 8px;
	margin-top: 10px;
	flex-wrap: wrap;
}

.tl-fc-card .tl-actions {
	margin-top: 0;
	justify-content: flex-end;
	flex-wrap: nowrap;
}

.tl-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 3px 12px;
	font-size: 12px;
	border-radius: 6px;
	border: 1px solid #D9D9D9;
	background-color: #fff;
	color: #212121;
	cursor: pointer;
	line-height: 1.4;
	transition: all 0.2s;
}

.tl-btn:hover {
	border-color: #999;
	background-color: #fafafa;
}

.tl-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.tl-btn-primary {
	background-color: #fff;
	border-color: #2970FF;
	color: #2970FF;
}

.tl-btn-primary:hover {
	background-color: #f0f5ff;
	border-color: #2970FF;
}

/* 工具卡片内的主按钮为蓝底填充 */
.tl-fc-card .tl-btn-primary {
	background-color: #2970FF;
	border-color: #2970FF;
	color: #fff;
}

.tl-fc-card .tl-btn-primary:hover {
	background-color: #1a5ee6;
	border-color: #1a5ee6;
}

/* ================= 消息操作按钮（复制/删除） ================= */
.tl-msg-actions {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 20px;
}

.tl-msg-action-icon {
	width: 16px;
	height: 16px;
	cursor: pointer;
	transition: opacity 0.2s;
}

.tl-msg-action-icon:hover {
	opacity: 0.8;
}

/* ================= 欢迎区 ================= */
#welcomeContainer {
	overflow: hidden;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
}

.banner-img {
	width: 180px;
  height: 140px;
	margin-top: 48px;
}


.bannerbg-message {
	color: rgba(0, 0, 0, 0.94);
	font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
	font-size: 14px;
	font-weight: 400;
	line-height: 22px;
	margin-top: 16px;
	text-align: center;
}

/* ================= 隐私协议提示页 ================= */
#agreementContainer {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 48px 24px 24px;
}

.agreement-title {
	color: rgba(0, 0, 0, 0.94);
	font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
	font-size: 20px;
	font-weight: 600;
	margin-top: 48px;
}

.agreement-subtitle {
	color: rgba(0, 0, 0, 0.6);
	font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
	font-size: 13px;
	line-height: 20px;
	margin-top: 12px;
}

.agreement-img {
	width: 160px;
	height: auto;
	margin-top: 24px;
}

.agreement-btn {
	margin-top: 16px;
	padding: 8px 20px;
	border: none;
	border-radius: 6px;
	background-color: #2970FF;
	color: #fff;
	font-size: 13px;
	cursor: pointer;
}

.agreement-btn:hover {
	background-color: #1b5fe0;
}

/* ================= 确认弹窗 ================= */
.confirm-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.3);
	z-index: 999;
	justify-content: center;
	align-items: center;
}

.confirm-dialog {
	background: #fff;
	border-radius: 8px;
	width: 320px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
	overflow: hidden;
}

.confirm-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 20px;
}

.confirm-header-left {
	display: flex;
	align-items: center;
	gap: 8px;
}

.confirm-title-icon {
	width: 20px;
	height: 20px;
}

.confirm-header-title {
	font-size: 18px;
	font-weight: 600;
	color: rgba(0, 0, 0, 0.94);
}

.confirm-close {
	width: 16px;
	height: 16px;
	cursor: pointer;
	transition: opacity 0.2s;
}


.confirm-body {
	padding: 20px;
}

.confirm-msg {
	font-size: 16px;
	font-weight: 400;
	color: #000;
	text-align: left;
	line-height: 24px;
	word-break: break-all;
}

.confirm-sub-msg {
	font-size: 12px;
	color: #999;
	text-align: left;
	margin-top: 4px;
	line-height: 18px;
}

.confirm-sub-msg:empty {
	display: none;
}

.confirm-footer {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	padding: 0 16px 14px;
}

.confirm-btn {
	padding: 5px 16px;
	border-radius: 4px;
	font-size: 13px;
	cursor: pointer;
	transition: all 0.2s;
	border: 1px solid #d9d9d9;
	min-width: 60px;
}

.confirm-btn-cancel {
	background: #fff;
	color: #333;
}

.confirm-btn-cancel:hover {
	border-color: #999;
	background: #fafafa;
}

.confirm-btn-ok {
	background: #2970FF;
	color: #fff;
	border-color: #2970FF;
}

.confirm-btn-ok:hover {
	background: #1a5ee6;
	border-color: #1a5ee6;
}

/* ================= 底部声明 ================= */
.footer {
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 6px;
}

.footer-text,
.footer-text1 {
	font-family: "Microsoft YaHei";
	font-size: 12px;
	line-height: 18px;
}

.footer-text {
	color: #999;
	padding-right: 8px;
	border-right: 1px solid #D9D9D9;
}

.footer-text1 {
	color: #2970FF;
	padding-left: 8px;
	cursor: pointer;
}

/* ================= 思考中动画 ================= */
.waiting_tips {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px;
	color: rgba(0, 0, 0, 0.46);
	font-size: 14px;
	white-space: nowrap;
	animation: breathe 1.5s ease-in-out infinite;
}

.waiting_tips .waiting-icon {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}

.waiting_tips::after {
	content: '...';
	display: inline-block;
	width: 0;
	overflow: hidden;
	vertical-align: bottom;
	animation: dots 1.5s steps(3, end) infinite;
}

@keyframes breathe {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.4; }
}

@keyframes dots {
	0% { width: 0; }
	100% { width: 1.2em; }
}

/* ================= Toast 提示 ================= */
.toast-tip {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background-color: rgba(0, 0, 0, 0.7);
	color: #fff;
	padding: 8px 16px;
	border-radius: 6px;
	font-size: 13px;
	z-index: 9999;
	pointer-events: none;
	transition: opacity 0.3s;
}

.toast-tip-hide {
	opacity: 0;
}


/* 用户消息选中高对比度颜色 */
.message.user ::selection,
.message.user::selection,
.message.user .message-content::selection {
    background-color: #FFF;
    color: #2970FF;
}
.message.user ::-moz-selection,
.message.user .message-content::-moz-selection {
    background-color: #FFF;
    color: #2970FF;
}