@font-face {
	font-family: "DingTalk JinBuTi";
	src: url("../fonts/DingTalkJinBuTi.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Douyin Sans";
	src: url("../fonts/DouyinSansBold.woff2") format("woff2");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

:root {
	--bg-0: #f3f7f5;
	--bg-1: #eaf3ef;
	--bg-2: #ffffff;
	--glass: rgba(255, 255, 255, 0.78);
	--glass-strong: rgba(255, 255, 255, 0.92);
	--border: rgba(20, 40, 35, 0.1);
	--border-strong: rgba(14, 168, 110, 0.4);
	--text: #1a2b26;
	--text-muted: #5f736b;
	--accent: #0ea86e;
	--accent-hover: #0c935f;
	--accent-dim: rgba(14, 168, 110, 0.12);
	--accent-glow: rgba(14, 168, 110, 0.28);
	--danger: #e5484d;
	--on-accent: #ffffff;
	--radius: 16px;
	--radius-sm: 10px;
	--font-ui: "DingTalk JinBuTi", "PingFang SC", "Microsoft YaHei", sans-serif;
	--font-brand: "Douyin Sans", "DingTalk JinBuTi", "PingFang SC", sans-serif;
	--font-mono: "Cascadia Code", "Consolas", "SF Mono", monospace;
	--shadow: 0 10px 36px rgba(26, 43, 38, 0.08);
	--header-h: 64px;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

html,
body {
	padding: 0 !important;
	margin: 0 !important;
	min-height: 100%;
	width: 100%;
	color: var(--text) !important;
	font-family: var(--font-ui) !important;
	background: var(--bg-0) !important;
	-webkit-font-smoothing: antialiased;
	line-height: 1.5 !important;
}

h1, h2, h3, h4, h5, h6,
p, label, button, input, textarea, a, span {
	font-family: inherit;
}

h1, h2, h3 {
	color: var(--text);
}

body {
	background:
		radial-gradient(ellipse 70% 45% at 12% -8%, rgba(14, 168, 110, 0.14), transparent 52%),
		radial-gradient(ellipse 55% 40% at 92% 8%, rgba(64, 148, 220, 0.1), transparent 48%),
		radial-gradient(ellipse 50% 28% at 50% 100%, rgba(14, 168, 110, 0.08), transparent 42%),
		linear-gradient(180deg, #f7fbf9 0%, var(--bg-0) 40%, var(--bg-1) 100%) !important;
	background-attachment: fixed !important;
}

body::before {
	content: "";
	position: fixed;
	inset: 0;
	pointer-events: none;
	opacity: 0.45;
	background-image:
		linear-gradient(rgba(26, 43, 38, 0.035) 1px, transparent 1px),
		linear-gradient(90deg, rgba(26, 43, 38, 0.035) 1px, transparent 1px);
	background-size: 48px 48px;
	mask-image: radial-gradient(ellipse at center, black 25%, transparent 78%);
	z-index: 0;
}

a {
	color: var(--accent);
	text-decoration: none;
	transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
	color: var(--accent-hover);
}

.glass {
	background: var(--glass);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	backdrop-filter: blur(18px);
	-webkit-backdrop-filter: blur(18px);
}

/* Header */
.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	padding: 12px 24px;
	min-height: 60px;
	background: rgba(255, 255, 255, 0.78);
	border-bottom: 1px solid transparent;
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	transition: border-color 0.2s ease, background 0.2s ease;
	box-sizing: border-box;
}

.site-header.is-compact {
	/* Keep size stable to avoid sticky scroll flicker */
	border-bottom-color: var(--border);
	background: rgba(255, 255, 255, 0.94);
}

.site-header__inner {
	max-width: 1280px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	gap: 20px;
	flex-wrap: wrap;
	min-height: 36px;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--text);
	text-decoration: none;
}

.brand:hover {
	color: var(--text);
}

.brand__logo {
	width: 36px;
	height: 36px;
	border-radius: 9px;
	display: block;
	flex-shrink: 0;
	box-shadow: 0 4px 14px var(--accent-glow);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.brand:hover .brand__logo {
	transform: translateY(-1px);
	box-shadow: 0 6px 18px var(--accent-glow);
}

.brand__text {
	font-family: var(--font-brand);
	font-size: 1.35rem;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.site-header__tagline {
	margin: 0;
	color: var(--text-muted);
	font-size: 0.875rem;
}

/* Page shell */
.page {
	position: relative;
	z-index: 1;
	max-width: 1280px;
	margin: 0 auto;
	padding: 28px 24px 64px;
}

.hero {
	text-align: center;
	margin-bottom: 24px;
	animation: fade-up 0.5s ease both;
}

.hero__title {
	margin: 0 0 10px;
	font-family: var(--font-brand);
	font-size: clamp(1.6rem, 3vw, 2.1rem);
	font-weight: 700;
	letter-spacing: 0.02em;
	line-height: 1.25;
}

.hero__desc {
	margin: 0 auto;
	max-width: 620px;
	color: var(--text-muted);
	font-size: 0.95rem;
	line-height: 1.6;
}

@keyframes fade-up {
	from { opacity: 0; transform: translateY(12px); }
	to { opacity: 1; transform: translateY(0); }
}

/* Workspace — do NOT override React editor heights (uses calc(100vh - 63px)) */
.workspace-panel {
	padding: 0;
	animation: fade-up 0.55s ease 0.08s both;
	overflow: hidden;
	border-radius: var(--radius);
	/* solid surface: backdrop-filter can break Monaco hit-testing in some browsers */
	background: var(--glass-strong);
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
}

#myMainDiv {
	width: 100%;
	max-width: 100%;
	border-radius: inherit;
	overflow: hidden;
}

#myMainDiv > #__next {
	width: 100%;
	max-width: 100%;
}

.editor-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 320px;
	padding: 48px 16px;
	color: var(--text-muted);
	font-size: 0.95rem;
	letter-spacing: 0.02em;
}

.editor-loading::after {
	content: "";
	width: 18px;
	height: 18px;
	margin-left: 10px;
	border: 2px solid var(--border);
	border-top-color: var(--accent);
	border-radius: 50%;
	animation: spin 0.7s linear infinite;
}

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

/* About */
.about {
	margin-top: 48px;
	animation: fade-up 0.55s ease 0.12s both;
}

.about__title {
	margin: 0 0 20px;
	text-align: center;
	font-family: var(--font-brand);
	font-size: 1.25rem;
}

.about__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
}

.about-card {
	padding: 22px 20px;
	transition: transform 0.25s ease, border-color 0.25s ease;
}

.about-card:hover {
	transform: translateY(-3px);
	border-color: var(--border-strong);
}

.about-card__icon {
	width: 48px;
	height: 48px;
	margin-bottom: 14px;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--accent-dim);
	border: 1px solid rgba(14, 168, 110, 0.2);
	color: var(--accent);
}

.about-card__icon svg {
	width: 24px;
	height: 24px;
	display: block;
}

.about-card h3 {
	margin: 0 0 8px;
	font-size: 1.05rem;
	color: var(--text);
	font-weight: 600;
}

.about-card p {
	margin: 0;
	font-size: 0.875rem;
	line-height: 1.55;
	color: var(--text-muted);
}

.related {
	margin-top: 28px;
	text-align: center;
	color: var(--text-muted);
	font-size: 0.9rem;
}

.related a {
	margin-left: 6px;
	font-weight: 600;
}

/* To top */
.to-top {
	position: fixed;
	right: 18px;
	bottom: 24px;
	z-index: 90;
	width: 42px;
	height: 42px;
	border-radius: 12px;
	border: 1px solid var(--border);
	background: var(--glass-strong);
	color: var(--text-muted);
	backdrop-filter: blur(12px);
	cursor: pointer;
	opacity: 0;
	pointer-events: none;
	transform: translateY(8px);
	transition: opacity 0.25s ease, transform 0.25s ease, color 0.2s ease, border-color 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.to-top.is-visible {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0);
}

.to-top:hover {
	color: var(--accent);
	border-color: var(--border-strong);
}

.to-top svg {
	width: 18px;
	height: 18px;
}

/* Footer */
.site-footer {
	position: relative;
	z-index: 1;
	border-top: 1px solid var(--border);
	background: rgba(255, 255, 255, 0.85);
	padding: 20px 24px;
}

.site-footer__inner {
	max-width: 1280px;
	margin: 0 auto;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.site-footer a {
	color: var(--text-muted);
	font-size: 0.85rem;
}

.site-footer a:hover {
	color: var(--accent);
}

.site-footer__links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
}

/* Responsive */
@media screen and (max-width: 900px) {
	.about__grid {
		grid-template-columns: 1fr;
	}
}

@media screen and (max-width: 560px) {
	.page {
		padding: 20px 14px 48px;
	}

	.site-header {
		padding: 12px 14px;
	}

	.site-header__tagline {
		display: none;
	}

	.hero__title {
		font-size: 1.4rem;
	}
}
