:root {
	--bg: #f6f7f9;
	--panel: #ffffff;
	--text: #20242a;
	--muted: #667085;
	--border: #d9dee7;
	--accent: #0f766e;
	--accent-dark: #115e59;
	--danger: #b42318;
	--danger-bg: #fff1f0;
	--code-bg: #111827;
	--code-text: #e5e7eb;
	--keyword: #67e8f9;
	--string: #86efac;
	--number: #fbbf24;
	--comment: #94a3b8;
	--function: #c4b5fd;
	--operator: #fda4af;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	min-height: 100vh;
	background: var(--bg);
	color: var(--text);
	font-family: Arial, "Noto Sans TC", sans-serif;
}

button,
select,
textarea {
	font: inherit;
}

.topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 20px 28px;
	border-bottom: 1px solid var(--border);
	background: var(--panel);
}

.eyebrow {
	display: inline-block;
	margin: 0 0 4px;
	color: var(--muted);
	font-size: 13px;
	text-decoration: none;
}

.eyebrow:hover,
.eyebrow:focus-visible {
	color: var(--accent-dark);
	outline: none;
}

h1,
h2 {
	margin: 0;
	letter-spacing: 0;
}

h1 {
	font-size: 28px;
}

h2 {
	font-size: 16px;
}

.status {
	min-width: 120px;
	padding: 8px 10px;
	border: 1px solid var(--border);
	border-radius: 6px;
	color: var(--muted);
	text-align: center;
	background: #fbfcfe;
}


.tool-menu {
	display: inline-flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 4px;
	padding: 4px;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: #fbfcfe;
}

.tool-menu a {
	min-width: 68px;
	padding: 7px 10px;
	border-radius: 6px;
	color: var(--muted);
	font-size: 14px;
	text-align: center;
	text-decoration: none;
}

.tool-menu a:hover {
	color: var(--text);
	background: #eef2f7;
}

.tool-menu a.is-active {
	color: #ffffff;
	background: var(--accent);
}

.status.is-valid {
	color: var(--accent-dark);
	border-color: #99f6e4;
	background: #ecfdf5;
}

.status.is-error {
	color: var(--danger);
	border-color: #fecaca;
	background: var(--danger-bg);
}

.workspace {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 18px;
	padding: 18px;
	min-height: calc(100vh - 89px);
}

.pane {
	display: flex;
	min-width: 0;
	min-height: 560px;
	flex-direction: column;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--panel);
	overflow: hidden;
}

.pane-header,
.meta-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 12px 14px;
	border-bottom: 1px solid var(--border);
}

.toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

button,
select {
	height: 34px;
	border: 1px solid var(--border);
	border-radius: 6px;
	background: #ffffff;
	color: var(--text);
	cursor: pointer;
}

button {
	padding: 0 12px;
}

button:hover,
select:hover {
	border-color: #9aa4b2;
}

#formatBtn {
	border-color: var(--accent);
	background: var(--accent);
	color: #ffffff;
}

textarea {
	flex: 1;
	width: 100%;
	min-height: 420px;
	padding: 14px;
	border: 0;
	resize: none;
	outline: none;
	color: #1f2937;
	font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
	font-size: 14px;
	line-height: 1.55;
}

.meta-row {
	justify-content: flex-start;
	flex-wrap: wrap;
	color: var(--muted);
	font-size: 13px;
}

.meta-row label:first-of-type {
	margin-left: auto;
}

.check-option {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.check-option input {
	width: 16px;
	height: 16px;
	margin: 0;
}

.output-panel {
	flex: 1;
	margin: 0;
	padding: 14px;
	overflow: auto;
	background: var(--code-bg);
	color: var(--code-text);
	font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
	font-size: 14px;
	line-height: 1.55;
}

.token-keyword {
	color: var(--keyword);
	font-weight: 700;
}

.token-string {
	color: var(--string);
}

.token-number {
	color: var(--number);
}

.token-comment {
	color: var(--comment);
	font-style: italic;
}

.token-function {
	color: var(--function);
}

.token-operator {
	color: var(--operator);
}

@media (max-width: 900px) {
	.topbar {
		align-items: flex-start;
		flex-direction: column;
		padding: 16px;
	}

	.status {
		width: 100%;
		text-align: left;
	}

	.tool-menu {
		width: 100%;
		justify-content: space-between;
	}

	.tool-menu a {
		flex: 1;
	}

	.workspace {
		grid-template-columns: 1fr;
		padding: 12px;
		min-height: auto;
	}

	.pane {
		min-height: 460px;
	}

	.pane-header {
		align-items: flex-start;
		flex-direction: column;
	}

	.meta-row label:first-of-type {
		margin-left: 0;
	}
}
