/* Hongguo Board - front-end card components. Theme-agnostic, v1.1.
   Dual skin: dark (default) / light. The theme re-declares the same variables. */

:root,
[data-skin="dark"],
body.hgb-skin-dark {
	--hgb-bg: #0b0c10;
	--hgb-bg-soft: #111319;
	--hgb-surface: #161920;
	--hgb-surface-2: #1e222c;
	--hgb-line: rgba(255, 255, 255, .09);
	--hgb-line-strong: rgba(255, 255, 255, .18);
	--hgb-text: #f2f3f7;
	--hgb-muted: #9aa1af;
	--hgb-faint: #6d7482;
	--hgb-accent: #ff4d55;
	--hgb-accent-2: #ff914f;
	--hgb-accent-soft: rgba(255, 77, 85, .13);
	--hgb-accent-text: #ffffff;
	--hgb-gold: #f2c46b;
	--hgb-pinned-line: rgba(242, 196, 107, .42);
	--hgb-note-bg: rgba(242, 196, 107, .10);
	--hgb-note-text: #e9c891;
	--hgb-shadow: 0 22px 48px rgba(0, 0, 0, .48);
	--hgb-cover-shade: linear-gradient(180deg, rgba(8, 9, 13, 0) 55%, rgba(8, 9, 13, .55) 100%);
	--hgb-glass: rgba(22, 25, 32, .74);
	--hgb-placeholder: linear-gradient(150deg, #262b37, #14171e);
}

[data-skin="light"],
body.hgb-skin-light {
	--hgb-bg: #f3f0ea;
	--hgb-bg-soft: #fbf9f5;
	--hgb-surface: #ffffff;
	--hgb-surface-2: #f4f1eb;
	--hgb-line: rgba(38, 32, 28, .11);
	--hgb-line-strong: rgba(38, 32, 28, .2);
	--hgb-text: #211d1a;
	--hgb-muted: #706961;
	--hgb-faint: #9c948b;
	--hgb-accent: #c43a2d;
	--hgb-accent-2: #e2703d;
	--hgb-accent-soft: rgba(196, 58, 45, .08);
	--hgb-accent-text: #ffffff;
	--hgb-gold: #a97a2e;
	--hgb-pinned-line: rgba(169, 122, 46, .46);
	--hgb-note-bg: #f8efe0;
	--hgb-note-text: #8a5a1b;
	--hgb-shadow: 0 16px 36px rgba(66, 48, 36, .13);
	--hgb-cover-shade: linear-gradient(180deg, rgba(28, 18, 12, 0) 62%, rgba(28, 18, 12, .28) 100%);
	--hgb-glass: rgba(255, 255, 255, .82);
	--hgb-placeholder: linear-gradient(150deg, #e8e0d5, #f8f4ee);
}

.hgb-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 20px;
	margin: 0;
}
.hgb-grid--single { grid-template-columns: minmax(0, 260px); }

.hgb-board { margin: 0 0 56px; counter-increment: hgb-section; }
.hgb-board__head {
	display: flex; align-items: center; gap: 12px;
	margin: 0 0 20px; padding-bottom: 15px;
	border-bottom: 1px solid var(--hgb-line);
}
.hgb-board__head::before {
	content: counter(hgb-section, decimal-leading-zero);
	font-size: 11px; font-weight: 700; letter-spacing: .12em;
	color: var(--hgb-faint); padding-right: 13px;
	border-right: 1px solid var(--hgb-line);
}
.hgb-board__head::after {
	content: ""; flex: 1; height: 1px; order: 9;
	background: linear-gradient(90deg, var(--hgb-line), transparent);
	margin-left: auto;
}
.hgb-board__title {
	font-size: 23px; line-height: 1.25; margin: 0;
	font-weight: 700; letter-spacing: -.02em; color: var(--hgb-text);
}
.hgb-board__mode {
	font-size: 11px; padding: 4px 10px; border-radius: 999px; white-space: nowrap;
	background: var(--hgb-accent-soft); color: var(--hgb-accent);
	border: 1px solid transparent; font-weight: 600; letter-spacing: .02em;
}
/* Sits after the flexible rule (order 9) so it lands on the far right edge. */
.hgb-board__more {
	order: 10; flex: 0 0 auto;
	font-size: 12px; font-weight: 600; color: var(--hgb-muted); white-space: nowrap;
	transition: color .2s;
}
.hgb-board__more:hover { color: var(--hgb-accent); }

.hgb-card {
	position: relative; display: flex; flex-direction: column;
	background: var(--hgb-surface); border: 1px solid var(--hgb-line);
	border-radius: 16px; overflow: hidden;
	transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease;
	animation: hgb-rise .45s ease backwards;
}
.hgb-card:hover {
	transform: translateY(-6px);
	border-color: var(--hgb-line-strong);
	box-shadow: var(--hgb-shadow);
}
.hgb-card--pinned { border-color: var(--hgb-pinned-line); }
.hgb-card__main {
	display: flex; flex-direction: column; flex: 1;
	color: inherit; text-decoration: none;
}
.hgb-card__main:hover { color: inherit; }
.hgb-card__cover {
	position: relative; aspect-ratio: 3 / 4; overflow: hidden;
	background: var(--hgb-surface-2);
}
.hgb-card__cover::after {
	content: ""; position: absolute; inset: 0;
	background: var(--hgb-cover-shade); pointer-events: none;
}
.hgb-card__cover img {
	width: 100%; height: 100%; object-fit: cover; display: block;
	transition: transform .5s cubic-bezier(.2, .7, .3, 1);
}
.hgb-card:hover .hgb-card__cover img { transform: scale(1.06); }
.hgb-card__placeholder {
	position: relative; width: 100%; height: 100%;
	display: flex; align-items: center; justify-content: center;
	background: var(--hgb-placeholder); color: var(--hgb-faint);
	font-size: 38px; font-weight: 700; letter-spacing: .1em;
}
.hgb-card__placeholder span { position: relative; z-index: 1; opacity: .75; }
.hgb-card__rank {
	position: absolute; z-index: 2; top: 10px; left: 10px;
	min-width: 32px; height: 32px; padding: 0 7px;
	display: flex; align-items: center; justify-content: center;
	border-radius: 9px; background: var(--hgb-glass);
	backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
	border: 1px solid var(--hgb-line);
	color: var(--hgb-text); font-size: 13px; font-weight: 700;
	font-variant-numeric: tabular-nums; letter-spacing: .02em;
}
.hgb-grid .hgb-card:nth-child(1) .hgb-card__rank {
	background: linear-gradient(135deg, #f8d681, #d89b3b);
	color: #2c1d08; border-color: transparent;
}
.hgb-grid .hgb-card:nth-child(2) .hgb-card__rank {
	background: linear-gradient(135deg, #e2e7ef, #939dad);
	color: #1e232b; border-color: transparent;
}
.hgb-grid .hgb-card:nth-child(3) .hgb-card__rank {
	background: linear-gradient(135deg, #eab78b, #aa6a3c);
	color: #2b1608; border-color: transparent;
}
.hgb-card__pin {
	position: absolute; z-index: 2; top: 10px; right: 10px;
	padding: 5px 9px; border-radius: 999px;
	background: var(--hgb-accent); color: #fff;
	font-size: 10px; font-weight: 700; letter-spacing: .04em;
	box-shadow: 0 6px 16px rgba(255, 77, 85, .28);
}
/* Position movement since the previous snapshot. Deliberately small: it is
   evidence, not decoration. */
.hgb-card__delta {
	position: absolute; z-index: 2; left: 10px; bottom: 10px;
	padding: 3px 8px; border-radius: 6px;
	font-size: 10px; font-weight: 700; letter-spacing: .02em;
	background: rgba(10, 12, 16, .72); color: #f2f3f7;
	backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.hgb-card__delta--up { background: rgba(24, 92, 46, .82); color: #8fe6a4; }
.hgb-card__delta--down { background: rgba(56, 58, 64, .82); color: #c6cad2; }
.hgb-card__delta--new { background: rgba(150, 34, 40, .84); color: #ffd9db; }
.hgb-card__body { padding: 14px 15px 16px; flex: 1; display: flex; flex-direction: column; }
.hgb-card__title {
	font-size: 15.5px; line-height: 1.4; margin: 0 0 7px; font-weight: 700;
	color: var(--hgb-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hgb-card__meta {
	font-size: 11.5px; color: var(--hgb-muted); margin: 0 0 9px;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hgb-dot { color: var(--hgb-faint); padding: 0 3px; }
.hgb-card__intro {
	font-size: 12px; line-height: 1.65; color: var(--hgb-muted); margin: 0 0 11px;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hgb-card__note {
	position: relative; font-size: 11.5px; line-height: 1.55;
	color: var(--hgb-note-text); background: var(--hgb-note-bg);
	border-radius: 8px; padding: 8px 10px 8px 13px; margin: 0 0 11px;
}
.hgb-card__note::before {
	content: ""; position: absolute; left: 0; top: 9px; bottom: 9px;
	width: 2px; border-radius: 2px; background: var(--hgb-gold);
}
.hgb-card__note-label {
	display: block; font-size: 10px; letter-spacing: .08em;
	opacity: .8; margin: 0 0 2px; font-weight: 700;
}
.hgb-card__cta {
	margin-top: auto; display: inline-flex; align-items: center;
	justify-content: space-between; gap: 8px;
	padding: 9px 12px; border-radius: 9px;
	background: var(--hgb-accent-soft); color: var(--hgb-accent);
	font-size: 12px; font-weight: 700;
	transition: background .25s, color .25s, transform .25s;
}
.hgb-card:hover .hgb-card__cta { background: var(--hgb-accent); color: var(--hgb-accent-text); }
.hgb-card__cta span { transition: transform .25s; }
.hgb-card:hover .hgb-card__cta span { transform: translateX(3px); }
.hgb-card__fallback {
	display: block; text-align: center; font-size: 11px;
	color: var(--hgb-faint); padding: 9px 8px;
	border-top: 1px solid var(--hgb-line); text-decoration: none;
	transition: color .2s, background .2s;
}
.hgb-card__detail {
	display: block; text-align: center; font-size: 11.5px; font-weight: 600;
	color: var(--hgb-accent); padding: 9px 8px;
	border-top: 1px solid var(--hgb-line); text-decoration: none;
	transition: color .2s, background .2s;
}
.hgb-card__detail:hover { background: var(--hgb-accent-soft); }
.hgb-card__fallback:hover { color: var(--hgb-accent); background: var(--hgb-accent-soft); }

.hgb-empty {
	font-size: 13px; color: var(--hgb-muted);
	background: var(--hgb-surface); border: 1px dashed var(--hgb-line-strong);
	border-radius: 14px; padding: 26px; text-align: center; margin: 0;
}
.hgb-disclaimer {
	font-size: 12px; line-height: 1.8; color: var(--hgb-muted);
	background: var(--hgb-surface); border: 1px solid var(--hgb-line);
	border-left: 3px solid var(--hgb-accent);
	border-radius: 10px; padding: 15px 18px; margin: 8px 0 0;
}

@keyframes hgb-rise {
	from { opacity: 0; transform: translateY(12px); }
	to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 700px) {
	.hgb-grid { grid-template-columns: repeat(auto-fill, minmax(142px, 1fr)); gap: 12px; }
	.hgb-board { margin-bottom: 40px; }
	.hgb-board__head { margin-bottom: 14px; padding-bottom: 12px; }
	.hgb-board__title { font-size: 19px; }
	.hgb-card { border-radius: 13px; }
	.hgb-card__body { padding: 11px 11px 13px; }
	.hgb-card__title { font-size: 14px; }
	.hgb-card__intro, .hgb-card__note { display: none; }
	.hgb-card__placeholder { font-size: 28px; }
	.hgb-card__rank { top: 7px; left: 7px; min-width: 26px; height: 26px; font-size: 11px; border-radius: 7px; }
	.hgb-card__pin { top: 7px; right: 7px; font-size: 9px; padding: 4px 7px; }
	.hgb-card__cta { padding: 8px 9px; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
	.hgb-card { animation: none; }
	.hgb-card, .hgb-card__cover img, .hgb-card__cta, .hgb-card__fallback, .hgb-card__detail { transition: none; }
	.hgb-card:hover { transform: none; }
}
