---
// 演示画廊:横向 scroll-snap,真实界面录屏(VHS GIF)+ 一行功能性说明。
// 用原生 <img>(而非 astro:assets <Image>)以保留 GIF 动画,不被 sharp 处理成静帧。
import readGif from "../../assets/guides/read.gif";
import networkGif from "../../assets/guides/network-read.gif";
import themeGif from "../../assets/guides/theme.gif";
import loginGif from "../../assets/guides/login.gif";

const shots = [
	{ img: readGif, title: "沉浸式阅读", desc: "正文分页流畅，目录随时跳转，命名主题全局生效。" },
	{ img: networkGif, title: "网络小说在线读", desc: "分类浏览、详情、阅读一气呵成。" },
	{ img: themeGif, title: "主题随心配", desc: "命名主题驱动全局配色，终端背景或主题背景随时切换。" },
	{ img: loginGif, title: "需登录的书源", desc: "表单 / 浏览器登录，登录态加密保存自动复用。" },
];
---

<div class="tn-gallery">
	{
		shots.map((s) => (
			<figure>
				<div class="crop">
					<img src={s.img.src} width={s.img.width} height={s.img.height} alt={s.title} loading="lazy" />
				</div>
				<figcaption>
					<strong>{s.title}</strong>
					<span>{s.desc}</span>
				</figcaption>
			</figure>
		))
	}
</div>

<style>
	.tn-gallery {
		display: flex;
		gap: 1.25rem;
		margin-top: 2rem;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		padding-bottom: 0.75rem;
		scrollbar-width: thin;
	}

	figure {
		flex: 0 0 min(560px, 86%);
		margin: 0;
		scroll-snap-align: start;
	}

	.crop {
		overflow: hidden;
		border: 1px solid var(--tn-border);
		border-radius: 12px;
		background: #1e1e2e;
	}

	.crop img {
		display: block;
		width: 100%;
		height: auto;
	}

	figcaption {
		display: flex;
		flex-direction: column;
		gap: 0.15rem;
		margin-top: 0.75rem;
	}

	figcaption strong {
		font-size: 0.95rem;
		color: var(--sl-color-white);
	}

	figcaption span {
		font-size: 0.85rem;
		color: var(--sl-color-gray-3);
	}
</style>
