/* 智愈 web 面 · 共享样式（零构建：原生 CSS，自定义属性 + 亮暗自适应） */
:root {
	--accent: #ff6b1a; /* 赛博橙：与食音兽 CMF 同源（docs/hardware/DESIGN.md §3.1） */
	--bg: #f7f6f3;
	--surface: #ffffff;
	--text: #1c1b19;
	--text-dim: #6f6b64;
	--border: #e4e1db;
	--ok: #1a7f4e;
	--err: #c03221;
	--radius: 14px;
	--shadow: 0 1px 2px rgb(0 0 0 / 4%), 0 8px 32px rgb(0 0 0 / 6%);
}
@media (prefers-color-scheme: dark) {
	:root {
		--bg: #151412;
		--surface: #1f1e1b;
		--text: #ece9e4;
		--text-dim: #96918a;
		--border: #34322e;
		--ok: #4cc38a;
		--err: #ff6a5c;
		--shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 32px rgb(0 0 0 / 30%);
	}
}

* {
	box-sizing: border-box;
}
html {
	height: 100%;
}
body {
	margin: 0;
	min-height: 100%;
	display: grid;
	place-items: center;
	padding: 24px 16px;
	background: var(--bg);
	color: var(--text);
	font:
		15px/1.6 system-ui,
		-apple-system,
		"PingFang SC",
		"Noto Sans CJK SC",
		sans-serif;
	-webkit-font-smoothing: antialiased;
}

.card {
	width: 100%;
	max-width: 420px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 32px 28px 28px;
}

.brand {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 4px;
}
.brand .mark {
	width: 34px;
	height: 34px;
	border-radius: 9px;
	background: var(--accent);
	color: #fff;
	display: grid;
	place-items: center;
	font-size: 17px;
	font-weight: 700;
	letter-spacing: 1px;
	user-select: none;
}
.brand h1 {
	font-size: 18px;
	font-weight: 650;
	margin: 0;
}
.brand .sub {
	color: var(--text-dim);
	font-size: 13px;
	margin-left: auto;
}

p.lead {
	color: var(--text-dim);
	margin: 6px 0 20px;
	font-size: 14px;
}

label {
	display: block;
	font-size: 13px;
	color: var(--text-dim);
	margin-bottom: 6px;
}
input {
	width: 100%;
	padding: 11px 12px;
	font: inherit;
	color: inherit;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 10px;
	outline: none;
	transition:
		border-color 0.15s,
		box-shadow 0.15s;
}
input:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

button {
	font: inherit;
	font-weight: 600;
	border: 0;
	border-radius: 10px;
	padding: 11px 18px;
	cursor: pointer;
	background: var(--accent);
	color: #fff;
	transition:
		filter 0.15s,
		transform 0.05s;
}
button:hover {
	filter: brightness(1.06);
}
button:active {
	transform: translateY(1px);
}
button.ghost {
	background: transparent;
	color: var(--text-dim);
	border: 1px solid var(--border);
	font-weight: 500;
}
button.ghost.on {
	color: var(--accent);
	border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
button.block {
	width: 100%;
	margin-top: 14px;
}
button[disabled] {
	opacity: 0.55;
	cursor: default;
}

.inline-row {
	display: flex;
	gap: 8px;
}
.inline-row input {
	flex: 1;
	min-width: 0;
}
.inline-row button {
	flex: none;
	white-space: nowrap;
}

.status {
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 24px;
	margin: 14px 0 0;
	font-size: 14px;
	color: var(--text-dim);
}
.status .dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--text-dim);
	flex: none;
}
.status.busy .dot {
	background: var(--accent);
	animation: pulse 1.2s ease-in-out infinite;
}
.status.ok {
	color: var(--ok);
}
.status.ok .dot {
	background: var(--ok);
	animation: none;
}
.status.err {
	color: var(--err);
}
.status.err .dot {
	background: var(--err);
	animation: none;
}
@keyframes pulse {
	50% {
		opacity: 0.35;
	}
}

.qr {
	display: grid;
	place-items: center;
	margin: 18px auto 4px;
	min-height: 40px;
}
.qr img {
	border-radius: 10px;
	border: 8px solid #fff; /* 静默区：暗色模式下二维码仍可扫 */
	box-shadow: var(--shadow);
	image-rendering: pixelated;
}
.qr .hint {
	margin-top: 10px;
	font-size: 12.5px;
}
.qr .hint a {
	color: var(--accent);
}

.pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12.5px;
	padding: 3px 10px;
	border-radius: 99px;
	border: 1px solid var(--border);
	color: var(--text-dim);
}
.pill.on {
	color: var(--ok);
	border-color: color-mix(in srgb, var(--ok) 40%, transparent);
}

.row {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 18px;
}
.row .spacer {
	flex: 1;
}

.error-text {
	color: var(--err);
	font-size: 13.5px;
	min-height: 20px;
	margin: 10px 0 0;
}

footer {
	margin-top: 22px;
	padding-top: 14px;
	border-top: 1px solid var(--border);
	font-size: 12px;
	color: var(--text-dim);
	display: flex;
	justify-content: space-between;
}
footer a {
	color: inherit;
}
