body {
	width: 380px;
	margin: 0;
	padding: 16px;
	font-family: system-ui, -apple-system, sans-serif;
}

.container {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

h1 {
	margin: 0;
	font-size: 20px;
	color: #333;
}

.input-area textarea {
	width: 100%;
	padding: 12px;
	border: 1px solid #ddd;
	border-radius: 6px;
	resize: vertical;
	font-size: 14px;
	box-sizing: border-box;
}

.input-area textarea:focus {
	outline: none;
	border-color: #4caf50;
}

.primary-btn {
	background: #4caf50;
	color: white;
	border: none;
	padding: 10px 20px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
}

.primary-btn:hover {
	background: #45a049;
}

.result-area {
	background: #f5f5f5;
	border-radius: 6px;
	padding: 12px;
	max-height: 300px;
	overflow-y: auto;
	scroll-behavior: smooth;
}

.result-area::-webkit-scrollbar {
	width: 8px;
}

.result-area::-webkit-scrollbar-track {
	background: #f1f1f1;
	border-radius: 4px;
}

.result-area::-webkit-scrollbar-thumb {
	background: #888;
	border-radius: 4px;
}

.result-area::-webkit-scrollbar-thumb:hover {
	background: #666;
}

.result-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
	color: #666;
	font-size: 14px;
}

.icon-btn {
	background: none;
	border: none;
	color: #4caf50;
	cursor: pointer;
	padding: 4px 8px;
	font-size: 14px;
}

.icon-btn:hover {
	text-decoration: underline;
}

.result-content {
	color: #333;
	line-height: 1.5;
	font-size: 14px;
	overflow-wrap: break-word;
}

.result-content p {
	margin: 0.5em 0;
}

.result-content code {
	background: #f5f5f5;
	padding: 0.2em 0.4em;
	border-radius: 3px;
	font-size: 0.9em;
	font-family: monospace;
}

.result-content pre {
	background: #f5f5f5;
	padding: 1em;
	border-radius: 6px;
	overflow-x: auto;
	margin: 0.5em 0;
}

.result-content pre code {
	background: none;
	padding: 0;
	font-size: 13px;
}

.result-content blockquote {
	margin: 0.5em 0;
	padding-left: 1em;
	border-left: 4px solid #ddd;
	color: #666;
}

.result-content h1,
.result-content h2,
.result-content h3 {
	margin: 1em 0 0.5em;
	font-weight: 600;
	line-height: 1.3;
}

.result-content h1 {
	font-size: 1.5em;
}

.result-content h2 {
	font-size: 1.3em;
}

.result-content h3 {
	font-size: 1.1em;
}

.result-content ul,
.result-content ol {
	margin: 0.5em 0;
	padding-left: 1.5em;
}

.result-content li {
	margin: 0.3em 0;
}

.footer {
	display: flex;
	justify-content: flex-end;
	border-top: 1px solid #eee;
	padding-top: 12px;
}

.text-btn {
	background: none;
	border: none;
	color: #666;
	cursor: pointer;
	padding: 4px 8px;
	font-size: 14px;
}

.text-btn:hover {
	color: #333;
}

.error {
	color: #d32f2f;
	margin: 0;
	padding: 16px;
	background: #ffebee;
	border-radius: 8px;
	text-align: center;
	font-size: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.error::before {
	content: "⚠️";
}

.result-section {
	margin-bottom: 16px;
	padding: 12px;
	border-radius: 6px;
	background: #fff;
}

.result-section:last-child {
	margin-bottom: 0;
}

.result-label {
	font-size: 12px;
	color: #666;
	margin-bottom: 8px;
	font-weight: 500;
}

#reasoningText {
	color: #666;
	line-height: 1.5;
	font-size: 0.95em;
	background: #f8f9fa;
	padding: 12px;
	border-radius: 4px;
	border-left: 3px solid #6c757d;
}

#translatedText {
	color: #333;
	line-height: 1.5;
	font-weight: 500;
}

/* 历史记录模态框样式 */
.modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.5);
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.modal-content {
	background-color: white;
	border-radius: 8px;
	width: 90%;
	max-height: 80%;
	display: flex;
	flex-direction: column;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.modal-header {
	padding: 12px 16px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-bottom: 1px solid #eee;
}

.modal-header h2 {
	margin: 0;
	font-size: 18px;
}

.close-modal {
	font-size: 24px;
	cursor: pointer;
	color: #666;
}

.modal-body {
	padding: 16px;
	overflow-y: auto;
	flex-grow: 1;
}

/* 历史记录面板样式 */
.history-panel {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: #f9f9f9;
	z-index: 1000;
	display: none;
	flex-direction: column;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.history-panel.visible {
	opacity: 1;
}

.history-panel-header {
	padding: 8px 12px;
	display: flex;
	align-items: center;
	border-bottom: 1px solid #eaeaea;
	background-color: #fff;
	position: sticky;
	top: 0;
	z-index: 10;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.history-panel-title {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 15px;
	margin-right: 8px;
}

.history-panel-title h2 {
	margin: 0;
	font-size: 15px;
	font-weight: 500;
	color: #333;
}

.back-button {
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	width: 20px;
	height: 20px;
	color: #505050;
	background: transparent;
	transition: color 0.2s;
}

.back-button:hover {
	color: #000;
}

.history-search-container {
	flex: 1;
	position: relative;
	max-width: 300px;
}

.history-search {
	padding: 7px 12px;
	border: 1px solid #e0e0e0;
	border-radius: 16px;
	font-size: 12px;
	width: 100%;
	background-color: #f7f7f7;
	transition: all 0.2s;
	box-sizing: border-box;
	color: #444;
}

.history-search::placeholder {
	color: #999;
	opacity: 0.9;
}

.history-search:focus {
	outline: none;
	border-color: #4caf50;
	background-color: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.history-panel-content {
	padding: 12px 12px 64px; /* 增加底部填充，为底部导航留出空间 */
	overflow-y: auto;
	flex-grow: 1;
}

/* 底部操作按钮栏 */
.history-panel-footer {
	position: fixed;
	bottom: 0;
	left: 0;
	width: 100%;
	background-color: #fff;
	border-top: 1px solid #e8e8e8;
	padding: 6px 0;
	display: flex;
	justify-content: space-around;
	box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05);
	z-index: 10;
	box-sizing: border-box;
}

.footer-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	padding: 4px 0;
	width: 33.33%;
	color: #666;
	cursor: pointer;
	border: none;
	background: transparent;
	font-size: 11px;
	transition: color 0.2s;
}

.footer-btn:hover {
	color: #4caf50;
}

.footer-btn-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 1px;
}

/* 视觉要素统一优化 */
.footer-btn svg, .back-button svg {
	opacity: 0.85;
}

.footer-btn:hover svg, .back-button:hover svg {
	opacity: 1;
}

#clearHistory {
	color: #f44336;
}

#clearHistory:hover {
	color: #d32f2f;
}

#exportHistory, #importHistory {
	color: #2196f3;
}

#exportHistory:hover, #importHistory:hover {
	color: #1976d2;
}

/* 历史记录项样式 */
.history-item {
	padding: 10px 12px;
	margin-bottom: 8px;
	border-radius: 8px;
	background: #fff;
	cursor: pointer;
	border-left: 3px solid #4caf50;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
	transition: box-shadow 0.15s, border-left-color 0.2s;
	animation: fadeIn 0.3s ease backwards;
	position: relative;
	overflow: hidden;
}

.history-item:last-child {
	margin-bottom: 0;
}

.history-item:hover {
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
	border-left-color: #2e7d32;
}

.history-item-title {
	font-weight: 500;
	margin-bottom: 4px;
	color: #333;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	font-size: 13px;
}

.history-meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 6px;
}

.history-item-time {
	font-size: 11px;
	color: #999;
}

.history-actions {
	display: flex;
	gap: 4px;
}

.history-action-btn {
	background: none;
	border: none;
	cursor: pointer;
	padding: 2px 6px;
	font-size: 11px;
	border-radius: 4px;
	transition: all 0.2s;
	opacity: 0.85;
}

.history-action-btn.history-restore {
	color: #4caf50;
}

.history-action-btn.history-delete {
	color: #f44336;
}

.history-action-btn:hover {
	text-decoration: none;
	background-color: rgba(0, 0, 0, 0.05);
	opacity: 1;
}

.history-action-btn.history-restore:hover {
	background-color: rgba(76, 175, 80, 0.1);
}

.history-action-btn.history-delete:hover {
	background-color: rgba(244, 67, 54, 0.1);
}

.history-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-top: 4px;
}

.history-tag {
	background: #e8f5e9;
	color: #2e7d32;
	padding: 1px 6px;
	border-radius: 10px;
	font-size: 10px;
	font-weight: 500;
}

.empty-history {
	text-align: center;
	color: #888;
	padding: 10px 0;
	font-size: 14px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
}

.empty-history:before {
	content: "📜";
	font-size: 40px;
	margin-bottom: 8px;
	opacity: 0.6;
}

/* 修改滚动条样式 */
.history-panel-content::-webkit-scrollbar {
	width: 4px;
}

.history-panel-content::-webkit-scrollbar-track {
	background: transparent;
}

.history-panel-content::-webkit-scrollbar-thumb {
	background: rgba(0, 0, 0, 0.15);
	border-radius: 4px;
}

.history-panel-content::-webkit-scrollbar-thumb:hover {
	background: rgba(0, 0, 0, 0.25);
}

/* 修改按钮样式 */
.history-panel-actions .text-btn {
	padding: 5px 8px;
	border-radius: 4px;
	font-size: 13px;
	transition: all 0.2s;
	color: #4caf50;
	opacity: 0.85;
}

.history-panel-actions .text-btn:hover {
	background-color: rgba(76, 175, 80, 0.1);
	opacity: 1;
}

/* 清除历史按钮特殊样式 */
#clearHistory {
	color: #f44336;
}

#clearHistory:hover {
	background-color: rgba(244, 67, 54, 0.1);
}

/* 导入导出按钮样式 */
#exportHistory, #importHistory {
	color: #2196f3;
}

#exportHistory:hover, #importHistory:hover {
	background-color: rgba(33, 150, 243, 0.1);
}

/* 加载中状态样式 */
.loading {
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 60px 20px;
	color: #777;
	font-size: 14px;
}

.loading::after {
	content: '';
	display: inline-block;
	width: 14px;
	height: 14px;
	margin-left: 10px;
	border: 2px solid #eee;
	border-top-color: #4caf50;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

/* 添加历史记录项动画效果 */
@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* 给每个条目添加递增的延迟 */
.history-item:nth-child(1) { animation-delay: 0.05s; }
.history-item:nth-child(2) { animation-delay: 0.1s; }
.history-item:nth-child(3) { animation-delay: 0.15s; }
.history-item:nth-child(4) { animation-delay: 0.2s; }
.history-item:nth-child(5) { animation-delay: 0.25s; }
.history-item:nth-child(6) { animation-delay: 0.3s; }
.history-item:nth-child(7) { animation-delay: 0.35s; }
.history-item:nth-child(8) { animation-delay: 0.4s; }
.history-item:nth-child(9) { animation-delay: 0.45s; }
.history-item:nth-child(10) { animation-delay: 0.5s; }

/* 删除动画 */
@keyframes deleteShake {
	0% { transform: translateX(0); }
	20% { transform: translateX(-5px); }
	40% { transform: translateX(5px); }
	60% { transform: translateX(-3px); }
	80% { transform: translateX(3px); }
	100% { transform: translateX(0); }
}

.history-item.deleting {
	animation: deleteShake 0.4s ease-in-out;
	border-left-color: #f44336;
}

/* 恢复动画 */
@keyframes restoreHighlight {
	0% { background-color: rgba(76, 175, 80, 0.2); }
	100% { background-color: #fff; }
}

.history-item.restoring {
	animation: restoreHighlight 1s ease;
}

/* 提示框样式 */
.toast {
	position: fixed;
	bottom: 80px;
	left: 50%;
	transform: translateX(-50%) translateY(20px);
	padding: 10px 16px;
	border-radius: 8px;
	background-color: rgba(0, 0, 0, 0.7);
	color: white;
	font-size: 14px;
	text-align: center;
	z-index: 1000;
	opacity: 0;
	transition: transform 0.3s ease, opacity 0.3s ease;
	pointer-events: none;
}

.toast.show {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

.toast.success-toast {
	background-color: rgba(76, 175, 80, 0.9);
}

.toast.error-toast {
	background-color: rgba(244, 67, 54, 0.9);
}

/* 页面滑入动画 */
@keyframes slideUpIn {
	from {
		transform: translateY(15px);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

.history-panel.visible .history-panel-content {
	animation: slideUpIn 0.25s ease forwards;
}

/* 添加分割线 */
.footer-btn + .footer-btn {
	position: relative;
}

.footer-btn + .footer-btn::before {
	content: '';
	position: absolute;
	left: 0;
	top: 20%;
	height: 60%;
	width: 1px;
	background-color: rgba(0, 0, 0, 0.08);
}

/* 历史记录数量限制提示 */
.history-limit-hint {
	text-align: center;
	color: #999;
	font-size: 11px;
	padding: 12px 0 16px;
	margin-top: 12px;
	border-top: 1px dashed #e0e0e0;
}

/* 空历史记录状态下的提示 */
.empty-state-container {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 200px;
}

.empty-state-container .history-limit-hint {
	margin-top: -5px;
	border-top: none;
	padding-top: 0;
}
