/* ============================================================
   灵犀导航 Lingxi Nav 主样式
   骨架版：双主题（浅色/暗黑）CSS 变量 + 基础布局
   ============================================================ */

/* ---------- 主题变量 ---------- */
:root {
	--lx-bg: #f5f6fa;
	--lx-surface: #ffffff;
	--lx-surface-2: #f0f1f6;
	--lx-border: #e4e6ee;
	--lx-text: #22252e;
	--lx-text-2: #6b7280;
	--lx-primary: #ff6000;
	--lx-primary-2: #e65500;
	--lx-header-grad: #ffffff;
	--lx-radius: 10px;
	--lx-shadow: 0 1px 4px rgba(20, 20, 60, 0.06);
	--lx-shadow-hover: 0 6px 20px rgba(20, 20, 60, 0.12);
	--lx-max: 1920px;
}

html[data-theme="dark"] {
/* 暗黑顶栏覆盖（全站） */
html[data-theme="dark"] .lx-header { background: #1e202b; box-shadow: 0 1px 8px rgba(0,0,0,0.4); }
html[data-theme="dark"] .lx-logo { color: #e6e8f0; }
html[data-theme="dark"] .lx-logo:hover { color: #ff8733; }
html[data-theme="dark"] .lx-nav a { color: #b9bfcf; }
html[data-theme="dark"] .lx-nav a:hover,
html[data-theme="dark"] .lx-nav .current-menu-item > a { background: rgba(255,96,0,0.15); color: #ff8733; }
html[data-theme="dark"] .lx-header__tools .lx-btn--icon { color: #b9bfcf; }
html[data-theme="dark"] .lx-header__tools .lx-btn--ghost { color: #b9bfcf; }
html[data-theme="dark"] .lx-header__tools .lx-btn--icon:hover,
html[data-theme="dark"] .lx-header__tools .lx-btn--ghost:hover { color: #ff8733; }
	--lx-bg: #14151d;
	--lx-surface: #1e202b;
	--lx-surface-2: #262936;
	--lx-border: #33364a;
	--lx-text: #e6e8f0;
	--lx-text-2: #9aa0b5;
	--lx-header-grad: #1e202b;
	--lx-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
	--lx-shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.45);
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	margin: 0;
	background: var(--lx-bg);
	color: var(--lx-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
	font-size: 14px;
	line-height: 1.6;
	transition: background 0.2s ease, color 0.2s ease;
}

a { color: var(--lx-primary); text-decoration: none; }
a:hover { color: var(--lx-primary-2); }

img { max-width: 100%; height: auto; }

.lx-container { max-width: var(--lx-max); margin: 0 auto; padding: 0 16px; }

/* ---------- 按钮 ---------- */
.lx-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 8px 16px;
	border: 1px solid var(--lx-border);
	border-radius: 8px;
	background: var(--lx-surface);
	color: var(--lx-text);
	font-size: 14px;
	cursor: pointer;
	transition: all 0.15s ease;
}
.lx-btn:hover { border-color: var(--lx-primary); color: var(--lx-primary); }
.lx-btn--primary { background: var(--lx-primary); border-color: var(--lx-primary); color: #fff; }
.lx-btn--primary:hover { background: var(--lx-primary-2); color: #fff; }
.lx-btn--ghost { background: transparent; border-color: transparent; }
.lx-btn--icon { padding: 8px; border: none; background: transparent; color: var(--lx-text); }
.lx-btn--icon:hover { color: var(--lx-primary); }

/* ---------- 头部 ---------- */
.lx-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--lx-header-grad);
	transition: background 0.3s ease;
}

/* 滚动后毛玻璃效果（JS 挂 is-scrolled） */
.lx-header.is-scrolled {
	-webkit-backdrop-filter: saturate(180%) blur(6px);
	backdrop-filter: saturate(180%) blur(6px);
	background: rgba(255, 255, 255, 0.9);
}
html[data-theme="dark"] .lx-header.is-scrolled {
	background: rgba(30, 32, 43, 0.9);
}

.lx-header__inner {
	max-width: var(--lx-max);
	margin: 0 auto;
	padding: 0 16px;
	height: 68px;
	display: flex;
	align-items: center;
	gap: 20px;
}

.lx-logo { display: flex; align-items: center; gap: 8px; color: #2b2f36; font-size: 20px; font-weight: 700; }
.lx-logo__img { height: 32px; max-height: 32px; width: auto; max-width: 220px; object-fit: contain; display: block; box-sizing: border-box; }
html[data-theme="dark"] .lx-logo__img { background: #fff; border-radius: 4px; padding: 2px; }
.lx-logo:hover { color: #ff6000; }
.lx-logo__mark { letter-spacing: 1px; }

.lx-header__nav { flex: 1; }
.lx-nav { display: flex; list-style: none; margin: 0; padding: 0; gap: 4px; }
.lx-nav li { position: relative; }
.lx-nav a {
	display: block;
	padding: 8px 14px;
	color: #3c3c3c;
	border-radius: 6px;
	font-size: 15px;
}
.lx-nav a:hover { background: #fff3ec; color: #ff6000; }
.lx-nav .current-menu-item > a { background: #fff3ec; color: #ff6000; }

.lx-header__tools { display: flex; align-items: center; gap: 4px; }
.lx-header__tools .lx-btn--icon { color: #3c3c3c; }
.lx-header__tools .lx-btn--icon:hover { color: #ff6000; }
.lx-header__tools .lx-btn--ghost { color: #3c3c3c; }
.lx-header__tools .lx-btn--ghost:hover { color: #ff6000; }

.lx-icon-sun { display: none; }
html[data-theme="dark"] .lx-icon-sun { display: block; }
html[data-theme="dark"] .lx-icon-moon { display: none; }

/* ---------- 搜索条 ---------- */
.lx-searchbar {
	max-width: var(--lx-max);
	margin: 0 auto;
	padding: 10px 16px 16px;
}
.lx-search { display: flex; gap: 8px; }
.lx-search__input {
	flex: 1;
	padding: 10px 16px;
	border: none;
	border-radius: 8px;
	background: var(--lx-surface);
	color: var(--lx-text);
	font-size: 14px;
	outline: none;
}

/* ---------- 主布局 ---------- */
.lx-main { min-height: 60vh; }

/* ---------- 顶部导航用户面板 ---------- */
.lx-user { position: relative; display: flex; align-items: center; }
.lx-user__trigger {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 4px;
	border: none;
	background: transparent;
	cursor: pointer;
	border-radius: 999px;
	color: inherit;
}
.lx-user__trigger:hover { background: rgba(0, 0, 0, 0.05); }
.lx-user__avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; display: block; }
.lx-user__caret { opacity: 0.6; transition: transform 0.2s ease; }
.lx-user.is-open .lx-user__caret { transform: rotate(180deg); }

.lx-user__panel {
	position: absolute;
	top: calc(100% + 10px);
	right: 0;
	z-index: 200;
	width: 264px;
	padding: 8px;
	background: var(--lx-surface);
	border-radius: 14px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}
/* 桌面端 hover 展开；移动端/触屏由 JS 的 .is-open 控制 */
.lx-user:hover .lx-user__panel,
.lx-user.is-open .lx-user__panel { opacity: 1; visibility: visible; transform: translateY(0); }
.lx-user__panel::before {
	/* 视觉桥：避免鼠标从头像移向面板时经过空隙导致 hover 断开 */
	content: "";
	position: absolute;
	top: -12px;
	left: 0;
	right: 0;
	height: 12px;
}

.lx-user__info {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px;
	border-radius: 10px;
	text-decoration: none;
}
.lx-user__info:hover { background: rgba(0, 0, 0, 0.04); }
.lx-user__info .lx-user__avatar { width: 48px; height: 48px; }
.lx-user__meta { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lx-user__name { font-size: 14px; color: var(--lx-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lx-user__mail { font-size: 12px; color: var(--lx-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lx-user__stats {
	display: flex;
	margin: 6px 2px 8px;
	padding: 10px 0;
	border-radius: 10px;
	background: rgba(0, 0, 0, 0.03);
}
.lx-user__stats a {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	text-decoration: none;
}
.lx-user__stats strong { font-size: 16px; color: var(--lx-text); }
.lx-user__stats span { font-size: 12px; color: var(--lx-text-2); }

.lx-user__menu { display: flex; flex-direction: column; }
.lx-user__menu a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border-radius: 10px;
	font-size: 13px;
	color: var(--lx-text);
	text-decoration: none;
}
.lx-user__menu a:hover { background: rgba(0, 0, 0, 0.04); }
.lx-user__menu i { font-size: 17px; color: var(--lx-text-2); }
.lx-user__menu .lx-user__logout { color: #e5484d; }
.lx-user__menu .lx-user__logout i { color: #e5484d; }

body[data-theme="dark"] .lx-user__trigger:hover { background: rgba(255, 255, 255, 0.08); }
body[data-theme="dark"] .lx-user__panel { box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); }
body[data-theme="dark"] .lx-user__info:hover,
body[data-theme="dark"] .lx-user__menu a:hover { background: rgba(255, 255, 255, 0.06); }
body[data-theme="dark"] .lx-user__stats { background: rgba(255, 255, 255, 0.05); }

@media (max-width: 768px) {
	.lx-header__submit { display: none; }
	.lx-user__panel { position: fixed; top: 64px; right: 12px; left: 12px; width: auto; }
}

.lx-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 280px;
	gap: 20px;
	align-items: start;
}

/* 三列变体：仅当页面真的包含分类栏（lx-layout__cats）时使用 */
.lx-layout--cats {
	grid-template-columns: 200px minmax(0, 1fr) 280px;
}

@media (max-width: 1024px) {
	.lx-layout { grid-template-columns: minmax(0, 1fr) 260px; }
	.lx-layout__cats { display: none; }
	.lx-layout--cats { grid-template-columns: minmax(0, 1fr) 260px; }
}

@media (max-width: 768px) {
	.lx-layout,
	.lx-layout--cats { grid-template-columns: 1fr; }
	/* 顶部导航：横滑条（不换行、可左右滚动、隐藏滚动条） */
	.lx-header__nav {
		flex: 1 1 auto;
		min-width: 0;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}
	.lx-header__nav::-webkit-scrollbar { display: none; }
	.lx-nav { flex-wrap: nowrap; }
	.lx-nav a { white-space: nowrap; }
}

/* ---------- 左侧分类栏 ---------- */
.lx-cats__box {
	background: var(--lx-surface);
	border-radius: var(--lx-radius);
	box-shadow: var(--lx-shadow);
	padding: 14px;
	position: sticky;
	top: 76px;
}
.lx-cats__title { margin: 0 0 10px; font-size: 15px; }
.lx-cats__list { list-style: none; margin: 0; padding: 0; }
.lx-cats__list li { margin: 2px 0; }
.lx-cats__list a {
	display: block;
	padding: 6px 10px;
	border-radius: 6px;
	color: var(--lx-text-2);
	font-size: 13px;
}
.lx-cats__list a:hover { background: var(--lx-surface-2); color: var(--lx-primary); }

/* ---------- 区块 ---------- */
.lx-section { margin-bottom: 28px; }
.lx-section__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}
.lx-section__title {
	margin: 0;
	font-size: 18px;
	position: relative;
	padding-left: 12px;
}
.lx-section__title::before {
	content: "";
	position: absolute;
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 4px;
	height: 16px;
	border-radius: 2px;
	background: var(--lx-primary);
}
.lx-section__more { color: var(--lx-text-2); font-size: 13px; }

/* ---------- 网址卡片 ---------- */
.lx-website-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 12px;
}

.lx-website-card {
	background: var(--lx-surface);
	border: 1px solid var(--lx-border);
	border-radius: var(--lx-radius);
	box-shadow: var(--lx-shadow);
	padding: 14px;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.lx-website-card:hover { transform: translateY(-2px); box-shadow: var(--lx-shadow-hover); }

.lx-website-card__link { display: flex; align-items: center; gap: 10px; color: var(--lx-text); }
.lx-website-card__link:hover { color: var(--lx-primary); }
.lx-website-card__icon {
	width: 36px;
	height: 36px;
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--lx-surface-2);
	border-radius: 8px;
	overflow: hidden;
}
.lx-website-card__img { width: 24px; height: 24px; }
.lx-website-card__letter { font-size: 16px; font-weight: 700; color: var(--lx-primary); }
.lx-website-card__name { font-size: 14px; font-weight: 600; }
.lx-website-card__desc {
	margin-top: 8px;
	color: var(--lx-text-2);
	font-size: 12px;
	line-height: 1.5;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ---------- 文章卡片 ---------- */
.lx-post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.lx-post-card { background: var(--lx-surface); border: 1px solid var(--lx-border); border-radius: var(--lx-radius); box-shadow: var(--lx-shadow); padding: 16px; }
.lx-post-card__title { margin: 0 0 8px; font-size: 16px; }
.lx-post-card__meta { display: flex; gap: 12px; color: var(--lx-text-2); font-size: 12px; }
.lx-post-card__excerpt { color: var(--lx-text-2); font-size: 13px; }

/* ---------- 侧边栏 ---------- */
.lx-sidebar { position: sticky; top: 76px; }
.lx-widget {
	background: var(--lx-surface);
	border: 1px solid var(--lx-border);
	border-radius: var(--lx-radius);
	box-shadow: var(--lx-shadow);
	padding: 14px;
	margin-bottom: 14px;
}
.lx-widget__title { margin: 0 0 10px; font-size: 15px; }
.lx-side-list { list-style: none; margin: 0; padding: 0; }
.lx-side-list li { padding: 5px 0; border-bottom: 1px dashed var(--lx-border); }
.lx-side-list li:last-child { border-bottom: none; }
.lx-side-list a { color: var(--lx-text-2); font-size: 13px; }
.lx-side-list a:hover { color: var(--lx-primary); }

/* ---------- 归档 / 详情 / 页面 ---------- */
.lx-archive__head { margin-bottom: 18px; }
.lx-archive__title { margin: 0 0 6px; font-size: 22px; }
.lx-archive__desc { color: var(--lx-text-2); font-size: 13px; }
.lx-archive__count { color: var(--lx-text-2); font-size: 13px; }

.lx-single, .lx-page { background: var(--lx-surface); border: 1px solid var(--lx-border); border-radius: var(--lx-radius); box-shadow: var(--lx-shadow); padding: 24px; }
.lx-single__title, .lx-page__title { margin: 0 0 10px; font-size: 24px; }
.lx-single__meta { display: flex; gap: 14px; color: var(--lx-text-2); font-size: 13px; margin-bottom: 16px; }
.lx-single__content { line-height: 1.8; }
.lx-single__content img { border-radius: 8px; }

/* ---------- 404 ---------- */
.lx-404 { padding: 80px 16px; text-align: center; }
.lx-404__code { font-size: 72px; margin: 0; color: var(--lx-primary); }
.lx-404__text { color: var(--lx-text-2); margin: 10px 0 24px; }

/* ---------- 空状态 ---------- */
.lx-empty { text-align: center; color: var(--lx-text-2); padding: 40px 0; }

/* ---------- 页脚 ---------- */
.lx-footer {
	background: var(--lx-surface);
	border-top: 1px solid var(--lx-border);
	margin-top: 20px;
}
.lx-footer__inner {
	max-width: var(--lx-max);
	margin: 0 auto;
	padding: 40px 24px 20px;
}

/* 层 1：品牌与栏目导航 */
.lx-footer__grid {
	display: grid;
	grid-template-columns: 1.5fr 1fr 1fr 1fr;
	gap: 32px;
	padding-bottom: 28px;
	border-bottom: 1px solid var(--lx-border);
}
.lx-footer__logo {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--lx-text-1);
	font-size: 16px;
	font-weight: 700;
	text-decoration: none;
}
.lx-footer__logo img { max-height: 32px; max-width: 150px; object-fit: contain; display: block; }
.lx-footer__logo-mark {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--lx-primary);
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
}
.lx-footer__desc { margin: 12px 0 10px; font-size: 13px; line-height: 1.7; color: var(--lx-text-2); max-width: 320px; }
.lx-footer__contact { margin: 0; font-size: 13px; }
.lx-footer__contact a { color: var(--lx-text-2); }
.lx-footer__contact a:hover { color: var(--lx-primary); }
.lx-footer__col-title { margin: 0 0 14px; font-size: 14px; color: var(--lx-text-1); }
.lx-footer__col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.lx-footer__col a { color: var(--lx-text-2); font-size: 13px; }
.lx-footer__col a:hover { color: var(--lx-primary); }

/* 层 2：友情链接 */
.lx-footer__links { padding: 20px 0; border-bottom: 1px solid var(--lx-border); }
.lx-footer__links-title { margin: 0 0 10px; font-size: 13px; color: var(--lx-text-2); }
.lx-footer__links-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.lx-footer__links-list a { display: inline-flex; align-items: center; gap: 5px; color: var(--lx-text-2); font-size: 12px; }
.lx-footer__links-list a:hover { color: var(--lx-primary); }
.lx-footer__links-list img { border-radius: 3px; }

/* 层 3：合规底栏 */
.lx-footer__bottom {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	padding-top: 18px;
}
.lx-footer__copy { margin: 0; font-size: 12px; color: var(--lx-text-2); }
.lx-footer__copy a { color: var(--lx-text-2); }
.lx-footer__copy a:hover { color: var(--lx-primary); }
.lx-footer__legal { display: flex; gap: 16px; flex-wrap: wrap; }
.lx-footer__legal a { font-size: 12px; color: var(--lx-text-2); }
.lx-footer__legal a:hover { color: var(--lx-primary); }
.lx-footer__backtop {
	background: var(--lx-surface);
	border: 1px solid var(--lx-border);
	border-radius: 8px;
	color: var(--lx-text-2);
	font-size: 12px;
	padding: 6px 14px;
	cursor: pointer;
	transition: color 0.15s ease, border-color 0.15s ease;
}
.lx-footer__backtop:hover { color: var(--lx-primary); border-color: var(--lx-primary); }

@media (max-width: 899px) {
	.lx-footer__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 599px) {
	.lx-footer__grid { grid-template-columns: 1fr; gap: 24px; }
	.lx-footer__bottom { flex-direction: column; align-items: flex-start; }
}

/* 暗黑模式 */
html[data-theme="dark"] .lx-footer__col-title { color: var(--lx-text-1); }

/* ---------- 分页 ---------- */
.lx-pagination, .navigation.pagination { margin-top: 20px; }
.lx-pagination .nav-links, .navigation.pagination .nav-links { display: flex; gap: 6px; flex-wrap: wrap; }
.lx-pagination a, .lx-pagination span, .navigation.pagination a, .navigation.pagination span {
	display: inline-flex;
	min-width: 34px;
	height: 34px;
	padding: 0 8px;
	align-items: center;
	justify-content: center;
	background: var(--lx-surface);
	border: 1px solid var(--lx-border);
	border-radius: 8px;
	color: var(--lx-text);
	font-size: 13px;
}
.lx-pagination .current, .navigation.pagination .current { background: var(--lx-primary); border-color: var(--lx-primary); color: #fff; }


/* ============================================================
   新增组件样式（M2-M3：卡片 / 详情 / 表单 / 排行 / 分类树 / 暗黑适配）
   ============================================================ */

/* ---------- 卡片网格与统一卡片 ---------- */
.lx-card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 12px;
}
.lx-card {
	position: relative;
	background: var(--lx-surface);
	border: 1px solid var(--lx-border);
	border-radius: var(--lx-radius);
	box-shadow: var(--lx-shadow);
	padding: 14px;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.lx-card:hover { transform: translateY(-2px); box-shadow: var(--lx-shadow-hover); }

.lx-card-main { display: flex; align-items: center; gap: 12px; color: var(--lx-text); min-width: 0; }
.lx-card-main:hover { color: var(--lx-primary); }

.lx-card-icon {
	width: 48px;
	height: 48px;
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--lx-surface-2);
	border-radius: 10px;
	overflow: hidden;
}
.lx-card-icon img { width: 32px; height: 32px; object-fit: contain; }

.lx-card-body { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.lx-card-title {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	display: flex;
	align-items: center;
	gap: 6px;
}
.lx-card-desc {
	color: var(--lx-text-2);
	font-size: 12px;
	line-height: 1.5;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.lx-card-meta {
	display: flex;
	align-items: center;
	gap: 12px;
	color: var(--lx-text-2);
	font-size: 12px;
	border-top: 1px dashed var(--lx-border);
	padding-top: 8px;
}
.lx-meta-views { display: inline-flex; align-items: center; gap: 4px; }
.lx-meta-item { display: inline-flex; align-items: center; gap: 4px; color: var(--lx-text-2); font-size: 13px; }
.lx-badge-featured {
	display: inline-block;
	padding: 0 5px;
	font-size: 10px;
	font-style: normal;
	font-weight: 700;
	color: #fff;
	background: linear-gradient(135deg, #ff6b6b, #f97316);
	border-radius: 4px;
}
.lx-fav-btn {
	border: none;
	background: transparent;
	color: var(--lx-text-2);
	cursor: pointer;
	padding: 2px;
	display: inline-flex;
	align-items: center;
	margin-left: auto;
	transition: color 0.15s ease;
}
.lx-fav-btn:hover { color: var(--lx-primary); }
.lx-fav-btn.is-faved { color: var(--lx-primary); }

/* 资源卡片 */
.lx-resource-icon { background: linear-gradient(135deg, var(--lx-primary), var(--lx-primary-2)); color: #fff; }
.lx-resource-type-tag { font-size: 18px; font-weight: 700; }
.lx-type-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 5px;
	font-size: 11px;
	font-weight: 600;
	background: var(--lx-surface-2);
	color: var(--lx-text-2);
	border: 1px solid var(--lx-border);
}
.lx-type-app { background: #eef2ff; color: #4f46e5; border-color: #c7d2fe; }
.lx-type-cloud { background: #ecfeff; color: #0e7490; border-color: #a5f3fc; }
.lx-type-software { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.lx-type-material { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.lx-type-document { background: #fefce8; color: #a16207; border-color: #fef08a; }
.lx-type-template { background: #faf5ff; color: #7e22ce; border-color: #e9d5ff; }
.lx-type-other { background: var(--lx-surface-2); color: var(--lx-text-2); }
html[data-theme="dark"] .lx-type-app { background: #1e1b4b; color: #a5b4fc; border-color: #312e81; }
html[data-theme="dark"] .lx-type-cloud { background: #164e63; color: #67e8f9; border-color: #155e75; }
html[data-theme="dark"] .lx-type-software { background: #14532d; color: #86efac; border-color: #166534; }
html[data-theme="dark"] .lx-type-material { background: #7c2d12; color: #fdba74; border-color: #9a3412; }
html[data-theme="dark"] .lx-type-document { background: #713f12; color: #fde047; border-color: #854d0e; }
html[data-theme="dark"] .lx-type-template { background: #3b0764; color: #d8b4fe; border-color: #581c87; }

.lx-post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lx-thumb-placeholder { width: 100%; height: 100%; background: var(--lx-surface-2); }

/* ---------- 左侧分类树（新版） ---------- */
.lx-cats-panel {
	background: var(--lx-surface);
	border: 1px solid var(--lx-border);
	border-radius: var(--lx-radius);
	box-shadow: var(--lx-shadow);
	padding: 14px;
	position: sticky;
	top: 76px;
	max-height: calc(100vh - 100px);
	overflow-y: auto;
}
.lx-panel-title { margin: 0 0 10px; font-size: 15px; }
.lx-cats-tree { list-style: none; margin: 0; padding: 0; }
.lx-cats-item { position: relative; margin: 1px 0; }
.lx-cats-item > a {
	display: block;
	padding: 6px 10px;
	padding-right: 28px;
	border-radius: 6px;
	color: var(--lx-text-2);
	font-size: 13px;
}
.lx-cats-item > a:hover { background: var(--lx-surface-2); color: var(--lx-primary); }
.lx-cats-count { float: right; color: var(--lx-text-2); font-size: 11px; opacity: 0.7; }
.lx-cats-sub { padding-left: 12px; display: none; }
.lx-cats-item.is-open > .lx-cats-sub { display: block; }
.lx-cats-toggle {
	position: absolute;
	right: 4px;
	top: 4px;
	width: 22px;
	height: 22px;
	border: none;
	background: transparent;
	color: var(--lx-text-2);
	cursor: pointer;
	font-size: 11px;
	line-height: 1;
	border-radius: 4px;
}
.lx-cats-toggle:hover { background: var(--lx-surface-2); color: var(--lx-primary); }

/* ---------- 面包屑 ---------- */
.lx-breadcrumb {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 14px;
	color: var(--lx-text-2);
	font-size: 12px;
}
.lx-breadcrumb a { color: var(--lx-text-2); }
.lx-breadcrumb a:hover { color: var(--lx-primary); }
.lx-bc-sep { opacity: 0.5; }
.lx-bc-current { color: var(--lx-text); }

/* ---------- 归档页头 ---------- */
.lx-archive-head { margin-bottom: 16px; }
.lx-archive-title { margin: 0 0 6px; font-size: 22px; }
.lx-archive-desc { color: var(--lx-text-2); font-size: 13px; }
.lx-page-head { margin-bottom: 18px; }
.lx-page-head p { color: var(--lx-text-2); margin: 4px 0 0; }

/* ---------- 形态筛选 ---------- */
.lx-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.lx-tag {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 20px;
	background: var(--lx-surface);
	border: 1px solid var(--lx-border);
	color: var(--lx-text-2);
	font-size: 12px;
	transition: all 0.15s ease;
}
.lx-tag:hover { border-color: var(--lx-primary); color: var(--lx-primary); }
.lx-tag.is-active { background: var(--lx-primary); border-color: var(--lx-primary); color: #fff; }

/* ---------- 详情页 ---------- */
.lx-detail {
	background: var(--lx-surface);
	border: 1px solid var(--lx-border);
	border-radius: var(--lx-radius);
	box-shadow: var(--lx-shadow);
	padding: 24px;
}
.lx-detail-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.lx-detail-icon {
	width: 72px;
	height: 72px;
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--lx-surface-2);
	border-radius: 16px;
	overflow: hidden;
}
.lx-detail-icon img { width: 48px; height: 48px; object-fit: contain; }
.lx-detail-title { margin: 0 0 6px; font-size: 22px; line-height: 1.4; }
.lx-detail-head-info { flex: 1; min-width: 0; }
.lx-detail-head-info .lx-type-badge { margin-left: 8px; vertical-align: middle; }
.lx-detail-head-info p { margin: 6px 0 0; color: var(--lx-text-2); }

.lx-detail-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.lx-btn--lg { padding: 12px 24px; font-size: 15px; }
.lx-btn--block { display: flex; width: 100%; }

.lx-detail-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 20px;
	background: var(--lx-surface-2);
	border-radius: 8px;
	padding: 12px 16px;
	margin-bottom: 18px;
}
.lx-detail-content { line-height: 1.8; }
.lx-detail-content img { border-radius: 8px; }
.lx-detail-byline { display: flex; gap: 14px; color: var(--lx-text-2); font-size: 13px; margin-bottom: 14px; }
.lx-detail-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.lx-pan-code { user-select: all; letter-spacing: 1px; }

.lx-like-btn .lx-like-icon { color: #ef4444; }
.lx-like-btn.is-liked { color: #ef4444; border-color: #ef4444; }
.lx-like-btn.is-loading { opacity: 0.6; pointer-events: none; }

/* ---------- 相关推荐 ---------- */
.lx-related { margin-top: 24px; }

/* ---------- 排行榜 ---------- */
.lx-rank-panel .lx-rank-tabs { display: flex; gap: 4px; margin-bottom: 10px; }
.lx-rank-tab {
	border: none;
	background: transparent;
	color: var(--lx-text-2);
	padding: 4px 10px;
	border-radius: 6px;
	font-size: 12px;
	cursor: pointer;
}
.lx-rank-tab.is-active { background: var(--lx-surface-2); color: var(--lx-primary); font-weight: 600; }
.lx-rank-list { list-style: none; margin: 0; padding: 0; }
.lx-rank-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--lx-border); font-size: 13px; }
.lx-rank-item:last-child { border-bottom: none; }
.lx-rank-no {
	width: 20px;
	height: 20px;
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 5px;
	background: var(--lx-surface-2);
	color: var(--lx-text-2);
	font-size: 11px;
	font-weight: 700;
}
.lx-rank-item:nth-child(1) .lx-rank-no { background: linear-gradient(135deg, #f59e0b, #ef4444); color: #fff; }
.lx-rank-item:nth-child(2) .lx-rank-no { background: linear-gradient(135deg, #94a3b8, #64748b); color: #fff; }
.lx-rank-item:nth-child(3) .lx-rank-no { background: linear-gradient(135deg, #d97706, #b45309); color: #fff; }
.lx-rank-item a { flex: 1; color: var(--lx-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lx-rank-item a:hover { color: var(--lx-primary); }
.lx-rank-clicks { color: var(--lx-text-2); font-size: 11px; }
.lx-rank-empty, .lx-rank-loading { color: var(--lx-text-2); font-size: 12px; padding: 8px 0; text-align: center; }

/* ---------- 标签云 / 侧栏友链 ---------- */
.lx-tagcloud { display: flex; flex-wrap: wrap; gap: 6px; }
.lx-side-links { list-style: none; margin: 0; padding: 0; }
.lx-side-links li { padding: 4px 0; border-bottom: 1px dashed var(--lx-border); }
.lx-side-links li:last-child { border-bottom: none; }
.lx-side-links a { color: var(--lx-text-2); font-size: 13px; }
.lx-side-links a:hover { color: var(--lx-primary); }
.lx-widget__empty { color: var(--lx-text-2); font-size: 13px; }
.lx-widget--cta p { color: var(--lx-text-2); font-size: 13px; }

/* ---------- 表单 ---------- */
.lx-form { display: flex; flex-direction: column; gap: 14px; max-width: 640px; }
.lx-form-row { display: flex; flex-direction: column; gap: 6px; }
.lx-form-label { font-size: 13px; font-weight: 600; color: var(--lx-text); }
.lx-form-control {
	padding: 10px 12px;
	border: 1px solid var(--lx-border);
	border-radius: 8px;
	background: var(--lx-surface);
	color: var(--lx-text);
	font-size: 14px;
	outline: none;
	transition: border-color 0.15s ease;
}
.lx-form-control:focus { border-color: var(--lx-primary); }
textarea.lx-form-control { resize: vertical; }
.lx-form-inline { display: flex; gap: 8px; }
.lx-form-inline .lx-form-control { flex: 1; }
.lx-form-hint { color: var(--lx-text-2); font-size: 12px; margin: 4px 0 0; }
.lx-form-status { font-size: 13px; margin-left: 8px; }
.lx-form-status.is-ok { color: #16a34a; }
.lx-form-status.is-error { color: #dc2626; }
.lx-form-fields { display: flex; flex-direction: column; gap: 14px; }

/* ---------- 搜索页 ---------- */
.lx-search-head { margin-bottom: 16px; }
.lx-search-engines { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.lx-search-engines-label { color: var(--lx-text-2); font-size: 13px; }
.lx-search-results { display: flex; flex-direction: column; gap: 10px; }
.lx-search-results .lx-card { flex-direction: row; align-items: center; }
.lx-search-results .lx-card-meta { border: none; padding: 0; margin-left: auto; }

/* ---------- 用户中心 ---------- */
.lx-dashboard-section { padding: 16px; }
.lx-submit-list { list-style: none; margin: 0 0 12px; padding: 0; }
.lx-submit-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--lx-border); font-size: 13px; }
.lx-submit-type { padding: 1px 8px; border-radius: 4px; background: var(--lx-surface-2); color: var(--lx-text-2); font-size: 11px; }
.lx-submit-item a { flex: 1; color: var(--lx-text); }
.lx-submit-status { font-size: 12px; }
.lx-submit-status.is-ok { color: #16a34a; }
.lx-submit-status.is-wait { color: #d97706; }
.lx-submit-status.is-draft { color: var(--lx-text-2); }
.lx-submit-date { color: var(--lx-text-2); font-size: 12px; }

/* 用户中心：前台个人资料编辑 */
.lx-profile-form { display: flex; flex-direction: column; gap: 12px; max-width: 460px; }
.lx-profile-field { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.lx-profile-field label { font-size: 13px; color: var(--lx-text-2); }
.lx-profile-field input,
.lx-profile-field textarea {
	padding: 9px 12px;
	border: 1px solid var(--lx-border);
	border-radius: 8px;
	background: var(--lx-surface);
	color: var(--lx-text);
	font-size: 14px;
	width: 100%;
	box-sizing: border-box;
}
.lx-profile-field input:focus,
.lx-profile-field textarea:focus { outline: none; border-color: var(--lx-primary); }
.lx-notice { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin: 0 0 12px; }
.lx-notice--ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.lx-notice--err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ---------- 评论 ---------- */
.lx-comments { margin-top: 24px; }
.lx-comment-list { list-style: none; margin: 0 0 16px; padding: 0; }
.lx-comment-list li { margin-bottom: 12px; }
.lx-comment-list .comment-body { background: var(--lx-surface-2); border-radius: 8px; padding: 12px; }
.lx-comment-list .avatar { border-radius: 50%; margin-right: 8px; }
.lx-comments-closed { color: var(--lx-text-2); }

/* ---------- 页脚友链（样式已并入页脚三层结构主块） ---------- */

@media (max-width: 768px) {
	.lx-card-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
	.lx-detail { padding: 16px; }
	.lx-detail-head { flex-direction: column; }
	.lx-layout--single .lx-layout__main { grid-column: 1; }
}
/* ---------- 访问趋势图 ---------- */
.lx-trend { margin-top: 24px; }
.lx-trend-bars {
	display: flex;
	align-items: flex-end;
	gap: 3px;
	height: 120px;
	padding: 8px 4px 0;
	background: var(--lx-surface-2);
	border-radius: 8px;
	overflow-x: auto;
}
.lx-trend-bar {
	flex: 1;
	min-width: 4px;
	background: linear-gradient(180deg, var(--lx-primary-2), var(--lx-primary));
	border-radius: 2px 2px 0 0;
	opacity: 0.85;
	transition: opacity 0.15s ease;
	position: relative;
}
.lx-trend-bar:hover { opacity: 1; }
.lx-trend-bar::after {
	content: attr(data-tip);
	position: absolute;
	bottom: calc(100% + 4px);
	left: 50%;
	transform: translateX(-50%);
	background: var(--lx-text);
	color: var(--lx-surface);
	font-size: 10px;
	white-space: nowrap;
	padding: 2px 6px;
	border-radius: 4px;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.15s ease;
	z-index: 5;
}
.lx-trend-bar:hover::after { opacity: 1; }
/* ---------- 富文本内容排版（文章/资源正文，兼容古腾堡块） ---------- */
.lx-rich h1, .lx-rich h2, .lx-rich h3, .lx-rich h4, .lx-rich h5, .lx-rich h6 {
	line-height: 1.4;
	margin: 1.4em 0 0.6em;
	font-weight: 700;
	color: var(--lx-text-strong);
}
.lx-rich h1 { font-size: 1.75em; }
.lx-rich h2 { font-size: 1.5em; }
.lx-rich h3 { font-size: 1.25em; }
.lx-rich h4 { font-size: 1.125em; }
.lx-rich p { margin: 0 0 1em; }
.lx-rich a { color: var(--lx-primary); text-decoration: none; }
.lx-rich a:hover { text-decoration: underline; }
.lx-rich blockquote {
	border-left: 4px solid var(--lx-primary);
	background: var(--lx-surface-2);
	margin: 1.2em 0;
	padding: 0.8em 1.2em;
	border-radius: 0 8px 8px 0;
	color: var(--lx-muted);
}
.lx-rich code, .lx-rich kbd {
	background: var(--lx-surface-2);
	border-radius: 4px;
	padding: 0.1em 0.4em;
	font-size: 0.9em;
	color: #b91c1c;
	font-family: Consolas, Monaco, "Courier New", monospace;
}
.lx-rich pre {
	background: #111827;
	color: #e5e7eb;
	border-radius: 8px;
	padding: 1em 1.2em;
	overflow-x: auto;
	font-size: 0.9em;
	line-height: 1.7;
	margin: 1.2em 0;
}
.lx-rich pre code { background: transparent; color: inherit; padding: 0; }
.lx-rich table { border-collapse: collapse; width: 100%; margin: 1.2em 0; font-size: 0.95em; }
.lx-rich th, .lx-rich td { border: 1px solid var(--lx-border); padding: 0.5em 0.8em; text-align: left; }
.lx-rich th { background: var(--lx-surface-2); font-weight: 600; }
.lx-rich ul, .lx-rich ol { margin: 0 0 1em 1.4em; padding: 0; }
.lx-rich li { margin-bottom: 0.3em; }
.lx-rich img { max-width: 100%; height: auto; border-radius: 8px; }
.lx-rich figure { margin: 1.2em 0; }
.lx-rich figcaption { font-size: 0.85em; color: var(--lx-muted); text-align: center; margin-top: 0.4em; }
.lx-rich hr { border: none; border-top: 1px solid var(--lx-border); margin: 2em 0; }
.lx-rich .wp-block-embed iframe { max-width: 100%; border-radius: 8px; }
.lx-rich .alignwide { margin-left: auto; margin-right: auto; }
.lx-rich .alignfull { margin-left: 0; margin-right: 0; max-width: none; }
.lx-rich .wp-block-button__link { border-radius: 8px; font-weight: 500; }