/* ===== 沙箱聊天界面 - 浅色主题 ===== */
.sandbox-chat {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: #f8f9fa;
	color: #1f2937;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---- 头部 ---- */
.sandbox-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 16px;
	border-bottom: 1px solid #e5e7eb;
	background: #fff;
	flex-shrink: 0;
}
.sandbox-header-left { display: flex; align-items: center; gap: 10px; }
.sandbox-agent-info { display: flex; align-items: center; gap: 8px; }
.sandbox-agent-name { font-size: .9rem; font-weight: 600; color: #1f2937; }
.sandbox-agent-status {
	font-size: .72rem;
	color: #22c55e;
	display: flex;
	align-items: center;
	gap: 4px;
}
.badge-pro {
	font-size: .62rem;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: 3px;
	background: linear-gradient(135deg, #FF6A2B, #FF8E53);
	color: #fff;
	letter-spacing: .5px;
}

/* ---- 消息区 ---- */
.sandbox-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.sandbox-messages::-webkit-scrollbar { width: 4px; }
.sandbox-messages::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }

/* 消息气泡 */
.msg { display: flex; max-width: 90%; }
.msg-user { align-self: flex-end; }
.msg-agent { align-self: flex-start; }
.msg-content { padding: 10px 14px; border-radius: 12px; font-size: .85rem; line-height: 1.6; }
.msg-content p { margin: 0; }
.msg-content strong { color: #FF6A2B; }
.msg-content code {
	background: rgba(0,0,0,0.06);
	padding: 2px 6px;
	border-radius: 3px;
	font-size: .8rem;
	font-family: 'SF Mono', 'Consolas', monospace;
}

/* 用户气泡 */
.user-bubble {
	background: linear-gradient(135deg, #FF6A2B, #e85d1e);
	color: #fff;
	border-bottom-right-radius: 4px;
}

/* Agent 气泡 */
.agent-bubble {
	background: #fff;
	color: #1f2937;
	border: 1px solid #e5e7eb;
	border-bottom-left-radius: 4px;
	box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* 打字指示器 */
.typing-indicator .agent-bubble { padding: 12px 16px; }
.typing-dots { display: flex; gap: 4px; align-items: center; }
.typing-dots span {
	width: 6px; height: 6px;
	border-radius: 50%;
	background: #9ca3af;
	animation: typingBounce 1.4s infinite ease-in-out both;
}
.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: 0.16s; }
.typing-dots span:nth-child(3) { animation-delay: 0.32s; }
@keyframes typingBounce {
	0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
	40% { transform: scale(1); opacity: 1; }
}

/* ---- 输入区 ---- */
.sandbox-input-area {
	flex-shrink: 0;
	padding: 12px 16px 12px;
	border-top: 1px solid #e5e7eb;
	background: #fff;
}

/* 工具栏 */
.input-toolbar {
	display: flex;
	align-items: center;
	gap: 2px;
	padding: 0 0 6px;
}
.toolbar-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px; height: 30px;
	border: none;
	border-radius: 6px;
	background: transparent;
	color: #9ca3af;
	cursor: pointer;
	transition: all 0.2s;
}
.toolbar-btn:hover:not(:disabled) {
	background: #f3f4f6;
	color: #FF6A2B;
}
.toolbar-btn:disabled {
	opacity: 0.25;
	cursor: not-allowed;
}
.toolbar-divider {
	width: 1px; height: 16px;
	background: #e5e7eb;
	margin: 0 4px;
}

/* 上传预览 */
.upload-preview {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	padding: 0 0 6px;
}
.upload-preview-item {
	position: relative;
	width: 56px; height: 56px;
	border-radius: 8px;
	overflow: hidden;
	border: 1px solid #e5e7eb;
}
.upload-preview-item img {
	width: 100%; height: 100%;
	object-fit: cover;
}
.upload-preview-remove {
	position: absolute;
	top: 2px; right: 2px;
	width: 18px; height: 18px;
	border-radius: 50%;
	border: none;
	background: rgba(0,0,0,0.5);
	color: #fff;
	font-size: .7rem;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

/* 输入框容器（QQ风格：大文本框 + 右下角发送按钮） */
.input-row {
	position: relative;
	display: flex;
	flex-direction: column;
}
.input-row textarea {
	width: 100%;
	padding: 10px 14px;
	padding-bottom: 38px;
	border-radius: 10px;
	border: 1px solid #e5e7eb;
	background: #f9fafb;
	color: #1f2937;
	font-size: .88rem;
	line-height: 1.55;
	resize: none;
	outline: none;
	min-height: 90px;
	max-height: 160px;
	font-family: inherit;
	transition: border-color 0.2s;
	box-sizing: border-box;
}
.input-row textarea:focus {
	border-color: #FF6A2B;
	background: #fff;
}
.input-row textarea::placeholder {
	color: #9ca3af;
}
.input-row textarea:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

/* 发送按钮（右下角，悬浮在文本框内） */
.input-send-btn {
	position: absolute;
	right: 8px;
	bottom: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px; height: 32px;
	border: none;
	border-radius: 8px;
	background: linear-gradient(135deg, #FF6A2B, #e85d1e);
	color: #fff;
	cursor: pointer;
	transition: all 0.2s;
	flex-shrink: 0;
}
.input-send-btn:hover:not(:disabled) {
	transform: scale(1.08);
	box-shadow: 0 2px 10px rgba(255,106,43,0.35);
}
.input-send-btn:disabled {
	opacity: 0.3;
	cursor: not-allowed;
	transform: none;
}
.input-send-btn.loading {
	animation: sendPulse 1s infinite;
	pointer-events: none;
}
@keyframes sendPulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.5; }
}

/* 输入提示 */
.sandbox-input-hint {
	font-size: .68rem;
	color: #9ca3af;
	text-align: right;
	padding-top: 4px;
	padding-right: 2px;
}
/* ===== 沙箱启动按钮（替换原占位符） ===== */
.sandbox-start-container {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	min-height: 300px;
	padding: 40px;
}

.sandbox-start-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	padding: 32px 48px;
	background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
	border: 2px solid #e5e7eb;
	border-radius: 24px;
	cursor: pointer;
	transition: all 0.3s ease;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
	max-width: 480px;
	width: 100%;
}

.sandbox-start-btn:hover {
	transform: translateY(-4px);
	border-color: #FF6A2B;
	box-shadow: 0 12px 48px rgba(255, 106, 43, 0.15);
	background: linear-gradient(135deg, #fff 0%, #fff5f0 100%);
}

.start-btn-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	background: linear-gradient(135deg, #FF4D00, #FF6A2B);
	border-radius: 50%;
	color: #fff;
	box-shadow: 0 8px 24px rgba(255, 77, 0, 0.3);
	transition: all 0.3s ease;
}

.sandbox-start-btn:hover .start-btn-icon {
	transform: scale(1.1);
	box-shadow: 0 12px 32px rgba(255, 77, 0, 0.4);
}

.start-btn-text {
	font-size: 1.25rem;
	font-weight: 700;
	color: #1f2937;
	text-align: center;
}

.start-btn-subtext {
	font-size: 0.9rem;
	color: #6b7280;
	text-align: center;
	margin-top: -8px;
}

/* ===== 沙箱底部操作栏 ===== */
.sandbox-actions {
	display: flex;
	gap: 6px;
	padding: 8px 12px;
	border-top: 1px solid #e5e7eb;
	background: #fff;
	flex-shrink: 0;
}

.sandbox-action-btn {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	padding: 8px 4px;
	background: #f3f4f6;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	color: #4b5563;
	font-size: .75rem;
	font-weight: 500;
	text-decoration: none;
	cursor: pointer;
	transition: all 0.2s;
}

.sandbox-action-btn:hover,
.sandbox-action-btn:active {
	background: #eef2ff;
	border-color: #c7d2fe;
	color: #4f46e5;
}

.sandbox-action-back {
	background: linear-gradient(135deg, #FF4D00, #FF6A2B);
	border-color: transparent;
	color: #fff;
}

.sandbox-action-back:hover,
.sandbox-action-back:active {
	background: linear-gradient(135deg, #E04400, #FF5A1B);
	border-color: transparent;
	color: #fff;
}
