:root {
	--bg: #f7f7fa;
	--ink: #111827;
	--muted: #6b7280;
	--line: rgba(17, 24, 39, 0.08);
	--card: #ffffff;
	--blue: #3b82f6;
	--green: #16a34a;
	--red: #ef4444;
}

* {
	box-sizing: border-box;
}

html,
body {
	height: 100%;
}

body {
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Segoe UI', sans-serif;
	background: var(--bg);
	color: var(--ink);
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

.glow {
	position: fixed;
	inset: -20% -10% auto;
	height: 72vh;
	background:
		radial-gradient(42% 62% at 28% 18%, rgba(59, 130, 246, 0.16), transparent 70%),
		radial-gradient(38% 58% at 76% 8%, rgba(139, 92, 246, 0.12), transparent 70%);
	filter: blur(12px);
	pointer-events: none;
}

.shell {
	position: relative;
	display: flex;
	flex-direction: column;
	min-height: 100%;
	max-width: 1080px;
	margin: 0 auto;
	padding: 28px clamp(20px, 4vw, 40px);
}

.nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.brand {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--ink);
	text-decoration: none;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.01em;
}

.brand-mark {
	display: grid;
	place-items: center;
	position: relative;
	width: 22px;
	height: 22px;
	border-radius: 8px;
	background-color: var(--ink);
	background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 55%);
	font-size: 15px;
	line-height: 1;
}

.ghost {
	border: 1px solid var(--line);
	background: transparent;
	color: var(--muted);
	font: inherit;
	font-size: 13px;
	padding: 9px 16px;
	border-radius: 999px;
	cursor: pointer;
	transition:
		color 0.2s,
		border-color 0.2s,
		background 0.2s;
}

.ghost:hover {
	color: var(--ink);
	border-color: rgba(17, 24, 39, 0.18);
	background: rgba(255, 255, 255, 0.6);
}

.hero {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: clamp(48px, 9vh, 96px) 0 clamp(56px, 11vh, 120px);
}

.hero[hidden] {
	display: none;
}

.eyebrow {
	margin: 0 0 22px;
	color: #94a3b8;
	font-size: 11px;
	letter-spacing: 0.32em;
	text-transform: uppercase;
}

h1 {
	margin: 0;
	font-size: clamp(40px, 7.2vw, 70px);
	font-weight: 600;
	line-height: 1.08;
	letter-spacing: -0.03em;
}

h1 span {
	background: linear-gradient(100deg, #111827 8%, #3b82f6 55%, #8b5cf6 95%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.lede {
	margin: 26px 0 38px;
	color: var(--muted);
	font-size: clamp(15px, 2vw, 17px);
	line-height: 1.7;
}

.primary {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	border: 0;
	border-radius: 999px;
	background: var(--ink);
	color: #fff;
	font: inherit;
	font-size: 15px;
	font-weight: 500;
	padding: 15px 28px;
	cursor: pointer;
	box-shadow: 0 10px 24px -12px rgba(17, 24, 39, 0.55);
	transition:
		transform 0.18s ease,
		box-shadow 0.18s ease;
}

.primary svg {
	width: 17px;
	height: 17px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: transform 0.18s ease;
}

.primary:hover {
	transform: translateY(-1px);
	box-shadow: 0 16px 30px -12px rgba(17, 24, 39, 0.5);
}

.primary:hover svg {
	transform: translateX(3px);
}

.primary.small {
	padding: 11px 30px;
	font-size: 13.5px;
	box-shadow: none;
}

.foot {
	padding-bottom: 8px;
	color: #a1a1aa;
	font-size: 12px;
	text-align: center;
}

/* ── 弹层 ── */

.overlay {
	position: fixed;
	inset: 0;
	z-index: 40;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(15, 23, 42, 0.32);
	backdrop-filter: blur(10px);
	opacity: 0;
	transition: opacity 0.22s ease;
}

.overlay[hidden] {
	display: none;
}

.overlay.is-open {
	opacity: 1;
}

.sheet {
	position: relative;
	width: min(420px, 100%);
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	border-radius: 28px;
	background: var(--card);
	padding: clamp(22px, 4vh, 32px);
	box-shadow: 0 30px 80px -30px rgba(15, 23, 42, 0.45);
	transform: translateY(14px) scale(0.985);
	transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.overlay.is-open .sheet {
	transform: none;
}

.close {
	position: absolute;
	top: 18px;
	right: 18px;
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #9ca3af;
	cursor: pointer;
}

.close:hover {
	background: #f3f4f6;
	color: var(--ink);
}

.close svg {
	width: 16px;
	height: 16px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
}

.sheet-head h2 {
	margin: 0;
	font-size: 22px;
	letter-spacing: -0.01em;
}

.sheet-head p {
	margin: 8px 0 0;
	color: var(--muted);
	font-size: 13.5px;
}

.segmented {
	display: flex;
	gap: 4px;
	margin: clamp(14px, 3vh, 24px) 0 clamp(16px, 3.4vh, 26px);
	padding: 4px;
	border-radius: 14px;
	background: #f4f4f7;
}

.seg {
	display: flex;
	flex: 1;
	align-items: center;
	justify-content: center;
	gap: 6px;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: var(--muted);
	font: inherit;
	font-size: 13px;
	padding: 10px 8px;
	cursor: pointer;
}

.seg.is-active {
	background: #fff;
	color: var(--ink);
	font-weight: 500;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.soon {
	padding: 2px 5px;
	border-radius: 6px;
	background: #eef0f4;
	color: #a1a1aa;
	font-size: 10px;
	font-weight: 400;
}

/* ── 二维码 ── */

.qr-frame {
	display: grid;
	place-items: center;
	width: clamp(150px, 38vh, 236px);
	height: clamp(150px, 38vh, 236px);
	margin: 0 auto;
	padding: 10px;
	border: 1px solid var(--line);
	border-radius: 20px;
	background: #fff;
}

.qr-image,
.qr-image svg {
	display: block;
	width: 100%;
	height: 100%;
}

.qr-skeleton {
	width: 100%;
	height: 100%;
	border-radius: 12px;
	background: linear-gradient(100deg, #f4f4f7 20%, #ececf1 40%, #f4f4f7 60%);
	background-size: 220% 100%;
	animation: shimmer 1.4s ease-in-out infinite;
}

.qr-skeleton[hidden] {
	display: none;
}

.qr-status {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 20px;
	margin: clamp(12px, 2.6vh, 20px) 0 0;
	color: var(--muted);
	font-size: 13.5px;
}

.dot {
	flex: none;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #cbd5e1;
}

.dot.waiting {
	background: var(--blue);
	animation: pulse 1.8s ease-in-out infinite;
}

.dot.scanned {
	background: #8b5cf6;
	animation: pulse 1.8s ease-in-out infinite;
}

.dot.ok {
	background: var(--green);
}

.dot.error {
	background: var(--red);
}

.count {
	color: #a1a1aa;
	font-variant-numeric: tabular-nums;
}

.linkbtn {
	display: block;
	margin: clamp(6px, 1.4vh, 16px) auto 0;
	padding: 6px 10px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: #94a3b8;
	font: inherit;
	font-size: 12.5px;
	cursor: pointer;
}

.linkbtn:hover {
	background: #f7f7fa;
	color: var(--ink);
}

.linkbtn:disabled {
	opacity: 0.5;
	cursor: default;
}

/* ── 成功 ── */

.success {
	padding: 6px 0 2px;
	text-align: center;
}

.sheet.is-success .segmented,
.sheet.is-success .sheet-head p {
	display: none;
}

.success[hidden] {
	display: none;
}

.success-icon {
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	margin: 0 auto 18px;
	border-radius: 50%;
	background: #ecfdf3;
}

.success-icon svg {
	width: 26px;
	height: 26px;
	fill: none;
	stroke: var(--green);
	stroke-width: 2.2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.success h3 {
	margin: 0;
	font-size: 19px;
}

.success-name {
	margin: 10px 0 2px;
	font-size: 16px;
	font-weight: 600;
}

.success-id {
	margin: 0;
	color: #94a3b8;
	font-size: 12.5px;
	letter-spacing: 0.02em;
}

.success-hint {
	max-width: 280px;
	margin: 18px auto 24px;
	color: var(--muted);
	font-size: 12.5px;
	line-height: 1.7;
}

/* ── 后台登录 ── */

.sheet.is-admin .segmented {
	display: none;
}

.sheet.is-admin .sheet-head p {
	display: none;
}

.auth-panel[hidden],
.account-panel[hidden],
.dashboard[hidden] {
	display: none;
}

.auth-form {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin-top: 24px;
}

.field {
	display: flex;
	flex-direction: column;
	gap: 7px;
}

.field[hidden] {
	display: none;
}

.field-label {
	color: var(--muted);
	font-size: 12.5px;
}

.input {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: #fbfbfd;
	color: var(--ink);
	font: inherit;
	font-size: 14px;
	outline: none;
	transition:
		border-color 0.18s ease,
		background 0.18s ease,
		box-shadow 0.18s ease;
}

.input::placeholder {
	color: #b6bcc7;
}

.input:focus {
	border-color: rgba(59, 130, 246, 0.5);
	background: #fff;
	box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.form-error {
	margin: 0;
	padding: 10px 12px;
	border-radius: 10px;
	background: #fef2f2;
	color: #dc2626;
	font-size: 12.5px;
	line-height: 1.5;
}

.form-error[hidden] {
	display: none;
}

.form-error.is-warn {
	background: #fffbeb;
	color: #b45309;
}

.primary.wide {
	justify-content: center;
	width: 100%;
	margin-top: 4px;
	padding: 13px 20px;
	box-shadow: none;
}

.primary.wide:disabled {
	opacity: 0.6;
	cursor: default;
	transform: none;
}

.ghost.wide {
	width: 100%;
	padding: 12px 20px;
}

.dashboard {
	margin-top: 24px;
	text-align: left;
}

.dash-head {
	display: flex;
	align-items: center;
	gap: 14px;
}

.dash-head[hidden] {
	display: none;
}

.dash-avatar {
	display: grid;
	flex: none;
	place-items: center;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: linear-gradient(135deg, #e0e7ff, #ede9fe);
	color: #4f46e5;
	font-size: 20px;
	font-weight: 600;
}

.dash-info h3 {
	margin: 0;
	font-size: 18px;
}

.dash-info p {
	margin: 5px 0 0;
	color: #94a3b8;
	font-size: 12.5px;
}

.dash-head .admin-password {
	margin: 0 0 0 auto;
	padding: 4px 0;
	color: #94a3b8;
}

.admin-password[hidden] {
	display: none;
}

.workspace {
	flex: 1;
	width: 100%;
	max-width: 880px;
	margin: 0 auto;
	padding: clamp(36px, 7vh, 64px) 0 72px;
}

.workspace[hidden] {
	display: none;
}

.workspace-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 26px;
}

.workspace-head .eyebrow {
	margin-bottom: 10px;
}

.workspace-head h2 {
	margin: 0;
	font-size: clamp(28px, 4vw, 38px);
	font-weight: 600;
	letter-spacing: -0.02em;
}

.workspace-sub {
	margin: 10px 0 0;
	color: var(--muted);
	font-size: 13.5px;
}

.workspace-card {
	padding: clamp(20px, 4vw, 28px);
	border: 1px solid var(--line);
	border-radius: 24px;
	background: var(--card);
	box-shadow: 0 20px 50px -35px rgba(15, 23, 42, 0.35);
}

.workspace-card[hidden] {
	display: none;
}

.workspace-card .account-list {
	margin-top: 20px;
}

.workspace-card .pager {
	margin-bottom: 0;
}

.workspace-actions {
	display: flex;
	justify-content: flex-end;
	margin-top: 22px;
}

#adminBtn[hidden] {
	display: none;
}

.admin-password[hidden] {
	display: none;
}

.list-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 22px 0 12px;
	padding: 0 2px;
	color: var(--muted);
	font-size: 12px;
}

.list-head[hidden] {
	display: none;
}

.list-head span:first-child {
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

#listCount {
	color: #a1a1aa;
}

.account-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.account-list[hidden] {
	display: none;
}

.account-empty {
	padding: 28px 12px;
	border: 1px dashed var(--line);
	border-radius: 16px;
	color: #a1a1aa;
	font-size: 13px;
	text-align: center;
}

.account-item {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 14px;
	border: 1px solid var(--line);
	border-radius: 16px;
	background: #fff;
}

.account-main {
	display: flex;
	align-items: center;
	gap: 12px;
}

.account-avatar {
	display: grid;
	flex: none;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #f1f5f9;
	color: #64748b;
	font-size: 15px;
	font-weight: 600;
}

.account-info {
	min-width: 0;
}

.account-info strong {
	display: block;
	overflow: hidden;
	font-size: 14px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.account-info p {
	margin: 4px 0 0;
	color: #94a3b8;
	font-size: 11.5px;
}

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

.mini {
	padding: 7px 12px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: #fff;
	color: var(--ink);
	font: inherit;
	font-size: 12px;
	cursor: pointer;
	transition:
		background 0.18s ease,
		border-color 0.18s ease,
		color 0.18s ease;
}

.mini:hover {
	border-color: rgba(17, 24, 39, 0.16);
	background: #f7f7fa;
}

.mini.accent {
	border-color: rgba(37, 99, 235, 0.18);
	background: rgba(37, 99, 235, 0.05);
	color: #2563eb;
}

.mini.accent:hover {
	background: rgba(37, 99, 235, 0.09);
}

.mini.danger-text {
	border-color: rgba(220, 38, 38, 0.18);
	color: #dc2626;
}

.mini.danger-text:hover {
	background: #fef2f2;
}

.mini:disabled {
	opacity: 0.55;
	cursor: default;
}

.pager {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin: 16px 0 18px;
}

.pager[hidden] {
	display: none;
}

.pager span {
	color: var(--muted);
	font-size: 12px;
}

.form-actions {
	display: flex;
	gap: 10px;
}

.form-actions .primary,
.form-actions .ghost {
	flex: 1;
	justify-content: center;
	padding: 12px 16px;
}

.danger {
	flex: 1;
	padding: 12px 16px;
	border: 0;
	border-radius: 999px;
	background: #dc2626;
	color: #fff;
	font: inherit;
	font-size: 14px;
	cursor: pointer;
}

.danger:disabled {
	opacity: 0.6;
	cursor: default;
}

.confirm-text {
	margin: 10px 0 22px;
	color: var(--ink);
	font-size: 14px;
	line-height: 1.75;
}

.panel-lead {
	margin: 0;
	color: var(--muted);
	font-size: 12.5px;
	line-height: 1.7;
}

.checkin-status {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 12px 0 8px;
	color: var(--muted);
	font-size: 13px;
}

.checkin-status.is-error {
	color: #dc2626;
}

.checkin-status.is-warn {
	color: #b45309;
}

.checkin-status.is-success {
	color: #15803d;
}

.spinner {
	width: 14px;
	height: 14px;
	border: 2px solid rgba(59, 130, 246, 0.25);
	border-top-color: #3b82f6;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

.spinner[hidden] {
	display: none;
}

.log-box {
	max-height: min(180px, 22vh);
	margin: 0 0 10px;
	padding: 10px;
	overflow: auto;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: #f7f7fa;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 11.5px;
	line-height: 1.65;
	white-space: pre-wrap;
	word-break: break-word;
}

.log-line.log-info {
	color: #64748b;
}

.log-line.log-success {
	color: #15803d;
}

.log-line.log-warn {
	color: #b45309;
}

.log-line.log-error {
	color: #dc2626;
}

.checkin-summary {
	display: grid;
	gap: 6px;
	margin: 0 0 12px;
}

.checkin-summary[hidden] {
	display: none;
}

.checkin-summary > div {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 6px 10px;
	border-radius: 10px;
	background: #f7f7fa;
	font-size: 12px;
}

.checkin-summary span {
	color: var(--muted);
}

.checkin-summary strong {
	font-weight: 600;
	text-align: right;
}

/* ── 轻提示 ── */

.toast {
	position: fixed;
	left: 50%;
	bottom: 34px;
	z-index: 60;
	padding: 11px 18px;
	border-radius: 999px;
	background: rgba(17, 24, 39, 0.92);
	color: #fff;
	font-size: 13px;
	opacity: 0;
	pointer-events: none;
	transform: translate(-50%, 10px);
	transition:
		opacity 0.22s ease,
		transform 0.22s ease;
}

.toast[hidden] {
	display: none;
}

.toast.is-open {
	opacity: 1;
	transform: translate(-50%, 0);
}

@keyframes shimmer {
	from {
		background-position: 180% 0;
	}
	to {
		background-position: -20% 0;
	}
}

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

@keyframes pulse {
	0%,
	100% {
		box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.35);
	}
	50% {
		box-shadow: 0 0 0 5px rgba(59, 130, 246, 0);
	}
}

@media (max-width: 480px) {
	.shell {
		padding: 22px 20px;
	}

	.hero {
		padding: 72px 0 96px;
	}

	.sheet {
		padding: 28px 22px;
		border-radius: 24px;
	}
}

@media (max-height: 620px) {
	.shell {
		padding-top: 16px;
		padding-bottom: 16px;
	}

	.hero {
		padding: 24px 0 32px;
	}

	.eyebrow {
		margin-bottom: 12px;
	}

	h1 {
		font-size: clamp(32px, 6.4vw, 46px);
	}

	.lede {
		margin: 16px 0 24px;
	}

	.overlay {
		padding: 12px;
	}

	.sheet {
		max-height: calc(100vh - 24px);
		padding: 18px;
		border-radius: 22px;
	}

	.sheet-head p {
		margin-top: 6px;
	}
}

@media (max-width: 560px) {
	.workspace-head {
		flex-direction: column;
		align-items: flex-start;
	}

	.workspace-head .ghost {
		align-self: flex-start;
	}

	.dash-head {
		flex-wrap: wrap;
	}

	.dash-head .admin-password {
		margin-left: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}
