/* 动态活码 — 1:1 参考 Kimi_Agent_活码H5页面优化 */
:root {
	--hm-text: #1e3a5f;
	--hm-muted: rgba(30, 58, 95, 0.4);
	--hm-muted2: rgba(30, 58, 95, 0.35);
	--hm-border: rgba(180, 200, 225, 0.35);
	--hm-primary: #3b82f6;
	--hm-indigo: #6366f1;
	--hm-success: #10b981;
	--hm-warn: #f59e0b;
	--hm-danger: #ef4444;
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html,
body {
	min-height: 100dvh;
	font-family: -apple-system, "PingFang SC", "Noto Sans SC", "Helvetica Neue", sans-serif;
	color: var(--hm-text);
	background: linear-gradient(180deg, #e8f0f8 0%, #f0f5fa 30%, #f5f8fc 60%, #eef3f9 100%);
	-webkit-font-smoothing: antialiased;
	-webkit-tap-highlight-color: transparent;
}

.hm-page {
	min-height: 100dvh;
	position: relative;
	overflow-x: hidden;
}

#hmParticles {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 0;
	pointer-events: none;
}

.hm-main {
	position: relative;
	z-index: 1;
	max-width: 512px;
	margin: 0 auto;
	min-height: 100dvh;
	padding: calc(12px + env(safe-area-inset-top, 0)) 16px calc(96px + env(safe-area-inset-bottom, 0));
}

.hm-view {
	display: none;
	animation: hmFadeIn 0.22s ease;
}

.hm-view.active {
	display: block;
}

@keyframes hmFadeIn {
	from {
		opacity: 0;
		transform: translateX(12px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.hm-glass {
	background: rgba(255, 255, 255, 0.82);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border: 1px solid rgba(180, 200, 225, 0.3);
	border-radius: 16px;
	box-shadow: 0 2px 12px rgba(59, 130, 246, 0.06), 0 1px 3px rgba(0, 0, 0, 0.03);
}

.hm-glass-hover {
	transition: all 0.25s ease;
	cursor: pointer;
	border: none;
	font-family: inherit;
	text-align: inherit;
	color: inherit;
	width: 100%;
}

.hm-glass-hover:active {
	transform: scale(0.97);
	box-shadow: 0 6px 24px rgba(59, 130, 246, 0.1);
}

.hm-page-hd {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 16px;
}

.hm-back-btn {
	width: 36px;
	height: 36px;
	border-radius: 12px;
	border: none;
	background: rgba(255, 255, 255, 0.82);
	backdrop-filter: blur(16px);
	border: 1px solid rgba(180, 200, 225, 0.3);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	flex-shrink: 0;
	box-shadow: 0 2px 12px rgba(59, 130, 246, 0.06);
}

.hm-back-btn svg {
	color: var(--hm-primary);
	width: 18px;
	height: 18px;
}

.hm-back-btn [data-lucide]:empty::before {
	content: "←";
	font-size: 18px;
	line-height: 1;
	color: var(--hm-primary);
	font-weight: 700;
}

/* 活码首页：左上角返回智库 */
.hm-view#viewHome {
	position: relative;
}

.hm-home-back {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 5;
	width: 36px;
	height: 36px;
	border-radius: 12px;
	border: 1px solid rgba(180, 200, 225, 0.3);
	background: rgba(255, 255, 255, 0.82);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	box-shadow: 0 2px 12px rgba(59, 130, 246, 0.06);
	color: var(--hm-primary);
}

.hm-home-back svg {
	width: 18px;
	height: 18px;
	color: var(--hm-primary);
}

.hm-home-back [data-lucide]:empty::before {
	content: "←";
	font-size: 18px;
	line-height: 1;
	color: var(--hm-primary);
	font-weight: 700;
}

.hm-page-title {
	font-size: 18px;
	font-weight: 700;
	color: var(--hm-text);
}

.hm-page-sub {
	font-size: 10px;
	color: var(--hm-muted2);
	margin-top: 2px;
}

.hm-hero {
	text-align: center;
	margin-bottom: 20px;
	padding-top: 40px;
}

.hm-hero h1 {
	font-size: 26px;
	font-weight: 700;
	margin-bottom: 4px;
	text-shadow: 0 2px 12px rgba(59, 130, 246, 0.12);
}

.hm-hero p {
	font-size: 12px;
	color: var(--hm-muted);
}

.hm-steps {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-bottom: 16px;
}

.hm-step {
	padding: 14px;
}

.hm-step-icon {
	width: 32px;
	height: 32px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 8px;
	background: linear-gradient(135deg, #3b82f6, #6366f1);
}

.hm-step-icon svg {
	color: #fff;
	width: 15px;
	height: 15px;
}

.hm-step h3 {
	font-size: 14px;
	font-weight: 700;
	margin-bottom: 4px;
}

.hm-step p {
	font-size: 11px;
	line-height: 1.55;
	color: var(--hm-muted);
}

.hm-features {
	display: flex;
	align-items: center;
	justify-content: space-around;
	padding: 12px;
	margin-bottom: 16px;
}

.hm-feature-val {
	font-size: 12px;
	font-weight: 700;
}

.hm-feature-val.blue { color: var(--hm-primary); }
.hm-feature-val.indigo { color: var(--hm-indigo); }
.hm-feature-val.green { color: var(--hm-success); }

.hm-feature-lbl {
	font-size: 10px;
	color: var(--hm-muted2);
	margin-top: 2px;
}

.hm-actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-bottom: 20px;
}

.hm-action-card {
	padding: 16px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	height: 112px;
	position: relative;
}

.hm-action-step {
	position: absolute;
	top: 10px;
	left: 10px;
	font-size: 10px;
	font-weight: 700;
	color: var(--hm-primary);
	background: rgba(59, 130, 246, 0.1);
	padding: 2px 8px;
	border-radius: 999px;
}

.hm-action-card[data-nav="qrcode"] .hm-action-step {
	color: var(--hm-indigo);
	background: rgba(99, 102, 241, 0.1);
}

.hm-page-hd-icon {
	width: 36px;
	height: 36px;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.hm-page-hd-icon.indigo {
	background: linear-gradient(135deg, #6366f1, #818cf8);
}

.hm-page-hd-icon.indigo svg {
	color: #fff;
	width: 18px;
	height: 18px;
}

.hm-stat-link {
	border: none;
	background: transparent;
	font-family: inherit;
	cursor: pointer;
	transition: transform 0.2s ease;
}

.hm-stat-link:active {
	transform: scale(0.96);
}

.hm-list-item-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

.hm-btn-del {
	border: none;
	background: rgba(239, 68, 68, 0.1);
	color: var(--hm-danger);
	font-size: 11px;
	font-weight: 700;
	padding: 6px 10px;
	border-radius: 8px;
	cursor: pointer;
	font-family: inherit;
}

.hm-list-item-clickable {
	cursor: pointer;
	text-align: left;
	width: 100%;
}

.hm-empty {
	text-align: center;
	padding: 40px 16px;
	color: var(--hm-muted);
	font-size: 13px;
}

.hm-form-card-item .hm-list-sub {
	line-height: 1.5;
}

.hm-image-upload {
	min-height: 140px;
	border: 1px dashed rgba(180, 200, 225, 0.8);
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.72);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	color: var(--hm-muted);
	font-size: 12px;
	cursor: pointer;
	overflow: hidden;
}

.hm-image-upload img {
	width: 100%;
	height: 140px;
	object-fit: cover;
}

.hm-image-upload.is-uploading {
	opacity: 0.7;
	pointer-events: none;
}

.hm-customer-card {
	display: block;
	width: 100%;
	text-align: left;
	border: none;
	background: rgba(255, 255, 255, 0.82);
	backdrop-filter: blur(16px);
	border-radius: 16px;
	padding: 14px;
	margin-bottom: 10px;
	box-shadow: 0 2px 12px rgba(59, 130, 246, 0.06);
	font-family: inherit;
	color: inherit;
	cursor: pointer;
}

.hm-customer-card:active {
	transform: scale(0.99);
}

.hm-customer-row {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	font-size: 12px;
	line-height: 1.6;
	margin-bottom: 4px;
}

.hm-customer-row span {
	color: var(--hm-muted);
	flex-shrink: 0;
}

.hm-customer-row strong {
	font-weight: 600;
	color: var(--hm-text);
	text-align: right;
	word-break: break-all;
}

.hm-customer-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px solid rgba(180, 200, 225, 0.35);
	font-size: 11px;
	color: var(--hm-muted);
}

.hm-detail-card {
	padding: 16px;
	margin-bottom: 16px;
}

.hm-detail-row {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px solid rgba(180, 200, 225, 0.25);
	font-size: 13px;
}

.hm-detail-row:last-child {
	border-bottom: none;
}

.hm-detail-row span {
	color: var(--hm-muted);
	flex-shrink: 0;
}

.hm-detail-row strong {
	font-weight: 600;
	text-align: right;
	word-break: break-all;
}

.hm-detail-back {
	width: 100%;
	margin-top: 8px;
}

.hm-action-icon {
	width: 48px;
	height: 48px;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	animation: hmFloat 3s ease-in-out infinite;
}

.hm-action-icon.blue {
	background: rgba(59, 130, 246, 0.08);
	border: 1px solid rgba(59, 130, 246, 0.15);
}

.hm-action-icon.indigo {
	background: rgba(99, 102, 241, 0.08);
	border: 1px solid rgba(99, 102, 241, 0.15);
	animation-delay: 0.5s;
}

.hm-action-icon svg {
	width: 24px;
	height: 24px;
}

.hm-action-label {
	font-size: 14px;
	font-weight: 700;
}

@keyframes hmFloat {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-4px); }
}

.hm-stats {
	padding: 14px;
	margin-bottom: 16px;
}

.hm-stats-hd {
	font-size: 11px;
	font-weight: 600;
	color: rgba(30, 58, 95, 0.5);
	margin-bottom: 10px;
	display: flex;
	align-items: center;
	gap: 6px;
}

.hm-stats-hd svg {
	width: 12px;
	height: 12px;
	color: var(--hm-primary);
}

.hm-stats-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 8px;
}

.hm-stat {
	text-align: center;
	padding: 8px 4px;
	border-radius: 8px;
	background: rgba(59, 130, 246, 0.03);
}

.hm-stat .num {
	font-size: 16px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.hm-stat .num.blue { color: var(--hm-primary); }
.hm-stat .num.indigo { color: var(--hm-indigo); }
.hm-stat .num.warn { color: var(--hm-warn); }
.hm-stat .num.danger { color: var(--hm-danger); }

.hm-stat .lbl {
	font-size: 9px;
	color: var(--hm-muted2);
	margin-top: 2px;
}

.hm-section-title {
	font-size: 12px;
	font-weight: 600;
	color: rgba(30, 58, 95, 0.45);
	margin-bottom: 8px;
}

.hm-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 16px;
}

.hm-list-item {
	padding: 12px;
	display: flex;
	align-items: center;
	gap: 12px;
}

.hm-list-ico {
	width: 32px;
	height: 32px;
	border-radius: 8px;
	background: rgba(59, 130, 246, 0.08);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.hm-list-ico svg {
	width: 14px;
	height: 14px;
	color: var(--hm-primary);
}

.hm-list-body {
	flex: 1;
	min-width: 0;
}

.hm-list-title {
	font-size: 14px;
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.hm-list-sub {
	font-size: 10px;
	color: var(--hm-muted2);
	margin-top: 2px;
}

.hm-badge {
	font-size: 10px;
	padding: 2px 8px;
	border-radius: 999px;
	flex-shrink: 0;
}

.hm-badge.ok {
	background: rgba(16, 185, 129, 0.1);
	color: var(--hm-success);
}

.hm-badge.pending {
	background: rgba(245, 158, 11, 0.1);
	color: var(--hm-warn);
}

.hm-badge.active {
	background: rgba(59, 130, 246, 0.08);
	color: var(--hm-primary);
}

.hm-badge.expired {
	background: rgba(239, 68, 68, 0.08);
	color: var(--hm-danger);
}

.hm-footer {
	text-align: center;
	font-size: 10px;
	color: rgba(30, 58, 95, 0.2);
	padding: 8px 0;
}

.hm-tabbar {
	position: fixed;
	left: 50%;
	transform: translateX(-50%);
	bottom: calc(14px + env(safe-area-inset-bottom, 0));
	width: min(300px, calc(100% - 40px));
	background: rgba(255, 255, 255, 0.88);
	backdrop-filter: blur(12px);
	display: flex;
	justify-content: space-around;
	align-items: center;
	padding: 10px 8px;
	border-radius: 999px;
	border: 1px solid rgba(180, 200, 225, 0.35);
	box-shadow: 0 4px 20px rgba(59, 130, 246, 0.08);
	z-index: 50;
}

.hm-tab {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
	font-size: 11px;
	color: rgba(30, 58, 95, 0.4);
	min-width: 52px;
	text-decoration: none;
}

.hm-tab svg {
	width: 22px;
	height: 22px;
}

.hm-tab.active {
	color: var(--hm-primary);
}

.hm-field {
	margin-bottom: 12px;
}

.hm-label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	margin-bottom: 6px;
	color: var(--hm-text);
}

.hm-label-sm {
	font-size: 12px;
	font-weight: 600;
	margin-bottom: 4px;
}

.hm-label-req {
	color: var(--hm-danger);
	margin-right: 2px;
}

.hm-label-opt {
	font-size: 12px;
	font-weight: 400;
	color: var(--hm-muted2);
	margin-left: 4px;
}

.hm-input {
	width: 100%;
	height: 44px;
	padding: 0 14px;
	border-radius: 10px;
	border: 1px solid var(--hm-border);
	background: rgba(255, 255, 255, 0.7);
	color: var(--hm-text);
	font-size: 15px;
	font-family: inherit;
	outline: none;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.hm-input::placeholder {
	color: rgba(30, 58, 95, 0.3);
}

.hm-input:focus {
	border-color: var(--hm-primary);
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.hm-input.err {
	border-color: var(--hm-danger);
}

.hm-err {
	font-size: 12px;
	color: var(--hm-danger);
	margin-top: 4px;
}

.hm-section-hd {
	font-size: 11px;
	font-weight: 600;
	color: rgba(30, 58, 95, 0.45);
	margin-bottom: 8px;
	display: flex;
	align-items: center;
	gap: 4px;
}

.hm-section-hd svg {
	width: 11px;
	height: 11px;
	color: var(--hm-primary);
}

.hm-form-card {
	padding: 14px;
	margin-bottom: 14px;
}

.hm-form-card .hm-field:last-child {
	margin-bottom: 0;
}

.hm-grid2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

.hm-pill-group {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.hm-pill {
	padding: 8px 14px;
	border-radius: 999px;
	font-size: 12px;
	border: 1px solid rgba(59, 130, 246, 0.1);
	background: rgba(59, 130, 246, 0.05);
	color: var(--hm-text);
	cursor: pointer;
	font-family: inherit;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	transition: all 0.2s;
}

.hm-pill.on {
	background: var(--hm-primary);
	border-color: var(--hm-primary);
	color: #fff;
}

.hm-pill-type {
	padding: 10px 16px;
	border-radius: 12px;
	font-size: 14px;
}

.hm-toggle-row {
	display: flex;
	align-items: center;
	gap: 16px;
	padding-top: 4px;
}

.hm-toggle-item {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
}

.hm-switch {
	width: 38px;
	height: 20px;
	border-radius: 999px;
	border: none;
	position: relative;
	cursor: pointer;
	background: rgba(59, 130, 246, 0.12);
	transition: background 0.2s;
	flex-shrink: 0;
}

.hm-switch.on {
	background: var(--hm-primary);
}

.hm-switch-knob {
	position: absolute;
	top: 2px;
	left: 2px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
	transition: left 0.2s;
}

.hm-switch.on .hm-switch-knob {
	left: 18px;
}

.hm-range-row {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 8px;
}

.hm-range {
	flex: 1;
	accent-color: var(--hm-primary);
	height: 4px;
}

.hm-range-val {
	font-size: 14px;
	font-weight: 700;
	color: var(--hm-indigo);
	min-width: 44px;
	text-align: right;
	white-space: nowrap;
}

.hm-range-ticks {
	display: flex;
	justify-content: space-between;
	padding: 0 2px;
}

.hm-range-tick {
	font-size: 8px;
	color: rgba(30, 58, 95, 0.2);
	border: none;
	background: none;
	cursor: pointer;
	font-family: inherit;
	padding: 0;
}

.hm-range-tick.on {
	color: var(--hm-indigo);
}

.hm-hint {
	font-size: 11px;
	color: var(--hm-muted);
	margin-bottom: 8px;
	line-height: 1.4;
}

.hm-dropdown {
	position: relative;
}

.hm-dropdown-btn {
	width: 100%;
	height: 44px;
	padding: 0 14px;
	border-radius: 10px;
	border: 1px solid var(--hm-border);
	background: rgba(255, 255, 255, 0.7);
	color: var(--hm-text);
	font-size: 15px;
	font-family: inherit;
	display: flex;
	align-items: center;
	justify-content: space-between;
	cursor: pointer;
	text-align: left;
}

.hm-dropdown-btn.placeholder {
	color: rgba(30, 58, 95, 0.3);
}

.hm-dropdown-menu {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	z-index: 30;
	border-radius: 12px;
	overflow: hidden;
	background: rgba(255, 255, 255, 0.98);
	backdrop-filter: blur(12px);
	border: 1px solid rgba(180, 200, 225, 0.25);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
	max-height: 200px;
	overflow-y: auto;
}

.hm-dropdown-item {
	width: 100%;
	padding: 10px 12px;
	border: none;
	background: none;
	text-align: left;
	font-size: 14px;
	color: var(--hm-text);
	cursor: pointer;
	font-family: inherit;
	display: flex;
	align-items: center;
	gap: 8px;
}

.hm-dropdown-item:hover {
	background: rgba(59, 130, 246, 0.06);
}

.hm-logo-upload {
	width: 100px;
	height: 100px;
	border-radius: 12px;
	border: 2px dashed rgba(59, 130, 246, 0.15);
	background: rgba(255, 255, 255, 0.5);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	cursor: pointer;
	overflow: hidden;
	position: relative;
}

.hm-logo-upload img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hm-logo-upload span {
	font-size: 10px;
	color: rgba(30, 58, 95, 0.25);
}

.hm-logo-remove {
	position: absolute;
	top: -6px;
	right: -6px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--hm-danger);
	color: #fff;
	border: none;
	font-size: 12px;
	cursor: pointer;
	line-height: 1;
}

.hm-check-row {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	margin-bottom: 10px;
}

.hm-check {
	width: 16px;
	height: 16px;
	border-radius: 4px;
	border: 1px solid rgba(59, 130, 246, 0.15);
	background: rgba(59, 130, 246, 0.06);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.hm-check.on {
	background: var(--hm-primary);
	border-color: var(--hm-primary);
}

.hm-check svg {
	width: 11px;
	height: 11px;
	color: #fff;
}

.hm-check-label {
	font-size: 12px;
}

.hm-check-label a {
	color: var(--hm-primary);
	text-decoration: none;
}

.hm-warn-box {
	display: flex;
	align-items: flex-start;
	gap: 6px;
	padding: 10px;
	border-radius: 12px;
	background: rgba(245, 158, 11, 0.05);
	border: 1px solid rgba(245, 158, 11, 0.12);
	margin-bottom: 8px;
}

.hm-warn-box svg {
	width: 12px;
	height: 12px;
	color: var(--hm-warn);
	flex-shrink: 0;
	margin-top: 1px;
}

.hm-warn-box p {
	font-size: 11px;
	color: #b45309;
	line-height: 1.45;
}

.hm-btn-primary {
	width: 100%;
	height: 48px;
	border: none;
	border-radius: 12px;
	font-size: 15px;
	font-weight: 600;
	color: #fff;
	cursor: pointer;
	font-family: inherit;
	background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
	box-shadow: 0 4px 16px rgba(59, 130, 246, 0.25);
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	transition: transform 0.15s, opacity 0.15s;
	margin-bottom: 20px;
}

.hm-btn-primary:active {
	transform: scale(0.98);
}

.hm-btn-primary:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none;
}

.hm-btn-primary.success {
	background: var(--hm-success);
	box-shadow: 0 4px 16px rgba(16, 185, 129, 0.25);
}

.hm-btn-secondary {
	height: 42px;
	border-radius: 12px;
	font-size: 14px;
	font-weight: 500;
	color: var(--hm-primary);
	cursor: pointer;
	font-family: inherit;
	background: rgba(255, 255, 255, 0.7);
	border: 1px solid rgba(180, 200, 225, 0.4);
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	transition: all 0.2s;
}

.hm-btn-secondary:active {
	border-color: var(--hm-primary);
	background: rgba(59, 130, 246, 0.06);
}

.hm-qr-preview-wrap {
	display: flex;
	justify-content: center;
	margin-bottom: 16px;
}

.hm-qr-preview {
	width: 260px;
	padding: 16px;
	border-radius: 14px;
	text-align: center;
}

.hm-qr-preview-label {
	font-size: 11px;
	color: var(--hm-muted);
	margin-bottom: 8px;
}

.hm-qr-preview-title {
	font-size: 14px;
	font-weight: 700;
	margin-bottom: 8px;
}

.hm-qr-box {
	display: inline-block;
	padding: 8px;
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 2px 8px rgba(59, 130, 246, 0.08);
	margin-bottom: 8px;
}

.hm-qr-box canvas,
.hm-qr-box img {
	display: block;
}

.hm-qr-remark {
	font-size: 12px;
	color: var(--hm-indigo);
	margin-bottom: 4px;
}

.hm-qr-expire {
	font-size: 11px;
	margin-top: 6px;
}

.hm-qr-expire.perm { color: var(--hm-success); }
.hm-qr-expire.limited { color: var(--hm-warn); }

.hm-result-center {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 12px 0 20px;
}

.hm-result-card {
	width: 300px;
	border-radius: 16px;
	overflow: hidden;
	position: relative;
	background: linear-gradient(180deg, #ffffff 0%, #f5f8fc 100%);
	border: 1px solid rgba(180, 200, 225, 0.35);
	box-shadow: 0 8px 40px rgba(59, 130, 246, 0.1), 0 0 80px rgba(59, 130, 246, 0.04);
}

.hm-result-card-glow {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 96px;
	background: linear-gradient(180deg, rgba(59, 130, 246, 0.2) 0%, transparent 100%);
	opacity: 0.2;
	pointer-events: none;
}

.hm-result-card-body {
	position: relative;
	padding: 20px;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.hm-result-brand {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 12px;
	font-size: 10px;
	color: var(--hm-muted);
	letter-spacing: 0.04em;
}

.hm-result-title {
	font-size: 16px;
	font-weight: 700;
	text-align: center;
	margin-bottom: 2px;
}

.hm-result-product {
	font-size: 10px;
	color: var(--hm-muted2);
	text-align: center;
	margin-bottom: 4px;
}

.hm-result-remark {
	font-size: 11px;
	color: var(--hm-muted);
	text-align: center;
	margin-bottom: 12px;
}

.hm-result-qr {
	padding: 12px;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 4px 20px rgba(59, 130, 246, 0.1);
	margin-bottom: 12px;
}

.hm-result-expire {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	font-weight: 500;
	margin-bottom: 8px;
}

.hm-result-expire.perm { color: var(--hm-success); }
.hm-result-expire.limited { color: var(--hm-warn); }

.hm-result-manager {
	font-size: 10px;
	color: var(--hm-muted2);
	margin-bottom: 12px;
}

.hm-result-badges {
	display: flex;
	align-items: center;
	gap: 12px;
	padding-top: 8px;
	border-top: 1px solid rgba(180, 200, 225, 0.2);
	width: 100%;
	justify-content: center;
}

.hm-result-badge {
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: 9px;
	color: var(--hm-muted2);
}

.hm-result-badge svg {
	width: 10px;
	height: 10px;
}

.hm-result-bar {
	padding: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	background: rgba(59, 130, 246, 0.04);
	border-top: 1px solid rgba(180, 200, 225, 0.2);
}

.hm-result-bar-logo {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: linear-gradient(135deg, #3b82f6, #6366f1);
	color: #fff;
	font-size: 8px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
}

.hm-result-bar span {
	font-size: 9px;
	color: var(--hm-muted2);
}

.hm-security-tip {
	padding: 12px;
	margin-bottom: 12px;
	display: flex;
	gap: 8px;
	align-items: flex-start;
}

.hm-security-tip h4 {
	font-size: 12px;
	font-weight: 500;
	margin-bottom: 2px;
}

.hm-security-tip p {
	font-size: 10px;
	color: var(--hm-muted);
	line-height: 1.5;
}

.hm-result-actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.hm-char-count {
	font-size: 10px;
	color: rgba(30, 58, 95, 0.3);
}

.hm-field-hd {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 6px;
}

.hm-field-hd--link {
	flex-wrap: wrap;
	gap: 6px 8px;
}

.hm-field-hd--link .hm-char-count {
	margin-left: auto;
}

.hm-decode-btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	border: none;
	background: transparent;
	color: var(--hm-primary);
	font-size: 12px;
	font-weight: 700;
	padding: 4px 8px;
	border-radius: 8px;
	cursor: pointer;
	font-family: inherit;
}

.hm-decode-btn svg {
	width: 14px;
	height: 14px;
}

.hm-hint-link {
	margin-top: 6px;
}

.hm-sheet-mask,
.hm-modal-mask {
	position: fixed;
	inset: 0;
	z-index: 200;
	background: rgba(15, 23, 42, 0.45);
	display: flex;
	align-items: flex-end;
	justify-content: center;
	padding: 16px;
	padding-bottom: calc(16px + env(safe-area-inset-bottom, 0));
}

.hm-sheet-mask[hidden],
.hm-modal-mask[hidden] {
	display: none !important;
}

.hm-modal-mask {
	align-items: center;
}

.hm-action-sheet {
	width: 100%;
	max-width: 512px;
	background: #fff;
	border-radius: 14px;
	overflow: hidden;
}

.hm-sheet-item {
	display: block;
	width: 100%;
	border: none;
	background: #fff;
	padding: 16px;
	font-size: 16px;
	color: var(--hm-text);
	border-bottom: 1px solid rgba(180, 200, 225, 0.35);
	font-family: inherit;
	cursor: pointer;
}

.hm-sheet-item:last-child {
	border-bottom: none;
}

.hm-sheet-cancel {
	color: var(--hm-muted);
	margin-top: 8px;
	border-radius: 14px;
}

.hm-modal {
	width: 100%;
	max-width: 340px;
	background: #fff;
	border-radius: 16px;
	padding: 18px 16px 14px;
	box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
}

.hm-modal-title {
	text-align: center;
	font-size: 16px;
	font-weight: 700;
	margin-bottom: 12px;
}

.hm-decode-result-text {
	max-height: 160px;
	overflow: auto;
	font-size: 12px;
	line-height: 1.55;
	word-break: break-all;
	color: var(--hm-text);
	background: #f8fafc;
	border-radius: 10px;
	padding: 10px;
	margin-bottom: 14px;
}

.hm-modal-actions {
	display: flex;
	gap: 12px;
}

.hm-modal-actions--2 .hm-modal-btn {
	flex: 1;
}

.hm-modal-btn {
	border: none;
	background: #f1f5f9;
	color: var(--hm-text);
	padding: 12px;
	border-radius: 10px;
	font-size: 14px;
	font-family: inherit;
	cursor: pointer;
}

.hm-modal-btn.primary {
	background: var(--hm-primary);
	color: #fff;
	font-weight: 700;
}

.hm-modal-save {
	max-width: 320px;
}

.hm-save-tip {
	font-size: 13px;
	color: var(--hm-muted);
	text-align: center;
	margin: 0 0 12px;
	line-height: 1.5;
}

.hm-save-preview-wrap {
	display: flex;
	justify-content: center;
	margin-bottom: 14px;
}

.hm-save-preview {
	max-width: 100%;
	width: 240px;
	border-radius: 12px;
	box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
	background: #fff;
	-webkit-touch-callout: default;
	user-select: none;
}

.hm-spin {
	width: 20px;
	height: 20px;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: hmSpin 0.8s linear infinite;
}

@keyframes hmSpin {
	to { transform: rotate(360deg); }
}

.hm-toast {
	position: fixed;
	left: 50%;
	bottom: calc(100px + env(safe-area-inset-bottom, 0));
	transform: translateX(-50%) translateY(12px);
	background: rgba(30, 58, 95, 0.92);
	color: #fff;
	padding: 10px 18px;
	border-radius: 999px;
	font-size: 13px;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s, transform 0.2s;
	z-index: 300;
}

.hm-toast.show {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

.hm-collapsible {
	overflow: hidden;
	transition: max-height 0.2s ease, opacity 0.2s;
}

.hm-collapsible.hidden {
	max-height: 0 !important;
	opacity: 0;
}

.hm-chev {
	width: 14px;
	height: 14px;
	color: rgba(30, 58, 95, 0.2);
	flex-shrink: 0;
}

/* block page */
.hm-block-page {
	min-height: 100dvh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.hm-block-card {
	max-width: 360px;
	width: 100%;
	padding: 28px 22px;
	text-align: center;
}

.hm-block-icon {
	font-size: 48px;
	margin-bottom: 12px;
}

.hm-block-card h1 {
	font-size: 20px;
	margin: 0 0 8px;
	color: var(--hm-text);
}

.hm-block-card p {
	margin: 0;
	color: var(--hm-muted);
	font-size: 14px;
	line-height: 1.6;
}
