/* =========================================================
   LinkHub 网址收藏 · 前台样式（扁平化设计）
   ========================================================= */

:root {
	--lh-primary: #4f46e5;
	--lh-primary-dark: #4338ca;
	--lh-text: #1f2430;
	--lh-text-2: #6b7280;
	--lh-bg: #f6f7f9;
	--lh-card: #ffffff;
	--lh-border: #e5e7eb;
	--lh-radius: 10px;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	background: var(--lh-bg);
	color: var(--lh-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

a { color: var(--lh-primary); text-decoration: none; }
a:hover { color: var(--lh-primary-dark); }
img { max-width: 100%; height: auto; }

.lh-container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------- 头部 ---------- */
.lh-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: #fff;
	border-bottom: 1px solid var(--lh-border);
}
.lh-header-inner {
	display: flex;
	align-items: center;
	gap: 24px;
	height: 64px;
}
.lh-logo {
	font-size: 20px;
	font-weight: 800;
	color: var(--lh-text);
	letter-spacing: .5px;
}
.lh-menu {
	display: flex;
	gap: 4px;
	list-style: none;
	margin: 0;
	padding: 0;
}
.lh-menu a {
	display: block;
	padding: 8px 14px;
	border-radius: 8px;
	color: var(--lh-text);
	font-size: 15px;
}
.lh-menu a:hover,
.lh-menu .current-menu-item > a {
	background: #eef0fe;
	color: var(--lh-primary);
}

/* 头部右侧操作区（收藏页显示「复制网址」） */
.lh-header-actions {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 10px;
}
.lh-header-actions .lh-copy-link {
	border: 0;
	background: var(--lh-primary);
	color: #fff;
}
.lh-header-actions .lh-copy-link:hover {
	background: var(--lh-primary-dark);
	color: #fff;
}
.lh-header-actions .lh-copy-link.is-done {
	background: #16a34a;
	color: #fff;
}

.lh-nav-toggle {
	display: none;
	flex-direction: column;
	gap: 5px;
	background: none;
	border: 0;
	cursor: pointer;
	padding: 8px;
}
.lh-nav-toggle span { width: 22px; height: 2px; background: var(--lh-text); border-radius: 2px; }

/* ---------- 搜索框（首页 Hero 使用） ---------- */
.lh-search-form {
	display: flex;
	align-items: center;
	background: #fff;
	border: 1px solid var(--lh-border);
	border-radius: 999px;
	overflow: hidden;
	transition: border-color .2s;
}
.lh-search-form:focus-within { border-color: var(--lh-primary); }
.lh-search-form input[type="search"] {
	border: 0;
	outline: 0;
	padding: 8px 14px;
	font-size: 14px;
	width: 170px;
	background: transparent;
}
.lh-search-form button {
	border: 0;
	background: transparent;
	padding: 8px 14px;
	font-size: 16px;
	cursor: pointer;
	color: var(--lh-text-2);
}

/* ---------- Hero（首页） ---------- */
.lh-hero {
	background: var(--lh-primary);
	color: #fff;
	padding: 72px 0 64px;
	text-align: center;
}
.lh-hero-title { font-size: 40px; margin: 0 0 12px; font-weight: 800; }
.lh-hero-subtitle { font-size: 17px; opacity: .92; margin: 0 0 28px; }
.lh-hero-search { display: flex; justify-content: center; }
.lh-hero-search .lh-search-form { border-color: transparent; }
.lh-hero-search .lh-search-form input[type="search"] { width: min(420px, 60vw); padding: 12px 18px; }
.lh-hero-search .lh-search-form button { padding: 12px 18px; }

/* ---------- 区块 ---------- */
.lh-section { padding: 36px 0 8px; }
.lh-section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: 18px;
}
.lh-section-head h2 { font-size: 22px; margin: 0; }
.lh-more { font-size: 14px; }

/* ---------- 分类 / 标签 chips ---------- */
.lh-cat-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.lh-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: var(--lh-card);
	border: 1px solid var(--lh-border);
	border-radius: 999px;
	padding: 8px 16px;
	font-size: 14px;
	color: var(--lh-text);
	transition: border-color .2s, color .2s;
}
.lh-chip:hover { border-color: var(--lh-primary); color: var(--lh-primary); }
.lh-chip em { font-style: normal; font-size: 12px; color: var(--lh-text-2); background: var(--lh-bg); border-radius: 999px; padding: 0 8px; }
.lh-chip-tag { color: var(--lh-text-2); }
.lh-chip-sm { padding: 4px 12px; font-size: 13px; }

/* ---------- 收藏页卡片网格 ---------- */
.lh-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
	gap: 20px;
}
.lh-card {
	background: var(--lh-card);
	border: 1px solid var(--lh-border);
	border-radius: var(--lh-radius);
	overflow: hidden;
	transition: border-color .2s;
}
.lh-card:hover { border-color: var(--lh-primary); }
.lh-card-link { display: block; color: inherit; }
.lh-card-link:hover { color: inherit; }

.lh-card-cover { position: relative; aspect-ratio: 16 / 8; background: #eef0f7; overflow: hidden; }
.lh-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lh-card-cover-fallback {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	background: #eef0f7;
}
.lh-card-cover-fallback img {
	width: 44px;
	height: 44px;
	border-radius: 10px;
	background: #fff;
	padding: 6px;
}
.lh-card-letter {
	font-size: 44px;
	font-weight: 800;
	color: var(--lh-primary);
}
.lh-card-cat {
	position: absolute;
	left: 12px;
	top: 12px;
	background: #1f2430;
	color: #fff;
	font-size: 12px;
	padding: 3px 10px;
	border-radius: 999px;
}
.lh-card-body { padding: 16px 18px 18px; }
.lh-card-title { font-size: 17px; margin: 0 0 8px; }
.lh-card-excerpt {
	font-size: 14px;
	color: var(--lh-text-2);
	margin: 0 0 12px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 2.6em;
}
.lh-card-meta {
	display: flex;
	justify-content: space-between;
	font-size: 12.5px;
	color: var(--lh-text-2);
	border-top: 1px dashed var(--lh-border);
	padding-top: 10px;
}

/* ---------- 归档页 ---------- */
.lh-archive { padding: 32px 20px 48px; }
.lh-archive-head { margin-bottom: 24px; }
.lh-archive-title { font-size: 28px; margin: 8px 0 6px; }
.lh-archive-title em { font-style: normal; color: var(--lh-primary); }
.lh-archive-desc { color: var(--lh-text-2); margin: 0; }
.lh-archive .lh-cat-chips { margin-bottom: 22px; }

.lh-breadcrumb { font-size: 13px; color: var(--lh-text-2); }
.lh-breadcrumb a { color: var(--lh-text-2); }
.lh-breadcrumb a:hover { color: var(--lh-primary); }
.lh-breadcrumb .sep { margin: 0 8px; opacity: .5; }

/* ---------- 单页：收藏详情 ---------- */
.lh-single { padding: 32px 20px 56px; max-width: 900px; }
.lh-single-head { margin-bottom: 18px; }
.lh-single-title { font-size: 30px; margin: 10px 0 10px; }
.lh-single-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	font-size: 13.5px;
	color: var(--lh-text-2);
}
.lh-single-thumb { border-radius: var(--lh-radius); overflow: hidden; margin-bottom: 18px; }
.lh-single-content {
	background: var(--lh-card);
	border: 1px solid var(--lh-border);
	border-radius: var(--lh-radius);
	padding: 22px 26px;
	margin-bottom: 24px;
	font-size: 15.5px;
}
.lh-single-content h2, .lh-single-content h3 { margin-top: 1em; }

/* 网址卡片列表 */
.lh-links-list { display: flex; flex-direction: column; gap: 14px; }
.lh-link-item {
	display: flex;
	align-items: center;
	gap: 16px;
	background: var(--lh-card);
	border: 1px solid var(--lh-border);
	border-radius: var(--lh-radius);
	padding: 16px 18px;
	color: inherit;
	transition: border-color .18s;
}
.lh-link-item:hover {
	color: inherit;
	border-color: var(--lh-primary);
}
.lh-link-icon {
	flex: 0 0 52px;
	width: 52px;
	height: 52px;
	border-radius: 12px;
	background: var(--lh-bg);
	border: 1px solid var(--lh-border);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}
.lh-link-icon img { width: 34px; height: 34px; object-fit: contain; }
.lh-link-info { flex: 1; min-width: 0; }
.lh-link-title { display: block; font-size: 16px; margin-bottom: 2px; }
.lh-link-desc {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: 13.5px;
	color: var(--lh-text-2);
}
.lh-link-host { display: block; font-size: 12px; color: #a0a6b5; margin-top: 3px; }
.lh-visit-btn {
	flex: 0 0 auto;
	background: var(--lh-primary);
	color: #fff;
	font-size: 14px;
	padding: 8px 18px;
	border-radius: 999px;
	transition: background .2s;
}
.lh-link-item:hover .lh-visit-btn { background: var(--lh-primary-dark); }

.lh-single-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.lh-related { padding-top: 40px; }

/* ---------- 复制网址按钮（顶部导航使用） ---------- */
.lh-copy-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border: 1px solid var(--lh-border);
	background: var(--lh-card);
	border-radius: 999px;
	padding: 8px 18px;
	font-size: 13.5px;
	color: var(--lh-text-2);
	cursor: pointer;
	transition: all .18s;
	white-space: nowrap;
}
.lh-copy-link:hover { border-color: var(--lh-primary); color: var(--lh-primary); }
.lh-copy-link.is-done { border-color: #16a34a; color: #16a34a; background: #f0fdf4; }

/* ---------- 弹窗 ---------- */
body.lh-modal-open { overflow: hidden; }
.lh-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 9999;
	background: rgba(20, 22, 34, .55);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	animation: lhFadeIn .18s ease;
}
.lh-modal {
	position: relative;
	background: #fff;
	border: 1px solid var(--lh-border);
	border-radius: 14px;
	max-width: 440px;
	width: 100%;
	padding: 34px 30px 28px;
	text-align: center;
	animation: lhPop .22s ease;
}
.lh-modal-icon {
	width: 56px;
	height: 56px;
	margin: 0 auto 14px;
	border-radius: 50%;
	background: #eef0fe;
	color: var(--lh-primary);
	font-size: 26px;
	display: flex;
	align-items: center;
	justify-content: center;
}
.lh-modal-title { margin: 0 0 10px; font-size: 19px; }
.lh-modal-body {
	margin: 0 0 22px;
	font-size: 14.5px;
	color: var(--lh-text-2);
	word-break: break-all;
}
.lh-modal-actions { display: flex; gap: 12px; justify-content: center; }
.lh-modal-close {
	position: absolute;
	top: 10px;
	right: 14px;
	border: 0;
	background: none;
	font-size: 24px;
	line-height: 1;
	color: var(--lh-text-2);
	cursor: pointer;
}
.lh-btn {
	border: 0;
	border-radius: 999px;
	padding: 10px 22px;
	font-size: 14.5px;
	cursor: pointer;
	transition: background .18s;
}
.lh-btn-primary { background: var(--lh-primary); color: #fff; }
.lh-btn-primary:hover { background: var(--lh-primary-dark); }
.lh-btn-ghost { background: var(--lh-bg); color: var(--lh-text); }
.lh-btn-ghost:hover { background: #e8eaf1; }
.lh-count { font-weight: 700; }

@keyframes lhFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes lhPop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }

/* ---------- 空状态 / 404 / 分页 ---------- */
.lh-empty {
	background: var(--lh-card);
	border: 1px dashed var(--lh-border);
	border-radius: var(--lh-radius);
	text-align: center;
	color: var(--lh-text-2);
	padding: 60px 20px;
}
.lh-404 { margin: 60px 0; }
.lh-404-code { font-size: 72px; font-weight: 800; color: var(--lh-primary); margin: 0; }

.pagination, .nav-links { margin: 32px 0; text-align: center; }
.page-numbers {
	display: inline-block;
	min-width: 38px;
	padding: 7px 12px;
	margin: 0 3px;
	border-radius: 8px;
	background: var(--lh-card);
	border: 1px solid var(--lh-border);
	color: var(--lh-text);
	font-size: 14px;
}
.page-numbers.current { background: var(--lh-primary); border-color: var(--lh-primary); color: #fff; }
.page-numbers:hover:not(.current) { border-color: var(--lh-primary); color: var(--lh-primary); }

/* ---------- 页脚 ---------- */
.lh-footer {
	margin-top: 48px;
	border-top: 1px solid var(--lh-border);
	background: #fff;
	padding: 30px 0;
	text-align: center;
}
.lh-footer-menu {
	list-style: none;
	display: flex;
	justify-content: center;
	gap: 18px;
	padding: 0;
	margin: 0 0 10px;
	font-size: 14px;
}
.lh-copyright { color: var(--lh-text-2); font-size: 13px; margin: 0; }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
	.lh-header-inner { gap: 12px; }
	.lh-nav {
		display: none;
		position: absolute;
		top: 64px;
		left: 0;
		right: 0;
		background: #fff;
		border-bottom: 1px solid var(--lh-border);
		padding: 10px 20px;
	}
	.lh-nav.is-open { display: block; }
	.lh-menu { flex-direction: column; }
	.lh-nav-toggle { display: flex; }
	.lh-hero { padding: 52px 0 44px; }
	.lh-hero-title { font-size: 28px; }
}
@media (max-width: 560px) {
	.lh-grid { grid-template-columns: 1fr; }
	.lh-link-item { flex-wrap: wrap; }
	.lh-visit-btn { width: 100%; text-align: center; }
	.lh-single-title { font-size: 24px; }
}
