:root {
	--qh-bg: #ffffff;
	--qh-text: #1a1a2e;
	--qh-muted: #9a9aad;
	--qh-border: #e6e9f2;
	--qh-card-bg: #ffffff;
}

body.qh-dark {
	--qh-bg: #14141f;
	--qh-text: #f1f1f6;
	--qh-muted: #8a8aa0;
	--qh-border: #2a2a3d;
	--qh-card-bg: #1c1c2b;
}

.qh-site-header,
.qh-site-footer,
.qh-wrap,
.qh-breadcrumb,
.qh-related {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	color: var(--qh-text);
}

/* ---------- Site-wide header ---------- */

.qh-site-header {
	background: var(--qh-bg);
	border-bottom: 1px solid var(--qh-border);
}

.qh-topnav {
	max-width: 1100px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	gap: 16px;
}

.qh-topnav-logo {
	font-weight: 800;
	font-size: 17px;
	color: var(--qh-text) !important;
	text-decoration: none !important;
	white-space: nowrap;
}

.qh-topnav-links {
	display: flex;
	align-items: center;
	gap: 20px;
	flex-wrap: wrap;
}

.qh-topnav-links > a {
	color: var(--qh-text);
	text-decoration: none;
	font-size: 14px;
	font-weight: 600;
}

.qh-topnav-links > a:hover {
	color: #3b6fed;
}

.qh-dropdown {
	position: relative;
}

.qh-dropdown-toggle {
	background: none;
	border: none;
	font: inherit;
	color: var(--qh-text);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	padding: 0;
}

.qh-dropdown-toggle:hover {
	color: #3b6fed;
}

.qh-dropdown-menu {
	display: none;
	position: absolute;
	top: 28px;
	left: 0;
	min-width: 220px;
	max-height: 340px;
	overflow-y: auto;
	background: var(--qh-card-bg);
	border: 1px solid var(--qh-border);
	border-radius: 10px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	padding: 8px;
	z-index: 100;
}

.qh-dropdown.qh-dropdown-open .qh-dropdown-menu {
	display: block;
}

.qh-dropdown-menu a {
	display: block;
	padding: 8px 10px;
	font-size: 13px;
	font-weight: 500;
	color: var(--qh-text);
	text-decoration: none;
	border-radius: 6px;
	white-space: nowrap;
}

.qh-dropdown-menu a:hover {
	background: var(--qh-border);
}

.qh-theme-toggle {
	background: none;
	border: 1px solid var(--qh-border);
	border-radius: 999px;
	width: 34px;
	height: 34px;
	cursor: pointer;
	font-size: 15px;
	flex-shrink: 0;
}

/* ---------- Breadcrumb / back button (auto on every tool page) ---------- */

.qh-breadcrumb {
	max-width: 900px;
	margin: 16px auto 0;
	padding: 0 16px;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
	font-size: 13px;
	color: var(--qh-muted);
}

.qh-breadcrumb a {
	color: var(--qh-muted);
	text-decoration: none;
}

.qh-breadcrumb a:hover {
	color: #3b6fed;
}

.qh-breadcrumb-current {
	color: var(--qh-text);
	font-weight: 600;
}

.qh-back-btn {
	margin-left: auto;
	background: var(--qh-card-bg);
	border: 1px solid var(--qh-border);
	padding: 5px 12px;
	border-radius: 999px;
	font-weight: 600;
	color: var(--qh-text) !important;
}

.qh-back-btn:hover {
	color: #3b6fed !important;
}

/* ---------- Homepage wrapper ---------- */

.qh-wrap {
	max-width: 1100px;
	margin: 0 auto;
	padding: 10px 16px 40px;
	background: var(--qh-bg);
}

.qh-admin-notice {
	background: #fff3cd;
	border: 1px solid #ffe58f;
	color: #7a5c00;
	padding: 12px 16px;
	border-radius: 8px;
	margin-bottom: 16px;
	font-size: 14px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px;
}

.qh-admin-notice-btn {
	background: #7a5c00;
	color: #fff !important;
	padding: 6px 14px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
	text-decoration: none !important;
	white-space: nowrap;
}

.qh-related {
	max-width: 900px;
	margin: 30px auto;
	padding: 20px 16px 0;
	border-top: 1px solid var(--qh-border);
}

.qh-related-title {
	font-size: 17px;
	font-weight: 700;
	margin: 0 0 14px;
	color: var(--qh-text);
}

.qh-section-title {
	font-size: 19px;
	font-weight: 700;
	margin: 30px 0 14px;
	color: var(--qh-text);
}

.qh-hero {
	background: linear-gradient(135deg, #7c3aed, #2563eb, #06b6d4);
	border-radius: 16px;
	padding: 40px 24px;
	text-align: center;
	color: #fff;
	margin-bottom: 24px;
}

.qh-hero-title {
	font-size: 32px;
	font-weight: 800;
	margin: 0 0 8px;
}

.qh-hero-sub {
	font-size: 16px;
	opacity: 0.95;
	margin: 0 0 20px;
}

.qh-badges {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
}

.qh-badge {
	background: rgba(255, 255, 255, 0.18);
	padding: 6px 14px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
}

.qh-search {
	width: 100%;
	max-width: 500px;
	display: block;
	margin: 0 auto 32px;
	padding: 14px 18px;
	font-size: 15px;
	border: 2px solid var(--qh-border);
	border-radius: 999px;
	outline: none;
	background: var(--qh-card-bg);
	color: var(--qh-text);
}

.qh-search:focus {
	border-color: #3b6fed;
}

.qh-imei-section {
	margin-bottom: 30px;
}

.qh-imei-card {
	max-width: 480px;
	margin: 0 auto;
	border: 1px solid var(--qh-border);
	border-radius: 14px;
	overflow: hidden;
	background: var(--qh-card-bg);
}

.qh-imei-card-header {
	background: linear-gradient(135deg, #7c3aed, #2563eb, #06b6d4);
	color: #fff;
	text-align: center;
	padding: 28px 20px;
}

.qh-imei-icon {
	font-size: 30px;
	margin-bottom: 6px;
}

.qh-imei-title {
	font-size: 20px;
	font-weight: 800;
}

.qh-imei-subtitle {
	font-size: 13px;
	opacity: 0.9;
	margin-top: 4px;
}

.qh-imei-card-body {
	padding: 20px;
}

.qh-imei-card-body .qcalc-wrap {
	border: none;
	padding: 0;
	background: transparent;
}

/* ---------- Site-wide footer ---------- */

.qh-site-footer {
	background: var(--qh-bg);
	border-top: 1px solid var(--qh-border);
}

.qh-footer {
	max-width: 1100px;
	margin: 0 auto;
	padding: 20px 16px;
	text-align: center;
	font-size: 13px;
	color: var(--qh-muted);
}

.qh-footer-links a {
	color: var(--qh-muted);
	text-decoration: none;
}

.qh-footer-links a:hover {
	color: #3b6fed;
}

.qh-category {
	margin-bottom: 30px;
	scroll-margin-top: 90px;
}

.qh-category-title {
	font-size: 19px;
	font-weight: 700;
	color: var(--qh-text);
	margin: 0 0 14px;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--qh-border);
	display: flex;
	align-items: center;
	gap: 8px;
}

.qh-count {
	background: #eef2fd;
	color: #3b6fed;
	font-size: 12px;
	font-weight: 700;
	padding: 2px 9px;
	border-radius: 999px;
}

.qh-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 14px;
}

.qh-card {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px;
	border: 1px solid var(--qh-border);
	border-radius: 10px;
	background: var(--qh-card-bg);
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.qh-card:hover {
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
	transform: translateY(-1px);
}

.qh-card-icon {
	font-size: 26px;
	flex-shrink: 0;
}

.qh-card-body {
	flex: 1;
	min-width: 0;
}

.qh-card-name {
	font-size: 14px;
	font-weight: 700;
	color: var(--qh-text);
	line-height: 1.3;
}

.qh-card-slug {
	font-size: 11px;
	color: var(--qh-muted);
	margin-top: 2px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.qh-card-btn {
	flex-shrink: 0;
	background: #3b6fed;
	color: #fff !important;
	font-size: 13px;
	font-weight: 600;
	padding: 7px 14px;
	border-radius: 999px;
	text-decoration: none !important;
	white-space: nowrap;
}

.qh-card-btn:hover {
	background: #2f5bd0;
}

.qh-card.qh-hidden {
	display: none;
}

@media (max-width: 480px) {
	.qh-hero-title {
		font-size: 24px;
	}
	.qh-grid {
		grid-template-columns: 1fr;
	}
	.qh-topnav-links {
		gap: 12px;
	}
	.qh-topnav-links > a,
	.qh-dropdown-toggle {
		font-size: 12px;
	}
	.qh-topnav-logo {
		font-size: 14px;
	}
	.qh-back-btn {
		margin-left: 0;
	}
}
