* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}
html {
	width: 100vw;
	max-width: 100vw;
	overflow-x: hidden;
	scroll-behavior: smooth;
	scrollbar-gutter: stable both-edges;
}
body {
	width: 100vw;
	max-width: 100vw;
	overflow-x: hidden;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
	background: #f7f8fa;
	color: #111;
	transition: background 0.3s, color 0.3s;
}
body.dark {
	background: #1e1e1e;
	color: #eee;
}
body.dark header {
	background: #121212;
	border-bottom-color: #333;
}
body.dark .user {
	background: #2374e1;
}
body.dark .ai,
body.dark .think {
	background: #121212;
	color: #eee;
	box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
body.dark footer {
	background: #121212;
	border-top-color: #333;
}
body.dark footer input {
	background: #2a2a2a;
	border-color: #444;
	color: #eee;
}
html::-webkit-scrollbar {
	width: 6px;
	background: transparent;
}
html::-webkit-scrollbar-track {
	background: rgba(0,0,0,0.02);
}
html::-webkit-scrollbar-thumb {
	background: #ccc;
	border-radius: 3px;
}
html::-webkit-scrollbar-thumb:hover {
	background: #aaa;
}
header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: 56px;
	background: #ffffff;
	border-bottom: 1px solid #e5e5e5;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10;
	padding: 0 16px;
}
.menu {
	position: absolute;
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	border-radius: 6px;
	background: transparent;
	border: none;
	font-size: 20px;
	color: #1677ff;
}
body.dark .menu {
	color: #fff;
}
.git-link {
	position: absolute;
	right: 16px;
	top: 50%;
	transform: translateY(-50%);
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 6px;
	color: #1677ff;
	font-size: 20px;
	text-decoration: none;
	transition: color 0.2s;
}
body.dark .git-link {
	color: #fff;
}
.git-link:hover {
	color: #1568c8;
}
.logo {
	text-decoration: none;
	font-size: 20px;
	font-weight: 700;
	color: #1677ff;
}
nav {
	position: fixed;
	top: 56px;
	left: 12px;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 4px 16px rgba(0,0,0,0.12);
	overflow: hidden;
	z-index: 11;
	min-width: 160px;
	display: none;
}
body.dark nav {
	background: #121212;
	box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
nav.show {
	display: block;
}
.item {
	text-decoration: none;
	padding: 14px 18px;
	cursor: pointer;
	font-size: 15px;
	transition: background 0.2s;
	display: flex;
	align-items: center;
	gap: 12px;
}
body.dark .item {
	color: #eee;
}
.item:hover {
	background: #f0f2f5;
	color: #1677ff;
}
body.dark .item:hover {
	background: #2a2a2a;
}
.item a {
	text-decoration: none;
	color: inherit;
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
}
.item i {
	width: 20px;
	text-align: center;
	font-size: 17px;
	flex-shrink: 0;
}
.sub {
	background: #f7f8fa;
	display: none;
}
.sub a  {
	text-decoration: none;
	color: black;
}
body.dark .sub {
	background: #272727;
}
.sub.open {
	display: block;
}
.active {
	color: #1677ff;
	font-weight: 600;
}
body.dark .active {
	color: #4096ff;
}
main {
	padding: 16px;
	padding-top: 72px;
	padding-bottom: 80px;
	min-height: 100vh;
	overflow-y: visible;
	background: transparent;
}
.msg {
	margin: 12px 0;
	padding: 12px 16px;
	border-radius: 18px;
	line-height: 1.6;
	font-size: 15px;
	word-wrap: break-word;
}
.user {
	background: #1677ff;
	color: #fff;
	margin-left: auto;
	margin-right: 0;
	text-align: left;
	border-bottom-right-radius: 4px;
	max-width: 70%;
	width: fit-content;
}
.ai {
	background: #ffffff;
	color: #111;
	margin-right: auto;
	margin-left: 0;
	border-bottom-left-radius: 4px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
	max-width: 100%;
	width: 100%;
}
.think {
	font-style: italic;
	color: #666;
	margin-right: auto;
	margin-left: 0;
	text-align: left;
	background: #ffffff;
	padding: 12px 16px;
	border-radius: 18px;
	border-bottom-left-radius: 4px;
	max-width: 100%;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
	width: 100%;
}
body.dark .think {
	color: #aaa;
}
.tip {
	font-size: 13px;
	color: #888;
	margin-top: 6px;
}
.ai h1,
.ai h2,
.ai h3 {
	margin: 10px 0 6px;
	color: #111;
	font-weight: 600;
}
body.dark .ai h1,
body.dark .ai h2,
body.dark .ai h3 {
	color: #eee;
}
.ai p {
	margin: 8px 0;
}
.ai ul,
.ai ol {
	padding-left: 22px;
	margin: 8px 0;
}
.ai code {
	background: #f5f5f5;
	padding: 2px 6px;
	border-radius: 4px;
	font-family: monospace;
	font-size: 14px;
}
body.dark .ai code {
	background: #2d2d2d;
}
.ai pre {
	background: #1e1e1e;
	color: #dcdcdc;
	padding: 12px;
	border-radius: 8px;
	overflow-x: auto;
	margin: 10px 0;
}
.ai pre code {
	background: none;
	color: inherit;
	padding: 0;
}
.ai blockquote {
	border-left: 4px solid #1677ff;
	padding-left: 12px;
	margin: 10px 0;
	color: #666;
	font-style: italic;
}
body.dark .ai blockquote {
	color: #aaa;
}
footer {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 12px 16px;
	background: #ffffff;
	border-top: 1px solid #e5e5e5;
	display: flex;
	align-items: center;
}
footer input {
	flex: 1;
	min-width: 0;
	height: 44px;
	padding: 0 16px;
	border: 1px solid #ddd;
	border-radius: 22px;
	background: #f7f8fa;
	color: #111;
	font-size: 16px;
	outline: none;
	margin-right: 12px;
}
footer input:focus {
	border-color: #1677ff;
	background: #ffffff;
}
#send {
	flex-shrink: 0;
	width: 44px;
	height: 44px;
	border: none;
	border-radius: 50%;
	background: #1677ff;
	color: #fff;
	cursor: pointer;
	transition: background 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
}
#send i {
	font-size: 18px;
}
#send:hover {
	background: #1568c8;
}
#send:active {
	background: #1258a8;
}